Teknic-ClearPath / ClearPath-Arduino-Step-And-Direction

23 stars 20 forks source link

How to know that homing is done? #2

Open stephanschulz opened 3 years ago

stephanschulz commented 3 years ago

Thanks for making this library.

I have a clearPath SD auto-tuned to a vertical linear actuator. I have set it so that every time enable is called, the motor homes to the lowest actuator limit.

The example code works well on a feely rotating motor (i.e. no linear actuator attached) since there is no hard stop to worry about. But with the linear actuator attached i feel i need to check if homing is done, before i can start sending steps and direction commands, otherwise i might step in the wrong direction; i.e. further in to the hard stop.

Thanks for you advice.

youcangetme commented 3 years ago

I might be speaking out of turn on this but I believe the self-homing status can be checked by the HLFB.

stephanschulz commented 3 years ago

Thanks for the reply.

The closest I could see was on page 51 says: "In ASG-Position mode the HLFB output asserts (conducts) when the motor is enabled, not in a shutdown, and is considered "Move Done"" So, I guess I could wait for the first ASG signal after the firmware boots up. But it seems ASG would signal for all Move Done moment.

Screen Shot 2021-02-04 at 4 35 47 PM
youcangetme commented 3 years ago

It has been a while since I set up the servo but in the software I always check if the last move is complete using the HLFB. Back when I had it set up to home on start the app would not accept a new command until that homing move was finished. But that was a while ago and I really don't remember what the servo settings were at the time. If teknics doesn't answer back "soon" I can tear everything down and help a fellow traveler in need. Will take about a hour to disassemble and run on the test bench. I probably need to service the worm drive anyways.

stephanschulz commented 3 years ago

Honestly I have to dug too deep in to this aspect yet. Have been busy with making it all move. But now that I am getting closer to automating everything, it's important to not start any motion before knowing that homing was done. Thanks for your offer. But please no pressure :)