| Electronics > Projects, Designs, and Technical Stuff |
| Question on speed control for treadmill application |
| (1/1) |
| XaviPacheco:
I'm building a DC motor controller for a treadmill application using PWM. So far, the hardware works okay in open loop. I mean, I can control the duty cycle with the microcontroller. The motor responds really fast to step changes, which is not so desirable in this app. The commands given to the treadmill are Start, Stop, Speed up and Speed down. However, I don't have a special controller for this. The idea is to have a controller which increases/decreases the speed smoothly and mantain the speed under load conditions. I need some advice. Does a PI/PD/PID controller is critical for this? How do I effectively design one for this specific application? I believe I have to adjust the response time in order to have a smooth control and not to change speed abruptly. I'm measuring RPM of the motor, which is the closed loop element. |
| jbb:
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 Current I 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. |
| XaviPacheco:
Thank you. Yes, I'm using a microcontroller. --- Quote from: jbb on October 26, 2018, 09:31:48 am --- 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. --- End quote --- Is it like adjusting the response time of the controller with the proportional term? |
| jbb:
--- Quote from: XaviPacheco on October 27, 2018, 01:19:44 am ---Is it like adjusting the response time of the controller with the proportional term? --- End quote --- Not exactly. Generally, the PI controller is tuned for 'best' dynamic response (for assorted values of 'best'). You want a good dynamic response so that changes in mechanical load (e.g. footsteps on the belt) don't change the speed too much. But... If you start at zero speed, and suddenly try to spin up to running speed (say 20 km/h tops), the treadmill will start really aggressively - see first image. So the trick here is to modify the speed reference before you send it to the speed controller. This gives a gentler start - see second image - without changing the true dynamic response of the system. |
| Navigation |
| Message Index |