I am very new to Arduino Programming and I am trying to complete a project to move stepper motors in an unknown position each time to a desired position. To do this, I need to write some code that will move each stepper that is connected to the Arduino to a zero position and I want this to be fully revolved. I was wondeing if anyone could provide any help on this please?
I am also using an Arduino Uno with a TMC260 DFRobot Motor Shield, and if anyone has any hardware connection help that would be good.
I want the zero position to be when the Stepper is fully turned anti-clockwise. The stepper motor I am working with gets longer and shorter depending on how it is turned, therefore I want it to get to its shortest point each time and call this zero.
If you don't have a sensor then the only thing you can do is get the motor to do more steps anticlockwise than it takes to go from one end to the other.
You will have to hope that the mechanism doesn't get damaged by trying to step the motor whilst it is stalled.
If it takes 200 revolutions to go from fully extended to fully closed then at 20 steps/rev you will need to make it go 4000 steps to bring it back to zero
I once has a car with an automatic choke that worked like this.
The assembly had a clutch that would "slip" when the stepper tried to step backwards beyond the "fully retracted" position...
That driver incorporates "StallGuard" which can sense when it reaches an end stop - hopefully this will not damage the motor. (In my experience of driving steppers against leadscrew end stops though they are remarkably tolerant as long as the mechanism is.)
Read the documentation on the driver and learn how to use the feature - if you have questions after you have done that come back and ask.