Trying to force home position w/ DRV8825, get skip backward

I am driving a stepper motor with a DRV8825. The stepper pulls a cable via a shaft-mounted spindle, and I need to find the ‘home’ position each time the system starts up. I have been planning to do this by simply pulling in more cable than could possibly be there (there is just one rotation’s worth of cable on the spindle), thus stalling the stepper into the ‘home’ position, then taking that as my new zero position.

I am using the driver in 1/16 microstepping mode, and am getting very good speed and resolution in the general movements of the spindle/cable. The problem is occurring when I try to force the stepper into the home position. The stepper stalls, as expected, but takes a bit of a random jump backward when it stalls (ie, loosens the cable), thus sometimes ‘home’ results in a taught cable, and other times the cable ends up with varying amounts of slack.

I’m hypothesizing that this is occurring because I’m in micro-stepping mode, and when the stepper stalls, it is jumping back to the closest full step position? I suppose its also possible that the stall current is perhaps overloading the 8825’s overcurrent protection, and cutting power momentarily? (I have the on-board current limit set to about 1.8A, based on the ‘measure a stationary coil current’ method described in the DRV8825 docs.)

Figured I’d ask folks who know a lot more about this than I do. :slight_smile:

Thanks for any help and info!

The most popular method of establishing a home position is to use a limit switch (usually a mechanical microswitch or an optical interrupter) that is activated by a lever, a flag on a cable, an end wall on a slide, etc. The switch can either disable the motor driver, or signal the controlling computer that home has been reached.

Thanks for the advice, Jim - I agree that a limit switch would be simple in some respects, but the application/environment that I’m using this in makes that pretty impractical, I’m afraid.

I’d really like to understand the ‘jumping’ behavior that I’m experiencing in the induced stall state, and try to work with that as best I can.

I’m wondering if perhaps reverting to full-step mode when forcing the home position would stop the jump (or at least make it consistent), or if increasing or decreasing the current limit would help. The application doesn’t require brute force, so the current could be reduced a fair bit, if this might help with this stall/jump type of behavior.

I understand that the motor will skip when I stall it - that’s actually the intent at the endpoint of the cable movement, for setting the reference point - its specifically the variable ‘jump’ backward after the stall that I’m trying to understand.

Thanks!

I would avoid microstepping. With microsteps, skipping is worse and less reliable for positioning, as the incremental torque per step is much lower than with full steps. Microsteps are not meant for accurate positioning, rather for smooth rotation and avoidance of resonances at certain speeds. See micromo.com/microstepping-my … -realities

Sounds like you’re on the road to testing out the problem - i encourage testing it!

I’m curious if choosing to do full-steps on the way back will eliminate your problem, and hope you can report back.

but I’ve heard a stepper described as sort of having a spring-y ness to its steps, and so your theory sounds very valid- that it can go part of the way and jumps back to the closest full step when it stall.

But just as easily, I can imagine there is a literal spring-yness to your string that you are stalling on, and that may as well be causing the bounce back. What sort of rope are you using? With a lower current limit, you might find that the string never stretches enough to develop the energy to act as a spring after the stepper stalls.

Just an update - as Tomek surmised, I also decided to try switching to full steps when reversing back to the ‘forced home’ position. Its working very well, and I end up with a totally taught, or near-enough totally taught string/cable each time now!

The cable is 1.1mm steel (bicycle shifter cable), and the string is 100lb-test kevlar cord (very low stretch - I suspect the steel cable would stretch more than the string :slight_smile:. The shifter cable and housing are high-quality stuff - Jagwire, which is chi-chi stuff in the bike world :slight_smile: I think the back-step was definitely coming from the micro-step stopping between full steps. (All that having been said, I don’t have a good explanation of why I get a very consistent tautness when I overstep the home position to force home - it would have to be an improbable twist of fate that my cable/string came out to be just the right length, to allow the stepper to stop at the precise correct spot - esp, since I’ve dis/re-connected it several times. I’d bet that there’s just enough springiness in the string/cable/housing/adapter setup that it lets it sort of load up a teeny bit, one step beyond what would be taught in a stretch-less system.

Anyway, its working reliably and repeatably, and while I don’t take a whole lot on blind faith, I’m satisfied enough with the outcome and my 2-bit theory (and the repeatability!) to not spend much time digging into that gift horse’s mouth. :slight_smile:

Thanks for the suggestions and help, all!

Very cool! Thanks for following up, it’s good to hear about this sort of practical case scenario. I think your theory is probably (at least enough for me) satisfactory.

Also, heh, I don’t think there would have been much stretch to the cables you described :stuck_out_tongue: :). Unless you had a killer stepper motor. But there probably is a bit of play in the joints.