DC motor speed control is a classic.
Are you using a microcontroller for the control?
The typical strategy is to use a fast 'inner' control loop to control the motor current. A slower 'outer' control loop then adjusts the motor current reference to get the desired speed.
The inner current control loop sets torque. Limiting the current reference gets you torque limiting and (to a large extent) overload protection. The
electrical speed of the system is quite fast (some ms), so you probably aren't after the maximum possible bandwidth.
I would suggest a PI (Proportional + Integral) controller for motor current. I would recommend
against PID (PI + Derivative) here, because the derivative term actually turns out to be a high pass filter and sensitive to noise. There will be noise aplenty given the switching action. A simple P (Proportional only) controller may be sufficient - you probably don't care if the torque isn't perfectly controlled.
To get a constant speed, we use a speed control loop. It runs slower than the current control loop because the motor (and belt) has inertia to deal with - typically 10s to 100s of ms. Because you do care about true speed, I suggest a PI controller. The Integral action results in accurate speed tracking (after some settling time). You will need some kind of limiting on the integrator state value to prevent
windup.
To prevent sudden changes in speed, the trick is to use a rate limiter for the speed reference. That is to say, your master speed setting from the UI should be turned into a real speed limit which doesn't change very quickly.
So the signal path might look like:
Speed ref => Rate Limiter => + => Speed Controller => Current reference => + => Current controller => PWM duty
- -
^ ^
| |
Measured speed Measured CurrentI haven't reviewed the material, but a little bird tells me that
these course videos might be useful. Well, at least the Motion Control bit might be useful.