Professional Documents
Culture Documents
Mathematical Modeling
BIO
ESE
BIO
ESE
CS
M. F. Haydar (FlyCon, IST) Control Systems March 12, 2019 2 / 40
Recap
Review from
Week 1: Introduction last weekand Control
to Feedback
Control =
Feedback Control:
Sensing + Computation +
Actuate Sense Actuation
Sensing + Computation + Actuation:
This course is mainly about input
design Principles
Feedback
I while considering the sensors and
Compute Robustness to Uncertainty
the actuators
Design of Dynamics
Feedback Principles:
Many examples of feedback and control in natural & engineered systems:
Robustness to
BIO
I variations in system parameters (mass, stiffness, damping etc.)
I external disturbance (wind gusts etc.)
ESE
BIO
ESE
CS
M. F. Haydar (FlyCon, IST) Control Systems March 12, 2019 2 / 40
Recap
Review from
Week 1: Introduction last weekand Control
to Feedback
Control =
Feedback Control:
Sensing + Computation +
Actuate Sense Actuation
Sensing + Computation + Actuation:
This course is mainly about input
design Principles
Feedback
I while considering the sensors and
Compute Robustness to Uncertainty
the actuators
Design of Dynamics
Feedback Principles:
Many examples of feedback and control in natural & engineered systems:
Robustness to
BIO
Ivariations in system parameters (mass, stiffness, damping etc.)
I external disturbance (wind gusts etc.)
ESE
Design of Dynamics to achieve desired levels of
BIO
I natural frequency (speed of response)
A model
is a mathematical approximation of a real system.
A model
is a mathematical approximation of a real system.
helps in control design by giving an idea how the system will respond to an
input.
A model
is a mathematical approximation of a real system.
helps in control design by giving an idea how the system will respond to an
input.
needs not to be accurate for control design (feedback provides robustness via
corrective actions).
Questions to be answered:
How does the mass move if the forcing
frequency changes?
How variations in mass/stiffness/damping
affect the response of system?
Questions to be answered:
How does the mass move if the forcing
frequency changes?
How variations in mass/stiffness/damping
affect the response of system?
To be used for simulations or control design?
Questions to be answered:
How does the mass move if the forcing
frequency changes?
How variations in mass/stiffness/damping
affect the response of system?
To be used for simulations or control design?
Assumptions:
Mass, spring and damper properties are
fixed and exactly known.
Springs satisfy Hooke’s law.
Damper is a linear viscous force.
c k F (t)
ẍ = − ẋ − x + .
m m m
I position is calculated as
Z t1 Z t1
x= ẍdt + ẋ0 dt + x0 .
t0 t0
|{z}
| {z } initial position
change in position
c k F (t)
ẍ = − ẋ − x + .
m m m
c k F (t)
ẍ = − ẋ − x + .
m m m
The state of the mass spring damper system is comprised of position (x) and
velocity (ẋ) of the mass.
c k F (t)
ẍ = − ẋ − x + .
m m m
The state of the mass spring damper system is comprised of position (x) and
velocity (ẋ) of the mass.
The number of states is equal to number of integrators present in the system,
I called order of the system.
c k F (t)
ẍ = − ẋ − x + .
m m m
The state of the mass spring damper system is comprised of position (x) and
velocity (ẋ) of the mass.
The number of states is equal to number of integrators present in the system,
I called order of the system.
Accelerations are not part of the state, because they can be calculated
without integration.
Then we can write the model as a system of first order differential equations:
ẋ1 = x2
k c F (t)
ẋ2 = − x1 − x2 + .
m m m
Then we can write the model as a system of first order differential equations:
ẋ1 = x2
k c F (t)
ẋ2 = − x1 − x2 + .
m m m
Equivalently:
ẋ1 0 1 x1 0
= k c + 1 [F (t)].
ẋ2 −m −m x2 m
| {z }
ẋ=Ax+Bu
The model of system can thus be written as a first order (matrix) differential
equation:
ẋ1 0 1 x1 0
= k c + 1 [F (t)]. (1)
ẋ2 −m −m x2 m
| {z }
ẋ=Ax+Bu
The model of system can thus be written as a first order (matrix) differential
equation:
ẋ1 0 1 x1 0
= k c + 1 [F (t)]. (1)
ẋ2 −m −m x2 m
| {z }
ẋ=Ax+Bu
The model of system can thus be written as a first order (matrix) differential
equation:
ẋ1 0 1 x1 0
= k c + 1 [F (t)]. (1)
ẋ2 −m −m x2 m
| {z }
ẋ=Ax+Bu
ferential
are the State vector, x(t)
dx dx
= f (x, u) = Ax + Bu x ∈ Rn ,
dt dt
y = h(x, u) y = Cx + Du u ∈ Rp ,
Nonlinear system Linear system y ∈ Rm .
dx dx
= f (x, u) = Ax + Bu x ∈ Rn ,
dt dt
y = h(x, u) y = Cx + Du u ∈ Rp ,
Nonlinear system Linear system y ∈ Rm .
dn q dn−1 q dq
+ a1 + ... + an−1 + an q = u.
dtn dtn−1 dt
n−1
d q dq
y = b1 n−1 + ... + bn−1 + bn q
dt dt
dx dx
= f (x, u) = Ax + Bu x ∈ Rn ,
dt dt
y = h(x, u) y = Cx + Du u ∈ Rp ,
Nonlinear system Linear system y ∈ Rm .
dn q dn−1 q dq
+ a1 + ... + an−1 + an q = u.
dtn dtn−1 dt
n−1
d q dq
y = b1 n−1 + ... + bn−1 + bn q
dt dt
x1 0 1 0 ··· 0 x1 1
x2 0 0 1 ··· 0 x2 0
d
.. ..
.. ..
=. . . + . u
dt
xn−1 0 0 0 ··· 1 xn−1 0
xn −an −an−1 −an−2 · · · −a1 xn 0
y = b1 b2 . . . bn x + Du
Figure: (a) passive suspension, (b) full-active suspension, (c) hydraulic-active suspension.
Questions to be answered:
How do the road-bumps affect the
compartment at different frequencies?
I at which speed should I drive on this rough
road?
A stiff suspension is better or a soft one?
How variations in loading/mass affect the
comfort level?
Questions to be answered:
How do the road-bumps affect the
compartment at different frequencies?
I at which speed should I drive on this rough
road?
A stiff suspension is better or a soft one?
How variations in loading/mass affect the
comfort level?
Assumptions:
Mass, spring and damper properties are
fixed and exactly known.
Springs satisfy Hooke’s law.
Damper is a linear viscous force.
The state of the quarter car model is comprised of positions ( zs , zus ) and
velocities ( żs , żus ) of both masses.
Then we can write the model as system of first order differential equations:
ẋ1 = x3
ẋ2 = x4
ks kus cs cus
ẋ3 = − x1 + x2 − x3 + x4
ms ms ms ms
ks (kus + kt ) cs cus kt
ẋ4 = x1 − x2 + x3 − x4 + zr .
mus mus mus mus mus
Idea: use first order Taylor series approximation around the equilibrium
point.
Idea: use first order Taylor series approximation around the equilibrium
point.
Rationale: Feedback can provide corrective action against minor errors arising
from linear approximation:
Figure: Approximation of sin(x) with Taylor series (degree of the Taylor polynomial
1,3,5,7,9,11,13).
d 2θ MgL
J sin θ
L
dt2 2
T 2 T
Mg cos θ
θ Mg θ θ
L
2
Mg sin θ
Mg
(a) (b) (c)
d 2θ MgL
J sin θ
L
dt2 2
T 2 T
Mg cos θ
θ Mg θ θ
L
2
Mg sin θ
Mg
(a) (b) (c)
FIGURE 3.14
Solution:
a. Simple pendulum; b. force components of Mg; c. free-body diagram
d2 θ M gL
SOLUTION:
J 2 + sin θ = T
dt First
2 draw a free-body diagram as shown in Figure 3.14(c). Summing
torques, we get
d 2θ MgL
J 2 sin θ
L
x1 = θ dt 2
T 2 T
dθ
Mg cos θ x2 =
θ θ
dt θ
Mg
L
2
Mg sin θ
Mg
(a) (b) (c)
FIGURE 3.14
Solution:
a. Simple pendulum; b. force components of Mg; c. free-body diagram
d2 θ M gL
SOLUTION:
J 2 + sin θ = T
dt First
2 draw a free-body diagram as shown in Figure 3.14(c). Summing
torques, we get
d 2θ MgL
J 2 sin θ
L
x1 = θ dt 2
T 2 T
dθ
Mg cos θ x2 =
θ θ
dt θ
Mg
L
2
ẋ1 = x2
Mg sin θ M gL T
Mg ẋ2 = − sin x1 +
(a) (b) 2J J(c)
FIGURE 3.14
Solution:
a. Simple pendulum; b. force components of Mg; c. free-body diagram
d2 θ M gL
SOLUTION:
J 2 + sin θ = T
dt First
2 draw a free-body diagram as shown in Figure 3.14(c). Summing
torques, we get
d 2θ MgL
J 2 sin θ
L
x1 = θ dt 2
T 2 T
dθ
Mg cos θ x2 =
θ θ
dt θ
Mg
L
2
ẋ1 = x2
Mg sin θ M gL T
Mg ẋ2 = − sin x1 +
(a) (b) 2J J(c)
FIGURE 3.14
Solution:
a. Simple pendulum; b. forceIscomponents c. free-body
of Mg;model
the state space linear?diagram
d2 θ M gL
SOLUTION:
J 2 + sin θ = T
dt First
2 draw a free-body diagram as shown in Figure 3.14(c). Summing
torques, we get
d 2θ MgL
J 2 sin θ
L
x1 = θ dt 2
T 2 T
dθ
Mg cos θ x2 =
θ θ
dt θ
Mg
L
2
ẋ1 = x2
Mg sin θ M gL T
Mg ẋ2 = − sin x1 +
(a) (b) 2J J(c)
FIGURE 3.14
Solution:
a. Simple pendulum; b. forceIscomponents c. free-body
of Mg;model
the state space linear?diagram
d2 θ M gL
SOLUTION:
J 2 + sin θ = T How can we linearize this system?
dt First
2 draw a free-body diagram as shown in Figure 3.14(c). Summing
torques, we get
ẋ1 = x2
M gL T
ẋ2 ≈ − x1 +
2J J
ẋ1 = x2
M gL T
ẋ2 ≈ − x1 +
2J J
The linearized state space model (around the downward equilibrium point):
ẋ1 0 1 x1 0
≈ + 1 T
ẋ2 − M2JgL 0 x2 J
ẋ1 = x2
M gL T
ẋ2 ≈ x1 +
2J J
ẋ1 = x2
M gL T
ẋ2 ≈ x1 +
2J J
The linearized state space model around upright equilibrium point:
ẋ1 0 1 x1 0
≈ M gL + 1 T
ẋ2 2J 0 x 2 J
l l
(m1 + m2 ) z̈ + m1 cos θ θ̈ − m1 sin θ θ̇2 + bż = F
z2 2 ż
2
✓ ✓˙
l l l
m1 cos
` θ z̈ + m1 m1 θ̈ = m1 g sin θ
2 4 2
F
z
bż
M. F. Haydar (FlyCon, IST) Control Systems March 12, 2019 27 / 40
Case Study: Inverted Pendulum
l l
(m1 + m2 ) z̈ + m1 cos θ θ̈ − m1 sin θ θ̇2 + bż = F
2 2
l l2 l
m1 cos θ z̈ + m1 θ̈ = m1 g sin θ
2 4 2
F̄ = 0,
l
m1 g sin θ = 0.
2
F̄ = 0,
l
m1 g sin θ = 0.
2
Thus, any point θ̄ = nπ can be an equilibrium point (for integer n), if external
force F̄ is zero.
Linearization can be performed either
I by taking Jacobian of the nonlinear state space equations,
I or by linearizing each term and then converting to state space form.
M. F. Haydar (FlyCon, IST) Control Systems March 12, 2019 28 / 40
Case Study: Inverted Pendulum
Thus linearizing around the “inverted” position (i.e., θ̄ = 0 ± kπ where k is an
even integer):
∂ ∂
¨
cos θθ̈ ≈ cos θ̄θ̄ + cos θθ̈ ¨ θ − θ̄ + cos θθ̈ θ̈ − θ̄¨
∂θ (θ̄,θ̄ ) ∂ θ̈ (θ̄,θ̄¨)
= cos θ̄θ̄¨ − sin θ̄θ̄¨ (δθ) + cos θ̄ δ θ̈
= δ θ̈
∂ ∂
¨
cos θθ̈ ≈ cos θ̄θ̄ + cos θθ̈ ¨ θ − θ̄ + cos θθ̈ θ̈ − θ̄¨
∂θ (θ̄,θ̄ ) ∂ θ̈ (θ̄,θ̄¨)
= cos θ̄θ̄¨ − sin θ̄θ̄¨ (δθ) + cos θ̄ δ θ̈
= δ θ̈
∂ ∂
sin θθ̇2 ≈ sin θ̄θ̄˙2 + sin θθ̇2 ˙ θ − θ̄ + sin θθ̇2 θ̇ − θ̄˙
∂θ (θ̄,θ̄) ∂ θ̇ ˙
(θ̄,θ̄)
= sin θ̄θ̄˙2 + cos θ̄ (δθ) θ̄˙2 + 2θ̄˙ sin θ̄ δ θ̄˙
=0
∂ ∂
cos θz̈ ≈ cos θ̄z̄¨ + (cos θz̈)|(θ̄,z̄¨) θ − θ̄ + (cos θz̈) (z̈ − z̄¨)
∂θ ∂ z̈ (θ̄,z̄¨)
∂
sin θ ≈ sin θ̄ + (sin θ)|(θ̄) θ − θ̄
∂θ
= sin θ̄ + cos θ̄ (δθ)
= δθ
Linearized Model:
l
(m1 + m2 ) δz̈ + m1 δ θ̈ + bż = δF
2
l l2 l
m1 δz̈ + m1 δ θ̈ = m1 g δθ
2 4 2
Linearized Model:
l
(m1 + m2 ) δz̈ + m1 δ θ̈ + bż = δF
2
l l2 l
m1 δz̈ + m1 δ θ̈ = m1 g δθ
2 4 2
Note:
It is common in literature to drop δ with the variables, but one should never forget
that linearized models only work with small deviations.
l
(m1 + m2 ) z̈ + m1 θ̈ + bż = F
2
l l2 l
m1 z̈ + m1 θ̈ = m1 g θ
2 4 2
l
(m1 + m2 ) z̈ + m1 θ̈ + bż = F
2
l l2 l
m1 z̈ + m1 θ̈ = m1 g θ
2 4 2
b m1 g F
z̈ = − ż − θ+
m2 m2 m2
b 2(m1 + m2 )g 2F
θ̈ = 2 ż + θ−
m2 l m2 l m2 l
b m1 g F
z̈ = − ż − θ+
m2 m2 m2
b 2(m1 + m2 )g 2F
θ̈ = 2 ż + θ−
m2 l m2 l m2 l
x1 z
x2 ż
=
x3 θ
x4 θ̇
b m1 g F
z̈ = − ż − θ+
m2 m2 m2
b 2(m1 + m2 )g 2F
θ̈ = 2 ż + θ−
m2 l m2 l m2 l
x1 z
x2 ż
=
x3 θ
x4 θ̇
x1 0 1 0 0 x1 0
d x 0 − mb2 −m1g
0 x2 m1
=
2 m2 + 2 [F ]
dt x3 0 0 0 1 x3 0
x4 0 2 mb2 l 2(m1 +m2 )g
m2 l 0 x4 − m22 l
y= 0 0 1 0 x + 0 F
Js
✓
Rotational spring k
and damper b at joint
Jp
Js θ̈ = τ − b θ̇ − φ̇ − k (θ − φ)
Jp Jp φ̈ = b θ̇ − φ̇ + k (θ − φ)
k b
Js ✓
M. F. Haydar (FlyCon, IST) Control Systems March 12, 2019 34 / 40
Case Study: Satellite Attitude Control
Js θ̈ = τ − b θ̇ − φ̇ − k (θ − φ)
Jp φ̈ = b θ̇ − φ̇ + k (θ − φ)
Js θ̈ = τ − b θ̇ − φ̇ − k (θ − φ)
Jp φ̈ = b θ̇ − φ̇ + k (θ − φ)
x1 θ
x2 θ̇
=
x3 φ
x4 φ̇
Js θ̈ = τ − b θ̇ − φ̇ − k (θ − φ)
Jp φ̈ = b θ̇ − φ̇ + k (θ − φ)
x1 θ
x2 θ̇
=
x3 φ
x4 φ̇
x1 0 1 0 0 x1 0
d x − Jk − Jb
= s
2
k
Js
k
x
Js 2
1
Js [F ]
s
+
dt x3 0 0 0 1 x3 0
k b k k
x4 Js Js − Js − Js
x4 0
1 0 0 0 0
y= x + F
−1 1 0 0 0
r
y
F2
x F1
(a) Harrier “jump jet” (b) Simplified model
Figure 3.18: Vectored thrust aircraft. The Harrier AV-8B military aircraft (a) redirects its
engine thrust downward so that it can “hover” above the ground. Some air from the engine
is diverted to the wing tips to be used for maneuvering. As shown in (b), the net thrust on
the aircraft can be decomposed into a horizontal force F1 and a vertical force F2 acting at a
distance r from the center of mass.
front-wheel steering. The figure shows that the model also applies to rear wheel
steering if the sign of the velocity is reversed. ∇
Example 3.11 Vectored thrust aircraft
M. F. Haydar (FlyCon, IST) Control Systems March 12, 2019 36 / 40
steering if the sign of the velocity is reversed. ∇
Example: Vectored Thrust Aircraft
Example 3.11 Vectored thrust aircraft
3-32 CHAPTER 3. SYSTEM MODELING
Consider the motion of vectored thrust aircraft, such as the Harrier “jump jet”
shown Figure 3.18a. The Harrier is capable of verticalθtakeoff by redirecting its
thrust downward and through the use of smaller maneuvering thrusters located on
its wings. A simplified model of the Harrier is shown in Figure 3.18b, where we
focus on the motion of the vehicle in a vertical plane through the wings of the
aircraft. We resolve the forces generated by the main downward thruster and the
r
maneuvering thrusters as a pair of forces F1 andy F2 acting at a distance r below the
F2
aircraft (determined by the geometry of the thrusters).
Let (x, y, θ ) denote the position and orientation of the center of mass of the
x F
aircraft. Let m be the mass of the vehicle, J the moment of inertia,1 g the gravita-
(a) Harrier “jump jet” (b) Simplified model
tional constant and c the damping coefficient. Then the equations of motion for the
Figure 3.18: Vectored thrust aircraft. The Harrier AV-8B military aircraft (a) redirects its
vehicle areengine
given bydownward so that it can “hover” above the ground. Some air from the engine
thrust
is diverted to the wing tips to be used for maneuvering. As shown in (b), the net thrust on
mẍ = F1into
the aircraft can be decomposed θ − F2 sin
cosa horizontal forceθF1− cẋ,
and a vertical force F2 acting at a
distance r from the center of mass.
mÿ = F1 sin θ + F2 cos θ − mg − cẏ, (3.29)
front-wheel steering.J θ̈The rF1 . shows that the model also applies to rear wheel
= figure
steering if the sign of the velocity is reversed. ∇
It is convenient to redefine the inputs so that the origin is an equilibrium point
of the Examplewith3.11 zero
Vectored thrust aircraftu = F and u = F − mg, the equations
M. F.system
Haydar (FlyCon, IST) input. Letting 1
Control Systems 1 2 2 March 12, 2019 36 / 40
Frequency Response Models
1
4 10
0
−1
10
−2
−2
−4 10 −1 0 1
0 10 20 30 40 50 10 10 10
Time [s] Frequency [rad/sec] (log scale)
Figure 3.12: A frequency response (gain only) computed by measuring the response of
individual sinusoids. The figure on the left shows the response of the system as a function
of time to a number of different unit magnitude inputs (at different frequencies). The figure
on the right shows this same data in a different way, with the magnitude of the response
plotted as a function of the input frequency. The filled circles correspond to the particular
frequencies
M. F. Haydar shown
(FlyCon, in the time responses.
IST) Control Systems March 12, 2019 37 / 40
Block Diagrams
Problem: Real systems are very complicated and its hard to follow the effects
of different inputs individually.
Idea: focus only on the information flow and ignore the details of the
system.
3.3. MODELING METHODOLOGY 3-25
u2
u1 u1 + u2 u ku u sat(u)
Σ k
Figure 3.14: Standard block diagram elements. The arrows indicate the the inputs and out-
puts of each element, with the mathematical operation corresponding to the blocked labeled
at the output. The system block (f) represents
M. F. Haydar (FlyCon, IST)
the full input/output response
Control Systems
of a dynamical
March 12, 2019 38 / 40
Block Diagrams: Insect Flight Control Systems
3-26 CHAPTER 3. SYSTEM MODELING
Wind
(d) Drag
Aero-
dynamics
(e) Vision
−1
System
Figure 3.15: A block diagram representation of the flight control system for an insect flying
against the wind. The mechanical portion of the model consists of the rigid-body dynamics
of the fly, the drag due to flying through the air and the forces generated by the wings. The
motion of the body causes the visual environment of the fly to change, and this information
is then used to control the motion of the wings (through the sensory motor system), closing
M.the loop. (FlyCon, IST)
F. Haydar Control Systems March 12, 2019 39 / 40
What is next?
We will learn
how to analyze models.
I examine the dynamic characteristics of systems using models.
Check if the dynamic properties of the system match our desired properties.
Design controllers to tweak the dynamic properties.