State Regulator
Scope
Keywords
pole placement,
optimal control, LQ regulator, weighting matrices
Prerequisites
Contact
Date
MSE
Preliminary Remarks
The path to be followed in this and the next document is the following:
The first point to be discussed concerns the design of regulators which make
use of the state vector x to control a plant. It is assumed that the plant is
controllable.
The next point concerns the estimation of the state vector x in case that it is
not completely measured. To design such estimators (observers) it is assumed
that the plant is observable.
The third theme concerns the cooperation between the regulator and the observer. Instead of using the true statevector, the regulator then utilizes the
estimated statevector. Assumed that the two separate designs of regulator
and observer met their specific requirements are these requirements still
fulfilled if the regulator and the observer are used together?
The assumptions about the plant to be controlled are as follows:
Preferably, the plant is controllable and observable.
If the plant lacks one or both of the abovementioned properties (see the examples in Fig. 1), then the noncontrollable or nonobservable parts can be
removed from the model our methods will work for the remaining model
which is controllable and observable.
b)
a)
X1
X1
1
1
U
U
Y
Y
s+1
s+1
++
++
X2
X2
2
1
s+1
c)
U
s2
s2
s+1
X1
1
s2
X2
MSE
Figure 2: Control structure with feedforward term and full state feedback
In Fig. 2, the control system has two components: the feedback part K, and the
feedforward part Kvf . The state feedback K is used to determine the dynamics of
the closedloop system, while the prefilter Kvf is used to guarantee the static gain
(y = r )1 .
Note that the error signal e = r y which is used in classical output feedback does
not appear in this control structure.
In the feedback signal uR , the state variables x1 (t), x2 (t) . . . xn (t) are weighted by
the coefficients k1 , k2 , . . . , kn .
x1
x2
uR = k1 x1 + k2 x2 + ... + kn xn = k1 k2 ... kn .. = Kx
.
xn
The control signal u is
u = w uR = Kvf r K x
The matrix equations are
x = A x + B (Kvf r Kx) = A x BKx + BKvf r
x = (A BK) x + BKvf r
and y = C x
, Bg = BKvf
, Cg = C
The prefilter, as used here, is just a gain. More sophisticated prefilters might be used to shape
the dynamics of Y (s)/R(s).
MSE
Y (s)
= Cg (sI Ag )1 Bg = C(sI A + BK)1 BKvf
R(s)
For the moment we assume that K is known. Then the static gain can be
adjusted by setting G(0) = 1 or
Kvf = C(A + BK)1 B
1
(1)
Pole Placement
(2)
The question which arises is about the choice of good pole locations. Some
considerations are:
Obviously, the poles must be chosen in the left half plane for stability reasons.
Transients of the signals should decay towards zero faster than some C e1 .
Optimal Control
MSE
= 1/
(2)
Im
Re
= 1/
(2)
are adjusted to provide a minimum performance index are called optimal control
systems.
The function f often is defined based on some intermediary variables such as the
state vector x or the input u
J = f (K) =
Ztf
g(x, u)dt
MSE
x1
x2
Rtf
= xT x
derivation the time horizon is set to infinity, and a more general weighting scheme
for the state variables is used with a symmetric, positive semidefinite matrix Q:
J=
(3)
xT Qx dt
Note that the general form of the performance index incorporates a term containing u to weigh the control energy. This will be discussed in section 3.1.
To obtain the minimum value of J, we follow [1] and postulate the existence of
an exact differential with a constant symmetric matrix P such that
d T
(x P x) = xT Qx
dt
where P is to be determined. Applying the product rule for differentiation,
d T
(x P x) = x T P x + xT {z}
P x + xT P x
dt
0
defining
H = A BK
(4)
d T
(x P x) = (Hx)T P x + xT P (Hx) = xT H T P x + xT P Hx
dt
= xT (H T P + P H) x = xT Qx

{z
}
(5)
which is the exact differential we are seeking. Substituting that expression in (3)
results in the performance index
J=
Z
0
d T
(x P x)dt = xT P x0 = (0 xT (0)P x(0)) = xT (0)P x(0)
dt
Roland Bchi, Markus Kottmann
MSE
In the evaluation of the limit at t = , we have assumed that the system is stable
and hence x() = 0, as desired. Therefore to minimize the performance index J,
we consider the two equations:
J=
In a more general case, we also consider the control energy of u. A method suitable
for computer calculation is stated without proof in the following. Consider the
uncompensated MIMO system
x = Ax + Bu
with feedback
u = Kx.
(xT Qx + uT Ru)dt
(6)
With Q and R both positive definite, it can be shown that (6) is minimized with
K = R1 B T P
(7)
3.2
MSE
If the control loop is opened at the input u of the plant (see Fig. 4) then the openloop transfer function is given by G0 (s) = K(sI A)1 B. It can be shown, that
G0 (j) has at least a phase margin of 60 and a gain margin of [0.5 . . . [ on each
channel. This makes the LQregulator a considerably robust controller.
MSE
e = y r,
and its time derivative yields
0
z}{
e = y r = y = C x
z = x and w = u,
z } {
z } {
z } { z } { u
e
0 C
e
0 z}{
=
+
w
z
0 A
z
B
(8)
B)
is controllable, then some feedback gain K
which stabilizes (8)
If the system (A,
can be designed e.g. by pole placement or using the LQR method
x.
u = K
January 17, 2011
MSE
Since the error e is a state variable it converges towards zero, i.e. the requirement
of an asymptotic tracking with zero steadystate error is fulfilled. Splitting the
feedback term yields
x = [K1 K2 ] e = K1 e K2 z
u = w = K
z
and by integration the final control law
u(t) = K1
Zt
e( )d K2 x(t)
10
Bibliography
[1] Richard C. Dorf and Robert H. Bishop. Modern Control Systems. Pearson, 2008.
[2] William S. Levine, editor. The Control Handbook. The Electrical Engineering
Handbook Series. CRC Press/IEEE Press, 1996.
11
MSE
Solved Exercises
1
Pole Placement
, D=0
a = 4 , Ks = 8 , c1 = 6.4
For each of the following cases, find a controller u = k x + kvf r such that the
closed loop system has a unitary static gain and the poles p1 and p2 :
1. p1 = p2 = 15
2. p1,2 = 15 15j
3. p1 = p2 = 50
12
MSE
Consider the control system shown below. The state vector is x = [x1
openloop system is unstable, therefore state feedback is introduced.
x2 ]T . The
(xT Qx)dt.
and k1 = k2 = k
and
x(0) =
1
0
13
MSE
2. Find a controller u = kx, which stabilizes the system using minimal control
energy (q = 0).
14
MSE
Consider an inverted pendulum, where the input signal u(t) is a force, applied to
the cart, and the output signal y(t) is the position of the cart. The state vector
T . The parameters are given by M = 1kg,
[x1 , x2 , x3 , x4 ]T is assumed to be [y, y,
, ]
2
m = 0.1kg, g = 10m/s , l = 1m.
0
0
A=
0
0
1
0
0
0
1
0
0 mg
M
, B= M , C= 1 0 0 0
0
0
0
1
(M +m)g
M1 l
0
0
Ml
, D=0
1. Compute some optimal control regulators using Matlab command lqr and
plot step responses of the closedloop systems at different weights of control
energy r. Find also suitable prefilters Kvf .
2. For the same weights r of the control energy, plot the Bode diagram of the
closedloop systems and discuss the results.
3. Discuss the robustness of the system.
15
MSE
Solutions
1
det
det (I A + BK) = ( p1 )( p2 )
0
0 1
0
0
+
=
0
0 a
K s k 1 Ks k 2
1
det
=
K s k 1 + a + Ks k 2
( + a + Ks k2 ) + Ks k1 =
2 + (a + Ks k2 ) + Ks k1 = 2 (p1 + p2 ) + p1 p2
m
p1 p 2
p 1 p 2 = Ks k 1 k1 =
Ks
p1 + p 2 + a
(p1 + p2 ) = a + Ks k2 k2 =
Ks
1
a + Ks k 2 1
Ks k1 0
0
= c1 0
Ks
Ks k1
=
=
c1 Ks
Ks k1
k1
c1
1
1.
(15)(15)
= 28.125
8
15 15 + 4
= 3.25
k2 =
8
28.125
kvf =
= 4.39453125
6.4
k1 =
16
MSE
2.
(15 + 15j)(15 15j)
= 56.25
8
15 + 15j 15 15j + 4
k2 =
= 3.25
8
56.25
= 8.7890625
kvf =
6.4
k1 =
3.
(50)(50)
= 312.5
8
50 50 + 4
k2 =
= 12
8
312.5
= 48.828125
kvf =
6.4
k1 =
17
MSE
x 1
0 1 x1
0
=
+
u
0 0 x2
1
x 2
x1
+ 0 u
y= 1 0
x2
2. The solution can be found using equations (4) and (5):
H = A BK
0 1
0
k k
=
0 0
1
0
1
=
k k
H T P + P H = Q
It follows from P = P T that p12 = p21 :
p11 p12
p11 p12
0
1
1 0
+
=
0 1
p12 p22
p12 p22 k k
kp12 p11 kp12
1 0
kp12
kp22
+
=
0 1
p11 kp12 p12 kp22
kp22 p12 kp22
1 0
2kp12
p11 + kp12 + kp22
=
0 1
p11 + kp12 + kp22
2p12 + 2kp22
0 k
1 k
18
1
2k
k+1
=
2k 2
2k + 1
=
2k
2kp12 = 1
p12 =
2p12 + 2kp22 = 1
p22
p11
MSE
3.
J(k) = xT (0)P x(0)
p11 p12 1
= 1 0
p12 p22 0
2k + 1
1
= p11 =
=1+
2k
2k
Because P has to be positive definite (P > 0), k has to be positive (k > 0).
You can verify this condition by checking the eigenvalues of P which have to
be positive.
J(k) is monotonically decreasing for k > 0. The optimum is achieved for the
highest possible k. Because we have the additional condition u 10, k is
bounded by
1
= k 10
u(0) = Kx(0) = k k
0
kopt = 10
19
MSE
a a2 + b2
r
r
r
p= 2
b
a+
a2
b2
q
r
2ar
p2 = 0
b2
it follows that the solution p of the Riccati Equation is
0 if a 0
p=
2ar
if a > 0
b2
p1 =
The interpretation of this result is: if the system is stable (a 0), then we
need no control input to stabilize the system (the system operates in open
loop). For an unstable system, the feedback k moves the unstable pole a > 0
to
2a
a bk = a b = a
b
20
MSE
=
=
=
=
10;
1;
1;
0.1;
A = [0 1 0 0;
0 0 m * g / M 0;
0 0 0 1;
0 0 ( M + m ) * g /( M * l ) 0] ;
B = [0; 1/ M ; 0; 1/( M * l ) ] ;
C = [1 0 0 0];
Q = eye ( size ( A ) ) ;
R = logspace ( 2 ,2 ,5) ;
L = cell (1 , length ( R ) ) ;
G = cell (1 , length ( R ) ) ;
for i = 1: length ( R )
K = lqr (A ,B ,Q , R ( i ) ) ;
kvf = 1/( C /(  A + B * K ) * B ) ;
G { i } = ss (A  B *K ,B ,C ,[]) * kvf ;
L { i } = ss (A ,B ,K ,[]) ;
end
figure (1) ;
step ( G {:}) ;
legends = cell (1 , length ( R ) ) ;
for i = 1: length ( R )
legends { i } = [ R = num2str ( R ( i ) , % g ) ];
end
legend ( legends , Location , East ) ;
Decreasing the weight r for the input u leads to a closed loop system with a
faster response. This can be seen in the step responses in figure 8 and in the
increased bandwidth in the Bode diagrams in figure 9.
January 17, 2011
21
MSE
Step Response
1.2
Amplitude
0.8
0.6
R = 0.01
R = 0.1
R=1
R = 10
R = 100
0.4
0.2
0.2
10
15
20
25
30
35
Time (sec)
22
MSE
Magnitude (dB)
50
100
150
360
Phase (deg)
270
R = 0.01
R = 0.1
R=1
R = 10
R = 100
180
90
0
2
1
10
10
10
10
Frequency (rad/sec)
10
10
Imaginary Axis
R = 0.01
R = 0.1
R=1
R = 10
R = 100
2
4
6
6
4
2
2
Real Axis
10
23