Sei sulla pagina 1di 7

LAB No.

7
INTRODUCTION TO PID CONTROLLER
CONTROLLER
Controller is a device, which monitors and physically alters the operating
conditions of a given dynamical system.
PID CONTROLLER
A proportional-integral-derivative controller (PID controller) is a control loop
feedback mechanism (controller) widely used in industrial control systems
(Programmable Logic Controllers, SCADA systems, Remote Terminal Units
etc). A PID controller calculates an "error" value as the difference between a
measured process variable and a desired set point. The controller attempts
to minimize the error in outputs by adjusting the process control inputs.

Transfer function=U/e=kp +kI /s+ kDs


U=Kp e(t) +KI e(t) +KD de(t)/dt

Kp = Proportional gain
KI = Integral gain
Kd = Derivative gain

Proportional gain
The proportional term produces an output value that is proportional to the
current error value. The proportional response can be adjusted by multiplying
the error by a constant Kp, called the proportional gain constant.
The proportional term is given by: P(out)= Kp e(t)
A high proportional gain results in a large change in the output for a given
change in the error. If the proportional gain is too high, the system can
become unstable (see the section on loop tuning). In contrast, a small gain
results in a small output response to a large input error, and a less
responsive or less sensitive controller. If the proportional gain is too low, the
control action may be too small when responding to system disturbances.
Tuning theory and industrial practice indicate that the proportional term
should contribute the bulk of the output change.

Integral gain
The contribution from the integral term is proportional to both the magnitude
of the error and the duration of the error. The integral in a PID controller is
the sum of the instantaneous error over time and gives the accumulated
offset that should have been corrected previously. The accumulated error is
then multiplied by the integral gain and added to the controller output.
The integral term is given by:

I(out)=KI e(t)

The integral term accelerates the movement of the process towards setpoint
and eliminates the residual steady-state error that occurs with a pure
proportional controller. However, since the integral term responds to
accumulated errors from the past, it can cause the present value to
overshoot the setpoint value (see the section on loop tuning).
Derivative gain
The derivative of the process error is calculated by determining the slope of
the error over time and multiplying this rate of change by the derivative gain
Kd. The magnitude of the contribution of the derivative term to the overall
control action is termed the derivative gain, Kd.
The derivative term is given by: D(out)= KD de(t)/dt
Derivative action predicts system behavior and thus improves settling time
and stability of the system.[8][9] An ideal derivative is not causal, so that
implementations of PID controllers include an additional low pass filtering for
the derivative term, to limit the high frequency gain and noise.[10]
Derivative action is seldom used in practice though - by one estimate in only
20% of deployed controllers[10] - because of its variable impact on system
stability in real-world applications

MATLAB CODING AND RESULTS


FOR OPEN LOOP SYSTEM
Code
sys=tf([1],[1 10 20])
step(sys)
stepinfo(sys)

Results
Transfer function:
1
--------------s^2 + 10 s + 20
RiseTime: 0.8848
SettlingTime: 1.5899
SettlingMin: 0.0454
SettlingMax: 0.0500
Overshoot: 0
Undershoot: 0
Peak: 0.0500
PeakTime: 3.7956
PROPORTIONAL CONTROLLER:
Code
sys=tf([1],[1 10 20])
kp=300

sys1=feedback(kp*sys,1)

t=0:0.01:2;
step(sys1,t)
stepinfo(step(sys1,t))
Results
kp =300
Transfer function:
300
---------------s^2 + 10 s + 320
ans =
RiseTime: 7.2828
SettlingTime: 78.2521
SettlingMin: 0.7874
SettlingMax: 1.3126
Overshoot: 40.0089
Undershoot: 0
Peak: 1.3126
PeakTime: 19
COMMENTS:
It reduces rise time, steady
state error and settling time
but overshoot increases due
to it.
P-D CONTROLLER

Code:
sys=tf([1],[1 10 20])
kp=300
kd=10
c=tf([kd kp],1)

sys2=feedback(c*sys,1)
t=0:0.01:2;
stepinfo(step(sys2,t))
Results
kp = 300

step(sys2,t)

kd = 10
Transfer function:
10 s + 300
---------------s^2 + 20 s + 320
RiseTime: 7.7859
SettlingTime: 29.9722
SettlingMin: 0.8651
SettlingMax: 1.0814
Overshoot: 15.3445
Undershoot: 0
Peak: 1.0814
PeakTime: 18
COMMENTS:
It reduces overshoot
and settling time and
has small effect on rise
time and steady state
error.
P-I CONTROLLER

CODE:
sys=tf([1],[1 10 20])

kp=30

c=tf([kp ki],[1 0])

sys3=feedback(c*sys,1)

t=0:0.01:2;

step(sys3,t)

Results
kp = 30
ki = 70
Transfer function:

ki=70

30 s + 70
--------s
Transfer function:
30 s + 70
-----------------------s^3 + 10 s^2 + 50 s +
70
RiseTime: 40.5740
SettlingTime: 62.2310
SettlingMin: 0.8999
PeakTime:
82
SettlingMax: 1.0126
Overshoot:
1.5208
Undershoot: 0
Peak: 1.0126
COMMENTS:
PI controller eliminates steady state error
PID- CONTROLLER:
Code:
kp=350

ki=300
kd=50

sys=tf([1],[1 10 20])
sys4=feedback(c*sys,1)
step(sys4,t)
Result
kp =350
ki =300

c=tf([kd kp ki],[1 0])


t=0:0.01:2;
stepinfo(step(sys4,t))

kd = 50
Transfer function:
50 s^2 + 350 s + 300
-------------------s
Transfer function:
50 s^2 + 350 s + 300
-------------------------s^3 + 60 s^2 + 370 s + 300
RiseTime: 5.2835
SettlingTime: 57.1505
SettlingMin: 0.9072

SettlingMax: 0.9935

Overshoot: 0

Undershoot: 0

Peak: 0.9935

PeakTime: 201

COMMENTS:
No overshoot
Minimum rise time
SUMMARY

No steady state error

Potrebbero piacerti anche