PID Controller
Proportional-Integral-Derivative (PID), commonly known as a "three-term" controller, is
one of the most widely used control strategies in modern industry. Each of controllers has
a task as following description below [9]:
Proportional: the error is multiplied by a gain 𝐾𝑝 . If the gain is set too high, the system may
become unstable; if it's too low, the system might respond too slowly or fail to correct the
error effectively. [10]
Integral: the integral of the error is taken and multiplied by a gain 𝐾𝑖 . This gain is tuned to
eliminate steady-state error within the desired timeframe. A too high gain may cause
oscillations and a too low gain may result in a sluggish response. [10]
Derivative: the derivative of the error is multiplied by a gain 𝐾𝑑 . If this gain is too high,
the system may oscillate; on the other hand, if it's too low, the system response will be
sluggish. Based on description above, it can be generalized that PID controller can improve
system response according to desired response that determined. The input of this controller
is the error value, and the output is the control signal sent to the actuator. In continuous-
time systems, the block diagram of the PID controller is illustrated in the figure below. [10]
                          Figure 1. Continuous-time PID controller
The control signal of a PID controller in time-domain can be expressed as:
                                                𝑡
                                                                𝑑𝑒(𝑡)
                     𝑢(𝑡 ) = 𝐾𝑝 𝑒(𝑡 ) + 𝐾𝑖 ∫ 𝑒(𝑡) 𝑑𝑡 + 𝐾𝑑             (1)
                                                                 𝑑𝑡
                                            0
                                                    𝐾𝑝
                                       𝐾𝑖 =            (2)
                                                    𝑇𝑖
                                      𝐾𝑑 = 𝐾𝑝 𝑇𝑑 (3)
Where 𝑢(𝑡 ) is the output from the controller and 𝑒(𝑡 ) = 𝑟(𝑡 ) − 𝑦(𝑡), in which 𝑟(𝑡 ) is the
desired set-point (reference input) and 𝑦(𝑡) is the plant output, 𝑇𝑖 and 𝑇𝑑 are know as the
integral and derivative action time, respectively. For digital microcontroller
implementation, PID controller should be in discrete-time domain. The control signal of
PID controller given by (1) is transformed to discrete-time PID controller as follow:
                                       𝑛
                                                             𝑒(𝑘𝑇) − 𝑒(𝑘𝑇 − 𝑇)
           𝑢(𝑘𝑇) = 𝐾𝑝 𝑒(𝑘𝑇) + 𝐾𝑖 𝑇 ∑ 𝑒(𝑘𝑇) + 𝐾𝑑                                (4)
                                                                     𝑇
                                      𝑘=1
Where 𝑢(𝑘𝑇) and 𝑒(𝑘𝑇) are control signal and error signal in discrete-time with T
sampling time.