# DC Motor Speed Control - Using PID

Discussion in 'General Electronics Chat' started by McCarthy02, Nov 20, 2011.

1. ### McCarthy02 Thread Starter New Member

Nov 20, 2011
1
0
I am looking to control the speed of a DC Motor using PID, it is speed control. I understand how the PID works, but i have a few questions. Like,how would I find my gains for each of the PID, what values of resistors and caps would I use? Also, would a simple 5V DC motor be suffice? If anyone has done something like this, a circuit schematic would be great. Thanks

2. ### strantor AAC Fanatic!

Oct 3, 2010
4,302
1,988
How on earth would I know? You didn't say what the application is. Are you spinning a paper disk or powering granite milling equipment?

3. ### thatoneguy AAC Fanatic!

Feb 19, 2009
6,357
718
PID is a feedback/control method, it can be used for a huge spectrum of applications.

Without knowing the specifics of your application, complete with schematic, motor size/voltage/current needs, source voltage, and what you have to work with, it's impossible to answer your question beyond pointing you toward wikipedia.

4. ### THE_RB AAC Fanatic!

Feb 11, 2008
5,435
1,305
Just use a regulated voltage DC supply.

With most DC motors (and light to medium loads) that will keep RPM to within about 10% of the no-load speed.

5. ### jimkeith Active Member

Oct 26, 2011
539
99
Practically speaking, every closed loop motor speed control must contain a major "I" (integral ) component that provides 'infinite' gain so that the resulting error voltage can be whatever is necessary to provide the correct speed. Since the motor also tends to act as an integrator the system can never be stable as two integrators in series become an oscillator. For this reason the speed control integrator is generally made slower than the motor.

To provide stability, a "P" (proportional) term is added so that any step change in the motor speed will result is a similar step change in the resulting error voltage.

To provide rate of change information, a "D" (derivative) term may be added--the only place this is used is in extremely tight servo applications--generally, the result is simply noise and has no useful effect so it is neglected--systems can be made stable without the D term.

I have never been successful in mathematical analysis of such control circuits--if you do not manage the myriad of variables correctly, and have a correct model of the motor, the system is unstable. Instead, I have used an oscilloscope trace set at a low sweep speed to watch damped speed oscillations, so I can observe the effect of various adjustments.

The PID loop may be implemented via analog or digital means. With digital means, the resolution has to be 10bit or greater to make the system run smoothly as the minimum step change is amplified by the P term--forget about the D term unless you have perhaps 12 or 16bit resolution.