You are on page 1of 89

Control Systems

Mathematical Modeling

Muhammad Farooq Haydar

Flight Dynamics and Control Center


Department of Aeronautics and Astronautics
Institute of Space Technology, Islamabad

March 13, 2018

M. Farooq Haydar (FlyCon, IST) Control Systems March 13, 2018 1 / 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
Feedback Principles
input design
Compute Robustness to Uncertainty
I while considering the sensors
Design of the
and Dynamics
actuators

Many examples of feedback and control in natural & engineered systems:

BIO

ESE
BIO

ESE
CS

Oct 04 R. M. Murray, Caltech CDS 2


M. Farooq Haydar (FlyCon, IST) Control Systems March 13, 2018 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
Feedback Principles
input design
Compute Robustness to Uncertainty
I while considering the sensors
Design of the
and Dynamics
actuators

Many examplesPrinciples:
Feedback of feedback and control in natural & engineered systems:
Robustness to BIO
I variations in system parameters (mass, stiffness, damping etc.)
ESE
I external disturbance (wind gusts etc.)
BIO

ESE
CS

Oct 04 R. M. Murray, Caltech CDS 2


M. Farooq Haydar (FlyCon, IST) Control Systems March 13, 2018 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
Feedback Principles
input design
Compute Robustness to Uncertainty
I while considering the sensors
Design of the
and Dynamics
actuators

Many examplesPrinciples:
Feedback of feedback and control in natural & engineered systems:
Robustness to BIO
I variations in system parameters (mass, stiffness, damping etc.)
ESE
I external disturbance (wind gusts etc.)
BIO
Design of Dynamics to achieve desired levels of
I natural frequency (speed of response)
ESE
I damping ratio (stability)
CS

Oct 04 R. M. Murray, Caltech CDS 2


M. Farooq Haydar (FlyCon, IST) Control Systems March 13, 2018 2 / 40
Model-Based Control
Control (or input) design in a feedback system can be
counter-intuitive.

M. Farooq Haydar (FlyCon, IST) Control Systems March 13, 2018 3 / 40


Model-Based Control
Control (or input) design in a feedback system can be
counter-intuitive.

Design with hit-and-trial can be


I expensive
I dangerous
I inefficient.

M. Farooq Haydar (FlyCon, IST) Control Systems March 13, 2018 3 / 40


Model-Based Control
Control (or input) design in a feedback system can be
counter-intuitive.

Design with hit-and-trial can be


I expensive
I dangerous
I inefficient.

A model
is a mathematical approximation of a real system.

M. Farooq Haydar (FlyCon, IST) Control Systems March 13, 2018 3 / 40


Model-Based Control
Control (or input) design in a feedback system can be
counter-intuitive.

Design with hit-and-trial can be


I expensive
I dangerous
I inefficient.

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.

M. Farooq Haydar (FlyCon, IST) Control Systems March 13, 2018 3 / 40


Model-Based Control
Control (or input) design in a feedback system can be
counter-intuitive.

Design with hit-and-trial can be


I expensive
I dangerous
I inefficient.

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).

M. Farooq Haydar (FlyCon, IST) Control Systems March 13, 2018 3 / 40


Mass Spring Damper 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?

M. Farooq Haydar (FlyCon, IST) Control Systems March 13, 2018 4 / 40


Mass Spring Damper 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?

M. Farooq Haydar (FlyCon, IST) Control Systems March 13, 2018 4 / 40


Mass Spring Damper 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?

Assumptions:
Mass, spring and damper properties are
fixed and exactly known.
Springs satisfy Hooke’s law.
Damper is a linear viscous force.

M. Farooq Haydar (FlyCon, IST) Control Systems March 13, 2018 4 / 40


Mass Spring Damper System

Writing the system’s equation using rigid-body


mechanics:

mẍ + cẋ + kx = F (t).

Separating the acceleration term:

c k F (t)
ẍ = − ẋ − x + .
m m m

M. Farooq Haydar (FlyCon, IST) Control Systems March 13, 2018 5 / 40


State of a dynamic system:

M. Farooq Haydar (FlyCon, IST) Control Systems March 13, 2018 6 / 40


State of a dynamic system:
For dynamic systems, input alone does not completely specify the evolution of the
system.

M. Farooq Haydar (FlyCon, IST) Control Systems March 13, 2018 6 / 40


State of a dynamic system:
For dynamic systems, input alone does not completely specify the evolution of the
system.
A vector of variable called “state” captures all the information needed in addition
to input.

M. Farooq Haydar (FlyCon, IST) Control Systems March 13, 2018 6 / 40


State of a dynamic system:
For dynamic systems, input alone does not completely specify the evolution of the
system.
A vector of variable called “state” captures all the information needed in addition
to input.

Consider a mass driven by an input (force):


F (t)
ẍ = .
m

M. Farooq Haydar (FlyCon, IST) Control Systems March 13, 2018 6 / 40


State of a dynamic system:
For dynamic systems, input alone does not completely specify the evolution of the
system.
A vector of variable called “state” captures all the information needed in addition
to input.

Consider a mass driven by an input (force):


F (t)
ẍ = .
m
I acceleration is completely determined by the input (force).

M. Farooq Haydar (FlyCon, IST) Control Systems March 13, 2018 6 / 40


State of a dynamic system:
For dynamic systems, input alone does not completely specify the evolution of the
system.
A vector of variable called “state” captures all the information needed in addition
to input.

Consider a mass driven by an input (force):


F (t)
ẍ = .
m
I acceleration is completely determined by the input (force).
I velocity is calculated as
Z t1
ẋ = ẍdt + ẋ0 .
t
|{z}
| 0{z } initial velocity
change in velocity

M. Farooq Haydar (FlyCon, IST) Control Systems March 13, 2018 6 / 40


State of a dynamic system:
For dynamic systems, input alone does not completely specify the evolution of the
system.
A vector of variable called “state” captures all the information needed in addition
to input.

Consider a mass driven by an input (force):


F (t)
ẍ = .
m
I acceleration is completely determined by the input (force).
I velocity is calculated as
Z t1
ẋ = ẍdt + ẋ0 .
t
|{z}
| 0{z } initial velocity
change in velocity

I position is calculated as
Z t1 Z t1 
x= ẍdt + ẋ0 dt + x0 .
t0 t0
|{z}
| {z } initial position
change in position

M. Farooq Haydar (FlyCon, IST) Control Systems March 13, 2018 6 / 40


Mass Spring Damper System: State Space Form

Can you identify the state variable in the system?


c k F (t)
ẍ = − ẋ − x + .
m m m

M. Farooq Haydar (FlyCon, IST) Control Systems March 13, 2018 7 / 40


Mass Spring Damper System: State Space Form

Can you identify the state variable in 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.

M. Farooq Haydar (FlyCon, IST) Control Systems March 13, 2018 7 / 40


Mass Spring Damper System: State Space Form

Can you identify the state variable in 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 state is equal of number of integrators present in the


system,
I called order of the system.

M. Farooq Haydar (FlyCon, IST) Control Systems March 13, 2018 7 / 40


Mass Spring Damper System: State Space Form

Can you identify the state variable in 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 state is equal of 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.

M. Farooq Haydar (FlyCon, IST) Control Systems March 13, 2018 7 / 40


Mass Spring Damper System: State Space Form
If we write the state vector of mass spring damper system:
   
x1 x
= .
x2 ẋ

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

M. Farooq Haydar (FlyCon, IST) Control Systems March 13, 2018 8 / 40


Mass Spring Damper System: State Space Form
If we write the state vector of mass spring damper system:
   
x1 x
= .
x2 ẋ

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

M. Farooq Haydar (FlyCon, IST) Control Systems March 13, 2018 8 / 40


Mass Spring Damper System: State Space Form
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 output of the system can be taken as position, which is given by


an algebraic equation:
   
  x1 0
y= 1 0 + [F (t)]. (2)
x2 0
| {z }
y=Cx+Du

M. Farooq Haydar (FlyCon, IST) Control Systems March 13, 2018 9 / 40


Mass Spring Damper System: State Space Form
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 output of the system can be taken as position, which is given by


an algebraic equation:
   
  x1 0
y= 1 0 + [F (t)]. (2)
x2 0
| {z }
y=Cx+Du

Any idea why is equations (1)-(2) are called “state-space”


representation?
M. Farooq Haydar (FlyCon, IST) Control Systems March 13, 2018 9 / 40
bles for all t ' t0 .
State Vectors and State Space
ables.
he state vC
here the
apacitor
pace. A State space
e vector,
articular vR

ferential
are the State vector, x(t)

State vector trajectory


the out-
State vector, x(4)
ariables

efine the FIGURE 3.3 Graphic representation of state


M. Farooq Haydar (FlyCon, IST) Control Systems March 13, 2018 10 / 40
State Space Form

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 .

Linear ODE (higher order):

dn q dn−1 q dq
n
+ a1 n−1 + ... + an−1 + an q = u.
dt dt dt
dn−1 q dq
y = b1 n−1 + ... + bn−1 + bn q
dt dt

M. Farooq Haydar (FlyCon, IST) Control Systems March 13, 2018 11 / 40


State Space Form

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 .

Linear ODE (higher order):

dn q dn−1 q dq
n
+ a1 n−1 + ... + an−1 + an q = u.
dt dt dt
dn−1 q dq
y = b1 n−1 + ... + bn−1 + bn q
dt dt

How can this ODE be written as a system of first order ODEs?

M. Farooq Haydar (FlyCon, IST) Control Systems March 13, 2018 11 / 40


dn q dn−1 q dq
n
+ a1 n−1 + ... + an−1 + an q = u.
dt dt dt
dn−1 q dq
y = b1 n−1 + ... + bn−1 + bn q
dt dt
   q 
x1
 x2   dq 
   dt 
 ..   .. 

=⇒ x =  .  =  .  ,
 
xn−1   dn−2 q 
 dtn−2 
xn dn−1 q
n−1dt

M. Farooq Haydar (FlyCon, IST) Control Systems March 13, 2018 12 / 40


dn q dn−1 q dq
n
+ a1 n−1 + ... + an−1 + an q = u.
dt dt dt
dn−1 q dq
y = b1 n−1 + ... + bn−1 + bn q
dt dt
   q 
x1
 x2   dq 
   dt 
 ..   .. 

=⇒ x =  .  =  .  ,
 
xn−1   dn−2 q 
 dtn−2 
xn dn−1 q
n−1 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

M. Farooq Haydar (FlyCon, IST) Control Systems March 13, 2018 12 / 40


State Space Form

Choice of state is not unique.


I different choices of units,
I sums and differences of mass positions.
Inputs are external to the system.
Outputs are the variables which we can measure.
Different types of models for different purposes:
I ordinary differential equations for rigid body mechanics
I partial differential equations for fluid flow, solid mechanics
I finite state machines for manufacturing, logic controllers

M. Farooq Haydar (FlyCon, IST) Control Systems March 13, 2018 13 / 40


Quarter-Car Suspension

Figure 1: (a) passive suspension, (b) full-active suspension, (c) hydraulic-active


suspension.

M. Farooq Haydar (FlyCon, IST) Control Systems March 13, 2018 14 / 40


Quarter-Car Model
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?

M. Farooq Haydar (FlyCon, IST) Control Systems March 13, 2018 15 / 40


Quarter-Car Model
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.
M. Farooq Haydar (FlyCon, IST) Control Systems March 13, 2018 15 / 40
Quarter-Car Model

Writing the system’s equation using rigid-body


mechanics:

ms z̈s = −cs (żs − żus ) − ks (zs − zus ) (3)


mus z̈us = cs (żs − żus ) + ks (zs − zus ) − kt (zus − zr )
(4)

M. Farooq Haydar (FlyCon, IST) Control Systems March 13, 2018 16 / 40


Quarter-Car Model: State Space Form

Can you identify the state variable in the system?

ms z̈s = −cs (żs − żus ) − ks (zs − zus )


mus z̈us = cs (żs − żus ) + ks (zs − zus ) − kt (zus − zr )

M. Farooq Haydar (FlyCon, IST) Control Systems March 13, 2018 17 / 40


Quarter-Car Model: State Space Form

Can you identify the state variable in the system?

ms z̈s = −cs (żs − żus ) − ks (zs − zus )


mus z̈us = cs (żs − żus ) + ks (zs − zus ) − kt (zus − zr )

The state of the quarter car model is comprised of positions ( zs , zus )


and velocities ( żs , żus ) of both masses.

M. Farooq Haydar (FlyCon, IST) Control Systems March 13, 2018 17 / 40


Quarter-Car Model: State Space Form
If we write the state vector of quarter-car model:
   
x1 zs
x2  zus 
  =  .
x3   żs 
x4 żus

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

M. Farooq Haydar (FlyCon, IST) Control Systems March 13, 2018 18 / 40


Quarter-Car Model: State Space Form
Equivalently:
      
ẋ1 0 0 1 0 x1 0
ẋ2   0 0 0 1  x2   
 = cus    +  0  [zr ]
ẋ3   − ks
 ms
kus
ms −mcs 
ms  x3
  0 
s
kt
ẋ4 ks
mus − (kus +kt )
mus
cs
mus
cus
mus
x4 mus
| {z }
ẋ=Ax+Bu

M. Farooq Haydar (FlyCon, IST) Control Systems March 13, 2018 19 / 40


Quarter-Car Model: State Space Form
Equivalently:
      
ẋ1 0 0 1 0 x1 0
ẋ2   0 0 0 1  x2   
 = cus    +  0  [zr ]
ẋ3   − ks
 ms
kus
ms −mcs 
ms  x3
  0 
s
kt
ẋ4 ks
mus − (kus +kt )
mus
cs
mus
cus
mus
x4 mus
| {z }
ẋ=Ax+Bu

The output of the system can be taken as position of sprung mass, or


possibly even unsprung mass as:
 
  x1  
1 0 0 0  x2 
 0
y= + [z ].
0 1 0 0 x3  0 r
x4
| {z }
y=Cx+Du

M. Farooq Haydar (FlyCon, IST) Control Systems March 13, 2018 19 / 40


Linearization

Problem: almost every practical system is nonlinear!

M. Farooq Haydar (FlyCon, IST) Control Systems March 13, 2018 20 / 40


Linearization

Problem: almost every practical system is nonlinear!


Idea: use first order Taylor series approximation around the
equilibrium point.

M. Farooq Haydar (FlyCon, IST) Control Systems March 13, 2018 20 / 40


Linearization

Problem: almost every practical system is nonlinear!


Idea: use first order Taylor series approximation around the
equilibrium point.
Rationale: Feedback can provide corrective action against minor errors
arising from linear approximation:

M. Farooq Haydar (FlyCon, IST) Control Systems March 13, 2018 20 / 40


Linearization

Figure 2: Approximation of sin(x) with Taylor series (degree of the Taylor


polynomial 1,3,5,7,9,11,13).

M. Farooq Haydar (FlyCon, IST) Control Systems March 13, 2018 21 / 40


Linearization

Linearization is always specific to the operating/equilibrium point.


A nonlinear system can be approximated by infinitely many linear
systems at different operating points.

M. Farooq Haydar (FlyCon, IST) Control Systems March 13, 2018 22 / 40


mass at L/2. Then linearize the state equations about the pendulum’s equilibrium
point—the vertical position with zero angular velocity.
Example

d 2θ MgL
J sin θ

L
dt2 2

2
T T
Mg cos θ
θ Mg θ θ

L
2

Mg sin θ
Mg
(a) (b) (c)

FIGURE 3.14 a. Simple pendulum; b. force components of Mg; c. free-body diagram

SOLUTION: First draw a free-body diagram as shown in Figure 3.14(c). Summing


torques, we get

d2 θ MgL
M. Farooq Haydar (FlyCon, IST) JControl‡Systems sin θ ˆ T March 13, 2018 …3
23 / 40
mass at L/2. Then linearize the state equations about the pendulum’s equilibrium
point—the vertical position with zero angular velocity.
Example

We can take the states:

d 2θ MgL
J sin θ

L
dt2 2

2
T T
Mg cos θ
θ Mg θ θ

L
2

Mg sin θ
Mg
(a) (b) (c)

Solution:
FIGURE 3.14 a. Simple pendulum; b. force components of Mg; c. free-body diagram

d2 θ MFirst
SOLUTION: gL draw a free-body diagram as shown in Figure 3.14(c). Summing
J 2 we
torques, + get sin θ = T
dt 2
d2 θ MgL
M. Farooq Haydar (FlyCon, IST) JControl‡Systems sin θ ˆ T March 13, 2018 …3
23 / 40
mass at L/2. Then linearize the state equations about the pendulum’s equilibrium
point—the vertical position with zero angular velocity.
Example

We can take the states:

d 2θ MgL
J sin θ

L
dt2 2

2
x1 = θ
T T
Mg cos θx = dθ
2
θ Mg θ dt θ

L
2

Mg sin θ
Mg
(a) (b) (c)

Solution:
FIGURE 3.14 a. Simple pendulum; b. force components of Mg; c. free-body diagram

d2 θ MFirst
SOLUTION: gL draw a free-body diagram as shown in Figure 3.14(c). Summing
J 2 we
torques, + get sin θ = T
dt 2
d2 θ MgL
M. Farooq Haydar (FlyCon, IST) JControl‡Systems sin θ ˆ T March 13, 2018 …3
23 / 40
mass at L/2. Then linearize the state equations about the pendulum’s equilibrium
point—the vertical position with zero angular velocity.
Example

We can take the states:

d 2θ MgL
J sin θ

L
dt2 2

2
x1 = θ
T T
Mg cos θx = dθ
2
θ Mg θ dt θ

L
2

Mg sin θẋ1 = x2
Mg
(a) (b) M gL T
ẋ2 = − sin x1 + (c)
2J J
Solution:
FIGURE 3.14 a. Simple pendulum; b. force components of Mg; c. free-body diagram

d2 θ MFirst
SOLUTION: gL draw a free-body diagram as shown in Figure 3.14(c). Summing
J 2 we
torques, + get sin θ = T
dt 2
d2 θ MgL
M. Farooq Haydar (FlyCon, IST) JControl‡Systems sin θ ˆ T March 13, 2018 …3
23 / 40
mass at L/2. Then linearize the state equations about the pendulum’s equilibrium
point—the vertical position with zero angular velocity.
Example

We can take the states:

d 2θ MgL
J sin θ

L
dt2 2

2
x1 = θ
T T
Mg cos θx = dθ
2
θ Mg θ dt θ

L
2

Mg sin θẋ1 = x2
Mg
(a) (b) M gL T
ẋ2 = − sin x1 + (c)
2J J
Solution:
FIGURE 3.14 a. Simple pendulum; b. force components of Mg; c. free-body diagram
Is the state space model linear?
d2 θ MFirst
SOLUTION: gL draw a free-body diagram as shown in Figure 3.14(c). Summing
J 2 we
torques, + get sin θ = T
dt 2
d2 θ MgL
M. Farooq Haydar (FlyCon, IST) JControl‡Systems sin θ ˆ T March 13, 2018 …3
23 / 40
mass at L/2. Then linearize the state equations about the pendulum’s equilibrium
point—the vertical position with zero angular velocity.
Example

We can take the states:

d 2θ MgL
J sin θ

L
dt2 2

2
x1 = θ
T T
Mg cos θx = dθ
2
θ Mg θ dt θ

L
2

Mg sin θẋ1 = x2
Mg
(a) (b) M gL T
ẋ2 = − sin x1 + (c)
2J J
Solution:
FIGURE 3.14 a. Simple pendulum; b. force components of Mg; c. free-body diagram
Is the state space model linear?
d2 θ MFirst
SOLUTION: gL draw a free-body diagram as shown in Figure 3.14(c). Summing
J 2 we
torques, + get sin θ = T How can we linearize this system?
dt 2
d2 θ MgL
M. Farooq Haydar (FlyCon, IST) JControl‡Systems sin θ ˆ T March 13, 2018 …3
23 / 40
ẋ1 = x2
M gL T
ẋ2 = − sin x1 +
2J J
for small x1 (which is θ)
sin x1 ≈ x1

ẋ1 = x2
M gL T
ẋ2 ≈ − x1 +
2J J

M. Farooq Haydar (FlyCon, IST) Control Systems March 13, 2018 24 / 40


ẋ1 = x2
M gL T
ẋ2 = − sin x1 +
2J J
for small x1 (which is θ)
sin x1 ≈ x1

ẋ1 = x2
M gL T
ẋ2 ≈ − x1 +
2J J
The linearized state space model (around the downward equilibrium point):
      
ẋ1 0 1 x1 0
≈ M gL + 1 T
ẋ2 − 2J 0 x 2 J

M. Farooq Haydar (FlyCon, IST) Control Systems March 13, 2018 24 / 40


ẋ1 = x2
M gL T
ẋ2 = − sin x1 +
2J J
What will be the linearized model around upright equilibrium point?

M. Farooq Haydar (FlyCon, IST) Control Systems March 13, 2018 25 / 40


ẋ1 = x2
M gL T
ẋ2 = − sin x1 +
2J J
What will be the linearized model around upright equilibrium point?
for small x1 (which is θ)
sin x1 ≈ −x1

M. Farooq Haydar (FlyCon, IST) Control Systems March 13, 2018 25 / 40


ẋ1 = x2
M gL T
ẋ2 = − sin x1 +
2J J
What will be the linearized model around upright equilibrium point?
for small x1 (which is θ)
sin x1 ≈ −x1

ẋ1 = x2
M gL T
ẋ2 ≈ x1 +
2J J

M. Farooq Haydar (FlyCon, IST) Control Systems March 13, 2018 25 / 40


ẋ1 = x2
M gL T
ẋ2 = − sin x1 +
2J J
What will be the linearized model around upright equilibrium point?
for small x1 (which is θ)
sin x1 ≈ −x1

ẋ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 x2 J

M. Farooq Haydar (FlyCon, IST) Control Systems March 13, 2018 25 / 40


ẋ1 = x2
M gL T
ẋ2 = − sin x1 +
2J J

M. Farooq Haydar (FlyCon, IST) Control Systems March 13, 2018 26 / 40


ẋ1 = x2
M gL T
ẋ2 = − sin x1 +
2J J
Writing in matrix form:
     
ẋ1 0 1 0
= + 1 T
ẋ2 − M2JgL sin x1 0 J

M. Farooq Haydar (FlyCon, IST) Control Systems March 13, 2018 26 / 40


ẋ1 = x2
M gL T
ẋ2 = − sin x1 +
2J J
Writing in matrix form:
     
ẋ1 0 1 0
= + 1 T
ẋ2 − M2JgL sin x1 0 J

Taking the Jacobian at origion also gives:


  " #  
ẋ1 0 1 0
= M gL  1 + 1 T
ẋ2 − 2J cos 0
 : 0 J

M. Farooq Haydar (FlyCon, IST) Control Systems March 13, 2018 26 / 40


ẋ1 = x2
M gL T
ẋ2 = − sin x1 +
2J J
Writing in matrix form:
     
ẋ1 0 1 0
= + 1 T
ẋ2 − M2JgL sin x1 0 J

Taking the Jacobian at origion also gives:


  " #  
ẋ1 0 1 0
= M gL  1 + 1 T
ẋ2 − 2J cos 0
 : 0 J

Jacobian provides a linear approximation (i.e., tangent plane) in the


multivariable case.

M. Farooq Haydar (FlyCon, IST) Control Systems March 13, 2018 26 / 40


Case Study: Inverted Pendulum

   
l l
(m1 + m2 ) z̈ + m1 z cos θ θ̈ − m1 sin θ θ̇2 + bżż = F
2 ✓ 2 ✓˙
   2
 
l ` l m1 l
m1 cos θ z̈ + m1 θ̈ = m1 g sin θ F
2 4 2
z
bż
M. Farooq Haydar (FlyCon, IST) mControl
1 = 0.25Systems m2 = 1.0 ` = 1.0
March 13, 2018 g27=/ 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

M. Farooq Haydar (FlyCon, IST) Control Systems March 13, 2018 28 / 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

Lets linearize the equation around the equilibrium point z̄, θ̄, F̄ which is
found by setting ż = z̈ = θ̇ = θ̈ = 0.
F̄ = 0,
 
l
m1 g sin θ = 0.
2

M. Farooq Haydar (FlyCon, IST) Control Systems March 13, 2018 28 / 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

Lets linearize the equation around the equilibrium point z̄, θ̄, F̄ which is
found by setting ż = z̈ = θ̇ = θ̈ = 0.
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. Farooq Haydar (FlyCon, IST) Control Systems March 13, 2018 28 / 40
Case Study: Inverted Pendulum
Thus linearizing around the “inverted” position (i.e., θ̄ = 0 ± kπ where k is
an even integer):

M. Farooq Haydar (FlyCon, IST) Control Systems March 13, 2018 29 / 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 θ̄ δ θ̈
= δ θ̈

M. Farooq Haydar (FlyCon, IST) Control Systems March 13, 2018 29 / 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 θ̄ δ θ̈
= δ θ̈

∂    ∂    
˙ 2
2 2
sin θθ̇ ≈ sin θ̄θ̄ + sin θθ̇ ˙ θ − θ̄ + 2
sin θθ̇ θ̇ − θ̄˙
∂θ (θ̄,θ̄) ∂ θ̇ ˙
(θ̄,θ̄)
 
= sin θ̄θ̄˙2 + cos θ̄ (δθ) θ̄˙2 + 2θ̄˙ sin θ̄ δ θ̄˙
=0

M. Farooq Haydar (FlyCon, IST) Control Systems March 13, 2018 29 / 40


Case Study: Inverted Pendulum


∂  ∂
cos θz̈ ≈ cos θ̄z̄¨ + (cos θz̈)|(θ̄,z̄¨) θ − θ̄ + (cos θz̈) (z̈ − z̄¨)
∂θ ∂ z̈ (θ̄,z̄¨)
= cos θ̄z̄¨ − sin θ̄ (δθ) z̄¨ + cos θ̄ (δz̈)
= δz̈

∂ 
sin θ ≈ sin θ̄ + (sin θ)|(θ̄) θ − θ̄
∂θ
= sin θ̄ + cos θ̄ (δθ)
= δθ

M. Farooq Haydar (FlyCon, IST) Control Systems March 13, 2018 30 / 40


Case Study: Inverted Pendulum

Linearized Model:

l
(m1 + m2 ) δz̈ + m1 δ θ̈ + bż = δF
2
l l2 l
m1 δz̈ + m1 δ θ̈ = m1 g δθ
2 4 2

M. Farooq Haydar (FlyCon, IST) Control Systems March 13, 2018 31 / 40


Case Study: Inverted Pendulum

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.

M. Farooq Haydar (FlyCon, IST) Control Systems March 13, 2018 31 / 40


Case Study: Inverted Pendulum

l
(m1 + m2 ) z̈ + m1 θ̈ + bż = F
2
l l2 l
m1 z̈ + m1 θ̈ = m1 g θ
2 4 2

M. Farooq Haydar (FlyCon, IST) Control Systems March 13, 2018 32 / 40


Case Study: Inverted Pendulum

l
(m1 + m2 ) z̈ + m1 θ̈ + bż = F
2
l l2 l
m1 z̈ + m1 θ̈ = m1 g θ
2 4 2

after solving for z̈ and θ̈


b m1 g F
z̈ = − ż − θ+
m2 m2 m2
b (m1 + m2 )g 2F
θ̈ = 2 ż + θ−
m2 l m2 l m2 l

M. Farooq Haydar (FlyCon, IST) Control Systems March 13, 2018 32 / 40


Case Study: Inverted Pendulum

b m1 g F
z̈ = − ż − θ+
m2 m2 m2
b 2(m1 + m2 )g 2F
θ̈ = 2 ż + θ−
m2 l m2 l m2 l

M. Farooq Haydar (FlyCon, IST) Control Systems March 13, 2018 33 / 40


Case Study: Inverted Pendulum

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 θ̇

M. Farooq Haydar (FlyCon, IST) Control Systems March 13, 2018 33 / 40


Case Study: Inverted Pendulum

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   0 − mb m
− m12 g
0
   1 
x2  = 
 2
 x2  +  m2  [F ]
dt x3  0 0 0 1 x3   0 
x4 b
0 2m l 2(m1 +m2 )g
m l 0 x4 − m22 l
2 2
     
y= 0 0 1 0 x + 0 F
M. Farooq Haydar (FlyCon, IST) Control Systems March 13, 2018 33 / 40
Case Study: Satellite Attitude Control

Js

Rotational spring k
and damper b at joint

Jp

 
Js θ̈ = τ − b θ̇ − φ̇ − k (θ − φ)
Jp
 
k
Jp φ̈ = b θ̇ − φ̇ b+ k (θ − φ)
Js ✓
M. Farooq Haydar (FlyCon, IST) Control Systems March 13, 2018 34 / 40
Case Study: Satellite Attitude Control
 
Js θ̈ = τ − b θ̇ − φ̇ − k (θ − φ)
 
Jp φ̈ = b θ̇ − φ̇ + k (θ − φ)

M. Farooq Haydar (FlyCon, IST) Control Systems March 13, 2018 35 / 40


Case Study: Satellite Attitude Control
 
Js θ̈ = τ − b θ̇ − φ̇ − k (θ − φ)
 
Jp φ̈ = b θ̇ − φ̇ + k (θ − φ)

   
x1 θ
x2   θ̇ 
 = 
x3  φ
x4 φ̇

M. Farooq Haydar (FlyCon, IST) Control Systems March 13, 2018 35 / 40


Case Study: Satellite Attitude Control
 
Js θ̈ = τ − b θ̇ − φ̇ − k (θ − φ)
 
Jp φ̈ = b θ̇ − φ̇ + k (θ − φ)

   
x1 θ
x2   θ̇ 
 = 
x3  φ
x4 φ̇
      
x1 0 1 0 0 x1 0
   k
d x2  − Js − Js b k k    1 
= Js Js  x2  +  Js  [F ]
dt x3   0 0 0 1  x3   0 
k b
x4 Js Js − Js − Jks
k x4 0
   
1 0 0 0   0  
y= x + F
−1 1 0 0 0
M. Farooq Haydar (FlyCon, IST) Control Systems March 13, 2018 35 / 40
Example: Vectored Thrust Aircraft
3-32 CHAPTER 3. SYSTEM MODELING

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. Farooq Haydar (FlyCon, IST) Control Systems March 13, 2018 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 r and the
y
maneuvering thrusters as a pair of forces F1 and F2 acting at Fa2 distance r below the
aircraft (determined by the geometry of the thrusters).
Let (x, y, θ ) denote the position and orientation ofx the centerFof 1
mass of the
aircraft. Let m be the mass of the
(a) Harrier “jump jet” vehicle, J the moment of inertia,
(b) Simplified model g the gravita-
tional constant
Figureand
3.18:cVectored
the damping coefficient.
thrust aircraft. Then
The Harrier AV-8B the equations
military of motion
aircraft (a) redirects its for the
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 cosa θ − F2 sin
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
= figure
rF1 . shows that the model also applies to rear wheel
steering if the sign of the velocity is reversed. ∇
It is convenient to redefine the inputs so that the origin is an equilibrium point
Example 3.11 Vectored thrust aircraft
ofM.the system
Farooq Haydar with zero
(FlyCon, IST) input. Letting
ControluSystems
1 = F1 and u2 = F2 March
− mg, 13, the
2018 equations
36 / 40
Frequency Response Models

3-24 CHAPTER 3. SYSTEM MODELING

1
4 10

Gain (log scale)


2 0
10
Output y

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
M.frequencies
Farooq Haydarshown in the
(FlyCon, IST)time responses.
Control Systems March 13, 2018 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
3.3.
the system.
MODELING METHODOLOGY 3-25

u2
u1 u1 + u2 u ku u sat(u)
Σ k

(a) Summing junction (b) Gain block (c) Saturation


! t
u f (u) u ! u(t) dt u y
0
System

(d) Nonlinear map (e) Integrator (f) Input/output system

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
M. at the output.
Farooq Haydar The system
(FlyCon, IST) block (f) represents the full input/output response
Control Systems of a2018
March 13, dynamical
38 / 40
Block Diagrams: Insect Flight Control Systems
3-26 CHAPTER 3. SYSTEM MODELING

Wind
(d) Drag
Aero-
dynamics

Ref (a) Sensory (b) Wing


(c) Body
Σ Motor Aero- Σ
Dynamics
System 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
the loop.
M. Farooq Haydar (FlyCon, IST) Control Systems March 13, 2018 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
propoerties.
Design controllers to tweak the dynamic properties.

M. Farooq Haydar (FlyCon, IST) Control Systems March 13, 2018 40 / 40

You might also like