Lead Compensator design with Bode plot


The steps to design the Lead Compensator are:

  1. Determine K from the error constants given
  2. Sketch the bode plot
  3. Determine phase margin 
  4. The amount of phase angle to be contributed by lead network is
    $\phi_m=\gamma_{d}-\gamma + \epsilon$, where $\gamma_d$ is the required phase margin and $\epsilon$ is 5 initially. if the angle is greater than 60then we have to design the compensator as 2 cascade compensator with lead angle as $\phi_m/2$
  5. calculate
    $\alpha=\frac{1-sin(\phi_m)}{1+sin(\phi_m)}$ from bode plot find $\omega_m$ such that it is the frequency corresponding to the gain
    $-20log(1/\sqrt(\alpha))$
  6. calculate
    $T=\frac{1}{\omega_m \sqrt(\alpha)}$
  7. a lead compensator has the form
    $\frac{(s+\frac{1}{T})}{(s+\frac{1}{\alpha T})}$
  8. form the complete transfer function with the lead compensator added in series to th original system
  9. plot the new Bode plot and determine phase margin and observe that it is the required phase margin
  10. if not satisfactory repeat steps from step 4 by changing value of $\epsilon$ by 5


Now to do this In Matlab let us take a question. I will be solving the question number 6.2 in Control Systems By Nagoor Kani. In the text book the question has been solved without using matlab you can go through it to understand the steps better.

The question is
$G(s) = \frac{K}{s(s+4)(s+80)}$ the phase margin should be atleast 33 and velocity error constant is 30.

Solution:
The velocity error constant is
$K_v=\lim_{s \to 0}sG(s)H(s)$
On solving we get K =9600

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

clear all  % clear all variables
close all  % close all previous graphs
K=9600	% value of K calculated from error constants
'G(s)' % Display heading
G=tf(K,conv([1 4 0],[1 80])) % make the transfer function
[Gm,Pm]=margin(G) %get the gain margin and phase margin
margin(G) %plot the bode plot
Pd=input('Enter Desired Phase margin')
ep=input('Enter value e') % enter the value of epsilon initially start with 5
ph=Pd-Pm+ep
if ph>60   % check if angle needed is greater than 60
   phm=ph/2
else
   phm=ph
end

alpha=(1-sind(phm))/(1+sind(phm)) % calculate alpha
db=-20*log10(1/sqrt(alpha)) %calculate the gain in db
wm=input(‘Enter frequency’) % from plot obtain frequency corresponding to above gain
T=1/(wm*sqrt(alpha))
Gc=tf([1 1/T],[1 1/(alpha*T)]) % form transfer function of compensator
‘Open Loop Transfer Function is’
if ph==phm
‘Single’
Go=Gc*G/alpha
else
‘Cascade’
Go=Gc*Gc*G
%if angle was greater than 60 we designed compensator for half value so we cascade them and their attenuation is not nullified and should be retained
end

margin(Go)
pause
comp=feedback(Go,1,-1);
uncomp=feedback(G,1,-1);
step(uncomp) % observe step response
hold on
step(comp)
legend(‘Uncompensated’,’Compensated’)

Step response of compensated and Uncompensated system

 

About these ads

About vineethkartha

I am an Electrical and Electronics Engineer at Siemens India Ltd. Graduated from Govt Engg. College, Barton Hill. A free software promoter and electronics hobbyist. I love C programming and have authored a book "Thats How We C". Besides these my hobbies are cooking , Glass Painting and reading

Posted on May 24, 2012, in Technical and tagged , , , . Bookmark the permalink. 1 Comment.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 991 other followers

%d bloggers like this: