# Lag Compensator design with Root Locus

So far we have discussed on an Introduction to Matlab and Lag compensator design with bode plot. In this post we will deal with lag compensator design with time domain specifications and using the root locus technique.

The steps to design the lag Compensator are

- Draw the root locus of the given open loop uncompensated system with K=1
- From given specifications determine the damping ratio.
- Draw a line from origin making an angle with the negative real axis. The point of intersection of that line with root locus gives the dominant pole Sd
- Determine open Loop gain K at Sd,by taking equation
- Let Kv velocity constatn for uncompensated system, Kvd=Desired velocity Constant

- A=Kvd/Kv and

1/T is always choosen to be 10%of second pole of uncompensated system.- a lag compensator has the form

- form the complete transfer function with the lag compensator added in series to th original system
- plot the new Root locus and check if given conditions are satisfied. Or else change the location of poles.

We will solve question number 1.3 in Advanced Control Systems By Nagoor Kani. Let us solve this with matlab.

The question is Forward ath transfer function of a unity feedback control system is

. Design a lag compensator so that peak overshoot is less than 16% for step input and steady state error is less than 0.125 for ramp input.

Solution:

The percentage overshoot is given to determine the damping ratio and we can use the relation

The code below shows the matlab commands to obtain the design.

n=1 %taking K=1 d=conv([1 0],conv([1 2],[1 8])) 'G(s)' % Display title G(s) G=tf(n,d) rlocus(G) % plot root locus of uncompensated system M=input('Enter Percentage overshoot') zeta=sqrt(log(M)^2 /(pi^2 + log(M)^2)) % calulate damping ratio sgrid(zeta,0) % draw line from origin with angle of cos^(-1) zeta [K p]=rlocfind(G) % find the gain K at the point of Sd , Sd selected by clicking on the graph Kvu=input('Enter Uncompensated Vel VConst') ess=input('Enter aloowe steady state error') Kvd=1/ess A=Kvd/Kvu; Beta=1.2*A; root=roots(d); finding roots of the denominator T=1/(-0.1*root(2)) % usinthe second root Zc=1/T Pc=1/(Beta*T) Gc=tf([1 Zc],[1,Pc]) sys=Gc*G*K rlocus(sys) % plot root locus of compensated system pause sys=feedback(sys,1,-1) step(sys) hold on G=feedback(G,1,-1) step(G)

The Diagrams below show the results obtained Please don’t forget to comment or ask doubts in case of trouble.

Posted on May 23, 2012, in Technical and tagged feedback control system, matlab script, root locus, steady state error. Bookmark the permalink. 6 Comments.

Hi buddy,could you explain more about this part “T=1/(-0.1*root(2)) “,how do you define T? thank you !

See the step 7 says that 1/T is always choosen to be 10% of second pole of uncompensated system. So the roots of the denominator are stored in the array roots. So roots(2) takes the second root and we invert the sign and take 10% of it.

Good day! This is kind of off topic but I need some advice from an established blog.

Is it hard to set up your own blog? I’m not very techincal but I can figure things

out pretty fast. I’m thinking about making my own but I’m

not sure where to start. Do you have any tips or suggestions?

Thanks

As we know that we have a rlocus find…do we have any bode find..?

Why is your overshoot not satisfied? Mp ~ 60% > 16%

Design a lag compensator to

reduce

the steady

–

state error

for a step

input

by a factor of 10 while the system operates with 15% overshoot.