Department of Mechanical Engineering
ME 306: Instrumentation and Control
Engineering Report
Name ID:
Ghaliah Alhariri 211091,
Haifa alblehed 221226,
Shoug alsanousi 221032,
Sara alzamel 221277
Click on the link below to access MAtlab
[Link]
[Link]
1
PID Control is a feedback control technique that uses the error between the desired and actual
value and plays around with this error using some gains to achieve the final response much closer
to the desired value. PID control has three components: proportional, derivative and integral.
Proportional part of the PID controller adjusts according to the error value and multiplies with it.
Overall, it decreases the settling time and rise time and has a quick response to deviations in
reference values. It also tries to reduce the steady state error in the system. However, it generates
overshoot and oscillations in the system.
Derivative part of the PID controller adjusts according to the rate of change of error values and
multiplies with it a gain Kd. Overall, it improves system stability and reduces the initial overshoot
and oscillations induced in the system. However, it results in amplification of noise as it has a
derivative term.
Integral part of the PID controller adjusts according to the error accumulated over time and
multiplies with it a gain Ki. Overall, it rectifies steady state error in the system based on the history
of the error and tries to reduce the system to the desired values. However, it might shake up the
saturation levels due to accumulation over time.
2
In order to find the modeling equation, we apply the newton’s law which says that the net forces
result in an acceleration in the system. The modeling equation is derived below.
𝛴𝐹 = 𝑚𝑎
𝐹 − kx − b𝑥̇ = 𝑚𝑥̈
𝑚ẍ + bẋ + kx = F (1)
Force F acts rightwards so spring and damping force resist this movement and act leftwards and
hence the derivation results the equation of motion as seen by Equation 1.
To find the transfer function, we can apply Laplace transform to equation 1. The resultant transfer
function can be seen in Equation 2 below.
𝐹(𝑠) = 𝑚𝑠 2 𝑥(𝑠) + 𝑏𝑠𝑥(𝑠) + 𝑘𝑥(𝑠)
𝐹(𝑠) = 𝑥(𝑠)(𝑚𝑠 2 + 𝑏𝑠 + 𝑘)
𝑥(𝑠) 1
= 2 (2)
𝐹(𝑠) 𝑚𝑠 +𝑏𝑠+𝑘
Block Diagram:
3
4
Response Graph:
5
The graph as plotted from data points in MATLAB is as below.
1). Final Value as seen in the graph above is 0.05.
1−0.05
2). Steady State error = 1 ∗ 100 = 𝟗𝟓%.
3). Rise Time = Time for reaching 90% of final value – Time for reaching 10% of final value = 2
– 1.11 = 0.89 seconds.
4). Settling Time = Time for reaching within ±2% of the final value = 2.59 - 1 = 1.59 seconds
from the graph above.
Adding a proportional control to the system results in a closed loop system. It allows to improve
the response of the system. The feed forward gain becomes:
1
𝐺𝑓𝑜𝑟𝑤𝑎𝑟𝑑 = 𝐾𝑝 ∗ 2
𝑠 + 10𝑠 + 20
𝐾𝑝
𝐺𝑓𝑜𝑟𝑤𝑎𝑟𝑑 =
𝑠2 + 10𝑠 + 20
6
The closed loop equation becomes: -
𝐾𝑝
𝐺𝐶𝑙𝑜𝑠𝑒𝑑 𝐿𝑜𝑜𝑝 = 𝑠2
+ 10𝑠 + 20
𝐾𝑝
1+ 2
𝑠 + 10𝑠 + 20
𝐾𝑝
𝐺𝐶𝑙𝑜𝑠𝑒𝑑 𝐿𝑜𝑜𝑝 𝑠2
= 2 + 10𝑠 + 20
𝑠 + 10𝑠 + 20 + 𝐾𝑝
𝑠 2 + 10𝑠 + 20
𝐾𝑝
𝐺𝐶𝑙𝑜𝑠𝑒𝑑 𝐿𝑜𝑜𝑝 =
𝑠2
+ 10𝑠 + 20 + 𝐾𝑝
Standard form of closed loop second order system is:
𝑤𝑛 2
𝐺𝑠𝑦𝑠𝑡𝑒𝑚 =
𝑠 2 + 2𝛿𝑤𝑛 𝑠 + 𝑤𝑛 2
In order to find the value of Kp that improves the response and helps achieve the required natural
frequency wn = 17.89 rad/s, we can equate 𝐺𝑠𝑦𝑠𝑡𝑒𝑚 with 𝐺𝐶𝑙𝑜𝑠𝑒𝑑 𝐿𝑜𝑜𝑝 as we designed it. By doing
the above, we can see that Kp is roughly equal to the square of the natural frequency. Therefore,
Kp = 17.89 * 17.89 = 320.0521.
The new transfer function becomes: -
320.05
𝐺𝐶𝑙𝑜𝑠𝑒𝑑 𝐿𝑜𝑜𝑝 =
𝑠 2 + 10𝑠 + 340.05
Block Diagram:
7
Graph:
8
The graph as plotted from data points in MATLAB is as below.
1.32727−0.9411
1). Percentage Overshoot = ∗ 100 = 𝟒𝟏%
0.9411
1−0.9411
2). Final Value as seen in the graph above is 0.9411. Steady State error = ∗ 100 =
1
𝟓. 𝟖𝟗%.
3). Rise Time = Time for reaching 90% of final value – Time for reaching 10% of final value =
0.098 – 0.026 = 0.072 seconds.
4). Settling Time = Time for reaching within ±2% of the final value = 1.05337 seconds from the
graph above.
The comparison between the open loop response and response with Kp controller is shown in
the Table below.
Property Open Loop system System with proportional
controller
Percentage Overshoot (%) 0 41
Final Value 0.05 0.9411
Steady state error (%) 95 5.89
Rise Time (seconds) 0.89 0.072
Settling Time (seconds) 1.59 1.05337
The open loop system has no overshoot but it has high steady state error and system takes much
more time to settle to the final value. In contrast, the closed loop system with only proportional
controller has much lower steady state error and is much quick in settling to the final value.
However, it induces some initial overshoot in the system before settling to the final value.
9
Adding a proportional derivative control to the system results in a closed loop system. It allows to
improve the response of the system. The feed forward gain becomes:
1
𝐺𝑓𝑜𝑟𝑤𝑎𝑟𝑑 = (𝐾𝑝 + 𝐾𝑑 𝑠) ∗ 2
𝑠 + 10𝑠 + 20
𝐾𝑝 + 𝐾𝑑 𝑠
𝐺𝑓𝑜𝑟𝑤𝑎𝑟𝑑 =
𝑠2 + 10𝑠 + 20
The closed loop equation becomes: -
𝐾𝑝 + 𝐾𝑑 𝑠
𝑠 2 + 10𝑠 + 20
𝐺𝐶𝑙𝑜𝑠𝑒𝑑 𝐿𝑜𝑜𝑝 =
𝐾𝑝 + 𝐾𝑑 𝑠
1+ 2
𝑠 + 10𝑠 + 20
𝐾𝑝
𝐺𝐶𝑙𝑜𝑠𝑒𝑑 𝐿𝑜𝑜𝑝 = 2 𝑠2
+ 10𝑠 + 20
𝑠 + 10𝑠 + 𝐾𝑑 𝑠 + 20 + 𝐾𝑝
𝑠 2 + 10𝑠 + 20
𝐾𝑝
𝐺𝐶𝑙𝑜𝑠𝑒𝑑 𝐿𝑜𝑜𝑝 =
𝑠2
+ (10 + 𝐾𝑑 )𝑠 + (20 + 𝐾𝑝
Standard form of closed loop second order system is:
𝑤𝑛 2
𝐺𝑠𝑦𝑠𝑡𝑒𝑚 =
𝑠 2 + 2𝛿𝑤𝑛 𝑠 + 𝑤𝑛 2
In order to find the value of Kp that improves the response and helps achieve the required natural
frequency wn = 17.89 rad/s, we can equate 𝐺𝑠𝑦𝑠𝑡𝑒𝑚 with 𝐺𝐶𝑙𝑜𝑠𝑒𝑑 𝐿𝑜𝑜𝑝 as we designed it. By doing
the above, we can see that Kp is roughly equal to the square of the natural frequency. Therefore,
Kp = 17.89 * 17.89 = 320.0521. And 2𝛿𝑤𝑛 = 10 + 𝐾𝑑
2(0.56)(17.89) = 10 + 𝐾𝑑
𝐾𝑑 = 20.0368 − 10 = 10.0368
The new transfer function becomes: -
320.05
𝐺𝐶𝑙𝑜𝑠𝑒𝑑 𝐿𝑜𝑜𝑝 =
𝑠2 + 20.0368𝑠 + 340.05
10
Block Diagram:
Graph:
11
Block Diagram:
Graph:
12