0% found this document useful (0 votes)
27 views12 pages

Exp 10

Uploaded by

Jerin Samuel
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)
27 views12 pages

Exp 10

Uploaded by

Jerin Samuel
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/ 12

AIM:

To design PI, and PID controllers and evaluate their closed loop performance.

APPARATUS:

S.no Software Version


1. MATLAB R2021

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:

The system response is given below:

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.

3. Proportional - Integral (PI) control:

Closed loop block diagram of a system with only a PI controller action is


givenby:

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

4. Proportional Derivative (PD) Control:

For higher order processes, a PD controller improves the stability of the


system. It also improves transient response of the system.

5. Proportional-Integral-Derivative (PID) Control:

It is clear from above discussions that a suitable combination of


proportional,integral, and derivative actions can provide all the desired
performances of a closed loop system. The transfer function of a P-I-D
controller is given by:
The order of the controller is low, but this controller has universal applicability; it
can be used in any type of SISO system. However, for properuse, a controller must be
tuned for a particular process; i.e., selection of P, I, D parameters are especially
important and process dependent.

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.

Guideline for selection of controller mode:


1. Proportional Controller:

It is simple regulating type; tuning is easy. But it normally introduces steady


state error. It is recommended for process transfer functions having a pole at
origin, or for transfer functions having a single dominating pole; for example,
with:

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.

3. Proportional plus Integral (P-I) Control:

It does not because offset associated with proportional control. It also


yields much faster response than integral action alone. It is widely used for
process industries for controlling variables like level, flow, pressure, etc.,
those do not have large time constants.

4. Proportional plus Derivative (P-D) Control:

It is effective for systems having large number of time constants. It results


in a more rapid response and less offset than is possible by pure
proportional
control. But one must be careful while using derivative action in control of
fast processes, or if the measurement is noisy (ex: flow measurement).
5. Proportional plus Integral plus Derivative (P-I-D) Control:

It finds universal application. But proper tuning of the controller is


difficult. It is particularly useful for controlling slow variables, like pH,
temperature, etc. in process industries.

DESIGNING A PI/PID CONTROLLER ACCORDING TO GIVEN


SPECIFICATIONS:
The most common way of tuning a P/PI/PID controller is using Ziegler-
Nichol’s technique, but that method cannot be used if design specifications
are given.
Two types of specifications can be given:
 In frequency domain, like phase margin
 In time domain, like damping ratio, steady state error
We employ two different methods of design depending on the type of
specification given.
For frequency domain specifications:
When the phase margin and gain crossover frequency are the design
parameters, the following steps are followed:
Step 1:
Determine magnitude and phase of uncompensated open loop sinusoidal
transfer function G(jw)
��� ∅d �ℎ� ������� �ℎ��� ������ �� ���� ��������� ��������� �1.
��� �1 = |(��)| �� � = �1 ��� ∅1 = ∠�(��) �� � = �1
Step 2:
Determine the phase margin of uncompensated system and the angle to be
contributed by the controller to achieve the desired phase margin.
��� ∅u − �ℎ��� ������ �� ������������� ������ ��� � − �ℎ��� ����� ��
���������� �� � = �1
Now, ∅u = 180° + ∅1 ��� � = ∅d − ∅u.
Step 3:
Determine the Transfer function of the controller.
For a PI controller:

Step 4:
Determine open loop transfer function of compensated system.

For time domain specifications:


When the damping ratio �, error constant and natural frequency �d are the
design parameters, the following steps are followed:

Step 1:

Determine the dominant pole �d and calculate its magnitude and phase:

By considering the dominant pole

Step 2:

Determine magnitude and phase of G(s) at �=�d.


Step 3:
Determination of transfer function of PI/PID controller

For PI controller:

For PID 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:

>> PM=60/57; %60 degrees converted to radians


>> w=0.5;
>> s=tf('s');
>> G=10/((s+1)*(1+0.5*s)*(1+0.2*s))
>> G1=10/((j*w+1)*(1+0.5*j*w)*(1+0.2*j*w))
>> M1=abs(G1)
>> theta1=(angle(G1))

%finding phase margin and theta2

>> 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')

For 2nd question:

>> e=0.9;
>> w=2.5;
>> s=tf('s');
>> G=4/((s+1) *(s+5));

%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)

%Magnitude and Phase of G(s) at s=sd

>> G1=4/((sd1+1) *(sd1+5));


>> M2=abs(G1)
>> theta2=angle(G1)

%Determining the constants

>> 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)

>> title('Root locus of compensated system')

For 3rd question:

>> 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)

%Magnitude and Phase of G(s) at s=sd

>> G1=75/((sd1+1)*(sd1+3)*(sd1+8));
>> M2=abs(G1)
>> theta2=angle(G1)

%Determining the constants

>> 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:

You might also like