Hi Bas,

Thanks for your suggestion! I’ll definitely look into writing a custom 
component rather than a custom MachineKit build.

I’m afraid, though, that I don’t completely follow the rest of your suggestion. 
Could you please expand a little? I have used immediate mode before. Let’s say 
a user clicks a home button in the Axis GUI. How could I tie into that event to 
start the process? Alternatively, if I created my own button to trigger 
something in Hal, how would I trigger immediate homing? How would you recommend 
setting the position on the rising edge?

I believe I have a good grasp on how Hal works, but my knowledge of the built 
in components is limited.

Thanks again for the help!

John Allwine
Owner of Allwine Designs
https://www.allwinedesigns.com

> On Feb 22, 2020, at 1:04 AM, Bas de Bruijn <[email protected]> wrote:
> 
> 
> 
> 
>>> On 21 Feb 2020, at 23:30, John Allwine <[email protected]> wrote:
>>> 
>> 
>> I'm looking into using Teknic SDSK servo motors with MachineKit. The SDSK 
>> models accept step and direction pulses like a stepper motor, so using 
>> hal_pru_generic's stepgen is straight forward. The major issue I see is 
>> attempting to use Teknic's precision homing routines, as it doesn't fit into 
>> MachineKit's limit switch routines. I'd really like to use their homing 
>> routine because it is accurate to less than 1/10,000 of an inch in my setup, 
>> which could be difficult to achieve using my own limit switch setup. It 
>> seems to me that in order to do so would require either a custom homing 
>> routine implemented in C++ (so a custom build of MachineKit). Any thoughts 
>> on this would be appreciated!
>> 
>> The Teknic motors have 3 control pins and 1 feedback pin:
>> 
>> Control Pins:
>> Enable - Used to enable/disable the motor and plays a part in initiating the 
>> precision homing (see below).
>> Step - Same as for a stepper motor
>> Direction - Same as for a stepper motor
>> 
>> Feedback - They refer to this as the HLFB (high level feedback) pin. Can be 
>> set to a number of different options, but the relevant one for homing would 
>> be ASG (all systems go) Position, which is high when the motor is in the 
>> commanded position, low while moving.
>> 
>> The precision homing sequence is initiated as follows:
>> 
>> 1) Put the motor into homing mode by toggling the enable pin on (if it's 
>> already on, then turn it off, then back on).
>> 2) Command the motor with step and direction to move the joint to a hard 
>> stop.
>> 3) The motor will detect the hard stop and stop accepting step pulses until 
>> it is commanded to go the opposite direction.
>> 4) After the hard stop is detected the motor will back off to a precise 
>> location a configured number of internal encoder counts away.
>> 5) After a configured number of milliseconds (default is 10), the HLFB pin 
>> asserts indicating that homing is complete.
>> 
>> The hard stop detection and precision homing is fantastic. After the first 
>> homing sequence, the motor will return to a very precise location as long as 
>> the hard stop stays within ~2mm. I can physically put a shim (less than 2mm 
>> thick) in front of the hard stop and it still goes to a precise location 
>> that properly ignores the shim (so wearing on the hard stop over time 
>> doesn't affect the precision of the homing sequence).
>> 
>> So, does anyone have recommendations for how to perform this sequence 
>> properly in MachineKit? Preferably, I'd avoid needing a custom build of 
>> MachineKit, but if it's required to make homing a simple click of a button 
>> then I'll have to go that route.
> 
> Hi John,
> 
> So if I understand correctly your homing sequence is started on the rising 
> edge of the enable pin.
> 
> Then you need to move to your chosen homing side.
> Your homing is done when the special pin rises.
> 
> Maybe all parts are already there.
> Have you tried configuring as ‘immediate’ homing? So rising special pin sets 
> the position?
> http://www.machinekit.io/docs/config/ini_homing/
> 
> Even if you decide you need a special component, you do not have to rebuild 
> MK, just write the comp in C and install with instcomp.
> 
> http://www.machinekit.io/docs/hal/instcomp/
> 
> Best,
> Bas
> 
> 
>> -- 
>> website: http://www.machinekit.io blog: http://blog.machinekit.io github: 
>> https://github.com/machinekit
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "Machinekit" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected].
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/machinekit/6b01a405-251f-4633-af72-abbcd6c78ab0%40googlegroups.com.

-- 
website: http://www.machinekit.io blog: http://blog.machinekit.io github: 
https://github.com/machinekit
--- 
You received this message because you are subscribed to the Google Groups 
"Machinekit" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/machinekit/7E019B91-0888-4BE4-8F65-1F22B40EC7C6%40allwinedesigns.com.

Reply via email to