0% found this document useful (0 votes)
61 views38 pages

Control Systems Ii: Mutaz Ryalat

This document discusses converting transfer functions to state space models and vice versa. It explains that there are three cases to consider when converting a transfer function to state space based on the order of the numerator and denominator polynomials. The document provides examples of converting simple third order transfer functions to state space models by defining state variables and writing the governing differential equations in matrix form. Converting from state space to transfer function is also briefly covered.

Uploaded by

noder mark
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
61 views38 pages

Control Systems Ii: Mutaz Ryalat

This document discusses converting transfer functions to state space models and vice versa. It explains that there are three cases to consider when converting a transfer function to state space based on the order of the numerator and denominator polynomials. The document provides examples of converting simple third order transfer functions to state space models by defining state variables and writing the governing differential equations in matrix form. Converting from state space to transfer function is also briefly covered.

Uploaded by

noder mark
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 38

CONTROL SYSTEMS II

Mutaz Ryalat

Mechatronics Department(ME)
School of Applied Technical Sciences (SATS)
The German-Jordanian University (GJU)

MR
c • Lecture 2 1/38
ME547-8
CONTROL SYSTEMS II

CH 3 (Modeling in the Time Domain)

q 3.5 Converting a Transfer Function to State Space


q 3.6 Converting from State Space to a Transfer Function
q 3.7 Linearization

MR
c • Lecture 2 2/38
3.5 Converting a Transfer Function to State Space

MR
c • Lecture 2 3/38
Transfer Function Representation

q Using the Laplace transform, it is possible to convert a system’s


time-domain representation into a frequency-domain input/output
representation, known as the transfer function. In so doing, it also
transforms the governing differential equation into an algebraic
equation which is often easier to analyze.
q Transfer Function. The transfer function of a linear, time-invariant,
differential equation system is defined as the ratio of the Laplace
transform of the output (response function) to the Laplace
transform of the input (driving function) under the assumption that
all initial conditions are zero in the in the frequency domain.
q The Laplace transform of a time domain function, f (t), is defined
below:
Z ∞
F (s) = L{f (t)} = e−st f (t)dt
0
where the parameter s = σ + jω is a complex frequency variable.
MR
c • Lecture 2 4/38
Transfer Function Representation

q The Laplace transform of the nth derivative of a function is


particularly important:
 n 
d f
L = sn F (s) − sn−1 f (0) − sn−2 f˙(0) − ... − f (n−1) (0)
dtn

q Frequency-domain methods are most often used for analyzing LTI


single-input/single-output (SISO) systems, e.g. those governed by a
constant coefficient differential equation, as shown below:
dn y dy dm u du
an + ... + a1 + a0 y(t) = b m + ... + b1 + b0 u(t)
dtn dt dtm dt
q The Laplace transform of this equation is given below:
an sn Y (s)+...+a1 sY (s)+a0 Y (s) = bm sm U (s)+...+b1 sU (s)+b0 U (s)

q where Y (s) and U (s) are the Laplace Transforms of y(t) and u(t),
respectively.
MR
c • Lecture 2 5/38
Transfer Function Representation

q Note that when finding transfer functions, we always assume that


the each of the initial conditions, y(0), ẏ(0), u(0), etc. is zero. The
transfer function from input U (s) to output Y (s) is, therefore:
Y (s) bm sm + bm−1 sm−1 + ... + b1 s + b0
G(s) = =
U (s) an sn + an−1 sn−1 + ... + a1 s + a0
q It is useful to factor the numerator and denominator of the transfer
function into what is termed zero-pole-gain form:
N (s) (s − z1 )(s − z2 )...(s − zm−1 )(s − zm )
G(s) = =K
D(s) (s − p1 )(s − p2 )...(s − pn−1 )(s − pn )
q The zeros of the transfer function, z1 , . . . , zm , are the roots of the
numerator polynomial, i.e. the values of s such that N (s) = 0. The
poles of the transfer function, p1 , . . . , pn , are the roots of the
denominator polynomial, i.e. the values of s such that D(s) = 0.
Both the zeros and poles may be complex valued (have both real
and imaginary parts). The system Gain is K = bm /an .
MR
c • Lecture 2 6/38
3.5 Converting a Transfer Function to State Space and vice versa

MR
c • Lecture 2 7/38
TFs to State-Space Models

q The goal is to develop a state-space model given a transfer function


for a system G(s).
q But there are three primary cases to consider:
q Simple numerator
Y (s) 1
G(s) = = n n−1
U (s) an s + an−1 s + ... + a1 s + a0
q Numerator order less than denominator order
Y (s) bm sm + bm−1 sm−1 + ... + b1 s + b0
G(s) = = , m<n
U (s) an sn + an−1 sn−1 + ... + a1 s + a0
q Numerator equal to denominator order
Y (s) bm sm + bm−1 sm−1 + ... + b1 s + b0
G(s) = = , m=n
U (s) an sn + an−1 sn−1 + ... + a1 s + a0

MR
c • Lecture 2 8/38
TFs to State-Space Models

q For case 1 consider the third order system:


Y (s) 5
G(s) = = 3 ,
U (s) s + 10s2 + 31s + 30
q From this we have
s3 Y (s) + 10s2 Y (s) + 31sY (s) + 30Y (s) = 5U (s).
q it can be rewritten as the differential equation
...
y + 10ÿ + 31ẏ + 30y = 5u.
q The differential equation is third order, and thus there are three
state variables: x1 = y, x2 = ẏ, and x3 = ÿ.
q The first derivatives are:
ẋ1 = x2
ẋ2 = x3 (1)
ẋ3 = −30x1 − 31x2 − 10x3 + 5u(t)

MR
c • Lecture 2 9/38
ẋ1 = x2
ẋ2 = x3 (2)
ẋ3 = −30x1 − 31x2 − 10x3 + 5u(t)
Or, in matrix form:
      
ẋ1 0 1 0 x1 0
ẋ2  =  0 0 1  x2  + 0 u(t)
ẋ3 −30 −31 −10 x3 5
 
  x1
y = 1 0 0 x2 
x3

MR
c • Lecture 2 10/38
TFs to State-Space Models

q For case 2 consider the third order system:


Y (s) s2 + 7s + 2 N (s)
G(s) = = 3 2
= ,
U (s) s + 9s + 26s + 24 D(s)
q Let
Y (s) Y (s) W (s)
= ·
U (s) W (s) U (s)
q where Y /W = N (s) and W/U = 1/D(s).
q The transfer function in block diagram cascade form

q Then representation of W/U = 1/D(s) is the same as case 1


s3 W (s) = −9s2 W (s) − 26sW (s) − 24W (s) + U (s)
... (3)
w = −9ẅ − 26ẇ − 24w + u(t).

MR
c • Lecture 2 11/38
q Then, consider Y /W = N (s), which implies that
Y (s) = s2 W (s) + 7sW (s) + 2W (s)
(4)
y(t) = ẅ + 7ẇ + 2w
q The time-domain differential equations for the whole system:
...
w = −9ẅ − 26ẇ − 24w + u(t).
(5)
y(t) = ẅ + 7ẇ + 2w
q The differential equation is third order, and thus there are three
state variables: x1 = w, x2 = ẇ, and x3 = ẅ.
q The first derivatives are:
ẋ1 = x2
ẋ2 = x3
(6)
ẋ3 = −24x1 − 26x2 − 9x3 + u(t)
y = 2x1 + 7x2 + x3 .
MR
c • Lecture 2 12/38
ẋ1 = x2
ẋ2 = x3
(7)
ẋ3 = −24x1 − 26x2 − 9x3 + u(t)
y = 2x1 + 7x2 + x3 .

Or, in matrix form:


      
ẋ1 0 1 0 x1 0
ẋ2  =  0 0 1  x2 + 0 u(t)
 
ẋ3 −24 −26 −9 x3 1
 
  x1
y = 2 7 1 x2 
x3

MR
c • Lecture 2 13/38
3.6 Converting from State Space to a Transfer Function

MR
c • Lecture 2 14/38
State space equations:
Consider a system:
ẋ = Ax + Bu (8)
y = Cx + Du, (9)
Laplace transform assuming zero initial conditions:
sX(s) = AX(s) + BU (s)
(10)
Y (s) = CX(s) + DU (s)
which implies:
(sI − A)X(s) = BU (s) .
Premultiply both sides with (sI − A)−1 to obtain:
X(s) = (sI − A)−1 BU (s) + (sI − A)−1 x(0) .
From (9), the Laplace transform of the output is:
Y (s) = C(sI − A)−1 BU (s) +DU (s) .
| {z }
CX(s)

MR
c • Lecture 2 15/38
For SISO system, the TF is by definition:
Y (s)
G(s) = = C(sI − A)−1 B + D .
U (s)

q Transfer function can be rewritten as:


C adj(sI − A)B + D det(sI − A)
G(s) =
det(sI − A)
or  
sI − A −B
det
C D
G(s) =
det(sI − A)
q Poles of the transfer function G(s) are the eigenvalues of state
matrix A, that is the solutions to the characteristic equation:
det(sI − A) = 0 .

q Zeros of the transfer function G(s) are solutions to:


C adj(sI − A)B + D det(sI − A) = 0

MR
c • Lecture 2 16/38
Find the transfer function for the following system
      
ẋ1 2 3 −8 x1 1
ẋ2  =  0 5 3  x2  + 4 u(t)
ẋ3 −3 −5 −4 x3 6
 
  x1
y= 1 3 6 x2 
x3

MR
c • Lecture 2 17/38
Solution
   
2 3 −8 1  
A= 0 5 3 , B = 4 , C = 1 3 6 , D = 0.
−3 −5 −4 6
Y (s)
G(s) = = C(sI − A)−1 B .
U (s)
   
s 0 0 2 3 −8
(sI − A) = 0 s 0 −  0 5 3
0 0 s −3 −5 −4
 
s − 2 −3 8
= 0 s − 5 −3 
3 5 s+4
 2 
s −s+5 3s + 25 8s + 49
 −9 s2 + 2s − 32 3s − 6 
adj(sI − A) −3s + 15 −5s + 1 s2 − 7s + 10
(sI−A)−1 = =
det(sI − A) s3 − 3s2 − 27s + 157

MR
c • Lecture 2 18/38
Solution

G(s) = C(sI − A)−1 B


 2 
s −s+5 3s + 25 8s + 49
 −9 s2 + 2s − 32 3s − 6   
  −3s + 15 −5s + 1 2
s − 7s + 10 1
= 1 3 6 4
s3 − 3s2 − 27s + 157
6
Therefore,
49s2 − 349s + 452
G(s) =
s3− 3s2 − 27s + 157

MR
c • Lecture 2 19/38
3.7 Linearization

MR
c • Lecture 2 20/38
Linearization

q The differential equations of motion for almost all processes and


plants selected for control in nature are nonlinear. On the other
hand, most analysis and control design methods are much easier for
linear than for nonlinear models.
q A nonlinear differential equation is an equation for which the
derivatives of the state have a nonlinear relationship to the state
itself and/or the control. In other words, a general nonlinear
state-space model can be written in the form:

ẋ = f (x, u) (11)
y = h(x, u), (12)

where x ∈ Rn , u ∈ Rm and y ∈ Rp are respectively the state,


input and output of the system.
Equation (11) is called the state equation and (12) is called the
output equation.

MR
c • Lecture 2 21/38
Equilibria and Linearization

q Linearization is a method that allows us to represent a general


nonlinear state space model (11), (12), locally about an operating
(nominal) point (equilibrium), by a linear state-space model. It
involves finding a linear model that approximates a nonlinear one.
q This nominal point is physically defined usually by the designer and,
roughly speaking, should be a condition where the system is
expected to spend most of its life at.
q In control engineering a normal operation of the system may be
around an equilibrium point, and the signals may be considered
small signals around the equilibrium.
q if the system operates around an equilibrium point and if the signals
involved are small signals, then it is possible to approximate the
nonlinear system by a linear system.

MR
c • Lecture 2 22/38
Equilibria and Linearization

q Equilibria (x0 , u0 ) are defined as a set of solutions to the nonlinear


algebraic equation:
ẋ = f (x0 , u0 ) = 0

q the solution x = x0 is our nominal point. Finding this solution is


the most difficult part of the linearization process.
q If x0 is obtained, then ẋ = f (x, u) is linearized around the nominal
point (x, u) = (x0 , u0 ) which may be expanded into a Taylor series
about this point and keep the first order terms only:


∂f (x, u) ∂f (x, u)
f (x, u) ≈ f (x0 , u0 )+ (x−x0 )+ (u−u0 )
∂x x0 ,u0 ∂u x0 ,u0

q This is the equation for the linearization of a function f (x, u) at a


point (x0 , u0 ).

MR
c • Lecture 2 23/38
q Introduce new variables δx = x − x0 and δu = u − u0 .
q Expand the nonlinear equation into McLaurin series around the
equilibrium and keep only the first order terms:
ẋ0 + δ ẋ ≈ f (x0 , u0 ) + Aδx + Bδu,
where A and B are Jacobians of f with respect to x and u,
evaluated at (x0 , u0 ), that is:
∂f ∂f
A= (x0 , u0 ); B = (x0 , u0 )
∂x ∂u
I.e. the elements of A and B are given by:
∂fi
A = [aij ], where [aij ] = ,
∂xj
∂fi
B = [bij ], where [bij ] = .
∂uj
q The system:
δ ẋ = Aδx + Bδu, (13)
is called the linearization of the nonlinear model ẋ = f (x, u) at
(x0 , u0 ).
MR
c • Lecture 2 24/38
Example: The simple pendulum system

q Derive the equilibrium points for the for the simple pendulum
system shown and determine the corresponding linear model.
q where θ is the angle (assumed to be measured), T the controlled
torque, l the pendulum length, M its mass.

MR
c • Lecture 2 25/38
Solution

q First write the equations of motion , where all the mass is


concentrated at the end point and there is a torque, Tc , applied at
the pivot.
q Equations of motion: The moment of inertia about the pivot point
is I = ml2
q The sum of moments about the pivot point contains a term from
gravity as well as the applied torque T
q The the nonlinear equations of motion of the simple pendulum:
ΣM = Iα where α = θ̈
T − mgl sin(θ) = I θ̈
q which is usually written in the form
g T
θ̈ + sin(θ) =
l ml2
q This equation is nonlinear due to the sin(θ) term.
MR
c • Lecture 2 26/38
Solution: linearization

q First, select as state variables


x1 = θ
x2 = θ̇.

q The equation of motion in in state-variable form is:


     
ẋ1 x2 f1 (x, u)
ẋ = = = = f 1 (x, u)
ẋ2 −ωo2 sin(x1 ) + u f2 (x, u)

q where ωo = gl , u = mlT
p
2.

q To determine the equilibrium state, suppose that the (normalized)


input torque has a nominal value of uo = 0. Then
ẋ1 = x2 = 0 =⇒ x2 = 0
ẋ2 = −ωo2 sin(x1 ) = 0, =⇒ sin(x1 ) = 0

q sin(x1 = θ) = 0 =⇒ θo = 0, π.

MR
c • Lecture 2 27/38
Solution: linearization
     
ẋ1 x2 f1 (x, u)
ẋ = = = = f 1 (x, u)
ẋ2 −ωo2 sin(x1 ) + u f2 (x, u)

q The equilibrium θo = 0, π correspond to the downward and the


inverted pendulum at rest configurations, respectively).
q The state-space matrices are given by
" ∂f1 ∂f1 # " #
∂x1 ∂x2 0 1
A= ∂f2 ∂f2
=
∂x1 ∂x2
−ωo2 cos(θo ) 0
xo ,uo
" ∂f1 # " #
∂u 0
B= =
∂f2
∂u
1
xo ,uo

q The linear system has eigenvalues of ±jωo and ±ωo corresponding


to θo = 0 and π, respectively, with the latter inverted case being
unstable as expected.
MR
c • Lecture 2 28/38
Example: The Magnetic Levitation System
q Derive the equilibrium points for the for the Magnetic Levitation
System shown and determine the corresponding linear model.

MR
c • Lecture 2 29/38
Introduction

q The Magnetic Levitation system is a classic electromechanical


experiment with interesting nonlinear dynamics and control
challenges.
q Magnetic levitation technology is used in systems such as Maglev
trains and electromagnetic cranes. Research is also being done to
use magnetic control technology for contactless, high-precision
positioning of wafers
q The Magnetic Levitation (MagLev) device is a single degree of
freedom electromagnet-based system which is used to levitate a steel
ball on air against the gravitational force by the electromagnetic
force generated by an electromagnet which is controlled based on
the measurement of the gap between the magnet and the ball.
q The overhead electromagnet, wound in coil, generates an attractive
force on the metal ball that initially sits on the post. The position
of the ball is measured using a photo-sensitive sensor embedded
inside the post. The system also includes a current sensor to
measure the current inside the electromagnets coil.
MR
c • Lecture 2 30/38
System Dynamics

q The dynamics of the maglev system is


described by the electrodynamics of the
electromagnet and the forces acting upon the
steel ball (magnetic & gravity). The
electromagnet can be easily modeled as a
series RL circuit, where:
q R: resistance of the electromagnet
q L: inductance of the electromagnet
q M: mass of the steel ball
q C: magnetic force constant
q g: acceleration due to gravity
q e: voltage applied across electromagnet
q i: current through electromagnet
q y: gap between electromagnet & center of ball
MR
c • Lecture 2 31/38
System Dynamics

q by combining Newtons second law and


Kirchoffs voltage law, the equations of motion
of the system are represented as

d2 y i2
M 2
= Mg − C 2
dt y (14)
di
e = Ri + L
dt
q State Space Representation:
q The first step in developing the control for the maglev system is
converting the system dynamics to a state space representation.
q The state variables are chosen as follows:
x1 = y(t), x2 = ẏ(t), x3 = i(t) . The system input u(t) will be e(t) .

MR
c • Lecture 2 32/38
System Dynamics

q Expressing the system dynamics in terms of the state variables


yields the following equations
ẋ1 = x2 = f1
C  x3 2
ẋ2 = g − = f2 (15)
M x1
1
ẋ3 = (u − Rx3 ) = f3
L
with f = [ẋ1 , ẋ2 , ẋ3 ]T and ẋ = [x1 , x2 , x3 ]T .
q Clearly, the system dynamics are non-linear.
q it is preferable to linearize the system about an equilibrium point.
q The equilibrium points of a system are found by setting f = 0 and
solving for x1 , x2 , x3 , u.
q Since there are four variables to solve for and only three equations,
the system is underdetermined.
MR
c • Lecture 2 33/38
Finding equilibrium points
To determine the equilibrium points of states, we set f = ẋ = 0:
f1 = ẋ1 = x2 = 0
C  x3 2
f2 = ẋ2 = g − =0 (16)
M x1
1
f3 = ẋ3 = (u − Rx3 ) = 0
L
ẋ1 = x2 = 0 =⇒ x2 = 0
C  x3 2  x 2
3 gM
ẋ2 = g − = 0 =⇒ = (17)
M x1 x1 C
1
ẋ3 = (u − Rx3 ) = 0 =⇒ u = Rx3 .
L
Obviously, from the third equation in (17), when the voltage (u = 0), the
current (x3 ) is also zero. thus, no electromagnetic attractive force. i.e.
the ball will not move and the position x1 = 0.
Thus we need to find the required equilibrium voltage u to suspend the
levitating ball at certain distance d. This means that for each desired
distance x1 = d we will have different input voltage u and current x3 .
MR
c • Lecture 2 34/38
Determining the Equilibrium Point
This can be remedied by setting x1 = d , where d (desired) is the height
set point. Substituting (x1 = d) in (17) and solving:

x2 = 0 =⇒ x2,e = 0
 x 2 r
3 gM 2 2 gM Mg
= =⇒ x3 = d =⇒ x3,e = d (18)
d C C C
r
Mg
u = Rx3 =⇒ ue = Rd ,
C
yields the following equilibrium point:
r r
Mg Mg
x1,e = d, x2,e = 0, x3,e = d , ue = dR . (19)
C C
Note: we are interested in the equilibrium point (e = u) corresponding to
levitation of the steel ball. The equilibrium point corresponding to x3 = 0
is not of interest since this implies the electromagnet is turned off.

MR
c • Lecture 2 35/38
Linearizing the System Dynamics

q The linearized system describes the system dynamics relative to the


equilibrium point.
q We define δx = x − xe and δu = u − ue as the deviations of the
state and control from the equilibrium point, respectively.
q The linearized system dynamics are given by

δ ẋ = Ãδx + B̃δu.

q where à = df /dx is the Jacobian of the state matrix and


B̃ = du/dx is the Jacobian of the input matrix, both evaluated at
the equilibrium point [xe , ue ] .

MR
c • Lecture 2 36/38
Linearizing the System Dynamics

q We need to find the Jacobean of the system dynamics:


ẋ1 = x2 = f1
C  x3 2
ẋ2 = g − = f2 (20)
M x1
1
ẋ3 = (u − Rx3 ) = f3
L
q The state-space matrices are given by
 ∂f1 ∂f1 ∂f1   
∂x1 ∂x2 ∂x3 0 1 0
 ∂f2 ∂f2 ∂f2   
A=   C x23
 ∂x1 ∂x2 ∂x3  = 2 M 3
x1
0 −2 C x3 
2
M x1 
∂f3
∂x1
∂f3
∂x2
∂f3
∂x3
0 0 −R L
 ∂f1    (21)
∂u 0
 ∂f   
B =  ∂u2  = 1
  
∂f3 1
∂u L

MR
c • Lecture 2 37/38
Linearizing the System Dynamics
h q i
q Substituting the equilibrium point (19) xe = d, 0, d MCg and
q
ue = dR MCg into (21), yields
 
0 1 0
 
0 1 0
q
 2

A= C x3 C x3  =  2g 0 −2 Cg
 
2 M x31
0 −2 M x21  d M 
0 0 −R 0 0 −RL
L (xe ,ue )
 
0
 
B = 1


1
L

q Finally, the linear state-space system ẋ = Ax + Bu can be written:


 
0 1 0
q

0

2g
ẋ =  0 −2 Cg x +  0 u
 
d M
1
0 0 −RL L
MR
c • Lecture 2 38/38

You might also like