PID Lec13
PID Lec13
Control
The Design of Feedback Control Systems
What is a control system? Why do we need
it?
On-Off Control
ERROR = SP - PV
●P – Sometimes used
●PI - Most often used
●PID – Sometimes used
●PD – Very rare, useful for controlling servomotors.
Proportional Control
A proportional controller attempts to perform better than the On-off type by
applying power in proportion to the difference in temperature between the
measured and the set-point. As the gain is increased the system responds faster to
changes in set-point but becomes progressively underdamped and eventually
unstable. The final temperature lies below the set-point for this system because
some difference is required to keep the heater supplying power.
The P-Control
In Proportional Only mode, the
controller simply multiplies the
Error by the Proportional Gain
(Kp) to get the controller output.
Controller Output(COI) = KI ∫e dτ
CO = COP + COI
Time
The PI-control
As e(t) grows or shrinks, the amount
added to CO grows or shrinks
immediately and proportionately. The
past history and current trajectory of the
controller error have no influence on
the proportional term computation.
Lastly, please keep in mind that you do not need to implement all three controllers
(proportional, derivative, and integral) into a single system, if not necessary. For
example, if a PI controller gives a good enough response (like the above
example), then you don't need to implement derivative controller to the system.
Keep the controller as simple as possible.
Tuning a PID Controller
Tuning a control loop is the adjustment of its control parameters (gain/proportional
band, integral gain/reset, derivative gain/rate) to optimum values for a target
response.
num=1;
den=[1 10 20];
step(num,den)
1
G( s )
2
s 10s 20
Response to Unit step
of a P controller
Proportional Control - Example
MATLAB Example
Step Response
From: U(1)
1.4
1.2
Kp=300; 1
Step Response
From: U(1)
1
num=[Kp];
Amplitude
0.8
To: Y(1)
0.9
0.6
0.8
0.6
t=0:0.01:2;
Amplitude
0.2
To: Y(1)
0.5
0
K=300 0.4 K=100
step(num,den,t) 0 0.2 0.4 0.6 0.8 1
Time (sec.)
1.2 1.4 1.6 1.8
0.3
2
0.2
Kp
T( s ) 0.1
2 0
s 10 s ( 20 Kp )
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2
Time (sec.)
Response to Unit step
of an I controller
Response to Unit step
of a D controller
Proportional - Integral - Example
The integral controller (Ki) decreases the rise time, increases both
the overshoot and the settling time, and eliminates the steady-state
error Kp s Ki
T( s )
3 2
MATLAB Example s 10 s ( 20 Kp ) s Ki
Step Response
From: U(1)
1.4
Kp=30;
1.2
Step Response
From: U(1)
1 1.4
Ki=70;
Amplitude
1.2
0.8
To: Y(1)
1
0.6
num=[Kp Ki];
Ki=70
Amplitude
0.8
To: Y(1)
0.4
0.4
0
Time (sec.)
1.2 1.4 1.6 1.8
0.2
2
Ki=100
0
Time (sec.)
1.2 1.4 1.6 1.8 2
Proportional - Derivative - Example
The derivative controller (Kd) reduces both the overshoot and the
settling time.
Kd s Kp
T( s )
MATLAB Example 2
s ( 10 Kd ) s ( 20 Kp )
Step Response
From: U(1)
1.4
1.2
Kd=10;
Amplitude
0.8
To: Y(1)
0.9
0.6 0.8
Kd=10
0.4
0.6
Amplitude
den=[1 10+Kd 20+Kp];
To: Y(1)
0.2 0.5
0.4
0
t=0:0.01:2;
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2
0.3
Time (sec.)
0.2
Kd=20
step(num,den,t) 0.1
0
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2
Time (sec.)
Example - Practice