Z-Plane RL Design Using MATLAB: 2.1 Plant
Z-Plane RL Design Using MATLAB: 2.1 Plant
Chapter 5
Introduction.
This document is intended to give you an example of using MATLAB and root locus to design controllers (compensators) in the z-plane.
2
2.1
The plant will be an pure unit inertia; this could be any rotary element in a low-friction environment. The general
transfer function from applied torque to angular position for a pure inertia is
1
1
(s)
=
= 2 (unit inertia)
2
(s)
Js
s
2.2
(1)
Specification.
I arbitrarily selected the closed-loop natural frequency to be 100 Hz and damping of 0.707, along with a sampling
frequency of fs =500 Hz (T =0.002). This corresponds to desired s-plane and z-plane pole locations of
p
s = n jn 1 2 444 j444.
(2)
z = esT = 0.2596 + j0.3192 0.26 + j0.32
(3)
This sampling frequency is quite low; we would typically sample at perhaps 20 the bandwidth (natural frequency).
2.3
Discretized Plant.
With T =0.002, the zoh-discretized model of the plant (found using MATLAB c2d) is:
>> Gc = tf([0 0 1],[1 0 0])
Transfer function:
1
--s^2
>> Gd = c2d(Gc,T)
Transfer function:
2e-06 z + 2e-06
--------------z^2 - 2 z + 1
Sampling time: 0.002
This can be expressed as
G(z) =
(2e 6)(z + 1)
(2e 6)z + (2e 6)
=
z 2 2z + 1
(z 1)2
Note the small numerator constant of 2e 6; that will probably be counteracted by a large forward path gain.
(4)
ME 481/581
Chapter 5
Compensator Design.
3.1
Proportional Control.
With proportional control the actuating signal sent to the plant is proportional to the error signal, hence the compensator is a pure gain K.
3.1.1
With system input called R(z) and system controlled variable (output) called Y (z) the closed-loop transfer function
W (z) is
KG(z)
Y (z)
=
R(z)
1 + KG(z)
(5)
1 + KG(z) = 0
(6)
0.4/T
0.3/T
0.7
0.6
0.2/T
Imaginary Axis
0.5
0.4
0.3
0.1/T
0.2 0.5/T
0.1
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
0.6/T
0.2
0.4
0.6
0.8
Real Axis
1.2
1.4
The locus (blue line) starts from the double pole at z = 1 and goes outside the unit circlethis system is unstable.
ME 481/581
3.2
Chapter 5
Lead Compensator.
We need to improve the stability of this system. A lead compensator (a quasi-differentiator) will do that. This can be
seen from two perspectives:
A lead network will pull the locus to the left, thus keeping it inside the unit circle
A lead network adds positive phase angle, thereby improving the phase margin
The structure of a lead compensator D(z) is
D(z) =
z+b
z+a
(7)
My philosophy on lead compensator design is to place the compensator zero in the s-plane at about one-third the
distance of the desired dominant poles. Thus if the desired poles are at 445 j445 Id place the compensator zero
at about 445/3 150. Now in the z-plane this zero location would be
z = esT = e(150)(0.002) 0.74 = D(z) =
z 0.74
z+a
(8)
The location of the compensator pole is found using the root-locus angle condition, in which we use open-loop transfer
function D(z)G(z):
(angles of vectors from poles to desired pole) (angles of vectors from zeros to desired pole) = 180
(9)
(10)
Parameter in (10) is the angle of the vector from the lead compensator pole to the desired closed-loop pole location.
From (10) this angle is
= 28
(11)
This implies that the pole must be located at z = 0.354, thus the lead compensator is
D(z) =
z 0.74
z + 0.35
(12)
The root-locus diagram of D(z)G(z) is shown on the next page; the cross shows where I specified the desired pole
(near = 0.6).
The corresponding K at this point is:
K = 3.14e5 = 314, 000
Remember the small numerator constant in G(z)? This K makes up for it.
(13)
ME 481/581
Chapter 5
Root Locus
0.6/T
0.5/T
0.4/T
0.8
0.1 0.3/T
0.7/T
0.2
0.3
0.6
0.2/T
0.4
Imaginary Axis
0.5
0.4 0.8/T
0.6
0.7
0.1/T
0.8
0.2 0.9/T
0.9
/T
0
/T
0.2 0.9/T
0.1/T
0.8/T
0.7/T
0.3/T
0.2/T
0.4
0.5
0.5
Real Axis
With the D(z) and G(z) given previously, the closed-loop transfer function is
Y (z)
KD(z)G(z)
=
R(z)
1 + KD(z)G(z)
(14)
Magnitude
Equiv. Damping
5.58e-01
2.29e-01 + 3.83e-01i
2.29e-01 - 3.83e-01i
5.58e-01
4.46e-01
4.46e-01
1.00e+00
6.16e-01
6.16e-01
2.91e+02
6.54e+02
6.54e+02
The complex closed-loop poles have a damping ratio of 0.65 and a natural frequency of 654 rad/s (104 Hz). Id say
our design is pretty close.
One could get the step response, etc.
Since this is a Type II system, it should definitely have a DC gain of 1.00; from MATLAB we get
>> dcgain(Wd)
ans = 1