# 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

1. Draw the root locus of the given open loop uncompensated system with K=1
2. From given specifications determine the damping ratio.
3. 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
4. Determine open Loop gain K at Sd,by taking equation 5. Let Kv velocity constatn for uncompensated system, Kvd=Desired velocity Constant 6. A=Kvd/Kv and 7. 1/T is always choosen to be 10%of second pole of uncompensated system.
8. a lag compensator has the form 9. form the complete transfer function with the lag compensator added in series to th original system
10. 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')
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. Uncompensated system root locus Hi, I am Vineeth Kartha, I hold a Masters degree in Embedded Systems from BITS Pilani, Goa Campus. I currently work as a Software Developer. I am A free software promoter and electronics hobbyist. In my free time I do a little bit of birding and Wildlife photography. I love travelling, reading and blogging.

Posted on May 23, 2012, in Technical and tagged , , , . Bookmark the permalink. 6 Comments.

1. amin

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

• vineethkartha

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.

2. photographyroot

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

3. kedar

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

4. Lilo17x@yahoo.com

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

5. mohitt v k

Design a lag compensator to
reduce