You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to work out how fast I can move the stepper motor on my platform (ESP32) using your library. As part of my testing, I modified the MoveAtVelocity example to test turning on/off StealthChop based on the current speed as "StealthChop provides silent operation but may limit speed. SpreadCycle allows dynamic motion."
I noticed two unexpected behaviors. First, if you call an API (moveAtVelocity for example), the next time you call isSetupAndCommunicating it will return false. It returns true on all subsequent calls but the first call after making changes will always return false.
The second issue I noticed was that after calling disableStealthChop, all calls to isSetupAndCommunicating it will return false (not just the next call like other APIs).
I've attached the modified sample so you can easily see this for yourself. Build/upload it then open he serial monitor and send a '+' key until the currentSpeed exceeds 32768. At that point, you can no longer successfully interact with the stepper driver.
Interesting, you probably found a bug in the communication. Thanks for reporting that. I will dig into it when I have some time.
As for getting max speed, you definitely want to switch from StealthChop to SpreadCycle at higher velocities. You do not need to call disableStealthChop directly. If you set the TPWMTHRS value the driver will automatically switch from StealthChop to SpreadCycle when the velocity crosses the threshold. I created the method setStealthChopDurationThreshold to set the TPWMTHRS value. The name is a little confusing. The TPWMTHRS is a velocity threshold, but it is actually the duration between steps. At higher velocities, the duration between steps decreases. You can use the method getInterstepDuration() when the motor is spinning to get the value of TPWMTHRS at that velocity. You can then use that value as the threshold for StealthChop by using it in setStealthChopDurationThreshold.
Also if you really want to get maximum velocity, you might get higher numbers by using the step and direction inputs from a stepper controller capable of gentle accelerations, like the TMC429. Each call to moveAtVelocity tries to make an instantaneous jump to a new velocity.
I'm trying to work out how fast I can move the stepper motor on my platform (ESP32) using your library. As part of my testing, I modified the MoveAtVelocity example to test turning on/off StealthChop based on the current speed as "StealthChop provides silent operation but may limit speed. SpreadCycle allows dynamic motion."
I noticed two unexpected behaviors. First, if you call an API (moveAtVelocity for example), the next time you call isSetupAndCommunicating it will return false. It returns true on all subsequent calls but the first call after making changes will always return false.
The second issue I noticed was that after calling disableStealthChop, all calls to isSetupAndCommunicating it will return false (not just the next call like other APIs).
I've attached the modified sample so you can easily see this for yourself. Build/upload it then open he serial monitor and send a '+' key until the currentSpeed exceeds 32768. At that point, you can no longer successfully interact with the stepper driver.
MoveAtVelocity.txt
The text was updated successfully, but these errors were encountered: