# 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
, where is the required phase margin and is 5 initially. if the angle is greater than 60then we have to design the compensator as 2 cascade compensator with lead angle as
5. calculate
from bode plot find such that it is the frequency corresponding to the gain
6. calculate
7. a lead compensator has the form
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 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
the phase margin should be atleast 33 and velocity error constant is 30.

Solution:
The velocity error constant is

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=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
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’)

## 3 thoughts on “Lead Compensator design with Bode plot”

1. thank you

2. SIPON DAS

plz give ur contact mail

3. Akash