0% found this document useful (0 votes)
14 views10 pages

Ipcc Pi PD

Uploaded by

Naveen Naveen
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views10 pages

Ipcc Pi PD

Uploaded by

Naveen Naveen
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

PRACTICAL COMPONENT OF IPCC

CONTROL SYSTEMS (BEC403) Sir MVIT


12A Implement PI Controllers.

Theory:-The PI (Proportional and Integral) controller is a commonly used method in control systems
to correct for error between the commanded setpoint and the actual value based on some type of
feedback.

A Proportional controller is used to reduce the rise time and speed up the response. This controller

makes no changes in the phase response of the plant.

A Derivative controller is required to minimise the transient errors like overshoot and oscillations in

the output of the plant. But this can create heavy instability in noisy environments. Be careful to use

smaller gain with this controller. It provides a phase

lead to the output when compared with the input. , usually with no change in magnitude.

An Integral controller corrects the time invariant errors. This provides a phase lag and no change in

magnitude in the output.

Department of Electronics and Communication 1


PRACTICAL COMPONENT OF IPCC
CONTROL SYSTEMS (BEC403) Sir MVIT

A PI controller helps in reducing both the rise time and the steady state errors of the system. To be

useful whenever you need to change magnitude and lag the phase together. Reduces rise time and

steady state errors. Changes the magnitude as well as lags the output.

A PD controller reduces the transients like rise time, overshoot, and oscillations in the output. Useful

for changing magnitude and want to add phase lead to the output. Reduces rise time and transient

errors such as overshoot, oscillations in output. Changes both the magnitude as well as adds a leading

phase to the output.

Department of Electronics and Communication 2


PRACTICAL COMPONENT OF IPCC
CONTROL SYSTEMS (BEC403) Sir MVIT

clc;
clear all;
close all;
% Define the PI controller gains
ki = 10;
kp = 10;
% Define the numerator and denominator of the PI controller transfer function
numI = [kp ki];
denI = [1 0];
% Define the system transfer function (Example)
% Replace `num` and `den` with your actual system transfer function coefficients
num = [1]; % Example numerator
den = [1 2 1]; % Example denominator
sys=tf(num,den)

% Convolve the denominator of the PI controller with the system's denominator


dr = conv(denI, den);
% Display the open-loop transfer function
disp('Transfer function for PI controller without feedback:');
sys2 = tf(numI, dr)
% Create the closed-loop transfer function with unity feedback
disp('Transfer function for PI controller with feedback:');
G2 = feedback(sys2, 1)
% Step response and plot
m=step(G2);

Department of Electronics and Communication 3


PRACTICAL COMPONENT OF IPCC
CONTROL SYSTEMS (BEC403) Sir MVIT
figure;
plot(m);
title('PI control Kp=10 and Ki=10');
xlabel('Time (seconds)');
ylabel('Amplitude');
% Calculate and display the DC gain of the closed-loop system
k = dcgain(G2)
disp(['DC gain of the closed-loop system: ', num2str(k)]);
grid on;

OUTPUT

Example 1
sys =

1
-------------
s^2 + 2 s + 1

Continuous-time transfer function.

Transfer function for PI controller without feedback:

sys2 = 10 s + 10
---------------
s^3 + 2 s^2 + s

Continuous-time transfer function.

Transfer function for PI controller with feedback:

G2 = 10 s + 10
-----------------------
s^3 + 2 s^2 + 11 s + 10

Continuous-time transfer function.

k=1

DC gain of the closed-loop system: 1

Department of Electronics and Communication 4


PRACTICAL COMPONENT OF IPCC
CONTROL SYSTEMS (BEC403) Sir MVIT

Example 2
sys =

1
-------
s^2 + s

Continuous-time transfer function.

Transfer function for PI controller without feedback:

sys2 =

100 s + 10
----------
s^3 + s^2

Continuous-time transfer function.

Transfer function for PI controller with feedback:

Department of Electronics and Communication 5


PRACTICAL COMPONENT OF IPCC
CONTROL SYSTEMS (BEC403) Sir MVIT
G2 =

100 s + 10
----------------------
s^3 + s^2 + 100 s + 10

Continuous-time transfer function.

k=

DC gain of the closed-loop system: 1

Department of Electronics and Communication 6


PRACTICAL COMPONENT OF IPCC
CONTROL SYSTEMS (BEC403) Sir MVIT
12B Implement PD Controllers.
clc;
clear all;
close all;
% Define the plant transfer function numerator and denominator
num = [1]; % Example plant numerator
den = [1 2 1]; % Example plant denominator
% PD controller parameters
sys=tf(num,den)

Kd = 10;
Kp = 10; % Assuming Kp = Kd for simplicity, you can change this as needed
% PD controller transfer function numerator (assuming D = Kd + Kp*s)
numc = [Kd Kp];
denomc = [1]; % PD controller denominator (assumed to be 1 for simplicity)
% Open-loop transfer function of the PD controller
nr = conv(num, numc);
disp('Transfer function for PD controller without feedback:');
sys1 = tf(nr, den)
% Closed-loop transfer function with unity feedback
disp('Transfer function for PD controller with feedback:');
G1 = feedback(sys1, 1)
% Step response
m = step(G1);
figure;
plot(m);
title('PD control Kp=10 and Kd=10');
xlabel('Time (seconds)');
ylabel('Amplitude');
grid on;

Department of Electronics and Communication 7


PRACTICAL COMPONENT OF IPCC
CONTROL SYSTEMS (BEC403) Sir MVIT

OUTPUT

Example 1

sys = 1
-------------
s^2 + 2 s + 1
Continuous-time transfer function.

Transfer function for PD controller without feedback:

sys1 =

10 s + 10
-------------
s^2 + 2 s + 1

Continuous-time transfer function.

Transfer function for PD controller with feedback:

G1 =

10 s + 10
---------------
s^2 + 12 s + 11

Continuous-time transfer function.

Department of Electronics and Communication 8


PRACTICAL COMPONENT OF IPCC
CONTROL SYSTEMS (BEC403) Sir MVIT

Example 2
sys =

1
-------
s^2 + s

Continuous-time transfer function.

Transfer function for PD controller without feedback:

sys1 =

0.01 s + 100
------------
s^2 + s

Continuous-time transfer function.

Transfer function for PD controller with feedback:

G1 =

Department of Electronics and Communication 9


PRACTICAL COMPONENT OF IPCC
CONTROL SYSTEMS (BEC403) Sir MVIT

0.01 s + 100
------------------
s^2 + 1.01 s + 100

Continuous-time transfer function.

Department of Electronics and Communication 10

You might also like