myee480-p1-introreview
TRANSCRIPT
EE480 Digital Control Systems
Kunio Takaya
Electrical and Computer Engineering
University of Saskatchewan
January 14, 2008
** Go to full-screen mode now by hitting CTRL-L
1
Contents
1 System Components 10
2 System Description 12
3 Open-Loop Control 16
4 Closed-Loop Control 18
5 Compensator Design by Root Locus Method 29
6 Assessment of the Designed Control System 37
7 Compensator Design by Frequency Response Method 42
2
8 Step Response 54
9 Assignment No.1 60
3
Rµν −1
2Rδµν =
8πG
c4Tµν
Here Tµν is tensor of energy momentum.
black blue
red magenta
green cyan
yellow
4
University of Saskatchewan, Electrical Engineering
EE 480.3 Digital Control Systems
January 2008, Kunio Takaya
Textbook: Charles L. Phillips and H. Troy Nagles Jr. “Digital
Control System, Analysis and Design” Third Edition, Prentice
Hall, 1995 ISBN 0-13-309832-x
Marks: Midterm Exam: 30%, Final Exam 55%, and Assignments
15%
1. Review of Linear Continuous-Time Control Systems.
• Control for a single arm of robot manipulators
• Analog and digital compensator design
5
2. Discrete Time Systems and the z-Transform (Chapter 2).
• System description for discrete systems
• Computational aspects of the z-Transform (difference
equation)
3. Sampling and Reconstruction (Chapter 3).
• Sampling and periodicity in spectrum
• Impulse invariant systems
• Step invariant systems (inclusion of a zero order hold)
4. Open Loop Discrete-Time Systems. (Chapter 4, 11)
• Direct conversion from the s-domain to the z-domain
• Bilinear transformation and frequency prewarping
5. Closed Loop Discrete-Time Systems. (Chapter 5)
• Simplifications of complex closed-loop systems mixed with
analog and digital blocks.
6
6. Discrete Controller Design I. (Chapter 2, 4, 5 and 9)
• Review of continuous-time state-equations
• Discrete state-equations
• Pole assignment method
7. Discrete Controller Design II. (Chapter 7, 8)
• Root locus in the z-plane
• Constraints on root loci due to specifications
8. Discrete Controller Design III. (Chapter 8)
• Phase-lead, phase-lag, and phase-lead-lag compensators
• PID controllers
• Controllers for robot manipulators
7
Blank Page
8
Control for Planar Robot Arms
9
Fig. 1 Schematic Diagram of a Planar Robot Arm
1 System Components
The specifications of the servo-motor (embedded direct drive DC
motor) are:
10
1. General: High initial torque, linear torque DC motor
2. Input Voltage: ±28V maximum
3. Output Torque: not specified
4. Angular Velocity: 3,600 rpm at 24V
5. Output Power: 1/20 HP at 24V
6. Torque Linearity: less than 1% within ±28V
7. Input Current: 4A at 24V
8. Built in Gear: Internally coupled by a down gear of 60:1
The power supply to be used is a voltage source for which the
output voltage is controlled by the input voltage.
11
1. Maximum Current: 5A
2. Input Voltage: ±28V
3. Voltage Gain: unity
4. Input Impedance: 100KΩ
5. Settling Time: 10ms for 24V
The mechanical specifications are known only in terms of the time
constant associated with each arm. The particular arm of interest
is quoted as 2 seconds.
12
2 System Description
The basic equation describing the dynamics of the arm is a second
order differential equation,
Jθ + fθ = τ
where J is the inertia of the arm, f is the friction coefficient, θ is
the angle of rotation, and τ is the applied torque. From this
differential equation, the transfer function can be derived as
G0(s) =θ(s)
T(s)=
1
s(Js+ f)=
1/f
s(Jf s+ 1)
Since J/f = T , mechanical time constant, and the torque is a
linear function of the input voltage Ea, i.e. τ = AEa, the transfer
13
function from the input voltage Ea to the angle θ now becomes,
G(s) =θ(s)
Ea(s)=
Af
s(Jf s+ 1)=
K
s(Ts+ 1).
The transfer function from the input voltage Ea to the angular
velocity of the arm ω is also given by
Gω(s) =Ω(s)
Ea(s)=
K
Ts+ 1.
If this arm is vertically placed instead of horizontally, the arm is
affected by the gravitational field. In this case, the system’s
equation needs to be modified by taking an additional torque into
account. Assuming the distance from the pivot (centre of arm
rotation) to the centre of the gravity being equal to `, the
differential equation is,
Jθ + fθ = τ +Mg` cos(θ).
14
Since this equation involves θ, θ and cos(θ) in a differential
equation, this system is no longer linear.
From the given specifications, we know that the motor rotates at
3,600 rpm when the input voltage is 24 V. However, this motor has
a built-in gear (down-gear) of 60:1 in its gear ratio. The speed of
rotation at the output shaft is, therefore, 60 rpm which is 1 rps
(revolutions per second or cycles/s). We decide here to use rps
(cycles/s) in our system model. Using the final value theorem of
the Laplace transform, we now determine two important
parameters, the gain K and time constant T .
Ωss = lims→0
sK
Ts+ 1· 24
s= 24K = 1rps
Thus, K = 1/24. Time constant T is given as 2 seconds. To check
the efficiency of the robot arm, calculate the input and output
15
power. The input power is 24V×4A=96 watts. The output power
at the input voltage of 24V is 1/20 HP, which is 120 × 746 = 37.3
watts. The efficiency is calculated to be 0.3885.
3 Open-Loop Control
This particular one arm of the robot manipulator can do angular
positioning without negative feedback. By simply applying a fixed
voltage for a certain time period, the arm rotates and come to a
desired position. This is open-loop control. Let us determine how
long a voltage of 24V has to be applied to change the arm position
by 90 or 1/4 of a revolution. This on-off control is described by
θ(s) =1/24
s(2s+ 1)· V0(
1
s− e−sT
s),
16
where V0 is the input voltage and and T is the duration of time
that V0 is applied.
L−1V0
24
1
s2(2s+ 1)=V0
48(2t− 4 + 4 e−0.5t)
yields
θ(t) =V0
48f(2t−4u(t)+4 e−0.5t)−(2(t−T )−4u(t−T )+4 e−0.5(t−T ))g.
Thus, the final value at t =∞ is
limt→∞
θ(t) =V0
48(2T ) =
1
4revolutions
If we apply V0 = 24V, T is, therefore, 0.25 seconds. Remember this
value, to turn the arm 90 the required time is 0.25 seconds at 24V.
17
4 Closed-Loop Control
The same task as considered previously as open-loop control can be
accomplished by closed-loop control that provides negative
feedback. The open-loop control cannot correct the set position of
90 in the event that the angle is disturbed. Whereas, the feedback
has ability to detect the error caused by the disturbance and
correct the error. This added functionality is achieved at the
expense of response time as well as higher power requirements. We
will investigate how the performance of the system is altered by the
closed loop configuration with a negative feedback loop.
18
We need to use a position sensor to detect the angular position of
the robot arm. The simplest position detector is a potentiometer.
We supply ±12V between two end terminals and measure the
voltage of the brush relative to the ground. Since one revolution
gives a voltage change of 24V, the sensor gain is 24V/revolution.
The transfer function is
Ep(s) = 24θ(s).
19
Fig. 2 Block diagram of the closed loop system
20
Incorporating two potentiometers, one to set a reference angle and
the other to measure the output angular position, the block
diagram of the closed-loop control system is illustrated in Fig. 2.
After simplification, we obtain the block diagram as shown at the
bottom of Fig. 2.
We now examine the characteristics of the closed-loop system in
terms of the commonly used indices such as damping ratio, time
constant, settling time, phase margin etc. According to Fig. 2, the
open-loop (forward) transfer function is
G(s) =0.5
s(s+ 0.5).
The feedback transfer function is H(s) = 1. The closed-loop
21
transfer function is given by
Gc(s) =G(s)
1 +G(s)H(s)=
0.5
s2 + 0.5s+ 0.5.
From the characteristic equation s2 + 0.5s+ 0.5 = 0, the roots
representing the closed-loop poles are found to be
s = −1
4± j√
7
4= −0.25± j0.6614.
The root locus plot for the open-loop transfer function G(s) varying
the loop gain can be plotted easily with a Matlab statement,
rlocus([0.5],[1, 0.5, 0]); The calculated poles can be verified
in the root locus plot. The loop gain is unity in this case.
22
Fig. 3 The root locus plot for G(s)
23
Referring to the standard 2nd order transfer function,
G2(s) =ω2n
s2 + 2ζωns+ ω2n
,
the poles of this system are located at
s = −ζωn ± jωn√
1− ζ2.
This equation defines damping ratio ζ and damped natural
frequency ωd as
ζ = cos θ and ωd = ωn√
1− ζ2.
24
Fig. 4 The poles of underdamped 2nd order systems
25
Percent overshoot for underdamped systems is given by
Mp = e−( ζ√
1−ζ2)π.
Time constant is
T =1
ζωn.
Other indices often used to assess the performance of control
system are settling time ts
ts ' 4
ζωn= 4T for 2% criterion
ts ' 3
ζωn= 3T for 5% criterion
and phase margin φm calculated approximately by
ζ ' 0.01φm (in degrees).
26
The calculated indices for the unity gain feedback closed-loop
system are summarized in the table below.
ζ 0.3536
ωn 0.7071 rad/s 0.1125 Hz
ωd 0.6614 rad/s 0.1052 Hz
Mp ' 30%
T 4 sec.
ts (2%) 16 sec.
ts (5%) 12 sec.
φm 35.36
27
Comparing these results, it can be concluded that the straight
negative feedback has made the system’s response slower and very
underdamped. The time constant of open loop control is 2 seconds.
Rough calculation of the settling time for the open loop,
e−ts2 = 0.02 (2% criterion)
yields ts = 7.82 seconds. This settling time is also less than that of
the closed loop control.
28
5 Compensator Design by Root Locus
Method
Feedback control can do much better job than what we have seen
in our simple trial of closing the loop with an arbitrary choice of
the loop gain.
• We now consider if it is possible to reduce system’s time
constant down to 1 second (twice as fast as the open loop case)
and keep the damping ration at about ζ = 0.6.
• The new time constant T = 1/ζωn and the damping ratio
ζ = cosφ = 0.6 determine desired pole locations. They are at
s = −1± j1.33 compared with s = −0.25± j0.66 of the trial
case as shown in Fig. 5.
29
Fig. 5 New poles (compensated) and poles of the trial case (uncompensated)
30
Passive circuits of a first order phase-lead and a phase-lag
compensator are shown in Fig. 6. The transfer function of either
compensator circuit will result in the form,
Gp(s) = Kp1 + Ts
1 + αTs.
Fig. 6 Passive Circuits of a phase-lead and a phase-lag compensator
31
For the phase-lead compensator, 0 < α < 1, whereas the phase-lag
compensator takes α > 1. Besides the gain Kp, the difference is its
mutual positions of the pole and the zero. The zero is on the
right-hand-side of the pole for the phase-lead compensator. In the
phase-lag compensator, the pole is on the right-hand-side of the
zero. A phase-lead compensator Gp+(s) and a phase-lag
compensator Gp−(s),
Gp+(s) =s+ 0.7
s+ 1.3and Gp−(s) =
s+ 1.3
s+ 0.7.
are individually incorporated in the closed loop system having a
transfer forward transfer function,
G(s) =0.5
s(s+ 0.5)
to demonstrate their general effects on the root locus. The root loci
were drawn with the Matlab commands,
rloci(poly([-0.7]),poly([0,-0.5,-1.3])) and
32
rloci(poly([-1.3]),poly([0,-0.5,-0.7])) As seen in Fig. 7, the zero of the
compensator attracts the root locus towards the zero whereas the
pole repels the root locus away form the pole.
Fig. 7 Effects of phase-lead and phase-lag compensators on root locus
33
Referring to Fig. 5, the root locus needs to be moved from the
uncompensated poles towards the left to come near the new pole
locations. This means that we must use a phase-lead compensator.
The root locus must pass through the new pole location of
s = −1± j1.33 with a certain gain. Usually adjusting the zero and
pole of the compensator is accomplished by try-and-error. For our
simple second order system, pole-zero cancellation would be
simpler than the tedious process of try-and-error. If we set the
phase-lead compensator to be
Gp+(s) = Kps+ 0.5
s+ 2,
The combined open-loop transfer function,
G(s) ·Gp+(s) = Kp0.5
s(s+ 2)
gives us a straight upright root locus at s = −1 as shown in Fig. 8.
34
Fig. 8 The root locus plot resulting from pole-zero cancellation
35
Letting the combined gain of jG(s) ·Gp+(s)j to be unity to satisfy
the condition of the root locus, we obtain the compensator gain
Kp = 5.55 from
jG(s) ·Gp+(s)js=−1±j1.33 = Kpj0.5
s(s+ 2)js=−1±j1.33 = 1.
Thus, our compensator is designed and it is,
Gp+(s) = 5.55s+ 0.5
s+ 2
36
6 Assessment of the Designed Control
System
The designed controller is improved the closed-loop system’s
performance as we have intended.
Uncompensated (Sys-I) Compensated (Sys-II)
ζ 0.3536 0.6
ωd 0.7071 rad/s 1.333 rad/s
T 4 sec. 1 sec.
Now, we investigate the power requirement which might have been
substantially increased because of the shortened time constant from
T = 4 down to T = 1. The direct input to the robot arm controller,
more specifically the input to the power supply, should be
37
compared for both of the uncompensated and the compensated
control system shown in Fig. 9, respectively.
Fig. 9 Input errors e1 and e2 in the uncompensated and compensated systems
38
When the input command is to turn the arm exactly one
revolution, the input errors E1(s) and E2(s) are:
E1(s) =1
1 +G(s)
1
s=
s+ 0.5
s2 + 0.5s+ 0.5
E2(s) =Gp+(s)
1 +G(s)Gp+(s)
1
s=
5.55(s+ 0.5)
s2 + 2s+ 2.775.
By using the initial value theorem to find the initial error, which
occurs at the onset of the command, we find:
e1(0) = lims→∞
sE1(s) = 1
e2(0) = lims→∞
sE2(s) = 5.55.
Recall that the input to G(s) is expressed in terms of angle θ
rather than the actual input voltage to the power supply, we would
expect the initial voltage of 5.55×24V to occur when the
compensator is incorporated. This input level far exceeds the
39
maximum input range of ±28V.
We can examine position offset using the final value theorem.
Position offset is the error that remains uncorrected for a step
input.
e1(∞) = lims→0
sE1(s) = 0
e2(∞) = lims→0
sE2(s) = 0
Since our system equation is of type I, i.e. G(s) has one integrator
1/s, zero position offset is expected. The velocity offset ess is
calculated from the velocity error coefficient Kv, i.e. ess = 1Kv
.
Kv = lims→0
sG(s) = 1, for Sys-I
Kv = lims→0
sGp+(s)G(s) = 1.39, for Sys-II
The velocity offset is the position error when input is a ramp signal
1/s2. ess = 1 for the uncompensated system Sys-I and ess = 0.72
40
for the compensated system Sys-II. Thus, Small improvement is
gained.
41
7 Compensator Design by Frequency
Response Method
The same first order compensator can be designed by using the
frequency response method. We still have to use a phase-lead
compensator to decrease the control system’s time constant. The
phase-lead compensator now has a transfer function,
Gc(s) =T1s+ 1
T2s+ 1.
where T1 > T2. DC gain is unity and its high frequency gain is
T1/T2. The frequency response of this phase-lead compensator is
shown in Fig. 10.
42
Fig. 10 Frequency Response of the Phase-lead Compensator
There are two corner frequencies defined by the amplitude
response. The lower corner frequency occurs at ω1 = 1/T1 and the
upper corner frequency is at ω2 = 1/T2. It can be proved that the
43
maximum leading phase occurs at ωm =√ω1ω2. From the
frequency response,
Gc(jω) =jω + ω1
jω + ω2,
the maximum phase obtained at ωm is given by
φm = tan−1 ωmω1− tan−1 ωm
ω2
= tan−1
√
ω2
ω1− tan−1
√
ω1
ω2
Letting α =ω2
ω1, we can express φm as
φm = tan−1 α− 1
2√α
or tanφm =α− 1
2√α.
Then, we can prove that
sinφm =α− 1
α+ 1.
44
This is the most important equation that determines the ratio
α =ω2
ω1for a desired phase compensation φm. Another important
equation to be used in designing the phase-lead compensator is
about the gain increase at a new cross-over frequency for 0dB.
Since the gain increase for high frequency, say ω =∞ is given by
Gain = 20 log10
T1
T2= 20 log10
ω2
ω1= 20 log10 α
the gain at the center frequency ωm should be
Gain(ωm) =1
220 log10 α = 10 log10 α
The design objective is to design a phase-lead compensator which
gives the overall control system a phase margin of φm = 60.
Usually, the loop gain must be determined according to error
criteria, separately from the phase-lead compensator. In our case,
we have found the loop gain of 5.55 was inadequate by the previous
45
design based on the root locus. Let us use the loop gain of 1 to
alleviate too high input voltage for the power supply.
The design procedure requires the Bode plot of the open-loop
system without a compensator. The following Matlab program
allows us to plot this Bode diagram.
% K
% DC Motor: G(s) = --------
% s(Ts+1)
%
clg, clc
K=1;
num=K;
den=[2,1,0];
w=logspace(-2,1,100);
jw=j*w;
H=polyval(num,jw)./polyval(den,jw);
mag=20*log10(abs(H));
phase=angle(H)*180/pi;
46
subplot(211),semilogx(w,mag,’w’),grid
title(’Magnitude Response’);
xlabel(’frequency in rad/s’),ylabel(’Magnitude in dB’);
subplot(212),semilogx(w,phase,’w’),grid
title(’Phase Response’);
xlabel(’frequency in rad/s’),ylabel(’Phase in degrees’);
47
Fig. 11 Frequency Response of the Phase-lead Compensator
48
From the obtained Bode plot, we can find that the magnitude
cross-over frequency is 0.45 rad/s and that the phase margin is
approximately 45. Therefore, we need to add an additional 15 to
meet the required phase margin of 60. Since a new cross-over
frequency needs to be chosen at a frequency higher than the
uncompensated system’s cross-over frequency 0.45 rad/s, we add 5
to account the further decrease in phase. Therefore, the required
phase compensation is φm = 20. Using
sinφm =α− 1
α+ 1,
we determine the corner frequency ratio α = ω2/ω1. We obtain
α = 2.03. Then, we must find the increase in gain introduced by
inserting the compensator.
Gain = 20 log10 α = 6.15 dB
Thus, the new cross-over frequency must occur when the
49
magnitude response of the Bode plot intersects -6.15dB line. The
new cross-over frequency is found to be approximately ωm = 1.0
rad/s. Then, we find two corner frequencies ω1 and ω2 from two
equations, α = ω2/ω1 and ωm =√ω1ω2. Since ωm = ω1
√α, we
find ω1 = 0.70. From ω2 = αω1, ω2 = 1.42. The designed
phase-lead compensator is
Gc(s) =T1s+ 1
T2s+ 1
=ω2
ω1
s+ ω1
s+ ω2
= αs+ ω1
s+ ω2
= 2.03s+ 0.70
s+ 1.42.
The frequency response of the compensated system by the
phase-lead compensator designed by using the frequency response
50
is calculated by the following Matlab program.
% 0.5
% DC Motor: G(s) = --------
% s(s+0.5)
% compensated by 2.03(s+0.7)/(s+1.42)
%
clg, clc
K=2.03;
num=K*0.5*poly([-0.7]);
den=poly([0,-0.5,-1.42]);
w=logspace(-2,1,100);
jw=j*w;
H=polyval(num,jw)./polyval(den,jw);
mag=20*log10(abs(H));
phase=angle(H)*180/pi;
subplot(211),semilogx(w,mag,’w’),grid
title(’Magnitude Response’);
xlabel(’frequency in rad/s’),ylabel(’Magnitude in dB’);
subplot(212),semilogx(w,phase,’w’),grid
title(’Phase Response’);
xlabel(’frequency in rad/s’),ylabel(’Phase in degrees’);
51
Fig. 12 Frequency Response of the compensated system
52
The obtained frequency response is shown in Fig. 12. The phase
margin appears to be close to 60.
53
8 Step Response
The characteristics of the three systems, uncompensated,
compensated with a controller designed using pole/zero
cancellation, and compensated with a phase-lead compensator
designed by the frequency response method, can be compared from
the step response view point. The unit step reponse can be
calculated and displayed by a single Matlab statement
step(num,den). The following Matlab program shows how to
combine a compensator transfer function, a system transfer
function, and a feedback transfer function, and generate one
combined closed-loop transfer function. This general Matlab
program to construct a closed-loop transfer funtion expects all
transfer functions to be represented by poles and zeros and their
gain. Using this program and the built-in function
step(num,den)., the unit step responses of the above three cases
54
are shown if Fig. 13.
% ----------------------------------------------------
% Finding Closed-Loop Step Response
% From Open-Loop Transfer Function
% K. Takaya Jan, 1998
% ----------------------------------------------------
% G(s)=A1*N1(s)/D1(s), H(s)=A2*N(s)/D2(s)
% Gc(s)=G(s)/1+G(s)H(s)
% =A1*N1(s)D2(s)/D1(s)D2(s)+A1*A2*N1(s)N2(s)
% ----------------------------------------------------
% Specify poles and zeros of G(s) and H(s),
% G(s)=0.5/s(s+0.5), H(s)=1
N1=[]; D1=[0,-0.5];
N2=[]; D2=[];
A1=0.5; A2=1;
% ---------------------(No Compensator)
Num=A1*poly([N1,D2]);
Den1=poly([D1,D2]);
Den2=poly([N1,N2]);
n1=size(Den1,2);
n2=size(Den2,2);
55
Den=Den1+A1*A2*[zeros(1,n1-n2),Den2];
T=[0:0.1:20];
figure(1); step(Num,Den,T);
% ---------------------(Pole/Zero Cancelled Compensator)
% Specify poles and zeros of G(s), Gc(s) and H(s),
% G(s)=0.5/s(s+0.5), Gc(s)=5.55(s+0.5)/(s+2), H(s)=1
N1=[]; D1=[0,-2.0];
N2=[]; D2=[];
A1=0.5*5.55; A2=1;
% ----------------------------------------------------
Num=A1*poly([N1,D2]);
Den1=poly([D1,D2]);
Den2=poly([N1,N2]);
n1=size(Den1,2);
n2=size(Den2,2);
Den=Den1+A1*A2*[zeros(1,n1-n2),Den2];
T=[0:0.1:20];
figure(2); step(Num,Den,T);
% ---------------------(Phase Margin 60 deg. Compensator)
% Specify poles and zeros of G(s), Gc(s) and H(s),
% G(s)=0.5/s(s+0.5), Gc(s)=2.03(s+0.7)/(s+1.42), H(s)=1
N1=[-0.7]; D1=[0,-0.5,-1.42];
N2=[]; D2=[];
A1=0.5*2.03; A2=1;
56
% ----------------------------------------------------
Num=A1*poly([N1,D2]);
Den1=poly([D1,D2]);
Den2=poly([N1,N2]);
n1=size(Den1,2);
n2=size(Den2,2);
Den=Den1+A1*A2*[zeros(1,n1-n2),Den2];
T=[0:0.1:20];
figure(3); step(Num,Den,T);
57
58
59
Fig. 13 Step Responses of (1) uncompensated system (top), (2) compensated
by pole/zero cancellation (left), and (3) by phase margin 60 (right).
60
9 Assignment No.1
1. Redesign the phase lead compensator without imposing
pole-zero cancellation. For a given zero at s = −1, determine
only the pole e.g. s = −p and an appropriate gain Kp of
Gp+(s) = Kps+ 1
s+ p
such that the time constant T = 1/ζωn = 1.5 sec. and the
damping ratio of ζ = cosφ = 0.6 are satisfied for the closed
loop system. Use the root locus method.
2. Redesign the phase lead compensator by the frequency
response method to satisfy the phase margin of 70.
61