Project Report DCS
Project Report DCS
Project Report DCS
CONTROL
Project Report
SAFEER ULLAH
REG# FA14-REE-
032
LINEAR SYSTEM
THEORY
INSTRUCTOR: Dr. SHAFAYAT
ABRAR
DEPARTMENT OF ELECTRICAL ENGINEERING
OBJECTIVES OF PROJECT:
Simulink.
Sate Space Realization of the System.
Implementing the Continuous & Discrete time State Space Model.
CONTROLLER DESIGNING & IMPLEMENTATION
Designing a controller to stabilize the system according to the
required design criteria.
Implementing the Stabilized system in MATLAB & Simulink.
ANALYSIS OF STABLE SYSTEM
Time response
o Transient
o Steady state
Frequency response
o Bode plot
Analysis on Pole Zero map of the stabilized system.
Step Response of the stable system.
TRANSFORMATION
Jordan Canonical Form of the System.
Companion form of the System
Modal Form of the system.
STABILITY ANALYSIS
Eigens Values
Eigen Vectors of the System.
Root locus
PID & Lead--lag
BIBO Stability
Lyapunov Stability.
Controllability & Observability of the System.
DESCRITIZATION
Discretizing the Continuous time Stable System for T=1.
INTRODUCTION:-
The above methods have some demerits like a large amount of power
is wasted in the controller resistance. Hence, efficiency is decreased. It needs
expensive arrangement for dissipation of heat produced in the controller
resistance. By these data that are acquainted we can draw a conclusion that
these electric and electromechanical methods are less adaptive so electronic
techniques are used for speed control. These methods provide higher
efficiency, greater reliability, quick response, higher efficiency. One such
technique is Pulse Width Modulation. We will apply this technique in our
project so as to control the speed and position of the DC motor.
PHYSICAL SETUP:
The dc motor is one example of an electro-mechanical system. The
circuit diagram of the armature controlled dc motor is given as follows
Figure 1
Figure 2(a, b)
For this example, we will assume the following values for the physical
parameters.
La
2.75 x 10 H
Ra
= armature resistance () =
4 Ohm
Kb
Jm
Kt
3.2284 x 10 kg . m
0.0274 N . m/ Amp
3.5077 x 106 N .m . s
e (t)
T l (t)
m (t)
MATHEMATICAL MODEL:The equations for obtaining the model can be done by two different
methods. One of them is derived with simple mathematic equations using
Newtons second law and another through the use of the Lagrangian Method.
SYSTEM EQUATIONS:
With the reference of Fig. 1, the developed torque of a dc motor is
proportional to the magnitude of the flux due to the field current if and the
armature current i. Therefore the developed torque can be expressed as:
T =K i ( 1 )
For any given motor, the only two adjustable quantities are the flux
and the armature current. There are two modes of operation of a servomotor.
For the armature-controlled mode (see Fig.1), the filed current is held
constant and an adjustable voltage is applied to the armature. In the field
control mode, the armature current is held constant and a voltage is applied
to the field circuit. Since the above circuit is armature controlled, the filed
current is held constant and therefore the equation (1) can be represented
as:
T =K t i a ( 2 )
Where, T is the motor torque, Ki is the motor torque constant in N-m/A
and i is the armature current.
When the armature is rotating, a voltage proportional to the product of
the flux and angular velocity is induced in the armature. For a constant flux,
the induced voltage ( e ) is directly proportional to the angular velocity by a
Ke
constant factor
.
e=K e m (3 )
Where
and
Ke
Kt
and
Ke
d ia
+ Ra i a +e=v a
dt
La
d ia
+ Ra i a=v ae
dt
La
d ia
+ Ra i a=v aK m ( 5 )
dt
K t =K e
( J m s2 m ( s )+ b s m ( s ) )=K I a ( s )
s ( J m s+ b ) m ( s )=K I a ( s )( 6 )
By applying Laplace Transform on eq (5), we get:
( La s I a ( s ) + Ra I a ( s ) ) =V a ( s )Ks m ( s )
( La s + Ra ) I a ( s )=V a ( s )Ks m ( s )( 7 )
Eliminating
I a ( s) =
V a ( s )Ks m (s)
Put value of
( La s+ R a )
s ( J m s+ b ) m ( s )=K
I ( s ) in eq (6), we obtain:
V a ( s )Ks m (s)
( La s+ Ra )
V a ( s ) K K 2 s m (s )
s ( J m s+ b ) m ( s )=
( La s + R a )
s ( La s+ R a ) ( J m s+ b ) m ( s )=V a ( s ) KK 2 s m ( s)
s ( La s+ R a ) ( J m s+ b ) m ( s ) + K 2 s m (s )=V a ( s ) K
s [ ( La s+ Ra ) ( J m s +b ) + K 2 ] m ( s ) =V a ( s ) K
m ( s)
K
=
[rad /V ]( 8)
(
)
V a s s [ ( La s+ Ra ) ( J m s +b ) + K 2 ]
m ( s)
0.0274
=
[rad /V ]
6
V a ( s ) s [ ( 2.75 x 10 s +4 ) ( 3.2 x 106 s+ 3.50 x 106 ) +0.00075 ]
m ( s)
0.0274
=
[rad /V ]
12 3
V a ( s ) [ 8.878 x 10 s +1.29 x 105 s2 +0.0007648 s ]
State Space:
In state-space form, the governing equations above can be expressed
by choosing the rotational position (
state variables.
From eq(4), we get
J m m +b m =K i a
J m m=K i ab m
K i ab m
m =
Jm
K
b
m = i a m
Jm
Jm
d
K
b
m= i a m ( 9 )
dt
Jm
Jm
d
= ( 10 )
dt m m
From eq(5), we get
La
d ia
+ Ra i a=v aK m
dt
La
d ia
=K m Ra i a+ v a
dt
d i a K m Ra i a+ v a
=
dt
La
R
v
d
K
i a=
m a i a + a ( 11 )
dx
La
La
La
Combining eq(9), eq(10) and eq(11) and representing them in matrix
format, we get
[ ][
b
0
d m
Jm
=
dt m
K
ia
0
La
][ ] [ ]
0
0
K m
0
J m m +
v ( 12 )
1 a
R a i a
La
La
va
) is the
input to the system and the rotational position ( ) is chosen as the output
to the system.
[]
y=[ 1 0 0 ] ( 13 )
ia
From eq: (12) & (13): we get:
x = Ax+ Bu
y=Cx+ Du
[ ][
0
1
b
0
Jm
A=
K
0
La
0
K
Jm
Ra
La
1
3.5077 x 106
0
3.2284 x 106
0.0274
0
2.75 x 106
0
1
0
A= 0 1.0865
8487.18
0 9963.63 1454545.45
] [
0
1
0
3
A= 0 1.0865
8.49 x 10 ;
3
6
0 9.96 x 10 1.45 x 10
0
0.0274
3.2284 x 106
4
2.75 x 106
0
1
0
0 1.0865 8.49e3
0 9.96e3 1.45e6
[ ][ ][
0
0
0
0
0
0
B=
=
= 0 =
;
0
1
1
5
3.64e5
3.64 x 10
La
2.75 x 106
][
C=[ 1 0 0 ] ;
D=[ 0 ] ;
MATLAB representation of State Space Equation:
We can also represent the system using the state-space equations. The
following additional MATLAB commands create a state-space model of the
motor and produce the output shown below when run in the MATLAB
command window.
A ( tt 0)
x ( t 0 ) + e A (t ) Bu ( ) d
t0
A (t t 0 )
x ( t 0 ) +C e A (t ) Bu ( ) d + Du (t )
t0
0
1
0
A= 0 1.0865
8487.18
0 9963.63 1454545.45
s
1
0
( sI A )= 0 s+1.0865 8.49 x 103
3
6
0 9.98 x 10 s +1.45 x 10
determinant ( sI A )=0
s
1
0
|sI A|= 0 s +1.0865
8487.176 =0
0 9963.636 s+1454545.455
s ( ( s+ 1.0865 )( s+1454545.455 ) + ( 9963.636 )( 8487.176 ) )=0
s ( s 2+ ( 1.0865+ 1454545.455 ) s+ ( 1.08651454545.455 )+ 84563132.33 )
s ( s 2+ 1454546.54 s+ 86143495.97 )
s 1=0, s 2=59.226, s3 =1454487.314
A11
(
)
Adjoint sI A = A21
A31
A12
A22
A32
A 13
A 23
A 33
A 11 =s 2+ 1454546.54 s +86143495.97
( s +59.226 ) ( s+ 1454487.314 )
A 12=0=0
A 13=0
A 21=( s+1454545.455 )
A 22=s( s +1454545.455 )
A 23=9963.636s
A 31=8487.176
A 32=8487.176s
A 33=( s+1.0865 )s
Adjoint ( sI A ) =
inverse ( sI A )= ( sI A )1=
( sI A ) =
Adjoint ( sI A )
determenant ( sI A )
s ( s+59.226 )( s+1454487.314 )
1
s
( sI A )1= 0
0
( s+1454545.455 )
s ( s+59.226 )( s +1454487.314 )
( s+1454545.455 )
( s +59.226 )( s+ 1454487.314 )
9963.636
( s +59.226 )( s+ 1454487.314 )
8487.176
s ( s+ 59.226 )( s+1454487.314 )
8487.176
( s+59.226 )( s +1454487.314 )
( s +1.0865 )
( s+59.226 )( s +1454487.314 )
X
Y1
Z1
( s+1454545.455 )
= 1+
+
s ( s+59.226 )( s +1454487.314 ) s ( s+59.226 ) ( s+ 1454487.314 )
0.016885 85 0.016885 85
1.454 x 107
+
s
( s+59.226 ) ( s+1454487.314 )
X2
Y2
( s+ 1454545.455 )
=
+
( s+59.226 )( s+1454487.314 ) ( s+59.226 ) ( s+ 1454487.314 )
5
1.0000 3997
3.9975 x 10
( s+59.226 ) ( s +1454487.314 )
X3
Y3
9963.636
=
+
( s+59.226 )( s+1454487.314 ) ( s+59.226 ) ( s+ 1454487.314 )
3
6.8 5055 x 10
6.8 5055 x 10
+
( s+59.226 )
( s+1454487.314 )
X
Y4
Z4
8487.176
= 4+
+
s ( s+59.226 ) ( s+1454487.314 ) s ( s +59.226 ) ( s+1454487.314 )
5
9.852 x 10
9. 852 x 10
4.007 x 10
+
s
( s +59.226 ) ( s +1454487.314 )
X5
Y5
8487.176
=
+
( s+59.226 )( s+1454487.314 ) ( s+59.226 ) ( s+ 1454487.314 )
3
5.8 35 x 10
5.8 35 x 10
( s+59.226 ) ( s +1454487.314 )
X6
Y6
( s+ 1.0865 )
=
+
( s+59.226 )( s+1454487.314 ) ( s+59.226 ) ( s+ 1454487.314 )
3.997
1.00004
+
( s+59.226 ) ( s +1454487.314 )
1
s
( sI A ) = 0
0
0.01688585 0.01688585
1.454 x 107
+
s
( s+59.226 ) ( s+ 1454487.314 )
1.00003997
3.9975 x 105
( s+ 59.226 ) ( s+1454487.314 )
3
3
6.85055 x 10
6.85055 x 10
+
( s +59.226 )
( s +1454487.314 )
+
s
( s+59.226 ) ( s+1454487.314 )
5.835 x 103
5.835 x 103
( s+ 59.226 ) ( s+1454487.314 )
3.997
1.00004
+
( s +59.226 ) ( s+1454487.314 )
( sI A )
e =L1 (1)=
At
1 0.016885850.01688585 e59.2 t +1.454 x 107 e1454487.3 t 9.852 x 105 +9.852 x 105 e59.2 t + 4.007 x 109 e1454487
0
1.00003997 e59.2t 3.9975 x 105 e1454487.3 t
5.835 x 103 e59.5 t5.835 x 103 e1454487.3 t
0
6.85055 x 103 e59.2t + 6.85055 x 103 e1454487.3 t
3.997 e59.2 t +1.00004 e1454487.3 t
( sI A )
1 0.0168850.01688585 e59.2(t +) + 0.0336 e1.454 x10 (t + ) 9.837 x 105 +9.852 x 105 e59.2 (t +
e A (t + )=L1 (1)= 0
1.00003997 e59.2(t + )3.9975 x 105 e1454487 .3(t+ )
5.835 x 103 e59.2(t+ ) 5.8
0 6.85055 x 103 e59.2(t + )+ 6.85055 x 103 e1454487 .3(t + )
3.997 e59.2(t+ ) +1.00
x ( t )=e
A ( tt 0)
x ( t 0 ) + e A (t ) Bu ( ) d
t0
Now find
At
by Cayley-Hamilton Theorem:
0
1
0
A= 0 1.0865
8487.18
0 9963.63 1454545.45
1
0
( I A )= 0 +1.0865
8487.18
0 9963.63 +1454545.45
determinant ( I A )=0
| I A|= 0 +1.0865
0
9963.63
0
8487.18 =0
+ 1454545.45
e =B0 I + B1 A +B 2 A
Or
e =B0 + B1 +B2
For
=0 ;
( )
e t 0 =B0 +B 1 ( 0 ) + B2 ( 0 )
B 0=1
For
2=59.226
Putting valve of
12
=B01454487.314 B1 +2.1155 x 10 B 2
B 0=1
=11454487.314 B1 +2.1155 x 10 B 2
1454487.314t
1=1454487.3146 B 1+2.1155 x 10 B2
12
1454487.314t
Putting valve of
B 0=1
12
][ ] [
59.226
3507.719
B1
e59.226t 1
=
1454487.314 2.1155 x 10 12 B2
e1454487.314t 1
[ ][
[ ][
B1
59.226
3507.719
=
B2 1454487.314 2.1155 x 1012
][
1
e59.226 t 1
e1454487.314 t 1
][
B1
0.016885
2.799 x 1011
e59.226t 1
=
B2 1.1609 x 108 4.727 x 1013 e1454487.314t 1
59.226t
B 1=0.016885(e
11
1)+2.799 x 10
59.226 t
B 1=+0.0168850.016885 e
8
59.226t
B 2=1.1609 x 10 (e
]
]
1454487.314t
(e
1)
11 1454487.314t
+2.799 x 10
13
1)+ 4.727 x 10
1454487.314t
(e
1)
1 0 0
0
1
0
e At = 0 1 0 + ( 0.016885 ( 1e59.226t ) +2.799 x 1011 e1454487.314t ) 0 1.0865
8487.176 +
0 0 1
0 9963.63 1454545.45
[ ]
[ ][
1
0.016885(1e59.226t )+2.74 x 1011 e1454487.314t
9.85 x 105 (1e59.226t )+ 4.01 x 109 e145
e At = 0
1.000035 ( e59.226 t ) 3.99 x 105 e1454487.314 t
7.02 x 103 e59.226 t 5.83 x 103 e1454487.314 t
0 8.25 x 103 e59.226t +6.884 x 103 e1454487.314 t +1.4 x 103
0.207 e59.226t + 1.000039 e1454487.314 t +
0
1
0
A= 0 1.0865
8487.18
0 9963.63 1454545.45
1
0
( I A )= 0 +1.0865
8487.18
0 9963.63 +1454545.45
determinant ( I A )=0
| I A|= 0
0
1
0
+1.0865
8487.18 =0
9963.63 + 1454545.45
One pole of the system is on origin and the two are on left hand side, so this
marginally stable.
Step Response
7
6
Amplitude
5
4
3
2
1
0
0
0.02
0.04
0.06
0.08
0.1
0.12
0.14
0.16
0.18
0.2
Time (seconds)
From the above plot, we can see that when 1 volt is applied to the
system the motor position grows unbounded. This is obviously at odds with
the given requirements, in particular, that there be no steady-state error. The
open-loop response of the system is not even stable. Stability of a system
can be verified with the MATLAB command isstable where a returned value
of TRUE (1) indicates that the system is stable and a returned value
of FALSE (0) indicates that the system is not stable.
Stability of the system can also be determined from the poles of the
transfer function where the poles can be identified using the MATLAB
command pole as shown below.
The closed-loop transfer function for the above with the controller C(s)
simply set equal to 1 can be generated using the MATLAB
command feedback as shown below.
Step Response
1.4
System: TF_cl
Peak amplitude: 1.07
Overshoot (%): 7.16
At time (seconds): 0.0886
1.2
System: TF_cl
Settling time (seconds): 0.13
Amplitude
1
System: TF_cl
Final value: 1
System: TF_cl
Rise time (seconds): 0.0426
0.8
0.6
0.4
0.2
0
0.02
0.04
0.06
0.08
0.1
0.12
0.14
0.16
0.18
Time (seconds)
Pole-Zero Map
40
System: TF_cl
Pole : -29.6 + 35.3i
Damping: 0.643
Overshoot (%): 7.16
Frequency (rad/s): 46.1
30
20
10
System: TF_cl
Pole : -1.45e+06
Damping: 1
Overshoot (%): 0
Frequency (rad/s): 1.45e+06
0
-10
System: TF_cl
Pole : -29.6 - 35.3i
Damping: 0.643
Overshoot (%): 7.16
Frequency (rad/s): 46.1
-20
-30
-40
-15
-10
-5
-1
0
5
x 10
The above plot shows that the closed-loop system has one real pole at
-1.45e6 and a pair of complex poles at (-29.6+35.3j) and (-29.6-35.3j) as
indicated by the locations of the blue x's. The damping and natural
frequencies associated with these poles can be determined by right-clicking
on the associated poles in the resulting plot. This information can also be
determined using the MATLAB command damp as shown below.
Since the one real pole is so much faster than the complex conjugate
poles (its real part is much more negative) its effect on the dynamic
response of the system will be mimimal. Therefore, the damping (zeta =
0.643) and the natural frequency (Wn = 46.1) of the complex conjugate
poles will primarily indicate the response of the closed-loop system.
The above results closely match the overshoot and settle time from the
step response plot above which explicitly captured the effect of the third,
non-dominant pole.
Throughout the rest of the pages of this example, different controllers
will be designed to reduce the settle time of the closed-loop step response to
meet the given 40 millisecond requirement while still meeting the other
system requirements, including the zero steady-state error in the presence of
a step disturbance.
For the original problem setup and the derivation of the above
equations, please refer to the DC Motor Position: System Modeling page.
For a 1-radian step reference, the design criteria are the following.
Settling time less than 0.040 seconds
Overshoot less than 16%
No steady-state error, even in the presence of a step disturbance input
Now let's design a PID controller and add it into the system. First create a
new m-file and type in the following commands (refer to main problem for
the details of getting these commands).
Recall that the transfer function for a PID controller has the following
form.
C ( s )=K p+
Ki
K d s2 + K p s+ K i
+ K d s=
s
s
Proportional control:
Let's first try using a proportional controller with gain ranging from 1 to
21. An array of LTI models, each with a different proportional gain, can be
built using a for loop. The closed-loop transfer functions can be generated
using the feedback command.
1.8
Kp = 1
1.6
Kp = 11
Kp = 21
Position, (radians)
1.4
1.2
1
0.8
0.6
0.4
0.2
0
0.02
0.04
0.06
0.08
0.1
0.12
Time (seconds)
0.14
0.16
0.18
0.2
1.4
1.2
Ki = 500
Position, (radians)
1
0.8
0.6
0.4
0.2
0
0.02
0.04
0.06
0.08
0.1
0.12
0.14
0.16
0.18
0.2
Time (seconds)
The above plots show that the system has no steady-state error in
response to the step reference by itself, no matter the choice of proportional
gain Kp. This is due to the fact that the plant has an integrator, that is, the
system is type 1. However, the system has significant steady state error
when the disturbance is added. Specifically, the response due to the
reference and disturbance applied simultaneously is equal to the sum of the
two graphs shown above. This follows from the property of superposition that
holds for linear systems. Therefore, to have zero steady-state error in the
PI control:
Let's first try a PI controller to get rid of the steady-state error due to
the disturbance. We will set Kp = 21 and test integral gains Ki ranging from
100 to 500. We should generate a figure like the one shown below.
1.8
Ki = 100
1.6
Ki = 300
Ki = 500
Position, (radians)
1.4
1.2
1
0.8
0.6
0.4
0.2
0
0.05
0.1
0.15
0.2
0.25
Time (seconds)
0.3
0.35
0.4
0.08
0.07
Ki = 300
Ki = 500
Position, (radians)
0.06
0.05
0.04
0.03
0.02
0.01
0
-0.01
0.05
0.1
0.15
0.2
0.25
0.3
0.35
0.4
Time (seconds)
The integral control has reduced the steady-state error to zero, even
when a step disturbance is present; that was the goal for adding the integral
term. For the response to the step reference, all of the responses look similar
with the amount of oscillation increasing slightly as Ki is made larger.
However, the response due to the disturbance changes significantly as the
integral gain Ki is changed. Specifically, the larger the value of Ki employed,
the faster the error decays to zero. We will choose Ki = 500 because the
error due to the disturbance decays to zero quickly, even though the
response to the reference has a longer settling time and more overshoot. We
will attempt to reduce the settling time and overshoot by adding a derivative
term to the controller.
PID control:
Adding a derivative term to the controller means that we now have all
three terms of the PID controller. We will investigate derivative
gains Kd ranging from 0.05 to 0.25. Go back to the m-file and make the
following changes.
1.4
K d = 0.05
K d = 0.15
1.2
K d = 0.25
Position, (radians)
1
0.8
0.6
0.4
0.2
0
0.01
0.02
0.03
0.04
0.05
0.06
0.07
0.08
0.09
0.1
Time (seconds)
0.06
Kd = 0.05
Kd = 0.15
0.05
Kd = 0.25
Position, (radians)
0.04
0.03
0.02
0.01
0
-0.01
0.02
0.04
0.06
0.08
0.1
0.12
0.14
0.16
0.18
0.2
Time (seconds)
From the above, we see that the response to a step reference has a
settling time of roughly 34ms (< 40 ms), overshoot of 12% (< 16%), and no
steady-state error. Additionally, the step disturbance response also has no
steady-state error. So now we know that if we use a PID controller with Kp =
21, Ki = 500, and Kd = 0.15, all of our design requirements will be satisfied.
x 10
3
2
1
0
-1
-2
-3
-4
-5
-6
-5
-4
-3
-2
-1
3
6
x 10
The commands sgrid and sigrid are functions that mark regions of the
complex plane corresponding to certain parameters. sgrid is a function in the
Control System Toolbox; however, to use sigrid we will have to download
it here. The variables in the sgrid command are the damping ratio (zeta =
0.5) and the natural frequency (Wn = 0). The variable in the sigrid command
is the sigma term. The zeta and sigma used above correspond to an
overshoot of 16% and a settling time of 0.040 seconds, respectively, for a
canonical second-order system. Even though our motor transfer function is
third order, it will be explained that these second-order based definitions will
work well. No value is given for Wn since we have no requirement on rise
time.
From the above figure, the two open-loop poles near the origin cannot
be distinguished because the scale of the axes is set to show the third pole
which is much farther to the left than the other two poles. The MATLAB
command pole can be employed to determine the exact values of the openloop poles.
The open-loop pole located very far to the left (further than -1e6) does
not affect the closed-loop dynamics unless very large gains are used. These
large gains place two of the closed-loop poles in the right-half complex splane where the system becomes unstable. Since we will not use gains that
will make the closed-loop system unstable, we can neglect this pole by
performing a model reduction.
Model reduction
In general, the real part of a pole indicates how quickly the transient
portion of the corresponding mode decays to zero (assuming negative real
part). Therefore, if we have a transfer function which has one (or more) poles
much farther to the left in the complex plane (more negative) than the other
poles, their effect on the dynamic response will be hidden by the slower,
more dominant poles. In the case of our motor position example, the
transient closed-loop response for small gains will not be affected much by
the open-loop pole at -1.45e6. The correct way to neglect this pole in order
to maintain its steady-state contribution is to keep the DC gain of the
transfer function the same, as follows:
H ( s )=
G( s)
G ( s ) for s p
s
+1
p
( )
We can then check that the other poles have not been affected by
again using the pole command as shown below.
200
0.5
150
100
50
0
-50
-100
-150
-200
-300
0.5
-250
-200
-150
-100
-50
50
100
If we examined the original root locus near the origin, it would closely
approximate the locus of the reduced transfer function shown above. We can
see from this new plot that the closed-loop poles are never fast enough to
meet the settling time requirement (that is, they never move to the left of
the sigma = 100 vertical line). Also, recall that we need an integrator in the
controller (not just in the system) to remove the steady-state error due to a
constant disturbance.
Integral control
Now, let's try using integral control to remove the steady-state error
due to a constant disturbance. Note that this adds a 1/s term to the forward
path of the system. Run this m-file and we will obtain a plot like the one
shown below.
Root Locus - I Control
200
0.5
150
100
50
0
-50
-100
-150
-200
-300
0.5
-250
-200
-150
-100
-50
50
100
From this root locus we can see that the closed-loop system under
integral control is never stable, therefore, a different controller must be
employed.
PI control
Now, let's modify the integral controller to a PI controller. Using PI
instead of I control adds a zero to the open-loop system. We'll place this zero
at s = -20. The zero must lie between the open-loop poles of the system in
this case so that the closed-loop system will be stable.
200
0.5
150
100
50
0
-50
-100
-150
-200
-300
0.5
-250
-200
-150
-100
-50
50
100
We have managed to stabilize the system and achieve zero steadystate error to a constant disturbance, but the system is still not fast enough.
PID control
In order to pull the root locus further to the left, to make it faster, we
need to place a second open-loop zero, resulting in a PID controller. After
some experimentation, we place the two PID zeros at s = -60 and s = -70.
Change the lines defining the controller in wer m-file to the following. Re-run
wer m-file and we will generate a plot like the one shown below.
Root Locus - PID Control
200
0.5
150
100
50
0
-50
-100
-150
-200
-300
0.5
-250
-200
-150
-100
-50
50
100
Now, we can see that two of the closed-loop poles can be placed well
within both the settling time and percent overshoot requirements. The third
closed-loop pole moves from the open-loop pole at s = -59.2 to the open-loop
zero at s = -60. This closed-loop pole nearly cancels with the zero (which
remains in the closed-loop transfer function) because they are so close
together. Therefore, we can neglect its effect. Let's reduce our new model
again by performing the zero-pole cancelation using the minrealcommand.
We pass 0.1 as a tolerance parameter as follows. The root locus for this
further reduced system with controller is shown below. Note how closely it
resembles the root locus without the pole-zero cancelation.
Root Locus - PID Control
200
0.5
150
100
50
0
-50
-100
-150
-200
-300
0.5
-250
-200
-150
-100
-50
50
100
Even though the one open-loop zero was canceled, the other open-loop
zero remains in the closed-loop transfer function and cannot be neglected.
The effect of an additional zero (if there is no cancellation) is in general to
speed up the response and add overshoot. Therefore, we have to be
conservative in picking where on the root locus we want the closed-loop
poles to lie.
Determining gain using rlocfind command
If we recall, we need the settling time and the overshoot to be as small
as possible, particularly because of the effect of the extra zero. Large
damping corresponds to points on the root locus near the real axis. A fast
response corresponds to points on the root locus far to the left of the
imaginary axis. To find the gain corresponding to a point on the root locus,
we can use the rlocfind command. Specifically, enter the command [k,poles]
= rlocfind(rsys_ol) in the MATLAB command window.
Then go to the plot and select a point on the root locus on left side of
the loop, close to the real axis as shown below with the small + marks. This
will ensure that the response will be nearly as fast as possible with minimal
overshoot. These pole locations indicate that the response would have
200
150
100
50
0
-50
-100
-150
-200
-300
-250
-200
-150
-100
-50
50
100
After doing this, we should see the following output in the MATLAB
command window.
Note that the values returned in wer MATLAB command window may
not be exactly the same, but should at least have the same order of
magnitude. We can also get the step response plots for the reference and
disturbance with this specific controller and loop gain by executing the
following code in the command window. These commands should produce
the plots shown below where the annotations to the figures are added by
choosing Characteristics from the right-click menu of each of the plots.
1.4
1.2
Position, (radians)
1
0.8
0.6
0.4
0.2
0
0.01
0.02
0.03
0.04
0.05
0.06
0.07
0.08
0.09
0.1
Time (seconds)
0.06
Position, (radians)
0.05
0.04
0.03
0.02
0.01
0.01
0.02
0.03
0.04
0.05
0.06
0.07
0.08
0.09
0.1
Time (seconds)
From the above, we can see that in response to a step reference the
system has an overshoot of approximately 14%, a settling time just under
0.04 seconds, and no steady-state error. Also, the response to a step
The use of the zpk command above transforms the transfer function
into a form where the zeros, poles, and gain can be seen explicitly.
Examining the poles of the plant (or its frequency response), it is clear that
the pole at -1.45e06 contributes very little to the response of the plant. The
gain crossover frequency of the plant is approximately 5 Hz. Therefore,
choosing a sampling period of 0.001 seconds (frequency of 1000 Hz) is
significantly faster than the dynamics of the plant. This sampling period is
also fast compared to the speed that will be achieved by the resultant
closed-loop system. A sample time of 0.001 seconds is specifically 1/100 of
the required time constant and 1/40 of the required settling time.
In this case, we will convert the given transfer function from the
continuous Laplace domain to the discrete z-domain. MATLAB can be used to
achieve this conversion through the use of the c2d command.
The c2d command requires three arguments: a system model, the sampling
time (Ts), and the type of hold circuit. In this example, we will assume a zeroorder hold (zoh) circuit. Refer to the Introduction: Digital Controller
Design page for further details. Adding the following commands to wer m-file
and running in the MATLAB command window generates the sampled-data
model shown below.
From the above, notice that there is a pole and zero very near to z = 0
that effectively cancel. This cancellation in the transfer function can be
accomplished by applying theminreal command with a tolerance of 0.001.
Cancellation of this pole and zero will reduce the order of our transfer
function and will help to avoid numerical difficulties in MATLAB. Applying
the minreal command, therefore, produces the following reduced order
transfer function. Note the absence of the pole and zero near z = 0.
1.5
Imag Axis
0.5
-0.5
-1
-1.5
-2
-5
-4
-3
-2
Real Axis
-1
10
8
6
4
Imag Axis
2
0
-2
-4
-6
-8
-10
-1
-0.5
0.5
Real Axis
1.5
The default format for compensators in the SISO Design Tool is Time
constant form. For the remainder of this problem, we will design the
compensator in Zero/pole/gainform. This change can be made by
choosing SISO Tool Preferences ... from the Edit menu of the Control and
Estimation Tools Manager window. The compensator parameterization can
then be changed under the Options tab.
By default, the root locus plot includes the unit circle shown in the
above figure by the dashed line. Recall that for a discrete-time system,
closed-loop poles located within the unit circle indicate a stable closed-loop
system. From the above, we can see that the after adding the extra pole at 1,
the root locus had three poles near 1. This caused the root locus to move to
the right (outside of the unit circle) indicating that the closed-loop response
will be more unstable.
Therefore, we will add a zero near 1, inside the unit circle, to cancel
one of the poles and pull the root locus in. We will specifically add a zero
at z = 0.95. In general, we must add at least as many poles as zeros for the
controller to be causal. This zero can be added to our compensator in the
same manner as the integrator was added above. The only difference is that
we will choose Real Zero from the right-click menu and then must specify in
the Location cell that the zero is to be placed at 0.95. The root locus plot
should now appear as shown below.
1.5
Imag Axis
0.5
-0.5
-1
-1.5
-2
-6
-5
-4
-3
-2
Real Axis
-1
From the above figure, we can see that the two dominant branches of
our root locus do not pass through the required region. Therefore, we need to
add poles and/or zeros to our compensator to bend the root locus into the
desired region. Let's first try cancelling the zero at approximately -0.98 by
adding a pole nearby. This can be done in the same manner described above
for the integrator and the real zero. It is desirable to cancel this zero since it
will add overshoot to the step response. The addition of this pole will result in
two of the branches of the root locus going off to the right and outside of the
unit circle.
We will attempt to pull these branches in by placing two additional
zeros near the desired closed-loop pole locations. These zeros can be added
via the Compensator Editor tab as done above. In this case, however, we will
place the zeros using a graphical tuning approach. Specifically, select a
single o from the tool bar at the top of theSISO Design for SISO Design
Task window. Then click the resulting "pointer" on the real axis to place the
zero. Repeat this process to add a second zero. The effect of moving these
two zeros can then be seen by moving the pointer over the
corresponding o on the root locus and clicking on it. While holding down the
mouse button, we can then move the zero along the real axis to visualize the
effect of different locations. Through trial and error we arrive at a location of
0.8 for the two zeros. In order to make the controller causal, we need to add
an additional pole. Using a graphical approach again, we can add a real pole
by choosing an x from the tool bar at the top of the SISO Design for SISO
Design Task window. Through trial and eror we arrive at a pole location of
0.6. The resulting root locus is shown below.
Next we must choose a loop gain in order to move the closed-loop pole
locations along the root locus to the desired location. Since our closed-loop
system is not canonical second order, we will have to employ some trial and
error to identify the exact pole locations. In order to assist us in this regard,
we can open a plot for the closed-loop step response so that we can observe
the effect of the gain changes on the actual step response, without having to
rely on a second-order idealization.
The closed-loop step response plot is opened from the Control and
Estimation Tools Manager window under the Analysis Plots tab as shown
below. In this tab, selectStep from the drop-down window for Plot 1 under
the Analysis Plots section of the window. Then under the Contents of
Plots section of the window check the box for Plot 1 on the first row, which
corresponds to a plot for the Closed Loop r to y. Finally, click the Show
Analysis Plots button to produce the closed-loop step response.
The resulting step response plot with loop gain of 1 appears to meet
the settling time requirement, but not the overshoot requirement. In order to
be certain, we can define the allowed step response shape by
choosing Design Requirements from the right-click menu of the step
response plot and choosing the overshoot to be 16% and the settling time to
be 0.040 seconds. Note that we will need to choose a rise time of less than
0.040 seconds, even though we have no such requirement.
We will now modify the loop gain to meet the overshoot requirement.
Using a graphical tuning approach, grab one of the pink boxes on the root
locus plot by clicking on it, then drag the box along the locus. Each box
represents the location of a closed-loop pole and dragging the box along the
locus changes the loop gain to the value that places that closed-loop pole at
that specified location. Through trial and error, a loop gain of 800 reduces
the overshoot of the associated step response to approxomately 10% while
achieving a settling time of approximately 0.02 seconds. Furthermore, the
steady-state error goes to zero when there is no disturbance present. The
resulting step response plot is shown below.
The only thing now left to verify is the system's disturbance rejection
properties. A plot of the system's response to a step disturbance can be
generated from the Analysismenu of the SISO Design for SISO Design
Task window. Instead, we will generate the disturbance response plot from
the MATLAB command line. Before we do that, however, we must first export
the compensator we have designed in the SISO Design Tool to the
workspace. This is accomplished by selecting Export from the File menu of
the Control
and
Estimation
Tools
Manager window.
We
then
select Compensator C and click on the Export to Workspace button. Once we
have done this, then enter the following instructions in the command window
to produce the response plot shown below.