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/5/matlab'
Copy to clipboard

3.5. Analytical Root-Locus Design of Phase-Lead Compensators

This MATLAB Live Script presents an analytical procedure for phase-lead design. It is based on Section 7.8 of Phillips and Harbor Feedback Control Systems, Prentice Hall, 1988[1]. For the procedure it is convenient to write the compensator transfer function as

D(s)=a1s+a0b1s+1

In this procedure we choose a1, a0, and b1 such that given s1, the equation

KD(s)G(s)H(s)|s=s1=1

is satisfied; that is we are designing a compensator that places a root of the closed-loop characteristic equation at s=s1.

In equation (2) we have four unknowns, including K, and only two relationships (magnitude and phase) that must be satisfied. Hence, we can arbitrarily assign values to two of the unknowns. K is easily eliminated since

KD(s)=Ka1s+Ka0b1+1

so if we assume that K=1 for the design procedure we eliminate one of the unknowns. The other unknown that can be eliminated is a0 which can be seen to be the DC gain of the compensator. Its value can therefore be chosen to satisfy the steady-state error requirements of the design and we need only to determine values for a1 and b1.

The design proceeds as follows. First, we express the desired closed loop pole position

s1=|s1|ejβ

and

G(s1)H(s1)=|G(s1)H(s1)|ejψ

Then the design equations (derived in Appendix B of Phillips and Harbor, 1988) are

a1=sinβ+a0|G(s1)H(s1)|sin(βψ)|s1||G(s1)H(s1)|sinψb1=sin(βψ)+a0|G(s1)H(s1)|sinψ|s1|sinψ

Given a0, G(s)H(s), and the desired closed-loop pole location s1, (5) and (6) give the remaining compensator coefficients. This procedure places a closed-loop pole at s=s1; however, the locations of the remaining poles are unknown and may be unsatisfactory. In fact, some may be unstable!

For the case that ψis either 0 or 180, equations (5) must be modified to give the single equation

a1|s1|cosβ±b1|s1||G(s1)H(s1)|±1|G(s1)H(s1)|+a0=0

where the plus sign applies to the case ψ=0 and the minus sign applies to ψ=180. For this case, the value of either a1 or b1 can also be assigned. An example is now given to illustrate the procedure.

3.5.1. Example

An executable version of this document is available as a MATLAB Live Script analrloc.mlx. You can use it to design a Lead Compensator for other systems by downoading that script and changing the set-up parameters.

3.5.1.1. Definitions (change these to change design)

The plant transfer function is :

G = tf(1,[1 0 0]);  
Copy to clipboard

The feedback transfer function is H(s)=1:

H = tf(1,1);
Copy to clipboard

So G(s)H(s) is:

GH=series(G,H)
Copy to clipboard
GH =
Copy to clipboard
   1
Copy to clipboard
  ---
Copy to clipboard
  s^2
Copy to clipboard
Continuous-time transfer function.
Copy to clipboard

The desired closed-loop poles are:

s1 = -2 + 2j;
Copy to clipboard

Now the DC gain of this type 2 system will be:

Ka=s2D(s)G(s)H(s)|s=0=s2a1s+a0b1+1×1s2|s=0=a0.

For the purpose of illustration let us arbitrarily take a value of a0=8/3:

a0 = 8/3;
Copy to clipboard

3.5.1.2. Calculations

(You shouldn’t need to change these commands)

Polar form of s1

m_s1=abs(s1),  p_s1 = (angle(s1)*180/pi + 90) % degrees 
Copy to clipboard
m_s1 =
    2.8284
Copy to clipboard
p_s1 =
   225
Copy to clipboard

Transfer function evaluated at s1=G(s1)H(s1)in polar form:

[numGH,denGH] = tfdata(GH,'v');GHs1=polyval(numGH,s1)/polyval(denGH,s1)
Copy to clipboard
GHs1 =
   0.0000 + 0.1250i
Copy to clipboard

Magnitude:

mGHs1=abs(GHs1)
Copy to clipboard
mGHs1 =
    0.1250
Copy to clipboard

Phase:

pGHs1=angle(GHs1)*180/pi - 180 % degrees
Copy to clipboard
pGHs1 =
   -90
Copy to clipboard

Hence angles are:

beta = p_s1*pi/180
psi = pGHs1*pi/180  % radians
Copy to clipboard
beta =
    3.9270
Copy to clipboard
psi =
   -1.5708
Copy to clipboard

From (5)

a1 = (sin(beta) + a0*mGHs1*sin(beta - psi))/(m_s1*mGHs1*sin(psi))  
b1 = (sin(beta + psi) + a0*mGHs1*sin(beta))/(-(m_s1)*sin(psi))  
Copy to clipboard
a1 =
    2.6667
Copy to clipboard
b1 =
    0.1667
Copy to clipboard

Compensator is therefore given by

numD = [a1, a0], denD = [b1, 1]  
Copy to clipboard
numD =
    2.6667    2.6667
Copy to clipboard
denD =
    0.1667    1.0000
Copy to clipboard

which in normal form:

D(s)=Kc(s+z1s+p1)

has

Kc = a1/b1, z0 = a0/a1, p0 = 1/b1  
Copy to clipboard
Kc =
   16.0000
Copy to clipboard
z0 =
     1
Copy to clipboard
p0 =
    6.0000
Copy to clipboard

Now make a transfer function

D = tf(Kc*[1, z0],[1, p0])  
Copy to clipboard
D =
Copy to clipboard
  16 s + 16
Copy to clipboard
  ---------
Copy to clipboard
    s + 6
Copy to clipboard
Continuous-time transfer function.
Copy to clipboard

3.5.1.3. Evaluation of Design

Open loop transfer function:

Go = series(D,GH)  
Copy to clipboard
Go =
Copy to clipboard
   16 s + 16
Copy to clipboard
  -----------
Copy to clipboard
  s^3 + 6 s^2
Copy to clipboard
Continuous-time transfer function.
Copy to clipboard

Root locus:

rlocus(Go) 
Copy to clipboard
../../_images/analrloc_37_0.svg

Closed-loop transfer function:

DG=series(D,G)  
Gc=feedback(DG,H)  
Copy to clipboard
DG =
Copy to clipboard
   16 s + 16
Copy to clipboard
  -----------
Copy to clipboard
  s^3 + 6 s^2
Copy to clipboard
Continuous-time transfer function.
Copy to clipboard
Gc =
Copy to clipboard
         16 s + 16
Copy to clipboard
  -----------------------
Copy to clipboard
  s^3 + 6 s^2 + 16 s + 16
Copy to clipboard
Continuous-time transfer function.
Copy to clipboard

Step response:

step(Gc)  
Copy to clipboard
../../_images/analrloc_41_0.svg

As an exercise, you should examine the effect of designing for a range of DC gains in the range 0Ka10.

3.5.2. Footnotes

[1] The proofs of the formulae given are derived in Appendix B of that text.