Control Systems Lab - SC4070: DR - Ir. Alessandro Abate

Download as pdf or txt
Download as pdf or txt
You are on page 1of 39

Control Systems Lab SC4070

Lecture 3, February 13, 2012

dr.ir. Alessandro Abate


Delft Center for Systems and Control
Delft University of Technology
The Netherlands

e-mail: [email protected]
tel: 015 27 85606
(slides modified from the original, drafted by Robert Babu
ska)

Lecture outline
Overview of control design methods.
Continuous vs. discrete time design.
State-feedback control, observers.
Control architectures, nonlinear control.
PID controllers.

Linear control design methods


P, PD, PI, PID, lead-lag control (classical, in frequency)
state feedback, output feedback (modern, in state-space)
LQR, linear quadratic control (optimal)
model predictive control (optimal, finite-horizon, constrained)
robust control (H, synthesis)

Nonlinear control techniques


feedback linearization
sliding-mode control
nonlinear model predictive control
passivity-based control
knowledge-based control
adaptive control

Computer-controlled systems: approach 1

Clock

u(t)
A-D

Algorithm

D-A

y(t)
System

Design a continuous-time controller, then make sure that the (digital) computer implementation approximates the continuous-time
controller as well as possible.

Computer-controlled systems: approach 2

Clock

u(t)
A-D

Algorithm

D-A

y(t)
System

Describe the system from the computers (digital) viewpoint and


design directly a discrete-time controller.

System from the computers viewpoint

Clock

u(t)

{u(t k )}
D-A

y(t)
System

{y(t k )}
A-D

Describe system (including converters) only over discrete sampling


instants.

A-D Converter: Zero-Order Hold

t0

t1

t2

u(t) = u(tk ),

t3

t4

t 5 Time

tk t < tk+1

Usually (but not necessarily) tk+1 tk = const = h.


Higher-Order converters also possible (see below).

Zero-order hold sampling of systems


Continuous-time system:
dx(t)
= Ax(t) + Bu(t)
dt
y(t) = Cx(t) + Du(t)
Discrete-time system:
x(k + 1) = x(k) + u(k)
y(k) = Cx(k) + Du(k)

with (recall solution of non-autonomous ODE):


= eAh , =

eAsdsB,

Reflect on eigenvalues placement

where h is the sampling period

Useful basic MATLAB commands

G = ss(A,B,C,D);

% LTI continuous-time state-space model

h = 0.1;

% sampling period [s]

H = c2d(G,h);

% convert to discrete time (ZOH)

H = c2d(G,h,method);
G = d2c(H);

% method = foh, matched, ...

% convert to continuous time (ZOH)

Selection of sampling period (1st order)


Number of samples per rise time: Nr = Thr 4 10
(a) 1
1

(a) Nr = 1

0
1

0
0

(b) 1
1

(b) Nr = 2

0
1

0
0

(c)

1
1

(c) Nr = 4

0
1

0
0

(d) 1
1

(d) Nr = 8

0
1

0
0

5
Time

5
Time

Selection of sampling period (2nd order)


Nr = Thr 4 10 corresponds to 0h 0.2 0.6
(a)

(b)
1

0
0

(c)

(d)
1

0
0

5
Time

Time

(a) h = 0.125 (0h = 0.23), (b) h = 0.250 (0h = 0.46),


(c) h = 0.500 (0h = 0.92), (d) h = 1.000 (0h = 1.83)

State feedback in DT: problem formulation


Discretize LTI model choosing a sampling interval
Model : x(k + 1) = x(k) + u(k)
Linear controller :
u(k) = Lx(k)
Design parameters: closed-loop poles
Evaluation: compare x(k) and u(k) with specifications

(trade-off between control magnitude and speed of response)

Poles placement: Ackermann formula


Compute L such that ( L) has a desired characteristic polynomial P(z). Ackermann formula:
L = (0

...

1)Wc1P()

where P() is the desired characteristic polynomial in


Place poles inside unit ball
In Matlab:
L = acker(Phi,Gamma,Po)

(SISO, numeric problems ?)

L = place(Phi,Gamma,Po)

(MISO, more robust)

Alternatively, choice of desired poles in CT


Use the continuous-time 2nd order model, study char. pol.:
s2 + 2s + 2,

which leads to z2 + p1z + p2 with



 p
p1 = 2eh cos h 1 2

p2 = e2h

Thereafter in Matlab use c2d for closed-loop model

Linear quadratic control: LQR


N

J=

x(k)T Qx(k) + u(k)T Ru(k),

k=1

where (matrices, weights) Q, R are design parameters


A state feedback matrix L that gives a minimal J can be found by
solving the Riccati equation.
Similar to pole placement, but no need to define poles!
In Matlab: dlqr(Phi,Gamma,Q,R)
In Matlab: dlqry(Phi,Gamma,C,D,Q,R)

% state weighting
% output weighting

State estimation: observers


x(k + 1) = x(k) + u(k)
y(k) = Cx(k)

Assume input and output are available, reconstruct the state:


Direct calculation (requires differentiation)
Luenberger observer (model-based)
Kalman filter (optimal in presence of noise)

Note: the terms observer, estimator, filter are in this context used synonymously

State reconstruction based on a model


Consider the model:

x(k
+ 1) = x(k)
+ u(k)

Model-based state estimation


Consider the model:

x(k
+ 1) = x(k)
+ u(k)

Introduce feedback term from measured y(k)

x(k
+ 1) = x(k)
+ u(k) + K[y(k) Cx(k)]

State reconstruction based on a model


Consider the model:

x(k
+ 1) = x(k)
+ u(k)

Introduce feedback from measured y(k)

x(k
+ 1) = x(k)
+ u(k) + K[y(k) Cx(k)]

Define estimation error e = x x


e(k + 1) = e(k) KCe(k) = [ KC]e(k)

Observer block diagram


y(k)

K
-

u(k)

x^(k+1)

1
z

y^(k)

x(k)
C

x(k)

Output feedback (observer + state feedback)



x(k
+ 1) = x(k)
+ u(k) + K y(k) Cx(k)

u(k) = Lx(k)

Poles of the closed-loop system


x(k + 1) = x(k) + u(k)
e(k + 1) = ( KC)e(k)
u(k) = L(x(k) e(k))

Poles of the closed-loop system


x(k + 1) = x(k) + u(k)
e(k + 1) = ( KC)e(k)
u(k) = L(x(k) e(k))

x(k + 1) L L x(k)

0
KC
e(k)
e(k + 1)

Poles of the closed-loop system


x(k + 1) = x(k) + u(k)
e(k + 1) = ( KC)e(k)
u(k) = L(x(k) e(k))

x(k + 1) L L x(k)

0
KC
e(k)
e(k + 1)

Separation principle:
(Closed-loop) Process poles: Ar (z) = det(zI + L)
Observer poles: Ao(z) = det(zI + KC)

Feed-forward (two-degree-of-freedom)
Goal: respond to a reference signal with desired specs.
Replace u(k) = Lx(k)

by: u(k) = Lx(k)


+ Lcuc(k)

uc
x

Lc

-L

Observer

Process

Feed-forward (two-degree-of-freedom)
Closed-loop system:
x(k + 1) = ( L)x(k) + Le(k) + Lcuc(k)
e(k + 1) = ( KC)e(k)
y(k) = Cx(k)

Transfer function from uc to y (for impulse response):


B(z)
Hcl (z) = C(zI + L) Lc = Lc
Ar (z)
1

Application to a nonlinear system


y0
-

Reference

y0

u0
Feedforward
controller

+
+
+

Nonlinear
system

Feedback
controller

Linearization of nonlinear models


xnl = f (xnl , unl )
ynl = g(xnl , unl )

Choose x0, y0 or u0 such that 0 = f (x0, u0) and y0 = g(x0, u0) (equilibrium). Linearize the above model:


f
f
(xnl x0) +
(unl u0)
x =


xnl xnl =x0
unl unl =u0

g
ynl y0 =
xnl


g
(xnl x0) +
(unl u0)

unl unl =u0
xnl =x0

Linearization of nonlinear models



f
x =
xnl

g
ynl y0 =
xnl


f
(xnl x0) +
(unl u0)

unl unl =u0
xnl =x0

g
(xnl x0) +
(unl u0)

unl unl =u0
x f nl=x0
x = Ax + Bu

y = Cx + Du

with x = xnl x0, u = unl u0, y = ynl y0, etc.

Comparison of models through simulation


y

Nonlinear
system

u
+
-

Linearized
model

+
+

y0

u0
u = unl u0

ynl = y + y0

Alternatively . . .
y0

u0
+

Nonlinear
system

Linearized
model

unl = u + u0

y = ynl y0

Control by local linear controller


y0

u0
+
+

Nonlinear
system
Linearized
model

Linear
controller

Model-based adaptive control

Controller

Design parameters

Process

Linear
model

ym

Adaptation

Continuous-time PID controller


The textbook version of a PID controller:


Z t
1
de(t)
u(t) = K e(t) +
e(s)ds + Td
Ti
dt

Continuous-time PID controller


The textbook version of a PID controller:


Z t
1
de(t)
u(t) = K e(t) +
e(s)ds + Td
Ti
dt

A more realistic PID controller:




sTd
1
Y (s)
U(s) = K bUc(s) Y (s) + (Uc(s) Y (s))
sTi
1 + sTd /N

Discrete-time PID controller


P-term: P(k) = K(buc(k) y(k))
I-term: I(k + 1) = I(k) + TKi e(k)
Td
dN
D-term: D(k) = Td +Nh
D(k 1) TKT
(y(k) y(k 1))
d +Nh

u(k) = P(k) + I(k) + D(k)

PID tuning
Pole placement
Root locus
Bode diagram
Tuning rules (Ziegler-Nichols, tuning)
G(s) = e

t0s

Kp
(s + 1)

t0
Kc =
, Ti = , Td =
K p( + t0)
2

Cascaded control Example:Inverted Pendulum

Reference

Position
controller

Angle
controller

Inverted
pendulum

You might also like