Ipcc Pi PD
Ipcc Pi PD
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
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
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
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
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)
OUTPUT
Example 1
sys =
1
-------------
s^2 + 2 s + 1
sys2 = 10 s + 10
---------------
s^3 + 2 s^2 + s
G2 = 10 s + 10
-----------------------
s^3 + 2 s^2 + 11 s + 10
k=1
Example 2
sys =
1
-------
s^2 + s
sys2 =
100 s + 10
----------
s^3 + s^2
100 s + 10
----------------------
s^3 + s^2 + 100 s + 10
k=
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;
OUTPUT
Example 1
sys = 1
-------------
s^2 + 2 s + 1
Continuous-time transfer function.
sys1 =
10 s + 10
-------------
s^2 + 2 s + 1
G1 =
10 s + 10
---------------
s^2 + 12 s + 11
Example 2
sys =
1
-------
s^2 + s
sys1 =
0.01 s + 100
------------
s^2 + s
G1 =
0.01 s + 100
------------------
s^2 + 1.01 s + 100