Sei sulla pagina 1di 6

EE 3CL4: Intro.

to Linear Control Systems


Lab 4: Lag Compensation
Tim Davidson
Ext. 27352
davidson@mcmaster.ca

Objective
To use the root locus technique to design a lag compensator for a marginally-stable servomotor.

Assessment
The assessment of this lab will occur within the time allocated for the lab. There is
1. a pre-lab design exercise, which must be completed before the lab,
2. a system identification experiment,
3. the design of a lag compensator for the system identified in item 2,
4. an experiment to evaluate the performance of the compensated closed loop designed in item 3.
Your answer to the pre-lab exercise will be evaluated at the beginning of the lab. Your performance of the
system identification experiment, the compensator design and the performance evaluation experiment will
be evaluated during the lab. The marks for each component are clearly indicated.

Pre-lab design exercise (5 marks)

Consider the closed loop in Figure 1 in the case in which H(s) = 1 and G(s) =

4.7
s(s+3.2) .

Design a lag

Kc (s+z)
(s+p)

compensator of the form Gc (s) =


so that the percentage overshoot of the output y(t) for a unit step
input r(t) = u(t) is close to 20% and the velocity error constant is 50. Note that you are only allowed to
use lag compensation in this exercise. Please provide the details of the calculations that you performed in
each step of the design process. (In addition to the material in lectures and the text book, the material in
Section 3.1 may be of assistance.)

Figure 1: A compensated closed loop. We will focus on the case in which H(s) = 1. (Figure 10.1 of Dorf
and Bishop, Modern Control Systems, 11th edition, Prentice Hall, 2008.)

Exp. 1: Closed Loop System Identification (1 mark)

Recall that we will model the motor in the experiments using the transfer function
G(s) =

A
.
s(sm + 1)

(1)

In order to perform the design component of this lab, we will need to obtain the A and m for the motor
that you will use in this laboratory. Note that the values that you obtain may be different from those that
you obtained in Lab. 1, even if you are using the same motor.
Repeat experiments 1 and 2 from Lab. 1 to obtain the parameters A and m for the motor that you
will use in this laboratory.
Remember that this involves constructing a circuit of the form in Fig. 2 using components in the form
of Figs 3 and 4. For these systems you can choose R1 = R2 = 10 k. Please follow the instructions
from Lab. 1 carefully.
To obtain your mark for this experiment you must show your TA the scope trace for input frequency p and
must provide the corresponding values of A and m .

Design of a Lag Compensator for the Servomotor

In the previous lab, we designed a lead compensator for the servomotor. The primary goal of that design
was to reduce the settling time compared to that achieved with a proportional controller.
In this lab, we will design a lag compensator that will enable us to achieve a substantially larger velocity
error constant than that obtained using a proportional controller in Lab. 2, while maintaining essentially the
same transient performance. The target velocity error constant for the compensated closed loop is Kv = 40.

3.1

Design of compensator (4 marks)

In this section we will determine the pole positions required to achieve the desired goals.
Sketch the root locus of the uncompensated plant. Begin by rewriting the motor transfer function as
A/m
and plotting the open loop poles.
G(s) = s(s+1/
m)
Locate the closed-loop pole positions on this root locus that yield an overshoot of 25%, and calculate
the gain, Kp of a proportional controller that would place the poles in that position.
Calculate the velocity error constant of your design, and the factor by which this will need to be
increased in order to obtain a velocity error constant of 40. The ratio z/p in your lag compensator
s+z
Gc (s) = Kc s+p
must be greater than this factor.
Place the zero of your compensator on the real axis close enough to the origin so as not to affect the
positions of the closed loop poles, yet not so close that the required values of the resistors and capacitor
become unreasonably large.
Determine the position of the pole of the compensator.
What value should you choose for Kc to keep the dominant poles close to their original positions?
Hint: Think about the magnitude criterion for the root locus, and the distances from the open loop
poles and zeros to the dominant closed-loop poles.
c a s+1 what should we choose for , a and K
c?
If we write the compensator in the form Gc (s) = K
s+1
To obtain your marks for this section, you must show a TA your worked solution, including your justification
c
for the choice of the position of the zero, and the values you computed for , a and K
2

Figure 2: Closed loop circuit from Labs 1 and 2.

Figure 3: Summing amplifier.

Figure 4: Unit-gain inverting amplifier (inverter).

Figure 5: An implementation of a lag compensator.

3.2

Design of compensator circuit (3 marks)

The goal of this section is to design a circuit that will implement the compensator that was designed in the
previous section.
For the circuit in Fig. 5, assume that the op-amp is ideal and the bias resistor is absent. Show that
the transfer function can be written as
c a s + 1
Gc (s) = K
s + 1

(2)

c = R2 /R3 , = C1 (R1 + R2 ), and a = R1 /(R1 + R2 ). Note that a < 1 so that the pole is
where K
closer to the origin than the zero. Hence, this circuit can be used to construct a lag compensator.
c , and the zero and
Now choose values for R1 , R2 , R3 and C1 so that we achieve the desired value of K
pole positions designed above. Note that there are three requirements, and four degrees of freedom.
This provides the flexibility required to ensure that we can use standard values for at least some of the
components. In particular,
Capacitors should be selected between 0.1F and 30F, preferably from standard values.
For the op-amps that we are using, resistors should be chosen between 10k and 1M. If R2 is
chosen to be larger than 500k, we must add the bias resistor in Fig. 5.
As a guide, you should consider choosing R2 to be a value that satisfies 33 103 (1 a)
R2 106 (1 a)/a, preferably a standard value. That should enable you to choose values for
the capacitor and R1 that can be constructed from the available equipment and enable linear
operation of the op-amp.
To obtain your marks for this section, you must show a TA your worked solution, including the values for
the resistors and the capacitor.

3.3

Analysis of your design (3 marks)

With the assistance of Matlab, analyze your design before implementing it. One way to do so is the
following:
At the Matlab command prompt, or in a Matlab script file, set values for A, tau m, K p, R 1,
R 2, R 3 and C 1.
Use the expressions that you have derived to compute the compensator parameters z, p and K c.
Calculate the value of the velocity error constant, Kv , that you have obtained. Does this meet the
specifications?
Show that the open loop transfer function of the compensated plant is
Gc (s)G(s) =

Kc A/m (s + z)

s s2 + (p + 1/m )s + p/m

(3)

Plot the root locus of the compensated closed loop by using the command:
rlocus([1,z],[1,(p+1/tau m),p/tau m,0])
Type grid; hold on
Show that the denominator polynomial of the compensated closed-loop transfer function from R(s) to
(s) is

s s2 + (p + 1/m )s + p/m + Kc (A/m )(s + z)
(4)
4

Use the following commands to plot the closed loop poles for values of Kc , z and p that you have
obtained. The positions of these poles will be marked with red diamonds.
cl poles compensated = roots([1,(p+1/tau m),p/tau m,0] + K c*A/tau m*[0,0,1,z]);
plot(real(cl poles compensated),imag(cl poles compensated),rd);
Now, show that the denominator of the closed loop transfer function from R(s) to (s) for the case of
proportional control is
s(s + 1/m ) + Kp A/m
(5)
Use the following commands to plot the poles of the proportionally controlled closed loop with blue
squares
cl poles prop = roots([1,1/tau m,K p*A/tau m]);
plot(real(cl poles prop),imag(cl poles prop),bs);
Type axis(auto)
Examine how close the dominant poles of the compensated closed loop are to those of the original
design. Revisit your design if necessary.
Type figure to open a new figure.
Show that the numerator of the compensated closed loop transfer function from R(s) to (s) is
Kc (A/m )(s + z)

(6)

Then use the following Matlab command to plot the step response of the compensated closed loop in
red
step(K c*A/tau m*[1,z], [1,(p+1/tau m),p/tau m,0]+K c*A/tau m*[0,0,1,z],r);
Type hold on
Show that the numerator of the proportionally controlled closed loop transfer function from R(s) to
(s) is Kp A/m
Then plot the step response of that closed loop in blue using the command
step(K p*A/tau m, [1,1/tau m,K p*A/tau m],b);
Compare the step responses. Can you relate the small differences in the transient response to the small
differences in the closed-loop pole positions of the compensated and proportionally-controlled loops?
Type figure to open a new figure.
Use the following commands to plot a unit ramp function in black, the response of the compensated
closed loop to the unit ramp input in red, and the response of the proportionally controlled closed loop
to the unit ramp input in blue.
t=0:0.01:5;
v=t;
plot(t,v,k);
hold on;
comp cl system=tf(K c*A/tau m*[1,z], [1,(p+1/tau m),p/tau m,0]+K c*A/tau m*[0,0,1,z])
y comp=lsim(comp cl system,v,t);
plot(t,y comp,r);
prop cl system=tf(K p*A/tau m, [1,1/tau m,K p*A/tau m])
y prop=lsim(prop cl system,v,t);
plot(t,y prop,b);
5

Compare the ramp responses, especially in the steady-state region. You may need to magnify your
plot. Did your design achieve its goal, at least in this simulation setting?
To obtain your marks for this section, you must show your working to a TA, and you must show the root
locus and step response plots.

4
4.1

Exp. 2: Implementation of the Lag Compensator


Construct the closed loop

As you did in Lab. 3, construct a closed loop that implements the designed system using a combination of the
summing amplifier in Fig. 3, the inverter in Fig. 4, the lead compensator in Fig. 5, and the SEU. (Recall that
the output of the summing amplifier is proportional to the negative of the sum.) Make sure that the Laplace
Transform of the output of the compensator is Gc (s) R(s) (s) , where R(s) is the Laplace Transform of
the input and (s) is the Laplace Transform of the angle output. In order to ensure that the sign of this
output is correct, the architecture of your closed loop may need to be different from that in Fig. 2.

4.2

Evaluation of the design

To obtain your marks for each section, you must show a TA the appropriate trace on the oscilloscope and
your associated calculations, and you should provide appropriate discussion.
4.2.1

Evaluate the percentage overshoot of your design (2 marks)

Apply a square wave to the command input, and measure the percentage overshoot that you obtained. Make
sure that the amplitude is large enough so that the non-linear effects of the motor are mitigated, but small
enough so that the op-amp voltage does not saturate. Some guidance on the latter point can be obtained
by considering the steady-state response of the compensator circuit to a step input, and the percentage
overshoot.
4.2.2

Evaluate the settling time of your design (2 marks)

Apply a square wave to the command input, and assess the settling time. Compare this value to 8m , which
was the settling time of an underdamped closed-loop with proportional control.
4.2.3

Evaluate the velocity error constant of your design (3 marks)

Apply a triangular wave to the command input. Make sure that the frequency of the wave is low enough for
the loop to settle into the steady state before the wave reverses. Let be the magnitude of the slope of the
triangular wave. Estimate the velocity error constant by dividing the steady-state value of r(t) (t) by .
The steady-state error can be measured by measuring the input r(t) using channel 1 of the oscilloscope and
measuring the output (t) using channel 2. Be sure to select a value of that facilitates this measurement.
Compare the achieved velocity error constant to the value that can be calculated from the gains and the
positions of the open-loop poles and zeros in your design in Section 3.1.

Potrebbero piacerti anche