Electronics > Mechanical & Automation Engineering

PID control of DC motor with minimum speed

(1/2) > >>

Infraviolet:
I'm trying to do PID control of a DC motor so it can act as an accurate servo. I have an encoder on the backshaft and my aim is to get it to be able to move to exactly the correct number of encoder pulses then stop right there. As it stands with a very simle proportional only controller I can get it close to the desired position, but not quite there. I can also create circumstances where I overshoot and oscillate. I've written a PID controller, based on various samples of code online which all seem to be well regarded, so I'm confident in my PID code itself. The trouble, I think, is due to the way DC motors have a minimum speed below which they just sing to the frequency of the PWM wave but don't move at all. Online I cannot find anything about tuning PID parameters when in a situation where there is a minimum speed below which the thing one is trying to control won't actually change position. I thought the integral part would help, but again it is either something which can be used to cause big oscillations about the ideal point, or can produce low enough PID outputs to cause low PWM and "singing".

Any tips on what to do in this situation where the PID has a minimum output below which any movement it commands does nothing?

Thanks

RoGeorge:
My naive approach would be to remap the output voltage (in software), so to skip all those values around zero that doesn't produce any move.  For example, if output values between [-3 +3] doesn't turn the motor, then when the PID produces a +1, I'll remap it to +4.  If the PID output is -2, remap it to -5.  That is for the motor only, the PID is kept unaware of the remapping.

No idea if that would work in practice, but it's very easy to try.

Infraviolet:
It doesn't. The issue is it comes to a halt from the initial motion somewhere a few steps either side of the exact position it should reach, then when you try to run at increased speed like that it runs far enugh to skip over the position it should reach. effectively this just makes it oscillate about the right position rather than stop at it.

IanB:
Given that you have overshoot and oscillation, you might want to try adding some derivative action. Derivative action has a kind of "look ahead" behavior, so it might help to slow down the motor faster before it overshoots.

RoGeorge:

--- Quote from: Infraviolet on April 11, 2022, 08:57:55 pm ---It doesn't. The issue is it comes to a halt from the initial motion somewhere a few steps either side of the exact position it should reach, then when you try to run at increased speed like that it runs far enugh to skip over the position it should reach. effectively this just makes it oscillate about the right position rather than stop at it.

--- End quote ---

Looks like the instability is caused by stiction.  Search for 'PID stiction' and see what can be applied to your system.
http://wescottdesign.com/articles/Friction/friction.pdf

Try dithering the motor to break the stiction and make it turn at very low RPMs (pulsing the motor with a bigger voltage instead of just applying that small voltage that doesn't make the motor turn).