You are on page 1of 9

Lecture 2 - Our First Control Design

1. Review
Block diagrams

K. J. strm

Feedback and feedforward (open or closed loop systems)

1. Review

Properties of feedback

2. Cruise Control
3. Standard Models
4. Summary
Themes: A simple control design. Use of standard models.

+
+
+
+

Reduce effects of process disturbances


Make system insensitive to process variations
Stabilize an unstable system
Create well defined relations between output and
reference
- Risk for instability
Rt
de
PID control: u = ke + ki 0 e( )d + kd
dt

2. Cruise Control

Construction of a Block Diagram


The block diagram gives an overview. To draw a block diagram:
Understand how the system works.
Identify the major components and the relevant signals.
Key questions:
Where is the essential dynamics?
What are appropriate abstractions?

Process input or control variable: gas pedal (throttle) u

Describe the dynamics of the blocks.

Process output: velocity v


Desired output or reference signal vr
Disturbances: slope
c K. J. strm August, 2001
&

Process Model

Block Diagram of Cruise Control

A simplified mathematical model


External Force
ref

Th

Cont

Eng

Velocity
Body

dv
+ vd = F mg
dt

With reasonable parameters


dv
+ 0.02v = u 10
dt

where
v [m/s] (10 m/s=36 km/h=22 miles/hour)

Simplifying assumptions

u normalized throttle 0 u 1

Essential dynamics relates velocity and force


The force responds very fast to a change in the throttle

slope in [rad/s]

Assume that all relations are linear (small perturbations)

The Closed Loop System

Stop and Think!!

dv
+ 0.02v = u 10
dt
Rt
PI controller: u = k(vr v) + ki 0 (vr v( ))d

How is the behavior of the equation

Process model:

d2 e
de
d
+ (0.02 + k) + ki e = 10
2
dt
dt
dt

The closed loop system is described by (differentiate both


equations and add them) e = vr v
de
d
d2 e
+
(
0
.
02
+
k
)
+
k
e
=
10
i
dt2
dt
dt

In steady state with constant and e we have e = 0.

influenced by the parameters k and ki?


What is the static gain of the system?

The Audience is Thinking ...

No surprise the controller has integral action!

c K. J. strm August, 2001


&

Behavior of the Equation

How to Find Controller Parameters?


d2 e
de
d
+ (0.02 + k) + ki e = 10
2
dt
dt
dt
Comparison with the normalized mass-spring-damper system

d2 e
de
d
+
(
0
.
02
+
k
)
+
k
e
=
10
i
dt2
dt
dt
Compare with spring-mass-damper system
m

d2 x
dx
+ 2 0
+ 02 x = 0
2
dt
dt

d2 x
dx
+
d
+ kx = 0
dt2
dt

What are the effects of damping d and spring constant k?


Normalized parameters

gives
k = 2 0 0.02
ki = 20

k
m

and = 0.5

d
mk

Parameter 0 gives response speed, and gives shape of the


response. Reasonable to choose = 1 critical damping. How
to choose 0 ?

Comparison of Open Loop and Closed Loop?


Controller parameters = 1, 0 = 0.1, open loop (dashed)
closed (solid) when the road has a slope of 4% (10 m/s=36
km/h=22 miles/hour)

= 0.1, = 0.5 (dotted), = 1 (solid), and = 2 (dashed)


2.5
2

e [m/s]

where 0 =

d x
dx
+
2

+ 02 x = 0
0
dt2
dt

1.5
1
0.5
0

18

0.5

10

20

30

40

t [s]

50

60

70

80

90

100

10

20

30

40

t [s]

50

60

70

80

90

100

Velocity error [m/s]

16

0.5

12

0.4

u [0-1]

14

0.3

10

0.2

0.1

10

20

30

40

50

60

Time [s]

70

80

90

100

c K. J. strm August, 2001


&

= 1, 0 = 0.05 (dotted), 0 = 0.1 (solid) and 0 = 0.2


(dashed)

= 1, 0 = 0.05 (dotted), 0 = 0.1 (solid) and 0 = 0.2


(dashed) with extra dynamics T = 5s

4
3

e [m/s]

e [m/s]

2.5
2

1.5
1

1
0

0.5
0

10

20

30

40

50

t [s]

60

70

80

90

100

0.4

0.8

0.3

20

30

40

10

20

30

40

50

60

70

80

90

100

50

60

70

80

90

100

t [s]

0.6

0.2

0.4

0.1
0

10

u [0-1]

u [0-1]

0.5

0.2

10

20

30

40

50

t [s]

60

70

80

90

100

t [s]

Agenda

What have we done?


Block diagram of the system

We must develop methods to

Derive process model in the form of ODE

Derive equations for the system

ODE = Ordinary Differential Equation

Manipulate the equations

Select controller ODE

Understand the equations (standard models)

Process and controller described in similar ways ODE


Eliminate variables to give relation disturbance output
Understand how closed loop system behaves
Select controller parameters to give desired behavior
Fine tune parameters by simulation or experiment

Qualitative understanding concepts


Insight
Standard forms
Computations

Find controller parameters


Validate the results by simulation

c K. J. strm August, 2001


&

3. Standard Models

A First Order Equation

Standard models are foundations of the language

The homogeneous equation

Learn to deal with the standard models

dy
+ ay = 0
dt

Transform problems to standard models


Software is often based on standard models

has the solution

y(t) = Ceat
where C = y(0) is an arbitrary constant. The equation

One of the standard forms of LTI systems is the ODE


dn y
d n1 y
d n1 u
+
a
+
.
.
.
+
a
y
=
b
+ . . . + b nu
1
n
1
dtn
dtn1
dtn1

A high order linear time invariant differential equation that


relates the output y of the system to its input u.

dy
+ a y = bu
dt

has the solution


at

y(t) = Ce

Z
+b

ea(t ) u( )dt

Parameter a tells a lot!


at

y(t) = y(0) e

+b

Equations of Higher Order

ea(t ) u( )dt

Consider the equation

dn y
d n1 y
d n2 y
+
a
+
a
+ . . . + an y = 0
1
2
dtn
dtn1
dtn2

First term depends on initial conditions, second term depends


on input signal
a>0

The characteristic polynomial is

a<0

A(s) = sn + a1 sn1 + a2 sn2 + . . . + an

1
2.5
0.8

2
1.5

0.4

0.2

0.5

If A( ) = 0 then y(t) = e t is a solution! If the characteristic


equation has distinct roots k the solution is

0.6

at

0.2

0.4

at

0.6

0.8

y(t) =

n
X

Ck e k t

k=1

Roots of the characteristic equation gives insight!


c K. J. strm August, 2001
&

Roots of Characteristic Equation give Insight!


A real root s = to the characteristic equation corresponds to
the time function e t .
Complex roots s = i corresponds to the time functions.
e t sin t,

30

The general solution is

20

0.2

0.4

10

0.2

10
5

10

20

15

y(t) =
5

10

y(t) =

kt

Ck1 (t) e

k=1

General Linear Time Invariant System (LTI)


dn y
d n1 y
d n1 u
+
a
+
.
.
.
+
a
y
=
b
+ . . . + bnu
1
n
1
dtn
dtn1
dtn1
has the solution
Z t
n
X
kt
y(t) =
Ck1 (t) e +
g(t )u( )d

h(t )u( )d

k=1

Where h is the solution to the homogeneous equation


dn h
d n1 h
+
a
+ . . . + an h = 0
1
dtn
dtn1
hP (0) = 0,

. . . , h(n2) (0) = 0,

where Ck (t) are polynomials and the impulse response g is


g(t) = b1 hn1(t) + b2hn2(t) + . . . + bnh(t)
where h is the solution to the homogeneous differential equation with initial conditions

with initial conditions


h(0) = 0,

Ck1 (t) e k t

15

dn y
d n1 y
+
a
+ . . . + an y = u
1
dtn
dtn1

has the solution

n
X
k=1

Ordinary Differential Equations

n
X

A(s) = sn + a1 sn1 + a2 sn2 + . . . + an

of multiplicity k and C(t) a polynomial of degree k 1 then


y = C(t) e t is a solution to the equation.

= 0.25

40

0.6

dn y
d n1 y
d n2 y
+ a1 n 1 + a2 n 2 + . . . + a n y = 0
dtn
dt
dt
If is a root to the characteristic polynomial

e t cos t

= 0.25

0.4

Multiple Roots

h(n1)(0) = 1

h(0) = 0,

c K. J. strm August, 2001


&

hP (0) = 0,

. . . , h(n2) (0) = 0,

h(n1) (0) = 1

Poles and Zeros

Standard Forms
Standard forms are foundations of the language
Learn to deal with the standard forms

The linear time invariant system


dn y
d n1 y
d n1 u
+
a
+
.
.
.
+
a
y
=
b
+ . . . + bnu
1
n
1
dtn
dtn1
dtn1

Transform problems to standard form


Software is often based on standard form

is characterized by two polynomials


A( s) = sn + a1 sn1 + a2 sn2 + . . . + an1 s + an

One of the standard forms of LTI systems is


n

n1

B ( s) = b1 sn1 + b2 sn2 + . . . + bn1 s + bn

n1

d y
d y
d u
+ a1 n1 + . . . + an y = b1 n1 + . . . + bnu
n
dt
dt
dt

A high order linear time invariant differential equation that


relates the output y of the system to its input u.

The roots of A(s) are called poles of the system. The roots of
B (s) are called zeros of the system.
The poles give the components of the time functions that
compose the solution.

Interpretation of Poles

Interpretation of Zeros

The poles s = k give the components of the solution


Z t
n
X
kt
y(t) =
Ck1(t) e +
g(t )u( )d
0

k=1

g(t) =

dn y
d n1 y
d n1 u
+
a
+
.
.
.
+
a
y
=
b
+ . . . + bnu
1
n
1
dtn
dtn1
dtn1

Introduce

where Ck (t) are polynomials and


n
X

Consider the linear time invariant system

A( s) = sn + a1 sn1 + a2 sn2 + . . . + an1 s + an


B ( s) = b1 sn1 + b2 sn2 + . . . + bn1 s + bn

Ck1 (t) e k t

If s = is a zero of B (s) and u(t) = Ce t it follows that

k=1

A system is stable if all poles have negative real parts.

d n1 u
d n2 u
b1 n1 + b2 n2 . . . + bnu = B ( ) Ce t = 0
dt
dt

A zero of B (s) at s = blocks the transmission of the signal


u(t) = Ce t .
c K. J. strm August, 2001
&

The Transfer Function

Inverse System

Consider the linear time invariant system

Consider the linear time invariant system

dn y
d n1 y
d n1 u
+
a
+
.
.
.
+
a
y
=
b
+ . . . + b nu
1
n
1
dtn
dtn1
dtn1

Introduce the polynomials

dn y
d n1 y
d n1 u
d n2 u
+
a
+
.
.
.
+
a
y
=
b
+
b
+ . . . + b nu
1
n
1
2
dtn
dtn1
dtn1
dtn2

Introduce

A( s) = sn + a1 sn1 + . . . + an1 s + an

A( s) = sn + a1 sn1 + a2 sn2 + . . . + an1 s + an

B ( s) = b1 sn1 + b2 sn2 + . . . + bn1 s + bn

B ( s) = b1 sn1 + b2 sn2 + . . . + bn1 s + bn

Notice (almost) symmetry between y and u. The inverse


system is obtained by reversing the roles of input and output.
B ( s)
and the inverse
The transfer function of the system is
A(s)
A(s)
system has the transfer function
.
B ( s)

The rational function

B ( s)
A(s)
is called the transfer function of the system

Steady State Gain

Cruise Control

Consider the linear time invariant system


dn y
d n1 y
d n1 u
d n2 u
+
a
+
.
.
.
+
a
y
=
b
+
b
+ . . . + bnu
1
n
1
2
dtn
dtn1
dtn1
dtn2

Assume that the and the output are constant, i.e. y(t) = y0 and
u(t) = u0 . Then
an y0 = bnu0
The number
y0
bn
=
u0
an
is called the static gain of the system.

The relation between velocity error e = vr v and the slope of


the road is described by the differential equation
d2 e
de
d
+ (0.02 + k) + ki e = 10
2
dt
dt
dt

where k and ki are the controller parameters. This differential


equation is characterized by the polynomials
A( s) = s2 + (0.02 + k) s + ki
B ( s) = 10s

The poles can be given arbitrary values by choosing the


controller parameters (pole placement). The choice k =
2 0 0.02 and ki = 02 gives a double pole at s = 0. The
zero at s = 0 blocks transmission of constant .

c K. J. strm August, 2001


&

Simulation of Cruise Control

Using Matlab

Using the Control Systems Tool box of Matlab it is very easy to


simulate an LTI system. Example cruise control

It is very convenient to use Matlab to analyze dynamical


systems and to plot solutions. The procedure is very simple:
First we define the polynomials A(s) and B (s) that characterize the system using commands like
A=[1 2 2 1];B=[5 6];

z=1.0;
w0=0.1;
t=0:0.01:100;
th0=0.04;
%Slope of the road
k=2*z*w0-0.02;
ki=w0^2;
syseol=tf(10*th0,[1 0.02]);
sysecl=tf(10*th0*[1 0],[1 0.02+k ki]);
eol=step(syseol,t);
ecl=step(syscl,t);
plot(t,eol,b--,t,ecl,b-)

The command roots(A) gives the roots of the polynomial


A (the poles of the system) and roots(A) gives the roots
of the polynomial B.
To find the response to a given input signal we first create
the signal. The response is then given by the command
lsim(S,u,t).
There are special commands step and impulse to compute the step and impulse responses.

4. Summary
Solution to a simple control problem:
Understand how the system works: use block diagram.
Approximate and write differential equations for the
blocks.
Eliminate variables to obtain a differential equation for
closed loop system
Select controller and its coefficients that give desired
roots of the characteristic equation.

The standard model and associated concepts: characteristic polynomial, poles, zeros and transfer functions, stability,
inverse systems
dn y
d n1 y
d n1 u
+
a
+
.
.
.
+
a
y
=
b
+ . . . + b nu
1
n
1
dtn
dtn1
dtn1
c K. J. strm August, 2001
&

You might also like