We Used The Following System Through The Investigation Process
We Used The Following System Through The Investigation Process
We Used The Following System Through The Investigation Process
D(s)
- Steps of design:
i. Design a proportional controller:
C(s) = Kp
For the first three steps the disturbance is considered zero.
a- First, I entered the plant and sensor’s transfer functions in MATLAB as
follows:
>> s = tf('s');
>> p = 4/((2*s+1)*(0.5*s+1));
>> H = 1/(0.05*s+1);
Then I plotted the root locus of the system and used the rlocfind to find Kp*
which makes the system marginally stable as follows:
>> sgrid
>> Kp = rlocfind(openloop_transfer_function);
c- I plotted the step response for different values of Kp < Kp* and showed the
overshoot in each case as follows:
Kp_values = [3 5 7 8 10];
s = tf('s');
p = 4/((2*s+1)*(0.5*s+1));
H = 1/(0.05*s+1);
for i=1:5,
closed_loop = feedback(Kp_values(i)*p, H);
step(closed_loop);
hold on
end
set(findall(gcf, 'type','line'),'linewidth', 1); legend('Kp=3',
'Kp=5', 'Kp=7', 'Kp=8', 'Kp=10');
The results are shown below:
Then by trial and error I found the largest value of gain k̅ Ԓ which produce
about 20% overshoot and it is found to be:
k̅Ԓ = 1.255
And the response for this k̅Ԓ is shown below:
Then I calculated the gain margin and phase margin for this k̅Ԓ as follows:
d- Finally, I used a unit step disturbance and visualized the response of the
system which is as follows:
Ki = x;
s = tf('s');
p=4/((2*s+1)*(0.5*s+1));
H = 1/(0.05*s+1);
for i=0.3:0.2:1.7,
c = (i*(s+Ki))/s ;
closed_loop = feedback(C*p, H);
step(closed_loop);
hold on
end
set(findall(gcf, 'type','line'),'linewidth',
1); legend('Kp=0.3', 'Kp=0.5', 'Kp=0.7', 'Kp=0.9',
'Kp=1.1', 'Kp=1.3', 'Kp=1.5', 'Kp=1.7')
Ki = 0:
Ki = 0.1:
Ki = 0.25:
Ki = 0.5:
Ki = 1:
Ki = 2:
b- The value of the Kp that results in overshoot less than 10% is Kp = 0.5.
Then I plotted the response using these values of Ki and Kp when both reference
input and disturbance input is unit step. The results are shown below:
Ki = 0.5;
KD = x;
s = tf('s');
p =4/((2*s+1)*(0.5*s+1));
H = 1/(0.05*s+1);
for KP=1:10,
C = (KP*((KD*s^2)+s+Ki))/s;
closed_loop = feedback(C*p, H);
step(closed_loop);
hold on
end
set(findall(gcf, 'type','line'),'linewidth', 1);
legend('Kp=1', 'Kp=2', 'Kp=3', 'Kp=4', 'Kp=5',
'Kp=6', 'Kp=7', 'Kp=8', 'Kp=9', 'Kp=10')
x in the above code is replaced by the corresponding value of KD. The
results are shown below:
KD = 0:
KD= 0.1 :
KD = 0.2 :
KD = 0.3:
KD = 0.4:
KD = 0.5:
From above responses we see that the smallest KD that will allow overshoot and
rise time specifications is K*D = 0.4.
b- I plotted the root locus for the system with Ki = 0.5, KD = 0.4 to determine
the j 𝜔 crossing which corresponds to Kp value that make the system
marginally stable as follows:
>> KD = 0.4;
>> C = ((KD*s^2)+s+Ki)/s;
>> openloop_transfer_function = C*p*H;
>> rlocus(openloop_transfer_function);
conclusion :
proportional controller can reduce error but will increase the
overshoot , reducing the settling time and the time constant ,
in the other hand the integral controller can eliminate error ,
increasing settling time and time constant , finally , the third
term controller or the derivative controller can highly
increase the overshoot but highly decrease the settling time
and time constant .