Wednesday, May 6, 2020

Design of Controller for an Inverted Pendulum

Question: Show step and impulse response of your designed system using Step and impulse command in MATLAB and comment on the performance. Answer: Impulse and step response of the system After analysis from MATLAB for the given transfer function we have following parameters values. Analysis RiseTime: 14.2418 SettlingTime: 17.4462 SettlingMin: -4.9000 SettlingMax: -4.8841 Overshoot: 0 Undershoot: 0 Peak: 4.9000 PeakTime: 124.2120 Plots Plots with impulse and unit response without PID controller are highly unstable as can be seen from below plots. After implying PID as phase margin and gain margins are positive system is stable after implying PID. As response is converging in this system hence stable This plot shows unstable step response of the system Matlab Code clc; clear all; close all; s=tf('s'); G1=-9.8/(s^2/2+s); G2=s^2/2/(6*s^2/2+s); G=G1*G2; % PID Kp=1;Ki=8;Kd=0.22; H=Kp+Ki/s+Kd*s; %% compensated system R=G*H/(1+G*H); %% Step Analysis figure; step(G) grid on; title('Step Response for G') stepinfo(G) saveas(gcf,'stepG.jpg','jpg') figure; step(R) grid on; title('Step Response for PID') saveas(gcf,'stepPID.jpg','jpg') %% impulse Analysis figure; impulse(G) grid on; title('impulse Response for G') saveas(gcf,'ImpulseG.jpg','jpg') figure; impulse(R) grid on; title('impulse Response for PID') saveas(gcf,'impulsePID.jpg','jpg')

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.