Docsity

Simulink Implementation-Control Systems-Lab Reports, Exercises of Control Systems

Toggle sidebar
bg1
P a g e | 1
Lab 14: Working with PID Controller FA06_BET_012
Lab Task 1
Implement the system done in m-file and Simulink using PID block
The modeling Equation is:
F = Mx’’ + Bx’ + Kx
Suppose:
M = 1kg
B = 10 Ns/m
K = 20 N/s
% original transfer function
num1 = 1;
den1 = [1 10 20];
G1 = tf(num1 , den1)
figure, step(G1)
Matlab Code:
Calculations:
M
B
k
F
x
docsity.com
pf3
pf4
pf5

Partial preview of the text

Download Simulink Implementation-Control Systems-Lab Reports and more Exercises Control Systems in PDF only on Docsity!

Lab 14: Working with PID Controller FA06_BET_

Lab Task 1

Implement the system done in m-file and Simulink using PID block

The modeling Equation is:

F = Mx’’ + Bx’ + Kx

Suppose: M = 1kg B = 10 Ns/m K = 20 N/s

% original transfer function num1 = 1; den1 = [1 10 20]; G1 = tf(num1 , den1) figure, step(G1)

Matlab Code:

Calculations:

M

B

k

F

x

Lab 14: Working with PID Controller FA06_BET_

%P controlled transfer function kp = 300; num2 = [kp]; den2 = [1 10 20+kp]; G2 = tf(num2 , den2) figure, step(G2)

%PD controlled transfer function kp = 300; kd = 10; num3 = [kd kp]; den3 = [1 10+kd kp]; G3 = tf(num3 , den3) figure, step(G3)

%PI controlled transfer function kp = 30; ki = 70; num4 = [kp ki]; den4 = [1 10 20+kp ki]; G4 = tf(num4 , den4) figure, step(G4)

%PID controlled transfer function kp = 350; ki = 300; kd = 50; num5 = [kd kp ki]; den5 = [1 (10+kd) (20+kp) ki]; G5 = tf(num5 , den5) figure, step(G5)

Lab 14: Working with PID Controller FA06_BET_

Simulink:

Lab 14: Working with PID Controller FA06_BET_

Lab Task 2

Gp(s) =

Use Zingler-Nichols rule to control the given plant using P, PI, and PID controls. What difference it makes to an open loop system.

num = 1; den = [1 6 5 0]; G =tf(num,den) figure,step(G)

kc = 30; G3 = G * kc; H1= feedback(G3,1) figure, step(H1)

SISOTOOL:

Matlab Code:

Lab 14: Working with PID Controller FA06_BET_

ku = 30; pu = 2. kp = ku/2; G2 = kp*G; H2 = feedback(G2,1) figure, step(H2)

kp = ku/2.2; Ti = pu/1.2; ki = kp/Ti; T = tf([kp ki],[1 0]); G3 = T*G; H3 = feedback(G3,1) figure, step(H3)

kp = ku/1.7; Ti = pu/2; ki = kp/Ti; Td = pu/8;

kd = kpTd; T = tf([kd kp ki],[1 0]) G4 = TG; H4 = feedback(G4,1) figure, step(H4)

For P Controller:

For PI Controller:

For PID Controller: