![Page 1: Introduction to Control Theory COMP417 Instructor: Philippe Giguère](https://reader035.vdocuments.mx/reader035/viewer/2022062303/5518a193550346881f8b48d0/html5/thumbnails/1.jpg)
Introduction to Control Theory
COMP417
Instructor: Philippe Giguère
![Page 2: Introduction to Control Theory COMP417 Instructor: Philippe Giguère](https://reader035.vdocuments.mx/reader035/viewer/2022062303/5518a193550346881f8b48d0/html5/thumbnails/2.jpg)
Actuators
• Earlier lecture presented actuators– Electrical motor
• Now how do we use them in an intelligent manner?
Electric Motor
![Page 3: Introduction to Control Theory COMP417 Instructor: Philippe Giguère](https://reader035.vdocuments.mx/reader035/viewer/2022062303/5518a193550346881f8b48d0/html5/thumbnails/3.jpg)
Open-loop?• We want to spin a motor at a given angular
velocity. We can apply a fixed voltage to it, and never check to see if it is rotating properly.
• Called open loop.
Power Amplifier
Electric Motor
Computer
Vol
tage
Angular Velocity
![Page 4: Introduction to Control Theory COMP417 Instructor: Philippe Giguère](https://reader035.vdocuments.mx/reader035/viewer/2022062303/5518a193550346881f8b48d0/html5/thumbnails/4.jpg)
Open-loop?• What if there is a changing load on the motor?
– Our output velocity will change!
torque
speed no torque at max speed
stall torque
![Page 5: Introduction to Control Theory COMP417 Instructor: Philippe Giguère](https://reader035.vdocuments.mx/reader035/viewer/2022062303/5518a193550346881f8b48d0/html5/thumbnails/5.jpg)
Closing the loop• Let’s measure the actual angular velocities.• Now we can compensate for changes in load
by feeding back some information.Power
AmplifierElectric Motor
Computer
Vol
tag
e
AngularVelocity
Tachometer
![Page 6: Introduction to Control Theory COMP417 Instructor: Philippe Giguère](https://reader035.vdocuments.mx/reader035/viewer/2022062303/5518a193550346881f8b48d0/html5/thumbnails/6.jpg)
Control Theory• Roots in another science: Cybernetics
Cybernetics is the study of feedback and derived concepts such as communication and control in living organisms, machines and organisations.
• Expression was coined by Norbert Weiner in 1948.
![Page 7: Introduction to Control Theory COMP417 Instructor: Philippe Giguère](https://reader035.vdocuments.mx/reader035/viewer/2022062303/5518a193550346881f8b48d0/html5/thumbnails/7.jpg)
Early Example of Feedback System
• James Watt’s “Centrifugal Governor” in 1788.
• Regulates the steam engine speed.
![Page 8: Introduction to Control Theory COMP417 Instructor: Philippe Giguère](https://reader035.vdocuments.mx/reader035/viewer/2022062303/5518a193550346881f8b48d0/html5/thumbnails/8.jpg)
Other Simple Examples• Body temperature regulation
– If cold, shiver (muscles produce heat)– If hot, sweat (evaporation takes away heat)
• Maintaining social peace– If a crime is found (sensor), the guilty party is
punished (actuator).
• Cruise control in cars– You set a speed, CC will increase fuel intake
uphill, and decrease it downhill.
• Etc…
![Page 9: Introduction to Control Theory COMP417 Instructor: Philippe Giguère](https://reader035.vdocuments.mx/reader035/viewer/2022062303/5518a193550346881f8b48d0/html5/thumbnails/9.jpg)
Why Control Theory• Systematic approach to analysis and design
– Transient response– Consider sampling times, control frequency– Taxonomy of basic controllers (PID, open-loop,
Model-based, Feedforward…)– Select controller based on desired characteristics
• Predict system response to some input– Speed of response (e.g., adjust to workload changes)– Oscillations (variability)
• Assessing stability of system
![Page 10: Introduction to Control Theory COMP417 Instructor: Philippe Giguère](https://reader035.vdocuments.mx/reader035/viewer/2022062303/5518a193550346881f8b48d0/html5/thumbnails/10.jpg)
Characteristics of Feedback System
• Power amplification– Compare neural signal power (W) vs muscle power
output (tens of W)– Means it is an active system, as opposed to passive.
• Actuator• Feedback
– measurement (sensor)
• Error signal• Controller
![Page 11: Introduction to Control Theory COMP417 Instructor: Philippe Giguère](https://reader035.vdocuments.mx/reader035/viewer/2022062303/5518a193550346881f8b48d0/html5/thumbnails/11.jpg)
Classic Feedback Diagram
PowerAmplification
Actuatoror
PlantController
Sensor
Command inputx(t)
Errore(t) System
ouputy(t)
ExternalDisturbance
d(t)Actuatorcommand
u(t)
SensorReading
b(t)
![Page 12: Introduction to Control Theory COMP417 Instructor: Philippe Giguère](https://reader035.vdocuments.mx/reader035/viewer/2022062303/5518a193550346881f8b48d0/html5/thumbnails/12.jpg)
Controller Design Methodology
Block diagram
construction
Model
Ok?
Stop
Start
Transfer function formulation and
validation
Controller Design
Objective
achieved?
Controller Evaluation
Y
Y
N N
System Modeling
![Page 13: Introduction to Control Theory COMP417 Instructor: Philippe Giguère](https://reader035.vdocuments.mx/reader035/viewer/2022062303/5518a193550346881f8b48d0/html5/thumbnails/13.jpg)
Control System Goals
• Regulation– thermostat
• Tracking– robot movement, adjust TCP window to
network bandwidth
• Optimization– best mix of chemicals, minimize response
times
![Page 14: Introduction to Control Theory COMP417 Instructor: Philippe Giguère](https://reader035.vdocuments.mx/reader035/viewer/2022062303/5518a193550346881f8b48d0/html5/thumbnails/14.jpg)
Approaches to System Modeling
• First Principles– Based on known laws.– Physics, Queueing theory.– Difficult to do for complex systems.
• Experimental (System Identification)– Requires collecting data– Is there a good “training set”?
![Page 15: Introduction to Control Theory COMP417 Instructor: Philippe Giguère](https://reader035.vdocuments.mx/reader035/viewer/2022062303/5518a193550346881f8b48d0/html5/thumbnails/15.jpg)
Common Laplace TransfomName f(t) F(s)
Impulse
Step
Ramp
Exponential
Sine
1
s
1
2
1
s
as 1
22 s
1)( tf
ttf )(
atetf )(
)sin()( ttf
00
01)(
t
ttf
Damped Sine 22)(
as)sin()( tetf at
![Page 16: Introduction to Control Theory COMP417 Instructor: Philippe Giguère](https://reader035.vdocuments.mx/reader035/viewer/2022062303/5518a193550346881f8b48d0/html5/thumbnails/16.jpg)
Transfer Function• Definition: H(s) = Y(s) / X(s)
• Relates the output of a linear system to its input.
• Describes how a linear system responds to an impulse… called impulse response– (remember! Convolving with impulse yields the same
thing. Hence probing a system with and impulse is finding its transfer function…)
• All linear operations allowed– Scaling, addition, multiplication
![Page 17: Introduction to Control Theory COMP417 Instructor: Philippe Giguère](https://reader035.vdocuments.mx/reader035/viewer/2022062303/5518a193550346881f8b48d0/html5/thumbnails/17.jpg)
Block Diagram
• Expresses flows and relationships between elements in system.
• Blocks may recursively be systems.• Rules
– Cascaded elements: convolution.
– Summation and difference elements
b(t)a(t) )()( tbta
![Page 18: Introduction to Control Theory COMP417 Instructor: Philippe Giguère](https://reader035.vdocuments.mx/reader035/viewer/2022062303/5518a193550346881f8b48d0/html5/thumbnails/18.jpg)
Laplace Transform of Classic Feedback Sysem
ActuatorA(s)
ControllerC(s)
SensorS(s)
Command inputX(s)
ErrorE(s) System
ouputY(s)
ExternalDisturbance
D(s)Actuator
commandU(s)
SensorReading
B(s)
![Page 19: Introduction to Control Theory COMP417 Instructor: Philippe Giguère](https://reader035.vdocuments.mx/reader035/viewer/2022062303/5518a193550346881f8b48d0/html5/thumbnails/19.jpg)
Key Transfer Functions
FeedbackFeedforward
ActuatorA(s)
ControllerC(s)
SensorS(s)
Command inputX(s)
ErrorE(s) System
ouputY(s)
ExternalDisturbance
D(s)
Actuatorcommand
U(s)
SensorReading
B(s)
)()()(1
)()(
X(s)
)( :Feedback
sHsAsC
sAsCsY
)()(
)(
)( :dFeedforwar sAsC
sE
sY
![Page 20: Introduction to Control Theory COMP417 Instructor: Philippe Giguère](https://reader035.vdocuments.mx/reader035/viewer/2022062303/5518a193550346881f8b48d0/html5/thumbnails/20.jpg)
First Order System
sTK
K
sX
sY
1)(
)(
K
1
Command inputX(s) sT1
1 Systemoutput
X(s)
1
1
1
11
11 iserror stateSteady
Theorem) Value (Final 0 is valuestateSteady
0KKK
K-
sTKK
s
s
![Page 21: Introduction to Control Theory COMP417 Instructor: Philippe Giguère](https://reader035.vdocuments.mx/reader035/viewer/2022062303/5518a193550346881f8b48d0/html5/thumbnails/21.jpg)
Response of System
• Impulse
• Step
sTK
K
1Exponential
=
t
t
“step” function
TsK
K
1s
1x
sT
K
K
Ks
K
TsKs
K
1)1()1()1(
t-
t
Tim
e D
omai
nLa
plac
e D
omai
n
![Page 22: Introduction to Control Theory COMP417 Instructor: Philippe Giguère](https://reader035.vdocuments.mx/reader035/viewer/2022062303/5518a193550346881f8b48d0/html5/thumbnails/22.jpg)
Steady-State vs. Transient
t
• Step Response illustrates how a system response can be decomposed into two components:– Steady-state part:
– Transient
t
![Page 23: Introduction to Control Theory COMP417 Instructor: Philippe Giguère](https://reader035.vdocuments.mx/reader035/viewer/2022062303/5518a193550346881f8b48d0/html5/thumbnails/23.jpg)
Second Order System
:frequency natural Undamped
2 where :ratio Damping
)04 (ie,part imaginary zero-non have poles if Oscillates
2)(
)( :response Impulse
2
22
2
2
J
K
JKBB
B
JKB
ssKBsJs
K
sX
sY
N
cc
NN
N
![Page 24: Introduction to Control Theory COMP417 Instructor: Philippe Giguère](https://reader035.vdocuments.mx/reader035/viewer/2022062303/5518a193550346881f8b48d0/html5/thumbnails/24.jpg)
Second Order Response
• Typical response to step input is:
t-
t t+
overshoot -- % of final value exceeded at first oscillation
rise time -- time to span from 10% to 90% of the final value
settling time -- time to reach within 2% or 5% of the final value
2% or 5%
settling time
overshoot
rise time
90%
![Page 25: Introduction to Control Theory COMP417 Instructor: Philippe Giguère](https://reader035.vdocuments.mx/reader035/viewer/2022062303/5518a193550346881f8b48d0/html5/thumbnails/25.jpg)
Basic Controller Function
)(
)()()(:control alDifferenti
)(
)()()(:control Integral
)(
)()()(:control alProportion
0
sKsE
sUte
dt
dKtu
s
K
sE
sUdtteKtu
KsE
sUteKtu
dd
it
i
pp
![Page 26: Introduction to Control Theory COMP417 Instructor: Philippe Giguère](https://reader035.vdocuments.mx/reader035/viewer/2022062303/5518a193550346881f8b48d0/html5/thumbnails/26.jpg)
Effect of Controller Functions
• Proportional Action– Simplest Controller Function
• Integral Action– Eliminates steady-state error– Can cause oscillations
• Derivative Action (“rate control”)– Effective in transient periods– Provides faster response (higher sensitivity)– Never used alone
![Page 27: Introduction to Control Theory COMP417 Instructor: Philippe Giguère](https://reader035.vdocuments.mx/reader035/viewer/2022062303/5518a193550346881f8b48d0/html5/thumbnails/27.jpg)
Control Performance (2nd O), P-type
Kp = 20
Kp = 200
Kp = 50
Kp = 500
![Page 28: Introduction to Control Theory COMP417 Instructor: Philippe Giguère](https://reader035.vdocuments.mx/reader035/viewer/2022062303/5518a193550346881f8b48d0/html5/thumbnails/28.jpg)
Steady-state Errors, P-type
Kp = 200 Kp = 50
![Page 29: Introduction to Control Theory COMP417 Instructor: Philippe Giguère](https://reader035.vdocuments.mx/reader035/viewer/2022062303/5518a193550346881f8b48d0/html5/thumbnails/29.jpg)
Control Performance, PI - type
Kp = 100
Ki = 50 Ki = 200
![Page 30: Introduction to Control Theory COMP417 Instructor: Philippe Giguère](https://reader035.vdocuments.mx/reader035/viewer/2022062303/5518a193550346881f8b48d0/html5/thumbnails/30.jpg)
You’ve been integrated...
Kp = 100
instability & oscillation
![Page 31: Introduction to Control Theory COMP417 Instructor: Philippe Giguère](https://reader035.vdocuments.mx/reader035/viewer/2022062303/5518a193550346881f8b48d0/html5/thumbnails/31.jpg)
Control Performance, PID-typeKp = 100 Ki = 200 Kd = 2
Kd = 10 Kd = 20
Kd = 5
![Page 32: Introduction to Control Theory COMP417 Instructor: Philippe Giguère](https://reader035.vdocuments.mx/reader035/viewer/2022062303/5518a193550346881f8b48d0/html5/thumbnails/32.jpg)
PID final control
![Page 33: Introduction to Control Theory COMP417 Instructor: Philippe Giguère](https://reader035.vdocuments.mx/reader035/viewer/2022062303/5518a193550346881f8b48d0/html5/thumbnails/33.jpg)
PID Tuning
How to get the PID parameter values ?
(1) If we know the transfer function, analytical methods can be used (e.g., root-locus method) to meet the transient and steady-state specs. (2) When the system dynamics are not precisely known, we must resort to experimental approaches.
Using only Proportional control, turn up the gain until the system oscillates w/o dying down, i.e., is marginally stable. Assume that K and P are the resulting gain and oscillation period, respectively.
Then, use
Ziegler-Nichols Tuning for second or higher order systems
for P control for PI control for PID control
Kp = 0.6 K
Ki = 2.0 / P
Kd = P / 8.0
Kp = 0.45 K
Ki = 1.2 / P
Kp = 0.5 K
Ziegler-Nichols Rules for Tuning PID Controller:
![Page 34: Introduction to Control Theory COMP417 Instructor: Philippe Giguère](https://reader035.vdocuments.mx/reader035/viewer/2022062303/5518a193550346881f8b48d0/html5/thumbnails/34.jpg)
Layered Approach to Control
• Robotic systems often have a layered approach to control:
Planner
Autopilot
AttitudeController
FlipperPositionController
Motor
movie
![Page 35: Introduction to Control Theory COMP417 Instructor: Philippe Giguère](https://reader035.vdocuments.mx/reader035/viewer/2022062303/5518a193550346881f8b48d0/html5/thumbnails/35.jpg)
Multiple Loops
Angle
Motor
PositionEncoder
PID
Back-EMFcomp
d/dt
DCMotor module
Velocity PID
Robotd/dt
UnderwaterSwimmer
GaitGeneration
Rate
IMU
Autopilot
Controller
Camera
Vision Tracker
TargetDetection
TargetLocation
DesiredTarget
Location
Target
Inner loops are generally “faster” that outer loop.
![Page 36: Introduction to Control Theory COMP417 Instructor: Philippe Giguère](https://reader035.vdocuments.mx/reader035/viewer/2022062303/5518a193550346881f8b48d0/html5/thumbnails/36.jpg)
Advanced Control Topics
• Adaptive Control– Controller changes over time (adapts).
• MIMO Control– Multiple inputs and/or outputs.
• Predictive Control– You measure disturbance and react before measuring
change in system output.• Optimal Control
– Controller minimizes a cost function of error and control energy.
• Nonlinear systems– Neuro-fuzzy control.– Challenging to derive analytic results.
![Page 37: Introduction to Control Theory COMP417 Instructor: Philippe Giguère](https://reader035.vdocuments.mx/reader035/viewer/2022062303/5518a193550346881f8b48d0/html5/thumbnails/37.jpg)
RC Servo• Is a controller + actuator in a small
package.
• Not expensive 10$-100$.
• Those in 417 will use some of these.
![Page 38: Introduction to Control Theory COMP417 Instructor: Philippe Giguère](https://reader035.vdocuments.mx/reader035/viewer/2022062303/5518a193550346881f8b48d0/html5/thumbnails/38.jpg)
PWM• PWM -- “pulse width modulation
• Duty cycle:– The ratio of the “On time” and the “Off time” in one cycle.– Determines the fractional amount of full power delivered to
the motor.
• Why:– Transistor acts as a resistor when partially on.– Leads to energy being wasted heat.