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
How to design DC Motor speed control, using PID
dcpid controllerspeed
Best Answer
Generally you find the PID gain values by structured experimentation, something like this:
I notice you plan on doing this all in analog electronics. This makes no sense, especially for something slow like a motor. For efficiency, you will want to drive the motor with PWM. The natural way to do this is the motor speed sensor feeds into a microcontroller A/D. The micro does the PID calculations and uses that to adjust the PWM duty cycle. It can also do the direction changing with the H bridge, guarantee break before make, etc. There are many small and cheap micros with A/D and PWM hardware built in. Some even have H bridge drive PWM outputs. This is such a common problem that there are whole subfamilies of micros optimized for this.
The compute power you need is modest. Back in the late 1990s I used a PIC 16F877 to run two layered PID control loops that drove a DC motor. The inner loop controlled the position of the motor and output PWM to the H bridge. The outer loop controlled the speed of a gasoline engine and output a position value to the inner loop. The PID computations were done in 24 bit floating point. We used 8 ms per iteration, which left a little time to do all the other low priority tasks. That micro was running at its maximum speed of 5 MIPS. That is quite slow by today's standards. Lots of micros are quite capable of doing what you need.
Doing this in analog will take more board space, take more components, be much harder to tweak, and does not provide a convenient interface to the motor driver power stage. It just doesn't make sense.