Q2. Scope 102 2+4s 102 P(s) Determine the values 8 and wn 1. Underdamped systems parameters Parameters PID Controller: Use the following table to change the values for PID controller and report 2. yo...
Question:
CODE:
>> %% PID controller design
Kp = 65.2861;
Ki = 146.8418;
Kd = 4.0444;
Gc = pid(Kp,Ki,Kd);
% close-loop TF
T = feedback(G*Gc,1);
%% checking the design obejective
a_pid = stepinfo(T);
% Settling Time
tp_pid = a_pid.SettlingTime
% Overshhot
OS_pid = a_pid.Overshoot
%% steady-state error
[yout_pid,tout_pid] = lsim(T,stepInput,t);
% steady-state error
ess_pid = stepInput(end) - yout_pid(end);
>> %% Effect of P in G
Kp = 65.2861;
Ki = 0;
Kd = 0;
Gc = pid(Kp,Ki,Kd);
% close-loop TF...