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