3.6. Lag Compensation

Lecturer

Set up MATLAB

%cd matlab
pwd
clear all
imatlab_export_fig('print-svg')  % Static svg figures.
format compact
Copy to clipboard
ans =
    '/Users/eechris/code/src/github.com/cpjobling/eglm03-textbook/03/6'
Copy to clipboard

3.6.1. Introduction

Lead compensation is used to improved the transient response of a closed-loop control system.

In most cases it is also important to ensure that the steady-state accuracy of the closed-loop system is controlled.

In order to reduce the steady-state errors in a system we can use integral action (see PID compensation) which has the affect of increasing the system type number by 1 or increase the system gain.

Unfortunately gain compensation, because it acts at all frequencies, usually has the effect of reducing stability.

What is needed is a form of compensation that acts in a frequency dependent way: adding gain at low frequencies while maintaining mid-to-high frequency gains at the values needed to guarantee stable transient behaviour.

A dynamic compensator that has this effect is the “lag compensator”.

The lag compensator has the transfer function:

Dlag(s)=Kc(sz0sp0)

where $|z0|>|p0|.$

Considering the frequency response of Dlag(s)

Dlag(jω)=Kc(jωz0jωp0)

The low and high-frequency gains are:

Dlag(jω)|ω0=Kc(z0p0)
Dlag(jω)|ω=Kc

Because the low frequency gain is higher than the high frequency gain (the compensator has a low-pass characteristic). If the high frequency gain is designed to match the gain needed for transient performance, the low frequency gain can be independently designed to achieve steady-state performance requirements.

3.6.2. Properties of the Cascade Lag Compensator

As |z0|>|p0| (a ratio of z0/p010 is usual), the angle contributed by the compensator to some arbitrary point s1 at on the s-plane, is illustrated in Figure 1.

Figure 1 Angle contribution of a lag compensator Figure 1 Angle contribution of a lag compensator

The net contribution is

ϕc=θp+θz<0

so that the lead compensator always makes a negative contribution to the angle criterion.

This has the effect of allowing the closed-loop poles to move to the right in the s-plane.

The design approach seeks to keep this negative contribution as small as possible so that the pole must be placed physically close to the zero. Typically |ϕc|<2.

For convenience, the DC gain of the lag compensator is made unity:

Dlag(s)|s=0=Kc(z0p0)=1

Since |z0|>|p0| then

Kc=p0z0<1.

Now, the uncompensated (or lead-compensated) closed-loop characteristic equation is

1+K0G(s)H(s)=0

so

K0=1G(s)H(s).

The gain K0 is the root-locus gain required to place the required dominant closed-loop poles at s=s1.

The values of the zero and pole are chosen such that

Dlag(s)|s=s1=Kc(sz0sp0)Kc.

This equation requires that the pole and zero be close together and also that

z0|s1|.

For the lag compensated system, the new root-locus gain will be

K=1D(s)G(s)H(s) 1KcG(s)H(s)=K0Kc.

The gain K is chosen to satisfy the steady-state error requirements and the compensator gain Kc is used to ensure that the effective gain at s=s1 is unchanged.

3.6.3. Design Procedure

  1. Choose K0 to ensure that the desired dominant closed-loop poles satisfy the transient response requirements.

  1. Calculate the gain K required to give the desired steady-state error.

  1. Assuming that the lag compensator has unity DC gain choose Kc=K0/K.

  1. Choose |z0| small with respect to |s1|.

A value of z0=|s1|/10 is often taken as a reasonable first approximation.

The lag compensator pole is then p0=Kcz0.

3.6.4. Example

The plant (type 1)

G(s)=1s(s+4)

The feedback is

H(s)=1

hence

s = tf('s');
G = 1/(s*(s+4));
H=1;
Copy to clipboard

root-locus

GH = series(G,H);
rlocus(GH)
Copy to clipboard
../../_images/lagc_34_0.svg

In common with previous examples, we chose closed-loop poles at s=2±j2 and determine K0:

s1 = -2+2j;
K0 = rlocfind(GH,s1)
Copy to clipboard
K0 =
     8
Copy to clipboard

As an aside, we calculate the step response for comparison later:

Gc1 = feedback(K0*G,H);
[y1,t1]=step(Gc1,10);
Copy to clipboard

The system is type 1 so that the static velocity error

Kv=sG(s)H(s)|s=0=sK0s(s+4)|s=0=K04=2.

We would, for the purposes of illustration, like to increase the static velocity error to 10 which will make the steady-state velocity error equal to 10%.

Thus we need K=40.

K=40;
Kc = K0/K
Copy to clipboard
Kc =
    0.2000
Copy to clipboard

Now

abs(s1)
Copy to clipboard
ans =
    2.8284
Copy to clipboard

so let the zero be

z0 = -3/10
Copy to clipboard
z0 =
   -0.3000
Copy to clipboard

and

p0 = Kc*z0
Copy to clipboard
p0 =
   -0.0600
Copy to clipboard

so

Dlag = zpk([z0],[p0],Kc)
Copy to clipboard
Dlag =
Copy to clipboard
  0.2 (s+0.3)
Copy to clipboard
  -----------
Copy to clipboard
   (s+0.06)
Copy to clipboard
Continuous-time zero/pole/gain model.
Copy to clipboard

Let us see how we have done.

Go2 = Dlag*GH
Copy to clipboard
Go2 =
Copy to clipboard
    0.2 (s+0.3)
Copy to clipboard
  ----------------
Copy to clipboard
  s (s+0.06) (s+4)
Copy to clipboard
Continuous-time zero/pole/gain model.
Copy to clipboard
[poles] = rlocus(Go2,K)
Copy to clipboard
poles =
  -1.8576 + 1.8730i
  -1.8576 - 1.8730i
  -0.3449 + 0.0000i
Copy to clipboard
rlocus(Go2),hold on,plot(poles,'*'),...
    title('Lag compensated design'),...
    hold off
Copy to clipboard
../../_images/lagc_52_0.svg

The closed-loop system:

Gc2 = feedback(K*Dlag*G,H)
Copy to clipboard
Gc2 =
Copy to clipboard
              8 (s+0.3)
Copy to clipboard
  ---------------------------------
Copy to clipboard
  (s+0.3449) (s^2 + 3.715s + 6.959)
Copy to clipboard
Continuous-time zero/pole/gain model.
Copy to clipboard

has step response

[y2,t2]=step(Gc2,10);
Copy to clipboard

Finally we compare the lag-compensated and gain compensated responses:

plot(t1,y1,t2,y2),title('Lag compensated response'),...
    legend('Transient design','Lag compensated')
Copy to clipboard
../../_images/lagc_58_0.svg

3.6.5. Comments

The lag compensator has a significantly longer settling time and a raised overshoot. These effects can be explained by examination of the closed-loop transfer function.

The benefits of the lag compensated repsonse can only be really seen when we compare the ramp responses. To determine the ramp response, we need to add an integrator to the plant and find the error responses:

Ge1 = 1/(1+K0*G*H);
[y3,t3]=step(Ge1*1/s,10);
Copy to clipboard
Ge2 = 1/(1+K*Dlag*G*H);
[y4,t4]=step(Ge2*1/s,10);
Copy to clipboard
plot(t3,y3,t4,y4),title('Lag compensated: ramp response'),...
    legend('Transient design','Lag compensated')
Copy to clipboard
../../_images/lagc_62_0.svg

The error is certainly reduced, but the settling time is rather long. To improve the design, a strategy would be to reduce the size of the lag pole to reduce still further the dynamic effects of the compensator on the settling time. However, the zero will still have an effect on the overshoot.

3.6.6. Resources

An executable version of this document is available to download as a MATLAB Live Script file cclag.mlx.

You can simulate this design after defining the parameters:

%%file params.m
% PARAMS - parameters for Lag Compensator Simulation
K0 = 8
Kc = 8/40
K = 8/Kc

G = tf(1,conv([1,0],[1,4]))
Clag = Kc*tf([1, 0.3],[1, 0.06])

H = 1;
F = 1;
Copy to clipboard
K0 =
     8
Copy to clipboard
Kc =
    0.2000
Copy to clipboard
K =
    40
Copy to clipboard
G =
Copy to clipboard
      1
Copy to clipboard
  ---------
Copy to clipboard
  s^2 + 4 s
Copy to clipboard
Continuous-time transfer function.
Copy to clipboard
Clag =
Copy to clipboard
  0.2 s + 0.06
Copy to clipboard
  ------------
Copy to clipboard
    s + 0.06
Copy to clipboard
Continuous-time transfer function.
Copy to clipboard

using this Simulink model lag_sim.slx [params.m].