Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Implementing digital PID control

  1. Oct 25, 2005 #1
    I want to control the rpm of a brushless motor with ESC(Electronic speed controller) using PID control.
    Suppose my motor is rotating at 2000 rpm detecting using hall sensor setup.Now I want it to run at 5000 rpm.The speed will be controlled by PWM signals generated by PWM module( 16-bit i.e. 65536 divisions in 0%-100% duty cycle, which we specify) in hardware which is fed to ESC.
    How am I going use the PID parameters Kp, Ki and Kd to drive the motor to desired rpm?
    desired rpm = 5000
    measured rpm = 2000
    error = desired - measured = + 3000
    C(t) = Kp*e + Ki*∫e.dt + Kd*de/dt in digital form

    Suppose somehow I find out PID constants, then how do I modify new PWM based on C(t) and error signal ?

    Is New PWM = Old PWM*C(t)*error or New PWM = Old PWM+C(t)*error ?
  2. jcsd
  3. Oct 26, 2005 #2
    A decent review of control is Reviews of Modern Physics vol 77, p783.
  4. Oct 26, 2005 #3
    Thanks for replying. i have a simpler query now : Suppose I use a proportional control to drive a motor. Measured rpm = 2000, Required rpm = 5000, Error = +3000. Control signal = K * Error. Now how should I apply this control signal to increase in voltage so as to attain the required rpm ?
  5. Oct 26, 2005 #4
    For a motor I think PID is little over kill. A giving input should correspond to a giving rpm for the motor. Look up the value of the input that corresponds to the output that you want. That will give you a rough agreement. You might need some type of PID for ultra fine control or if the load isn't constant.
  6. Oct 29, 2005 #5

    Ivan Seeking

    User Avatar
    Staff Emeritus
    Science Advisor
    Gold Member

  7. Nov 3, 2005 #6
    Actually, it really depends on the situation which he unfortunately did not tell us what he is doing. In robotics PID loops generally are not overkill or at least a partial PID loop is because the load is always changing.
  8. Nov 4, 2005 #7


    User Avatar
    Science Advisor
    Homework Helper

Share this great discussion with others via Reddit, Google+, Twitter, or Facebook