- From given specifications determine the damping ratio and the natural frequency .
- Find the dominant pole
. If damping ratio alone is given then draw the root locus and draw line from origin at an angle to intersect the root locus, the point of intersection is the dominant pole.
- Measure angle contributed by each pole and zero of uncompensated system to the dominant pole as marked in the diagram, the angles are measured in the counter clockwise direction from the positive real axis direction.
- The angle needed to be provided byt the compensator is
This angle if greater than 60 then two compensators each providing half the required angle is made.
- as In the figure above draw PC bisection angle APO and draw line PB and PD such that they make angle with respect to PC B is the required pole and D is the required zero.
- a lead compensator has the form
- Determine open Loop gain K at Sd,by taking equation
- form the complete transfer function with the lead compensator added in series to the original system
- plot the new Bode plot and determine phase margin and observe that it is the required phase margin
Now to do this In Matlab let us take a question. I will be solving the question number 1.7 in Advanced Control Systems By Nagoor Kani. In th text book the question has been solved without using matlab you can go through it to understand the steps better.
The question is
the Peak over shot is 12.63% natural frequency of oscillation is 8 rad/sec and velocity error constant should be greater than or equal to 2.5.
Calculate the damping ration from the peak over shoot given the equation had been discussed in the previous post.
The code below shows the matlab commands to obtain the design.
clear all close all n=input('Enter the Coefficients of Numerator') d=input('Enter the Coefficients of Denominator') %enter as array [1 11 28 0] 'G(s)' G1=tf(n,d) G2=tf(conv([1 0],n),d); % this is for evaluating the Kv we multiply numerator with s. M=input('Enter peak overshoot: ') z=sqrt(log(M)^2 /(pi^2 + log(M)^2)) % calulate damping ratio wn=input('Enter wn: ') Kv=input('Enter velocity constant: ') Sd=complex((-z*wn),(wn*sqrt(1-z^2))) % forming the dominant pole rlocus(G1) % plotting uncompensated root locus hold on plot(Sd,'*') % mark the dominant pole axis([-20 20 -20 20]) 'Press any key to proceeed' pause close all pzmap(G1) % make pole zero plot. hold on plot(Sd,'*') % mark the dominant pole plot(conj(Sd),'*') axis([-20 20 -20 20]) Po=roots(d) pang=zeros(1,size(Po,1));
% Finding the angle contributions of poles
% Finding the angle contributions of zeroes
‘Required Phase Lead’
% LOGIC TO CHECK IF PHASE LEAD IS GREATER THAN 60 in some cases it can be 4 times greater than 60 then we have to repeatedly divide it till less than 60
‘Press any key to proceeed’
‘The lead Compensator’
‘Open Loop Transfer Function K=1′
sG=Gc*G2; % For evaluating error constant
sG=(Gc^t)*G2 % For evaluating error constant
sG=minreal(sG); % For evaluating error constant
axis([-20 20 -20 20])
‘The Velocity Error Constant is’
Kvn=dcgain(K*sG); % For evaluating error constant
‘Condition is satisfied’
‘The Complete transfer open loop function’