| title | Control Theory |
|---|---|
| textbook | #control-theory |
consider a simple problem → how do you balance a ball?
Note:
- discuss pen balance
- show example in class
- what is the "input"?
- what is the "output"?
- what is the "desired state"?
consider a simple problem → how do you balance a ball?
consider a simple problem → how do you balance a ball?
ok, that's a bit hard!
let's simplify → in a one-dimensional plane?
balance a ball → in the middle of a table
balance a ball → in the middle of a table
pretty good attempt but unstable!
- the ball remains stable and
- it is in the middle of the table
options
- tilt the table down on the left (anti-clockwise)
- title the table down on the right (clockwise)
options
- tilt the table down on the left (anti-clockwise)
- title the table down on the right (clockwise)
options
- tilt the table down on the left (anti-clockwise)
- title the table down on the right (clockwise)
- control the speed at which the table tilts
| type | options |
|---|---|
| inputs | speed (clockwise, anticlockwise) |
| type | options |
|---|---|
| inputs | speed (clockwise, anticlockwise) |
| output | ball velocity, acceleration |
we need to control outputs → modifying inputs to system
- multidisciplinary field → applied mathematics+engineering
- multidisciplinary field → applied mathematics+engineering
- wide use → e.g., mechanical, aerospace, electrical, chemical, etc.
- multidisciplinary field → applied mathematics+engineering
- wide use → e.g., mechanical, aerospace, electrical, chemical, etc.
- even biological sciences, finance, you name it!
anything that you,
anything that you,
- want to control and
anything that you,
- want to control and
- can develop a model
anything that you,
- want to control and
- can develop a model
develop a controller → using control theory
lots of everyday applications as well
lots of everyday applications as well
adaptive cruise control, thermostats, ovens, lawn sprinkler systems, etc.
- understand a process or a system → develop a model
relationships between → inputs and outputs
adjust the inputs :model → to get desired outputs
relationship between inputs and outputs → empirical analysis
relationship between inputs and outputs → empirical analysis
- make changes to the input
relationship between inputs and outputs → empirical analysis
- make changes to the input
- wait for the system to respond
relationship between inputs and outputs → empirical analysis
- make changes to the input
- wait for the system to respond
- observe changes in the output
Note:
- Even if the model is based on an equation from physics, the parameters within the model are still identified experimentally or through computer simulations.
this is not what we really want!
this is not what we really want!
so, what is is that we want?
what is the objective?
what is the objective?
e.g., balance the ball
what is the objective?
e.g., balance the ball → control the output
control the output → tune the input!
assume we don't know relationship between bulb and switch
assume we don't know relationship between bulb and switch
conduct a few experiments → capture the relationship
results of empirical analysis
| switch state (input) |
bulb state (output) |
|---|---|
| off | off |
| on | on |
results of empirical analysis
| switch state (input) |
bulb state (output) |
|---|---|
| off | off |
| on | on |
"model" of input (switch state) → output (ligthbulb state)
results of empirical analysis
| switch state (input) |
bulb state (output) |
|---|---|
| off | off |
| on | on |
"model" of input (switch state) → output (ligthbulb state)
not the control model
not the control model
we care about → if bulb is on (or off)
we care about → if bulb is on (or off)
not if switch is on (or off)
so to develop a control model → invert above relationship
| desired output lightbulb state |
corresponding input switch state |
|---|
| desired output lightbulb state |
corresponding input switch state |
|---|---|
| on | on |
| off | off |
let's formalize things a little
consider following mathematical model
Note:
- The model says that if we change the input
uthe outputywill change to be twice the value of the inputu.
consider following mathematical model
remember → we want to get to a specific output, say
manipulate model → to get control model
manipulate model → to get control model
for any desired value of
for any desired value of
we have jus designed our first controller!
if our model is accurate+no disturbances
if our model is accurate+no disturbances
if our model is accurate+no disturbances
nothing guarantees this
desire certain outcome → hope controller actually gets there
what we really want → ensure controllers gets to setpoint
Note:
- problem is that while the input drives the output, there is no way to guarantee that the controller will get to the set point
the solution → feedback
the solution → feedback
from output → input
- adjust u
- adjust u
- ensure that we get to
$y^*$
- adjust u
- ensure that we get to
$y^*$
(or, at least as close to it as possible)
feedback from → output of controller model we created
feedback from → output of controller model we created
feedback from → output of controller model we created
feedback from → output of controller model we created
feedback can be positive or negative
how to ensure car remains in center of lane?
how to ensure car remains in center of lane?
apply a correction to direction of motion
apply a correction to direction of motion
apply a correction to direction of motion
- how do we apply the corrections?
- how much?
- when do we stop?
- compare system state to the desired state
- compare system state to the desired state
- apply a change to system inputs → counteract deviations
- compare system state to the desired state
- apply a change to system inputs → counteract deviations
- repeat until desired outcome → setpoint
e.g., temperature control of a room
e.g., temperature control of a room
e.g., temperature control of a room
Note:
- thermostat needs to control/provide inputs to a furnace/AC,
e.g., temperature control of a room
Note:
- which then affects the temperature in the room:
e.g., temperature control of a room
so we're...done?
real world has disturbances
disturbances → heat loss, bad insulation, physical problems, etc.
disturbances → heat loss, bad insulation, physical problems, etc.
input not sufficient to achieve set point
provide "feedback" to controller
Note:
- Essentially the temperature reading of the room, after the thermostat and furnace/AC have completed their operations based on the original inputs (desired temperature).
Note: -The "controller" is based on the "control model" that we developed earlier. It sends commands ("actuation signals") to an actuator and then affects the process under control. Finally, the process variable (the "output" from the earlier discussions) is what we want to drive towards the set point.
another example → cruise control
another example → cruise control
note → how the feedback reaches controller
some of these inputs/edges have specific names
main goal → error is minimized (ideally 0)
![]() |
|
||||||||||||
we want to keep car → center of its lane
question → how do you find the center of lane?
consider road with lane markings on either side,
consider road with lane markings on either side,
assume → can track white lines
need to find the center of the lane, as marked in the figure:
need to find the center of the lane, as marked in the figure:
car need not be in actual center of the lane,
assuming camera is mounted → center of car,
assuming camera is mounted → center of car,
car's position:
we calculate the cross-track error (CTE),
what happens when,
$CTE > 0$ -
$CTE < 0$ ?
keeping the car in center of lane,
- CTE → as small as possible and
- applying corrections
$64,000 question → how?
problem statement:
given the CTE, how do we compute the control signal
so the car stays in the middle of the lane?
final "corrections", when applied, may look something like:
start with one goal → lateral position control
start with one goal → lateral position control
start with one goal → lateral position control
| process variable |
|
start with one goal → lateral position control
| process variable |
|
|
| goal | keep the car at position 0 |
start with one goal → lateral position control
| process variable |
|
|
| goal | keep the car at position 0 | |
| control signal | steering | |
say we have the car's start and end positions,
we know relationship between →
we know relationship between →
we want
so, what should be our control input?
input → decreasing value of the feedback
correction is proportional to size of error, i.e.,
correction is proportional to size of error, i.e.,
apply proportional control → lateral control
apply proportional control → lateral control
following choices:
$K_p > 0$ $K_p < 0$
apply proportional control → lateral control
following choices:
$K_p > 0$ $K_p < 0$
following from
car moves towards reference/goal,
let's consider a few situations:
- what if
$K_p$ → too small (small "gain")?
- what if
$K_p$ → too small (small "gain")?
- what if
$K_p$ → too small (small "gain")?
response is too slow/gradual → may never reach goal!
- what if
$K_p$ → too large (large "gain")?
- what if
$K_p$ → too large (large "gain")?
- what if
$K_p$ → too large (large "gain")?
response is too sudden → system may overshoot the goal!
so, can the car be stabilized at $y=0$?
so, can the car be stabilized at $y=0$?
unlikely using only proportional control method since,
| gain | effect |
|---|---|
| small | stead-state error |
| large | oscillations |
how can we reduce oscillations
how can we reduce oscillations
Note: can we get to the following situation (smoother, actual approach to the goal)?
improves the dynamic response of system by,
improves the dynamic response of system by,
- studying the rate of change of the error and
- decreasing oscillation
improves the dynamic response of system
improves the dynamic response of system
measuring and trying to control → the rate of change
measuring and trying to control → the rate of change
car actually get close to reference/goal,
proportional/derivative control used together
counteract each others' influences
two options for derivative "gain":
$\frac{dy(t)}{dt} < 0$ $\frac{dy(t)}{dt} > 0$
derivative controller's job:
- steer away from the reference line
- act as a counter to proportional controller
derivative controller acts like a brake and counteracts correctional force
Note:
- derivative controller acts like a brake and counteracts the correctional force. It reduces overshoot by slowing the correctional factor → as the reference goal approaches.
- We see numerous uses of the combination, known as the P-D controllers in every day life, from the smallest to the largest, even rocket ships!
need to pick the right values for the gains,
consider following values for two coefficients,
consider following values for two coefficients,
tuning
Note:
- As we see, tuning
$K_d$ has a significant impact! The oscillations pretty much go away and we quickly get to the reference line with very little oscillation. Of course, the car overshoots a little but the combination of P-D brings it back soon enough.
what if we increase
what if we increase
can improve or make things worse → drive car away from goal!
Note:
- While we see from the first graph (
$K_p = 0.2$ ,$K_d = 4.0$ ) that the oscillations have gone away, increasing$K_d$ further make
fix → tuning paramters, e.g., K_p = 3.0
| before | after |
|---|---|
![]() |
![]() |
a quick, "smooth" path to the reference!
Note:
- In fact, a lot of the design of control systems involves the tuning of such parameters, depending on the system, to get things "just right".
are we done?
let's take a closer look at the results:
let's take a closer look at the results:
Note:
- As we see from this image, even though we reached the reference, the behavior is not smooth!
many reasons, e.g., steering drift
unmodeled disturbances and systemic errors ("bias")
unmodeled disturbances and systemic errors ("bias")
- actuators and processes → not ideal
unmodeled disturbances and systemic errors ("bias")
- actuators and processes → not ideal
- friction, steering, drift, changing workloads, misalignments, etc.
signal may never reach set points!
may end up "settling" near reference, which is not ideal
define steady state error (SSE):
difference between the reference and the steady-state process variable
when time goes to infinity,
applied correction must be,
- proportional to error and duration of error
- essentially it sums the error over time
unless the error is zero, this term will grow!
unless the error is zero, this term will grow!
|
unless the error is zero, this term will grow!
|
![]() |
I control used in conjunction with P/D controllers
I control used in conjunction with P/D controllers
I control used in conjunction with P/D controllers
examples of tuning PID parameters
Let's increase
Let's increase
system stabilized → around reference point
(if we zoom in, we see fewer disturbances)
what if we keep increasing
what if we keep increasing
what if we keep increasing
wait, the signal oscillates?
what if we keep increasing
the I term → not zero when crossing the reference,
takes a little while → wash out the cumulative error
- P is required
- P is required
- depending on system → PI, PD or PID
no "optimal" way to tune PID gains
no "optimal" way to tune PID gains
- start →
$K_p = 0$ ,$K_d = 0$ ,$K_i = 0$
no "optimal" way to tune PID gains
- start →
$K_p = 0$ ,$K_d = 0$ ,$K_i = 0$ -
slowly increase
$K_p$ → oscillate around set point
no "optimal" way to tune PID gains
- start →
$K_p = 0$ ,$K_d = 0$ ,$K_i = 0$ -
slowly increase
$K_p$ → oscillate around set point - slowly increase
$K_d$ → settle around set point
no "optimal" way to tune PID gains
- start →
$K_p = 0$ ,$K_d = 0$ ,$K_i = 0$ -
slowly increase
$K_p$ → oscillate around set point - slowly increase
$K_d$ → settle around set point - if steady-state error → slowly increase
$K_i$
no "optimal" way to tune PID gains
- start →
$K_p = 0$ ,$K_d = 0$ ,$K_i = 0$ -
slowly increase
$K_p$ → oscillate around set point - slowly increase
$K_d$ → settle around set point - if steady-state error → slowly increase
$K_i$ - system → corrected without additional oscillations
































































