We've implemented a number improvements to the Tinymovr firmware, the most important of which is the introduction of a deadband parameter for the velocity integrator.
The velocity integrator is important in ensuring accurate tracking of velocities, and as an extension also contributes to position tracking. One side effect of the use of the velocity integrator is the "hunting" behavior which can be witnessed as a low-frequency, low amplitude oscillation of the rotor at standstill. The main cause here is the cogging torque of the motor. Small position offsets from setpoint due to cogging torque cause integrator windup. At some point, the integrator value causes enough torque to overcome the cogging torque. This in turn causes overshoot of the setpoint, so that the rotor position now lies on the other side of the setpoint. As such, the phenomenon is repeated in the opposite direction.
The latest firmware introduces a configurable deadband around the position setpoint, within which the integrator value is not updated. As such, even if there is a small error in position, the torque applied is constant (following the current integrator value).
The deadband value can be configured using the relevant endpoint. To revert to the original pre-deadband behavior, just set the deadband parameter to zero. Note that the deadband only kicks in when in position control model. Velocity control applies the integrator as usual.
As a result of this change, we went on to perform a small rearrangement on the CAN endpoints map, splitting motor configuration in two separate endpoints and enabling better resolution figures into motor parameters.
Finally, we've performed some optimizations in the MCU HAL, resulting in more streamlined peripheral access with less overhead.
The new firmware is available on the releases page, and corresponding Studio on the Tinymovr Pypi page.