Project Matlab
Project Matlab
Project Matlab
Faculty of Engineering
School of Electrical and Nuclear Engineering
Fifth Year (Control)
Course of Computer Application 4
P PI PD PID
controllers
,
and
Prepared by:
Haitham Mohammed Ali Al-radhi
Number: 88
01-08-2016
1(t)
T(t)
2(t)
1(s)
1(s)
+ [(b1+b2)s + (k1+k2)]
2(s)
=0
.(2)
1(s)
[b1+ ]
2(s)
= T(s) (3)
-[b1+ ]
1(s)
+ [(b1+b2) +
2(s)
=0
.(4)
Now, we can write the equations using the electrical components where J=L, b=R,
k=1/c, T(s)=E(s), (s)=I(s) We get:
[Ls+ R1 +
]I1(s) [R1+
]I2(s) = 0
.(6)
e(t)
i1(t)
R1
R2
i2(t)
c1
c2
Fig.(2): The equivalent electrical circuit for our rotational mechanical system.
To simplify the operation, lets choose values for the components as follows:
J=1 kg.m2, b=1 N.m.s/rad, k=1N.m/rad, T=50 N.m
L=1H, R=1 , c=(1/k)=1 F, e=50v
.(8)
By solving the two equations (7),(8), either using the matrixes or the substituting,
we get the transfer function G(s)= I2(s)/E(s).
G(s)=
after simplification,
G(s) =
(a)
(b)
(c)
The DC gain of the closed loop transfer function (sys=
) is , so 0.5 is the
final value of the output to a unit step input. This corresponds to the steady-state
error of 0.5, quite large indeed.
4: P- Controller
Proportional controller contains a proportional gain serially connected to the
system plant. The main usage of the proportional (P) controller is to decrease (but
never eliminate) the steady state error of the system. Applying P controller
decreases the rise time. Increasing gain increases percent overshoot and number of
oscillations.
Figure (4) shows the simulink model, the m-file code and the step response
of the rotational mechanical system with P controller.
(a)
(b)
(c)
5: PI- Controller
Proportional-Integral controller contains a proportional gain and an integral
connected in parallel and the combination of them is connected serially to the
system plant. Using integral control makes the system type-one so, the steady-state
error due to a step input is zero. However, it has very poor transient response.
Using integral action increases the oscillations in the output of the closed loop
systems. Increasing ki increases overshoot and settling time making the system
response sluggish.
Figure (5) shows the simulink model, the m-file code and the step response of
the rotational mechanical system with PI controller.
(a)
(b)
(c)
6: PD- Controller
Proportional-Derivative controller contains a proportional gain and a derivative
controller connected in parallel and the combination of them is connected serially
to the system plant. Derivative action is usually used to improve transient response
of the closed loop system. Only D control is not used because it amplifies high
frequency noise which is never desired. Derivative action decreases the overshoot
and the settling time, and had a small effect on the rise time. However, it does not
have any effect on steady state performance of the closed loop.
Figure (6) shows the simulink model, the m-file code and the step response of
the rotational mechanical system with PD controller.
(a)
(b)
(c)
7: PID- Controller
Proportional-Integral-Derivative controller contains a proportional gain, a
derivative controller, as well as integral connected in parallel and the combination
of them is connected serially to the system plant. PID controllers are considered as
the best choice to control various plants. It has zero steady-state error, fast
response (short rise time), no oscillations and higher stability means acceptable
transient response. The only problem with PID control is tuning.
Figure (7) shows the simulink model, the m-file code and the step response of
the rotational mechanical system with PID controller.
(a)
(b)
(c)
8: Results
Control
type
-
Parameters
P
controller
PI
controller
PD
controller
PID
controller
kp=10
15.1
0.483
1.34
71.4
0.091
kp=10
ki=2
kp=10
kd=10
kp=10
ki=5.7
kd=10.6
24.4
0.499
1.35
67.8
2.38
0.286
0.814
10.9
0.091
1.49
0.346
0.907
3.97
Settling
Rising
time (sec) time (sec)
14.1
1.27
Peak
Over
time (sec) shoot (%)
3.32
44.3
Steadystate error
0.5
Important Notice:
As mentioned before that the problem with the controllers is the tuning
operation to find the best parameters. Fortunately, MATLAB has automatic tuning
option. However, automatic tuning does not usually provide the best results, it only
provides optimal results. P-I-D tuning is an engineering art and should be manually
done by control engineers. In this system the controllers parameters had chosen
manually.