Exp 10
Exp 10
To design PI, and PID controllers and evaluate their closed loop performance.
APPARATUS:
FORMULA/THEORY:
A controller is a mechanism that seeks to minimize the difference between
the actual value of a system (i.e., the process variable) andthe desired value
of the system (i.e., the setpoint). Controllers are afundamental part of control
engineering and used in all complex control systems. Some of the uses are:
o Controllers improve the steady-state accuracy by decreasing the
steady state error. As the steady-state accuracy improves,the stability
also improves.
o Controllers also help in reducing the unwanted offsets produced by
the system, while reducing the noise signalsproduced by the system.
o Controllers can help to speed up the slow response of anoverdamped
system.
Controllers are of different types, but the most common and popular one is
theProportional-Integral-Derivative (PID) controller. The general form of a
PID controller in s-domain is as follows:
where Kp, Kd and Ki are the gain constants of the different elements.
1. Proportional Control:
�
Consider the below block diagram, where is the system that needs to be
1+��
controlled and τ is the system time constant. The closed loop transfer
function of the above system is:
And the system response c(t) for a unit step input is:
1
By using proportional control, the time response improves by a factor of
1+���
which is good for the system, but we get a steady state offset between
the desired response and the output response. This can be reduced by
increasing the gain of the controller, but it introduces oscillations.
2. Integral Control:
Closed loop block diagram of a system with only integral controller action is
given by:
1
Where �� = . The closed loop transfer function of this system is given by:
��
With integral control, order of system increases by one. For a step input,
using the above transfer function, the steady state error turns out to be
zero. Thus, a major advantage of the I-controller is that it eliminates
steady state error, but the output response is generally slow and
oscillatory.
1
Where �� = . From the discussions of P and I controllers, a PI controller
��
provides dual advantages of fast response due to P-action and the zero
steady state error due to I-action.
By varying ��, it is possible to vary the damping ratio of the system
Unless the parameters are carefully chosen, a controller may cause instability to the
closed loop system. It is not always necessary that all the features of proportional,
derivative, and integral actions should be incorporated in the controller. In fact, in
most of the cases, a simple P-I structure will suffice.
2. Integral Control:
It does not exhibit steady state error but is relatively slow responding. It is
particularly effective for: fast process, with high noise level, process
dominated by dead time, high order system with all-time constants of the
same magnitude.
Step 4:
Determine open loop transfer function of compensated system.
Step 1:
Determine the dominant pole �d and calculate its magnitude and phase:
Step 2:
For PI controller:
Determine �i from the specified error constant, such that the compensated
system meets the error requirement.
Calculate the parameter �D and �P using the following equations
Step 4:
Determine open loop transfer function of compensated system
Questions Given:
1. Consider a unity feedback system with open loop transfer function G(s) =
100/(s+1)(s+2)(s+5). Design a PI controller, so that the phase margin of the
system is 60° at a frequency of 0.5 rad/sec.
2. Consider a unity feedback system with open loop transfer function G(s) =
4/(s+1)(s+5). Design a PI controller so that the closed loop has a damping ratio
of 0.9 and natural frequency of oscillation as 2.5 rad/sec.
3. Consider a unity feedback system with open loop transfer function G(s) =
75/(s+1)(s+3)(s+8). Design a PID controller to satisfy the following
specifications
(a) steady state error for unit ramp input should be less than 0.08,
(b) Damping ratio = 0.8
(c) Natural frequency of oscillation = 2.5 rad/sec.
MATLAB CODE:
For 1st question:
>> PM1=3.14+(theta1)
>> theta2=PM-PM1
%determining constants
>> Ki=(-w*sin(theta2))/M1
>> Kp=cos(theta2)/M1
>> contr=pid(Kp,Ki)
>> OL=contr*G
>> figure(1)
>> step(feedback(G,1))
>> hold on
>> step(feedback(OL,1))
>> legend('Without controller', 'With controller')
>> figure(2)
>> subplot 211
>> rlocus(OL)
>> title('Root Locus of G(s)')
>> subplot 212
>> rlocus(G)
>> title('Root locus of compensated system')
>> e=0.9;
>> w=2.5;
>> s=tf('s');
>> G=4/((s+1) *(s+5));
%Dominant pole
>> Ki=(-M1*sin(theta2)/(M2*sin(theta1)))
>> Kp=(-sin(theta2+theta1)/(M2*sin(theta1)))-(2*Ki*cos(theta1)/M1)
%Finding the TF
>> cont=pid(Kp,Ki)
>> OL1=G*cont
>> figure(1)
>> step(feedback(G, 1))
>> hold on
>> step(feedback(OL, 1))
>> legend('No controller', 'With controller')
>> figure(2)
>> subplot 211
>> rlocus(OL)
>> title('Root Locus of G(s)')
>> subplot 212
>> rlocus(G)
>> e=0.8;
>> ess=0.08;
>> w=2.5;
>> s=tf('s');
>> G=75/((s+1)*(s+3)*(s+8));
%Dominant pole
>> sd1=-e*w+j*w*sqrt(1-e^2)
>> sd2=-e*w-j*w*sqrt(1-e^2)
>> M1=abs(sd1)
>> theta1=angle(sd1)
>> G1=75/((sd1+1)*(sd1+3)*(sd1+8));
>> M2=abs(G1)
>> theta2=angle(G1)
>> Kv=1/ess
>> Ki=Kv/3.125
>> Kd=(sin(theta2)/(M1*M2*sin(theta1)))+(Ki/M1^2)
>> Kp=(-sin(theta2+theta1)/(M2*sin(theta1)))-(2*Ki*cos(theta1)/M1)
%Finding the TF
>> cont=pid(Kp,Ki,Kd)
>> OL=G*cont
>> figure(1)
>> step(feedback(G, 1))
>> hold on
>> step(feedback(OL, 1))
>> legend('No controller', 'With controller')
>> figure(2)
>> subplot 211
>> rlocus(OL)
>> title('Root Locus of G(s)')
>> subplot 212
>> rlocus(G)
>> title('Root locus of compensated system')
INFERENCE:
From the observations, a PI/PID controller always makes the steady state
error vanish.
From the plots obtained, the system’s closed loop step response reaches steady
state more quickly, except in the case of controller 2, where the design
specification led to the settling time being higher than the uncompensated
system.
From the Bode plot of controller 1, we can see that the design specification of
phase margin has been met, thus, the controller is functioning properly.
From the root locus plots of the compensated and uncompensated systems, we
can see that the addition of the poles/zeros by the controller pulls the rootlocus
towards the left so that it can accommodate the necessary gains.
The step responses inform us about the closed loop performance of the system.
The primary goal of any system is to obtain the desired response, i.e.,the input.
More the system is close to the input, more closed loop stable it is.
RESULT: