I'm seeing several groups attempt to make a closed-loop stepper motor controller using encoder feedback and they are all experiencing the same difficulties everyone does implementing a PID control loop.
- Large errors during speed changes.
- Unstable oscillation
- Differing error performance for long and short moves
- Differing error performance for slow and fast movements
An idea I've never spent much time on (so it's the BEST idea anyone has thought of yet!) is to NOT do PID/closed-loop control for normal movements and only use it to "close-the-loop" during recovery from errors.
The idea is that since we all love the performance of our open-loop steppers with microstepping, and we just want to recover from crashed heads or trying to step too fast causing missed steps, just enable closed-loop mode when you detect the error between actual and commanded position is larger than a setpoint.
When switching in and out of closed-loop mode you'll get blobs and errors in your print, but you had those anyway due to the missed steps that triggered the mode change in the first place.
This method would still require some motor/mechanical-system analysis and tuning, but would not come into play except when there already was an error on printing, and would only be in effect for a short time during the correction of errors phase so it would have much less change of causing catastrophic errors in position compared to a full-time PID loop running.
Anyway, it's an idea and I thought I should bring it up to the team implementing the closed-loop control stuff.
If it's a terrible idea I can live with that. I've had many. 