# MATLAB PROGRAMS | DESIGN OF PID CONTROLLER

PROGRAMS | MATLAB | MATLB PROGRAMS |  MATLAB PROGRAMS CODE | MATLAB SIMULATION PROGRAMS | SIMULATION | PID CONTROLLER | PID CONTROLLER MATLAB PROGRAM |PID CONTROLLER USING MATLAB

MATLAB SIMULATION PROGRAMS

DESIGN OF A PID CONTROLLER

PROGRAM:

%program to design a pid controller

clc

t=0:0.01:8;

for k=5:-0.2:2

for a=1.5:-0.2:0.5

num1=k*(1+2*a+a^2)

den1=[0 10];

sys1=tf(num1,den1);

num2=[0 0 0 1.2];

den2=[0.36 1.86 2.5 1];

sys2=tf(num2,den2);

sys3=sys1*sys2

sys4=feedback(sys3,1)

y=step(sys2,t);

m=max(y);

if((m>1.1)&(m<1.05))

plot(t,y)

grid

sol=[k;a;m]

break

end

end

end

sol=[k,a,m];

disp(‘the value of k:’);

disp(k)

disp(‘the value of a:’);

disp(a)

disp(‘the value of m:’);

disp(m)

plot(t,y)

OUTPUT:

the value of k:

2

the value of a:

0.5000

the value of m:

1.1907

OUTPUT WAVEFORM:

PROGRAMS | MATLAB | MATLB PROGRAMS | MATLAB PROGRAMS CODE | MATLAB SIMULATION PROGRAMS | SIMULATION | PID CONTROLLER | PID CONTROLLER MATLAB PROGRAM |PID CONTROLLER USING MATLAB