Changing the DRV8824 microstep mode in real time

Hello,

I am writing firmware to control the drv8825, and I would like to control the step size in real time. This is to give the motor acceleration and deceleration while maintaining a constant speed clock.

If I lower the step resolution in real time (speed up), will the motor retain its micro-step offset? In other words, will a full-step, for example, do a full step from the micro-step angle that was previously set?

Thank you for your help!

Hello.

It is unclear if you are talking about the DRV8824 or DRV8825, however those are very similar ICs and they should behave similarly if the microstepping mode is changed dynamically. The behavior is detailed in Section 8.3.5 of both the DRV8824 and DRV8825 datasheets.

If the step mode is changed while stepping, the indexer will advance to the next valid state for the new microstepping mode at the rising edge of STEP. So if you are in 1/32 microstepping mode, the indexer is currently at position 4 for that mode, you are stepping forward in the table and you change to 1/2 stepping mode, the next time you toggle the step pin high, the driver will move to indexer 1/2 step position 2 in the Table 2 provided in section 8.3.5.

Why do you want to use a fixed frequency on the step input?

-Nathan

Thank you for your response. There are a few reasons that I would like to maintain a constant speed clock. This is for driving up to 11 gauges in a classic car restoration, where there are higher technology elements present as well.

  • I would like acceleration and deceleration without having to change the timer prescaler, as I would like to be able to drive multiple motors from one IC.

  • I would like the stepper motor to go into higher resolution state when the gauge is at or near its’ destination, reducing jitter and audible clicking noise, while moving quickly (full step) when the destination is far.

  • I would like to drive multiple gauges from one clock source, and the horsepower (the number of gauges controlled by one IC) can be more easily assessed.

Thanks again. I believe I can still make this work.