Simple PI Controller (MATLAB)
Simple PI Controller (MATLAB)
Simple PI Controller
30 Oct 2014
By C R Rakesh, AE11B026
Problem 1: KI = 0
Let us consider the case of Vref as a constant (= 200) w.r.t time and Vi = 100
0.01 0.4 (The necessary changes can be made in the GUI): It is seen that the value of
V asymptotically reaches a steady state value. The steady state value then increases with
increase in KP. Hence, for KP in the above mentioned range, the gap between the steady state
value and Vref decreases with increase in KP. A sample graph is shown below (KP = 0.09):
0.5 0.75, then the change in V is also high ( ~ ), hence V may overshoot Vref. But
since KI is zero, there is no smooth correction to Vref, but an abrupt jump is observed. This
may cause enormous loads on the aircraft. A sample graph for this case is shown (KP = 0.7).
The overshoot is not smoothly brought back to Vref when KI = 0.
AE11B026
Page 2 of 10
KP 0.8: In this case, the overshoots grow and the system state diverges. The overshoot is
too large that the system oscillates very strongly. Such a control should not be used. Sample
graph (KP=1):
Problem 2: Different values of KP and KI: We shall explore the addition of KI into the above 3 cases
and see if KI solves any of the above problems.
KP = 0.09, KI = 0.1: We give a low KI to start with and observe that the velocity now
overshoots Vref slightly, but the overshoot dies down because of KI. But, it should be noted
that the steady state value (reached after some finite time) is now exactly equal to Vref
(confirmed from numerical values). This compensates the disadvantage of a purely
proportional controller. It should be noted that the overshoot die-down is gradual and not
abrupt.
AE11B026
Page 3 of 10
As KI increases, the number of overshoots increase, but the time at which steady state value
(Vref) is reached decreases, i.e., the overshoot die-down is more abrupt than when KI is low.
Note in the figure below that Vmax is higher (KI = 10)
KP = 0.7, KI = 0 to 10: Earlier, we said that for KI = 0, we observed oscillations till a particular
time, and which had very high frequency, i.e., abrupt changes in state of the system. For this
case, when you increase KI, it is seen that the frequency reduces, but the time till which the
oscillations persist increase. Also, at very high values of KI, the final steady state value of
velocity is equal to Vref.
AE11B026
Page 4 of 10
KP = 0.78, KI from 0 to 10: For low values of KI, we observe a graph similar to above. But,
as KI increases, something strange happens:
AE11B026
Page 5 of 10
AE11B026
Page 6 of 10
Note that the values of KI in the last 5 graphs dont differ by much. Yet the responses are
wildly different. In fact, in the last graph, the system is diverged very badly (Note the y axis)
After increasing KI further, it is seen that the system has truly diverged (Nan encountered):
Hence, we conclude that for certain values of KP, the system is very sensitive to KI. Does
there exist some sort of resonance that these values seem to be triggering?
AE11B026
Page 7 of 10
KP = 1, KI from 0 to 10: For low values of KI itself, the system diverges as so:
The response (on increasing KI) is similar to the last graph in the previous section (when KP
= 0.78 and KI = high). The only difference is that the value of KI at which the system truly
diverges (i.e., Nan encountered numerically) reduces when KP is high.
Some additional responses: It can be seen from the GUI that this code was built for a generic case
when Vref can vary with time. In this section, we show that if the PI controller is tuned properly, the
system can achieve any reference state. The response on changing KP and KI can be played around
with in the GUI.
Sine variation:
AE11B026
Page 8 of 10
Cosine variation:
Ramp
AE11B026
Page 9 of 10
Square
Sawtooth
Rectangular pulse
AE11B026
Page 10 of 10
Triangular Pulse
Conclusion: PI controller is a versatile tool for ensuring that the system state comes close to the
required state as soon as possible. The tuning method seems to be arbitrary but the general
consensus is that a higher value of KP and KI cause the system to diverge and a very low values of
both parameters are insufficient to bring the system state to the required state. The system dynamics
too play a vital role in deciding the response of the system. But it is seen that the PI controller too
has a very vital role in the final system response, sometimes it can be used to get a required system
response regardless of the system dynamics.
That is, in the above example, the system parameters are the constants A and B; It can be shown that
mild changes in A and B can have little effect on the final system response, if KI and KP are chosen
appropriately.
This process is called the PI controller tuning, on which significant care/time has to be taken.
AE11B026