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

T6b:

State Space Discrete-Time Control

22419 Control por Computador


Grado en Ingeniera Electrnica
Industrial y Automtica

Universitat de les
Illes Balears
Departament de Cincies
Matemtiques i Informtica

Alberto ORTIZ RODRGUEZ

Contents
State feedback control
Pole placement
Reference tracking controllers
State observers
Optimal control

Alberto Ortiz / EPS (ltima revisin 14/01/2014)

State feedback control


State feedback involves the use of the state vector to compute the control action:

plant

The goal is to determine Kx so as to make the system attain the desired behaviour

Alberto Ortiz / EPS (ltima revisin 14/01/2014)

State feedback control


There exist a number of methods to design SISO control systems using the state
space representation:
Pole placement
General systems
Deadbeat control
Regulation systems
Reference tracking systems
State observers
Optimal control
Others
We will consider pole placement as a general method for designing SISO control
systems, and next we will use it to solve reference tracking systems.

Alberto Ortiz / EPS (ltima revisin 14/01/2014)

Contents
State feedback control
Pole placement
Reference tracking controllers
State observers
Optimal control

Alberto Ortiz / EPS (ltima revisin 14/01/2014)

Pole placement
For simplicity, and without loss of generality, we will remove block D:

plant

For this case, we can write:

Assuming zero initial conditions, the transfer function becomes:

Alberto Ortiz / EPS (ltima revisin 14/01/2014)

Pole placement
The characteristic equation of this system is:
It can be shown that if the plant is controllable and observable, then it is possible to
determine a matrix Kx such that the poles li of the compensated system are placed
according to the design requirements.
It can also be shown that the li are the eigenvalues of matrix A - BKx
The procedure to determine Kx assumes the plant is in controllable form.
Since D = 0, b0 = 0 and matrices A, B and C become:

If the plant is not in controllable form, then it must be transformed (we will deal with
this later)
Alberto Ortiz / EPS (ltima revisin 14/01/2014)

Pole placement
If this is the case, then the characteristic polynomial can be written as follows:

Then, given the desired poles for the system l1, l2, l3, i.e.
we can write:
from which we obtain:
Alberto Ortiz / EPS (ltima revisin 14/01/2014)

Pole placement
As a particular case, we can consider the deadbeat controller, for which the closedloop poles are all at the origin, i.e. l1 = l2 = l3 = 0:
and thus:

Another case to consider is that of the so-called regulation systems, for which the
reference r(k) is set to 0, or, in other words, the control goal is to keep the state at 0
despite perturbations and noise affecting the system.
Given a controllable and observable
plant, it can also be shown that exists
a matrix Kx that places the closed-loop
poles at the desired places, and that
this matrix is as well given by:

Alberto Ortiz / EPS (ltima revisin 14/01/2014)

Pole placement
Example 1a: Given the following system in controllable form:
determine the gain matrix Kx s.t. for the compensated system ts = 2s and Mp = 10%
First we have to check that the plant is completely controllable:
Next we have to determine the desired discrete-time poles:

or directly the characteristic equation:


In this case: a2 = 0.6703 and a1 = -1.5769, and a2 = 0.16 and a1 = 1.
Consequently: Kx = [a2 - a2 , a1 - a1] = [0.6703 - 0.16 , -1.5769 - 1] = [0.5103, -2.5769]
Alberto Ortiz / EPS (ltima revisin 14/01/2014)

10

Pole placement
A = [0 1; -0.16 -1]; B = [0; 1]; C = [1 0]; D = 0;
CM = ctrb(A,B);
rank(CM)
T = 0.1; Mp = 10; ts = 2;
delta = -log(Mp/100)/sqrt(pi^2 + log(Mp/100)^2);
wn = 4/(ts*delta);
wd = wn*sqrt(1-delta^2);
z1 = exp(-delta*wn*T + j*wd*T);
z2 = exp(-delta*wn*T - j*wd*T);
cp = [1, -2*cos(wd*T)*exp(-delta*wn*T), exp(-2*delta*wn*T)];
a1 = -A(2,2); a2 = -A(2,1);
alpha1 = cp(2); alpha2 = cp(3);
Kx = [alpha2 - a2, alpha1 - a1];
% also: Kx = place(A,B,[z1 z2])
ss0 = ss(A, B, C, D, T);
ss1 = ss(A - B*Kx, B, C, D, T);
figure; step(ss0, ss1); legend(org, comp);
figure; impulse(ss1);
Alberto Ortiz / EPS (ltima revisin 14/01/2014)

11

Pole placement
Given the following controllable and observable system:

the following transformation Tc gives rise to a controllable form:

Alberto Ortiz / EPS (ltima revisin 14/01/2014)

12

Pole placement
Example 2: Given the following system:
determine the gain matrix Kx s.t., for the compensated system, ts = 2s and Mp = 10%
First we have to check that the plant is completely controllable:
The plant is not in controllable form. We have to determine the transformation T c:

From a previous example, we know that the characteristic polynomial for this case is:
So, in this case:
Therefore:
Finally:
Alberto Ortiz / EPS (ltima revisin 14/01/2014)

13

Pole placement
The pole placement method goal is to place the closed-loop poles at the locations
required to meet the desired transient reponse.
However, this method modifies significantly the closed-loop gain, and this change
depends on the placement performed.
One solution to this problem is to place an additional gain Kr at the input:

The value of Kr is calculated after the placement of the poles at the desired positions:

Alberto Ortiz / EPS (ltima revisin 14/01/2014)

14

Pole placement
Example 1b: Given the following system in controllable form:
determine the gains Kx and Kr s.t. ts = 2s, Mp = 10% and esp = 0
A = [0 1; -0.16 -1]; B = [0; 1]; C = [1 0]; D = 0;
T = 0.1; Mp = 10; ts = 2;
delta = -log(Mp/100)/sqrt(pi^2 + log(Mp/100)^2);
wn = 4/(ts*delta);
wd = wn*sqrt(1-delta^2);
z1 = exp(-delta*wn*T + j*wd*T);
z2 = exp(-delta*wn*T - j*wd*T);
cp = [1, -2*cos(wd*T)*exp(-delta*wn*T), exp(-2*delta*wn*T)];
a1 = -A(2,2); a2 = -A(2,1); alpha1 = cp(2); alpha2 = cp(3);
Kx = [alpha2 - a2, alpha1 - a1];
Kr = inv(C*inv([1 0; 0 1] - A + B*Kx)*B);
ss2 = ss(A - B*Kx, B*Kr, C, D, T);
figure; step(ss2);
Alberto Ortiz / EPS (ltima revisin 14/01/2014)

Kr = 0.0934
15

Contents
State feedback control
Pole placement
Reference tracking controllers
State observers
Optimal control

Alberto Ortiz / EPS (ltima revisin 14/01/2014)

16

Reference tracking controllers


The previous strategy is not robust against inaccuracies in the model or
perturbations. A better solution is the use of integrators in the forward path, e.g.

plant

For this configuration, we can write:

Alberto Ortiz / EPS (ltima revisin 14/01/2014)

17

Reference tracking controllers


And thus:

If the control law is defined as:


then we can write:

or, in other words:


Alberto Ortiz / EPS (ltima revisin 14/01/2014)

18

Reference tracking controllers


Example 1c: Given the following system:
design a tracking controller s.t., for the compensated system, ts = 2s and Mp = 10%
We have to consider the following system:

Next, we have to check the controllability of this system:

This system is not in controllable form. We have to determine the transformation T c,


which requires the coefficients of the characteristic polynomial of the new plant:

Alberto Ortiz / EPS (ltima revisin 14/01/2014)

19

Reference tracking controllers


Now, Tc is given by:

From a previous example, we know that the characteristic polynomial for the desired
system behaviour is:
However, since the integrator has made the system become of order 3, we have to
include an additional pole, e.g. z = 0 in order not to alter the system dynamics:

In this way:

Alberto Ortiz / EPS (ltima revisin 14/01/2014)

20

10

Reference tracking controllers


Ab = [A zeros(2,1); -C*A 1]; Bb = [B; -C*B];
Cb = [C 0]; Db = D;
CM = [Bb Ab*Bb (Ab^2)*Bb]; Tc = CM*[-0.84 0 1; 0 1 0; 1 0 0];
Abt = inv(Tc)*Ab*Tc; % Bbt = inv(Tc)*Bb; Cbt = Cb*Tc;
T = 0.1; Mp = 10; ts = 2;
delta = -log(Mp/100)/sqrt(pi^2 + log(Mp/100)^2);
wn = 4/(ts*delta); wd = wn*sqrt(1-delta^2);
% z1 = exp(-delta*wn*T + j*wd*T);
% z2 = exp(-delta*wn*T - j*wd*T);
cp = [1,-2*cos(wd*T)*exp(-delta*wn*T),exp(-2*delta*wn*T), 0];

one T more
due to the
extra pole

a1 = -Abt(3,3), a2 = -Abt(3,2), a3 = -Abt(3,1)


alpha1 = cp(2), alpha2 = cp(3), alpha3 = cp(4)
Kbt = [alpha3 - a3, alpha2 - a2, alpha1 - a1]
% also: Kbt = place(Abt, Bbt, [z1 z2 0])
Kb = Kbt*inv(Tc);
ss3 = ss(Ab - Bb*Kb, [0; 0; 1], Cb, Db, T);
figure; step(ss3);
figure; impulse(ss3);
Alberto Ortiz / EPS (ltima revisin 14/01/2014)

21

Contents
State feedback control
Pole placement
Reference tracking controllers
State observers
Optimal control

Alberto Ortiz / EPS (ltima revisin 14/01/2014)

22

11

State observers
Pole placement is based on the feedback of all the state variables to generate the
control signal. In practical terms, this means all the state variables are available for
measurement:
plant

However, in practice, not always all the state variables are available, or it is too costly
to measure them. For these cases, the solution is the estimation of the unavailable
variables by means of a state observer, a subsystem of the control system that
estimates the state variables from the output y(k) and the control input u(k).

The observability of the plant is crucial for this kind of system


since the observer will be feasible only if the plant is completely
observable
Alberto Ortiz / EPS (ltima revisin 14/01/2014)

The goals in this case are:


(1) decide whether we estimate all the
variables (full-order) or only the
unavailable ones (reduced-order),
(2) design the observer, e.g. an
asymptotic observer: same dynamics
as the observed system with an added
error term (and Ke, the observer gain)
to compensate for modelling errors. 23

Contents
State feedback control
Pole placement
Reference tracking controllers
State observers
Optimal control

Alberto Ortiz / EPS (ltima revisin 14/01/2014)

24

12

Optimal control
Optimal control systems are designed so as to maximize a certain performance
index (or minimize a cost function)
e.g. the quadratic performance index ( linear quadratic regulator, LQR):
where:
the first and second terms of the expression weight the difference of x(k) with regard
to 0, i.e. it is a regulation problem, and the last term weights the control effort,
S, Q and R are matrices which are tuned for the problem at hand and depending
whether we want to minimize the error (make matrices S and Q larger) or minimize
the control effort (make matrix R larger)

It can be proved that the optimal control law is again based on state feedback:
the resulting regulated system is ensured to be asymptotically stable
if N = , the matrix K(k) is constant and we say it is an infinite horizon problem
otherwise, the matrix K(k) must be determined for every sampling period, and we
talk about a finite horizon problem
Alberto Ortiz / EPS (ltima revisin 14/01/2014)

25

T6b:
State Space Discrete-Time Control

22419 Control por Computador


Grado en Ingeniera Electrnica
Industrial y Automtica

Universitat de les
Illes Balears
Departament de Cincies
Matemtiques i Informtica

Alberto ORTIZ RODRGUEZ

13

You might also like