ABARAJITHAN . G
• Quadcopter
• Flight Control
• Robots
• Self Driving Cars
• Air conditioner
When we need to automatically
control something…
• We are a feedback control system!!
• Try walking / writing with your eyes closed!
Feedback Control
Observe the
Effect
Make changes
Air conditioner
• Our room is at 30°C.
• We need to :
 Cool down it to 22°C
 Within a shortest time.
 Maintain the temperature at 22°C against external effects.
On-Off control
• Can’t control the power: only ON - OFF
• Disadvantage:
oTemperature oscillations
oUnstable System
Switch On
A/C
Switch Off
A/C
Temperature < 22°C
Temperature > 22°C
PID Control System
Remember the
PAST
(Integral)
Consider the
PRESENT
(Proportional)
Predict the
FUTURE
(Derivative)
And adjust power accordingly…
ERROR
• Air condition in a room
• Error will be changing over time.
Error
8°C
ProcessVariable
30°C
Set PointValue
22°C
= -
Proportional Control
Consider the present
Concept : Reduce power gradually
𝑃𝑜𝑤𝑒𝑟 = 𝐾 𝑝(𝐸𝑟𝑟𝑜𝑟)
Where 𝐾 𝑝 is proportional gain
(we need to tune)
Reduce power of A/C gradually, until temperature = 22°C
• Steady state error may occur
in pure proportional control.
• We don't have this in reality.
Systems have momentum –
The room has heat capacity
Add small overshoot
Proportional control…
Integral Control
Remember the past!
Concept : If past has high errors, increase the power
Integral : Sum of errors over time
𝑃𝑜𝑤𝑒𝑟 = 𝐾 𝑝 𝐸𝑟𝑟𝑜𝑟 + 𝐾𝑖(𝐼𝑛𝑡𝑒𝑔𝑟𝑎𝑙 𝑜𝑓 𝑝𝑎𝑠𝑡 𝑒𝑟𝑟𝑜𝑟𝑠)
Where 𝐾𝑖 is integral gain (we need to tune)
If temperature doesn’t settle for a long time, apply more power
Proportional-Integral control…
• Removes steady state error
• Tends to introduce overshoot!
• Increases relaxation time
• 𝐾𝑖 should be very small to prevent
overshoot
Derivative Control
Predict the future!
Concept : If room cools slowly, increase the power
𝑃𝑜𝑤𝑒𝑟 = 𝐾 𝑝 𝐸𝑟𝑟𝑜𝑟 + 𝐾𝑖 𝐼𝑛𝑡𝑒𝑔𝑟𝑎𝑙 𝑜𝑓 𝑝𝑎𝑠𝑡 𝑒𝑟𝑟𝑜𝑟𝑠 + 𝐾 𝑑 𝐷𝑒𝑟𝑖𝑣𝑎𝑡𝑖𝑣𝑒 𝑜𝑓 𝑒𝑟𝑟𝑜𝑟
Where 𝐾 𝑑 is derivative gain (we need to tune)
eg: Empty room cools fast  Use low power
Water filled room cools slowly  Use high power
PID Equation
Power = 𝐾 𝑝 Error 𝐾𝑖
Sum of past
errors over
time
𝐾 𝑑
How fast
error
changes
+ +
𝑃𝑜𝑤𝑒𝑟(𝑡) = 𝐾 𝑝 ∙ 𝑒𝑟𝑟𝑜𝑟(𝑡) + 𝐾𝑖 ∙
𝑠𝑡𝑎𝑟𝑡
𝑛𝑜𝑤
𝑒𝑟𝑟𝑜𝑟(𝑡) ∙ 𝑑𝑡 + 𝐾 𝑑 ∙
𝑑(𝑒𝑟𝑟𝑜𝑟(𝑡))
𝑑(𝑡)
Math : Second Order Ordinary Differential Equation
𝐾 𝑝 , 𝐾𝑖 , 𝐾 𝑑 are constants to be determined by careful tuning
• 𝐾𝑝 , 𝐾𝑖 , 𝐾 𝑑 are tuned to have
• Minimum relaxation time
• Minimum steady state error
• Minimum oscillations / vibrations
PID Equation
Power = 𝐾 𝑝 Error 𝐾𝑖
Sum of past
errors over
time
𝐾 𝑑
How fast
error
changes
+ +
Arduino
Code
No need of
advanced math!
• To self balance
• 3 axes – Adjust angle
(3 PID equations, 9 constants to be tuned)
• Error - Measured by a gyroscope module,
Power - Given to the motors
Quadcopters,
Aircrafts
THANK YOU
Presentation by:
ABARAJITHAN . G

PID Control system for Dummies

  • 1.
  • 2.
    • Quadcopter • FlightControl • Robots • Self Driving Cars • Air conditioner When we need to automatically control something…
  • 3.
    • We area feedback control system!! • Try walking / writing with your eyes closed! Feedback Control Observe the Effect Make changes
  • 4.
    Air conditioner • Ourroom is at 30°C. • We need to :  Cool down it to 22°C  Within a shortest time.  Maintain the temperature at 22°C against external effects.
  • 5.
    On-Off control • Can’tcontrol the power: only ON - OFF • Disadvantage: oTemperature oscillations oUnstable System Switch On A/C Switch Off A/C Temperature < 22°C Temperature > 22°C
  • 6.
    PID Control System Rememberthe PAST (Integral) Consider the PRESENT (Proportional) Predict the FUTURE (Derivative) And adjust power accordingly…
  • 7.
    ERROR • Air conditionin a room • Error will be changing over time. Error 8°C ProcessVariable 30°C Set PointValue 22°C = -
  • 8.
    Proportional Control Consider thepresent Concept : Reduce power gradually 𝑃𝑜𝑤𝑒𝑟 = 𝐾 𝑝(𝐸𝑟𝑟𝑜𝑟) Where 𝐾 𝑝 is proportional gain (we need to tune) Reduce power of A/C gradually, until temperature = 22°C
  • 9.
    • Steady stateerror may occur in pure proportional control. • We don't have this in reality. Systems have momentum – The room has heat capacity Add small overshoot Proportional control…
  • 10.
    Integral Control Remember thepast! Concept : If past has high errors, increase the power Integral : Sum of errors over time 𝑃𝑜𝑤𝑒𝑟 = 𝐾 𝑝 𝐸𝑟𝑟𝑜𝑟 + 𝐾𝑖(𝐼𝑛𝑡𝑒𝑔𝑟𝑎𝑙 𝑜𝑓 𝑝𝑎𝑠𝑡 𝑒𝑟𝑟𝑜𝑟𝑠) Where 𝐾𝑖 is integral gain (we need to tune) If temperature doesn’t settle for a long time, apply more power
  • 11.
    Proportional-Integral control… • Removessteady state error • Tends to introduce overshoot! • Increases relaxation time • 𝐾𝑖 should be very small to prevent overshoot
  • 12.
    Derivative Control Predict thefuture! Concept : If room cools slowly, increase the power 𝑃𝑜𝑤𝑒𝑟 = 𝐾 𝑝 𝐸𝑟𝑟𝑜𝑟 + 𝐾𝑖 𝐼𝑛𝑡𝑒𝑔𝑟𝑎𝑙 𝑜𝑓 𝑝𝑎𝑠𝑡 𝑒𝑟𝑟𝑜𝑟𝑠 + 𝐾 𝑑 𝐷𝑒𝑟𝑖𝑣𝑎𝑡𝑖𝑣𝑒 𝑜𝑓 𝑒𝑟𝑟𝑜𝑟 Where 𝐾 𝑑 is derivative gain (we need to tune) eg: Empty room cools fast  Use low power Water filled room cools slowly  Use high power
  • 13.
    PID Equation Power =𝐾 𝑝 Error 𝐾𝑖 Sum of past errors over time 𝐾 𝑑 How fast error changes + + 𝑃𝑜𝑤𝑒𝑟(𝑡) = 𝐾 𝑝 ∙ 𝑒𝑟𝑟𝑜𝑟(𝑡) + 𝐾𝑖 ∙ 𝑠𝑡𝑎𝑟𝑡 𝑛𝑜𝑤 𝑒𝑟𝑟𝑜𝑟(𝑡) ∙ 𝑑𝑡 + 𝐾 𝑑 ∙ 𝑑(𝑒𝑟𝑟𝑜𝑟(𝑡)) 𝑑(𝑡) Math : Second Order Ordinary Differential Equation 𝐾 𝑝 , 𝐾𝑖 , 𝐾 𝑑 are constants to be determined by careful tuning
  • 14.
    • 𝐾𝑝 ,𝐾𝑖 , 𝐾 𝑑 are tuned to have • Minimum relaxation time • Minimum steady state error • Minimum oscillations / vibrations PID Equation Power = 𝐾 𝑝 Error 𝐾𝑖 Sum of past errors over time 𝐾 𝑑 How fast error changes + +
  • 15.
  • 16.
    • To selfbalance • 3 axes – Adjust angle (3 PID equations, 9 constants to be tuned) • Error - Measured by a gyroscope module, Power - Given to the motors Quadcopters, Aircrafts
  • 17.