Evaluation of Automatic Voltage Regulators PID Controller Coefficients Using Python
Evaluation of Automatic Voltage Regulators PID Controller Coefficients Using Python
Abstract—Python is a flexible programming tool for all kinds oscillations, (ii) Poor robustness. These severe issues are
of technological and engineering tasks of academicians, overcome by a PID controller tuned by Internal Model control
researchers, etc. The variations in the terminal voltage will affect concept. A closed-loop transfer function data is needed to
the relative power of the synchronous generator, these variations apply this tuning method. The PID coefficients are evaluated
in the terminal voltage will mitigate by controlling the generator analytically to reach the closed-loop set-point response with
field excitation. This goal will achieve with the help of an Automatic the desired response [5].
Voltage Regulator (AVR), but unfortunately, the AVR solely cannot
control the variations in terminal voltage effectively. It needs a Lots of closed-loop tuning methods are available
supplementary control like a PID controller to achieve the goal. In nowadays. In [6-7], the authors estimated the model of the
this research paper, the PID coefficients are evaluated, in a closed-loop system from the data by operating the PID
Python environment, using Good gain and Pattern search tuning controller block as P-controller, and then the controller is
algorithms (proposed tuning methods). The robustness of the
2021 IEEE Madras Section Conference (MASCON) | 978-1-6654-0405-1/21/$31.00 ©2021 IEEE | DOI: 10.1109/MASCON51689.2021.9563458
Authorized licensed use limited to: Sri Sivasubramanya Nadar College of Engineering. Downloaded on May 06,2022 at 06:36:40 UTC from IEEE Xplore. Restrictions apply.
voltage error signal. Now the error signal is amplified and fed Kg
as input to the field winding to increase the field excitation Gg(s) (4)
sτg 1
voltage as well as current. The increase in the field excitation
will increase the reactive power generation and results in raise In this work, for the design of various controllers, the
in the terminal voltage to the desired voltage profile. This nominal parameters are taken from [1]. The nominal values of
research work mainly focuses on the achievement of the desire the components of the AVR system are as shown in TABLE I.
voltage profile. TABLE I. NOMINAL PARAMETERS OF AVR SYSTEM
Range of nominal Proposed nominal
Component
values value
Exciter Amplifier Kvs : 1.0 Kvs = 1.0
Vref(t) Voltage Sensor
- τvs : 0.01 to 0.06sec τvs = 0.01 sec
If
Vf(t) Ka : 10 to 40 Ka = 10.0
Alternator Amplifier
τa: 0.02 to 0.1 sec Τa = 0.1 sec
(3-Ph) Voltage sensor with Ke : 1.0 to 10.0 Ke = 1.0
Exciter
rectifier and filter Τe : 0.4 to 1.0 sec Τe = 0.4 sec
Alternator Kg : 0.7 to 1.0 Kg = 1.0
Transformer
(Syn. generator) Τg : 1.0 to 2.0 sec Τg = 1.0 sec
(3Ph)
3-Ph Bus Bar From the block diagram (see Fig. 2), Closed-Loop
Transfer Function of the AVR,
Fig. 1. Schematic diagram of Automatic Voltage Regulator (AVR). Vt(s) 0.1s 10
(5)
The dynamic performance of the AVR is investigated by Vref(s) 0.0004s 0.0454s3 0.555s2 1.51s 11
4
developing the mathematical transfer function of the AVR
(neglecting the saturation/non-linearity) [15-16]. The closed- Similarly, Open-Loop Transfer Function of the AVR,
loop block diagram of an AVR is as shown in Fig. 2. The
components of AVR are modeled as first order transfer Vt(s) 10
(6)
function models. Vref(s) 0.0004s4 0.0454s3 0.555s 2 1.51s 1
e(t) Vt(t)
+ Kamp Kex Kg III. TUNING OF PID CONTROLLER
Vref(t) - samp 1 sex 1 sg 1 The important objective of this section is PID controller
Vf(t)
design and testing its performance with set-point change. A
Kvs PID controller is a control loop mechanism that is widely used
svs 1 in industrial control systems. When the PID controller is used,
the overshoot increases and the error at steady-state will
Fig. 2. Closed loop block diagram representation of AVR.
decrease (but not entirely) with the increase in proportional
gain. However, with the addition of derivative, the overshoot
A. Transfer function model of AVR system decreases but there is no change in steady-state error. When
The AVR system mainly consists of a voltage sensor to the integral term is added, the controller will mitigate the
sense voltage magnitude on any one phase, an Amplifier (to steady state error completely/partially. In this research, the
strengthen the error signal), Exciter (to adjust the field error signal, e(t) (controller input) is defined by taking the
excitation), and a Generator to feed the power to the 3-Ph difference between the set-point voltage (Vr) and the generator
utility grid through a 3-Ph transformer. The transfer function terminal voltage (Vt).
model representation of these components is as follows:
The voltage sensor is modeled 1st order transfer function A. Internal Model Control – Direct Synthesis (IMC - DS)
with gain Kvs and time period τvs.
In this tuning method, by proper section of required
Kvs closed-loop response and time delay using Pade´
Gvs(s) (1)
sτvs 1 approximation, PID controller coefficients are derived. Let a
The first order transfer function model of an Amplifier required closed-loop transfer function with delay time (θ) and
with gain KAmp and time constant TAmp is given as tuning parameter (τc) as
KAmp y(s) 1
GAmp(s) (2) e θs (7)
sτAmp 1 ref(s) τcs 1
The modern AC generator uses a brushless excitation system. The Closed Loop Transfer Function for set point variations is
The transfer function model representation of an exciter is as
below with a gain Kex, time constant τex. y(s) Gp(s)Gc(s)
(8)
Kex ref(s) Gp(s)Gc(s) 1
Gex(s) (3)
sτex 1 Re-arranging the equation (8) for the feedback controller,
The first order transfer function model of an AC generator
with a gain Kg, time constant τg is given as below.
Authorized licensed use limited to: Sri Sivasubramanya Nadar College of Engineering. Downloaded on May 06,2022 at 06:36:40 UTC from IEEE Xplore. Restrictions apply.
y(s) stability is poor, reduce the controller gain (i.e kc0/4) and
ref(s) increase the integral time constant proportionally (i.e τi/4),
Gc(s) (9) repeat procedure from Step-III.
y(s)
Gp(s)1 1.5
τou
ref(s) Set-point
Comparing and rearranging equations (8) and (9)
Plant response
1
1
Gc(s) e θs (10)
Gp(s)(τc θ)s Plant response
0.5
But the standard form of 2nd order + time delay model is
k
Gp(s) e θs (11) 0
(τ 1 1)(τ 2 s 1) 0 1 2 3 4 5 6
Time (sec)
Comparing equations (10) & (11), the coefficients of the PID
controller are Fig. 3. Plant response for P-mode controller (Good gain tuning)
1 τ τ2 τ τ
, Ki Kp τ1 τ 2 and K d Kp 1 2
D. Pattern Search Algorithm (PSA)
Kp 1 τ τ
k θ τ c 1 2 This algorithm is initiated by creating mesh (set of points)
around the given point (called as current point) for the
B. Skogestad Internal Model Control (S IMC) minimization of the objective function. The starting point set
by the user or set from the previous step of the algorithm is
This tuning method is preferred when a fast response with called the current point. The mesh is created by the addition
good robustness is required. The tuning procedure of this of the current point to a pattern. When the improvement in the
method is similar to tuning procedure of IMC-DS tuning, but objective function at a current point is identified by a point in
in this method the tuning parameter τc = θ. The coefficients of mesh, then this current point is treated as a new point for the
PID controller are, where τi = min(τi, 8θ). next iteration and so on. This search algorithm will continue
0.5τ1 until an optimal solution is obtained with minimized objective
Kp , Ki Kp/τi and Kd Kp τ 2
kθ function [10, 12]. Fig. 4 shows the flow chart of Pattern
Search Algorithm.
C. Good Gain tuning
In this method of tuning, the controller coefficients Start
Authorized licensed use limited to: Sri Sivasubramanya Nadar College of Engineering. Downloaded on May 06,2022 at 06:36:40 UTC from IEEE Xplore. Restrictions apply.
IV. PYHTON CONTROL TOOLBOX: EVALUATION OF PID 10
Set-point
COEFFCIENTS AVR response without controller
Terminal voltage(Vt)
1.5
Authorized licensed use limited to: Sri Sivasubramanya Nadar College of Engineering. Downloaded on May 06,2022 at 06:36:40 UTC from IEEE Xplore. Restrictions apply.
The open-loop response of the original and 2nd order + performance will occurs for τc = 0.15sec, the corresponding
time-delay AVR model is as shown in Fig.7. The time domain coefficients are Kp = 0.6905, Ki = 0.4762 and Kd = 0.2143.
performance of the AVR system for various value of τc are
tabulated in TABLE II. b) Skogestad Internal Model Control tuning: This
10
tuning method is used when the fast response with good
robustness is required. The process for identification of system
Original model
8
parameters is same as IMC-DS tuning, hence the system gain
Terminal voltage (Vt)
TABLE II. PID COEFFICIENTS AND TIME DOMAIN RESPONSE OF AVR FOR DIFFERENT VALUES OF ΤC
c) Good Gain tuning: As explained in section 3, the The objective function is prepared in time and error
response is obtained with the controller in P-mode, the signal (difference in set-point and terminal voltage) as
proportional gain (kc0) is identified as 0.625 to achieve the t
overshoot as 20% approximately. The period between the 1st Objective function (ITAE) = t.Vref - Vt dt (13)
peak overshoot and undershoot of the step response is 0
represented as τou, from the response τou = 0.86sec.
V. SIMULATION RESULTS AND DISCUSSIONS
1 defpid(kc0, tauou) : # Define PID controller
2 # PID calculation
Fig. 8(a) and 8(b) shows the change in terminal voltage
3 Kp = 0.8*kc0
w.r.t time for various PID controllers.
4 taui = 1.5* tauou
5 Ki = Kp/taui
Change in Terminal voltage
6 taud = 0.25*taui 1
7 Kd= Kp*taud 0.8
8 a = pid(0.625, 0.861) # Initialize parameters
0.6
9 print(a)
0.4 Set-point
Code 5.PID coefficients evaluation – Good gain method
0.2 IMC (DS)
Python code 5 is used to evaluate the PID coefficients. The 0
S-IMC
PID coefficients are Kp = 0.50, Ki = 0.3407 and Kd = 0.1421. 0 1 2 3 4 5
Time (sec)
d) Pattern Search Algorithm: As discussed in section 3, Fig. 8(a). Change in terminal voltage (IMC-DS, S-IMC tuning)
the following objective function is considered for tuning the
Change in Terminal voltage
Authorized licensed use limited to: Sri Sivasubramanya Nadar College of Engineering. Downloaded on May 06,2022 at 06:36:40 UTC from IEEE Xplore. Restrictions apply.
TABLE III shows the comparison in overshoot (1 st peak), S-IM C
rise and settling times for different controllers. 0.8
Controller Uncertainties in Exciter gain (Ke) Uncertainties in Exciter Time constant (τe)
type Uncertainty factor tr (sec) ts (sec)* Uncertainty factor tr (sec) ts (sec)*
IMC (DS) 2.01 0.218 0.80 3.95 0.853 3.86
S-IMC 1.39 0.198 1.57 2.17 0.422 3.24
Good Gain 2.78 0.227 0.836 3.85 1.07 4.68
Pattern search 2.375 0.217 0.796 3.832 0.945 4.31
TABLE VI. COMPARISON OF UNCERTAINTY FACTOR, CORRESPONDING RISE TIME, SETTLING TIME FOR 35% O1VERSHOOT (AMPLIFIER PARAMETERS VARIATIONS)
Controller Uncertainties in Exciter gain (Ke) Uncertainties in Exciter Time constant (τe)
type Uncertainty factor tr (sec) ts (sec)* Uncertainty factor tr (sec) ts (sec)*
IMC (DS) 2.01 0.218 0.80 3.95 0.853 3.86
S-IMC 1.39 0.198 1.57 2.17 0.422 3.24
Good Gain 2.78 0.227 0.836 3.85 1.07 4.68
Pattern search 2.375 0.217 0.796 3.832 0.945 4.31
*
±3% variations allowed
Authorized licensed use limited to: Sri Sivasubramanya Nadar College of Engineering. Downloaded on May 06,2022 at 06:36:40 UTC from IEEE Xplore. Restrictions apply.
B. External Noise/Disturbances References
In this case, to study the robustness of the controller, [1] Celik Durgut R, “Performance enhancement of automatic voltage
regulator by modified cost function and symbiotic organisms search
external noise/ disturbances are applied to the AVR as shown algorithms”, Engineering science and Technology, International Journal,
in Fig. 10. Issue, Vol.21, pp. 1104-1111,Oct 2018.
External disturbances [2] Kansit S, Wudhicahai, “Optimization of PIDcontroller based PSOGSA
for an Automatic Voltage Regulator system”, 2016 International
-
Vt(t) e(t) + Vref(t) Electrical Engineering Congress, iEECON2016, pp.87-90, Chiang Mai,
+ PID
AVR System Thailand, 2-4 March 2016.
Controller
[3] Ziegler J.G, Nichols N.B, “Optimum Settings for Automatic
-
Controllers”, Trans. ASME, Vol. 64, pp. 759-768, November 1942.
Vf(t)
Voltage [4] Cohen G.H, Coon G.A, “Theoretical Consideration of Retarded
sensor Control”, ASME, Vol.75, pp. 827-834, 1953.
Fig. 10. Closed-loop AVR system with disturbances/noise [5] Dan C, Dale E.S, “PI/PID Controller Design based on Direct Synthesis
and Disturbance Rejection”, Ind. Eng. Chem. Res. Vol. 19, pp. 4807-
Fig.11 shows the response of change in terminal voltage of 4822,August 2002.
a closed-loop AVR system with Band limited noise/ [6] Lee J, Cho W, and Edgar T, “An Improved Technique for PID
disturbance. The Band limited noise/disturbance is defined Controller Tuning from Closed- Loop Tests”, AIChE Journal, Vol. 36,
pp. 1891-1895, September 1990.
with noise power as ‘0.075’and sample time as ‘0.25sec’. [7] Yuwana M. and Seborg D, “New Method for On-Line Controller
From Fig. 10, it is clear that when a band limit noise type Tuning”, AlChE Journal, Issue 3, Vol. 28, pp. 434- 440,1982.
disturbance is applied, both proposed PID controllers rejects [8] Mohammad S, Sigurd S, Ivar J.H, “A simple approach for on-line PI
the disturbances smoothly and quickly. controller tuning using closed-loop setpoint responses”, 20th European
Symposium on Computer Aided Process Engineering, ESCAPES20,
1.5 pp.619-624, Ischia, 6-9 May 2010.
Change in Terminal voltage
1 [9] Finn Haugen, “The Good Gain method for PI(D) controller tuning. Tech
Teach”, July 2010.
0.5
[10] Nahvi H, Silani S, “ Using Pattern Search algorithm and Finite element
0 method to detect rotor cracks”, International Journal of Engineering,
-0.5 Transactions A: Basics, Issue 2, Vol.22, pp. 195-204, June 2009.
Disturbances/Noise
[11] S. Ciba, I. Iskender, H.A Ariani, “Comparing control performance of
-1 Good Gain
Pattern search
MRAC and PID applied on a brushless DC motor”, International Journal
-1.5 on Technical and Physical Problems of Engineering (IJTPE), Issue 44,
0 2 4 6 8 10
Vol. 12, No. 3, pp. 10-15, September 2020.
Time (sec)
[12] Zewail I. et al. “Maximization of Total throughput using Patter Search
Fig. 11. AVR system response with Band limited noise algorithm underlay Cognitive radio network”, Menofia journal of
Electronics Engineering Research, Issue 2, Vol. 26, pp. 307-319,
Conclusions November 2017.
[13] Mohamma A.S et al “Closed loop tuning of cascde controllers based on
Python is a user-friendly programming tool for solving all set point experiment”, Journal of Engineering Research, Issue 4, Vol.8,
kinds of control engineering issues. Its syntaxes and usage are pp.117-138, December 2020.
simpler than similar programming tools. The controller [14] Ercan K. “Optimal control of AVR system with Tree seed algorithm-
coefficients are evaluated in the Python environment. In this based PID controller”, IEEE Access, Vol.8, pp. 89457-89467, May
work, a new tuning method (Good gain, Pattern Search) has 2020.
been introduced for tuning the coefficients of a PID controller [15] Mohanty P.K., Sahu B.K., Panda S, “Tuning and assessment of
for the Automatic Voltage Regulator. It is observed that even proportional integral–derivative controller for an automatic voltage
regulator system employing local unimodal sampling algorithm”,
though S-IMC tuning’s rise time is better than the proposed Electric Power Components and Systems, Issue 9, Vol. 42, pp. 959–969,
methods, the proposed methods are less sensitive to parameter May 2014.
uncertainties and external disturbances. [16] Shayeghi H, Younesi A, Hashemi Y, “Optimal design of a robust
discrete parallel FP + FI + FD controller for the Automatic Voltage
From the simulation results, the overshoots and settling Regulator system”, International Journal of Electrical Power and Energy
times of the controlled system are optimized with the Good Systems, Vol.67, pp.66–75, May 2015.
Gain method and Pattern search algorithm superior to other [17] M. Topal, I. Iskender, N. Genc, “Sensor less speed control of BLDC
tuning methods. Also, the proposed controllers provide good motor using improved sliding mode observer technique”, International
Journal on Technical and Physical Problems of Engineering (IJTPE),
robustness for parameter uncertainties and external Issue 38, Vol. 11, No. 1, pp. 1-9, March 2019.
disturbances. [18] https://python-control.readthedocs.io/en/0.8.4/index. html.
Authorized licensed use limited to: Sri Sivasubramanya Nadar College of Engineering. Downloaded on May 06,2022 at 06:36:40 UTC from IEEE Xplore. Restrictions apply.