Modeling and Simulation of AVR Systems in MATLAB/Simulink: Performance Comparison of PID and ANN Controllers

Abstract

This study presents the design and modeling of an Automated Voltage Regulator (AVR) using MATLAB/Simulink, with a comparative performance evaluation against Proportional-Integral-Derivative (PID) and Artificial Neural Network (ANN) controllers. Voltage regulation is crucial to ensure reliable and stable power delivery under varying load conditions. In this work, a dynamic system model was developed to represent the electrical network, followed by the implementation of control algorithms to maintain output voltage within acceptable limits. The proposed approach was assessed through extensive simulations under multiple operating conditions and disturbances. The results demonstrate that ANN-based control outperforms both conventional AVR and PID controllers in terms of peak time, settling time, rise time, and overshoot percentage. Furthermore, ANN provides superior stability and adaptability in handling load variations, establishing it as the most effective control strategy for voltage regulation.

Share and Cite:

Yusre, A. , Samuji, S. , Shari, N. , Saidin, N. and Azhuan, N. (2025) Modeling and Simulation of AVR Systems in MATLAB/Simulink: Performance Comparison of PID and ANN Controllers. Journal of Power and Energy Engineering, 13, 315-325. doi: 10.4236/jpee.2025.139021.

1. Introduction

A voltage regulator is a fundamental component in electrical engineering that maintains a stable voltage output despite fluctuations in input voltage or load conditions. It operates by adjusting its internal resistance to ensure the output voltage remains within a specified range. Voltage regulators are widely applied in electronic devices and industrial systems, playing a crucial role in power generation and distribution by stabilizing the grid and protecting sensitive equipment from damage [1]. An Automatic Voltage Regulator (AVR) enhances this process by continuously monitoring the output voltage and adjusting the excitation level of generators or transformers to maintain voltage stability. This ensures consistent power delivery to sensitive electrical devices while reducing the risks of overvoltage or undervoltage [2] [3]. Recent advancements in AVR technology have incorporated sophisticated control algorithms and integrated circuitry, which significantly improve regulation efficiency.

This study focuses on developing a more precise and reliable AVR design, particularly for regions where the Power Development Board (PDB) supply frequently falls short, increasing the risk of damage to sensitive devices [4]. Traditional AVR systems often oscillate between output voltages, resulting in reduced precision and stability. To address this issue, the present work aims to design an AVR with enhanced precision and hysteresis control, maintaining input voltage deviations within ±5% and thereby improving overall stability [5] [6].

In addition, the study investigates the integration of Artificial Neural Networks (ANNs) into AVR systems. Unlike conventional linear control approaches, ANNs are capable of learning and adapting to nonlinear and dynamic operating conditions, offering superior voltage regulation performance [7]. MATLAB/Simulink software is employed to design, simulate, and compare the performance of AVR systems equipped with PID controllers and ANN-based controllers [8]. By enhancing the efficiency of voltage regulation, this research also aligns with the United Nations Sustainable Development Goal (SDG) 7, which promotes affordable and clean energy. Improved AVR technology contributes to reducing energy waste, supporting sustainable energy utilization, and alleviating pressure on power generation resources. Ultimately, this study seeks to optimize AVR performance for stable voltage output while providing practical insights into system design and operation [9]-[11].

AVRs are essentially feedback-based systems that regulate generator excitation to ensure output voltage stability. Their development has evolved from electromechanical designs to modern digital systems that incorporate microcontrollers, digital signal processors (DSPs), and adaptive algorithms. Among existing approaches, PID controllers remain the most widely used, as they minimize steady-state error and enhance transient response. However, their reliance on linear control strategies reduces effectiveness when applied to nonlinear or highly dynamic environments [12] [13]. Recent research has emphasized the potential of ANNs in power system applications due to their ability to model complex system behaviors and adapt in real time. ANNs have been successfully applied in load forecasting, fault detection, and voltage regulation, demonstrating superior accuracy and robustness compared to traditional controllers [11] [12].

There are several active studies on adaptive AVR control. Amin et al. [14] enhances automatic voltage regulator (AVR) performance by applying exponential distribution and transit search optimization techniques to optimally tune PID controller parameters, resulting in improved stability, reduced overshoot, faster settling, and robust operation under load variations. Sonfack et al. [15] reported a neuro-adaptive excitation controller that enhances rotor angle and voltage stability in IET Generation, Transmission & Distribution. In addition, Jabari et al. [16] introduced a fractional-order PID controller optimized with metaheuristic algorithms, outperforming classical PID in time-domain indices. Recently, Idir et al. [17] presented fractional-order PID optimization for AVR with improved dynamic performance. Most recently, Michel et al. [18] validated passivity-based AVR control experimentally, showing significant robustness compared to conventional methods.

Collectively, these works confirm the trend toward adaptive and intelligent controllers and reinforce the findings of this study that ANN-based control provides superior voltage regulation compared to traditional PID controllers.

2. Simulation Framework for AVR Control Design

In systems with input voltage and load changes, a sophisticated Automatic Voltage Regulator (AVR) is essential for steady power supply. This research intends to create an AVR that improves power system performance using contemporary control methods and computer simulation tools. It is known that PID controllers and ANNs can stabilize output voltage. By understanding this relationship, the research will model the AVR using MATLAB/SIMULINK and optimize output stability for a dependable voltage regulator. The project uses intensive simulations and analysis to improve the final output, assuring power system reliability and avoiding graph distortion.

The AVR system was modeled using standard first-order transfer functions for the amplifier, exciter, and generator blocks, while the sensor was represented as a first-order low-pass filter with a small time constant to suppress measurement noise. The generator block modeled as a simplified synchronous generator with linear characteristics. Assumes constant mechanical input and neglects saturation and nonlinear magnetic effects. The gain was assumed to lie in the range of 0.7 - 1.0 with a time constant of 1 - 2 seconds under load variation conditions, and the sensor time constant was set between 0.01 - 0.06 seconds to ensure rapid feedback. Sensitivity analysis indicates that higher amplifier and exciter gains accelerate the transient response but tend to increase overshoot, while larger time constants prolong the settling process. A ±10% parameter variation analysis can further demonstrate that ANN maintains better damping performance compared to PID under parameter uncertainty.

The design and improvement of AVR control algorithms in this study are primarily based on simulation, as it provides a reliable and cost-effective approach to evaluate performance under different operating conditions. MATLAB is widely recognized as one of the most versatile computational tools for AVR modeling due to its extensive toolboxes, graphical interface, and ability to handle complex system dynamics [11] [19]. Figure 1 shows the Methodological Flow of AVR Modeling and Analysis.

Figure 1. Methodological flow of AVR modeling and analysis.

MATLAB enables the simulation of AVR systems using differential equations, transfer functions, and state-space models, allowing engineers to accurately analyze generator, transformer, load, and controller interactions. Several toolboxes such as the Control System Toolbox, Simulink, and Simscape Power Systems provide built-in functions and modeling environments to simplify AVR design and enhance productivity [13].

Simulink, in particular, offers a block-diagram-based modeling platform that facilitates the construction, simulation, and analysis of dynamic AVR system components. Its graphical environment improves system comprehension and fosters collaboration among researchers and practitioners [20]. Furthermore, MATLAB supports iterative optimization and parameter tuning, enabling real-time adjustments to control algorithms such as PID gain tuning, control loop bandwidth refinement, and system stability improvements. This feature accelerates the prototyping and enhancement of AVR designs [21].

Another advantage is MATLAB’s seamless integration from simulation to hardware implementation. Using code generation tools, control algorithms developed in MATLAB/Simulink can be directly deployed onto microcontrollers, digital signal processors (DSPs), or field-programmable gate arrays (FPGAs) for real-time execution. This functionality significantly enhances the efficiency of AVR development and reduces time-to-market [22].

Overall, MATLAB offers a robust and comprehensive platform for AVR research and development. Its accuracy, efficiency, and flexibility in system modeling, coupled with advanced toolboxes, graphical simulation environments, optimization features, and hardware integration capabilities, make it an indispensable tool for designing, analyzing, and optimizing AVR systems across diverse applications and industries [22].

3. Experimental Setup

3.1. Regular AVR

The simulation in Figure 2 involves an amplifier, exciter, generator, and sensor, all of which are configured according to predefined sample values. The process begins with the reference voltage (Vref) being fed into the amplifier, which controls the exciter field to increase the exciter terminal voltage. The output from the exciter, which exhibits nonlinear characteristics, is then directed to the generator. The generator’s output is monitored through feedback provided by the sensor. Finally, the output results are displayed on the scope for analysis.

Figure 2. Regular AVR system.

3.2. AVR with PID Controller

Based on Figure 3, the experimental setup focuses on evaluating the performance of the AVR by using PID controller. Based on the simulation model, the setup incorporates the Vref Step, Sum block, PID controller, amplifier, exciter, generator, and sensor. Using the MATLAB software, the simulation emulates the steady state graph and enabling detailed analysis. The primary objective of the simulation is to shows the difference between both result and how the PID controller can constant the output and reduce or eliminate the steady state error.

For the PID controller, the initial gain values were obtained using a standard tuning method such as MATLAB’s pidtune function at the nominal operating point, followed by fine manual adjustments to minimize overshoot while maintaining acceptable settling time. The final values of Kp, Ki, and Kd were used for the simulations. In contrast, the ANN controller weights were entirely optimized during training through the Levenberg-Marquardt algorithm until the convergence criteria were achieved. Training was conducted over 10,000 epochs with a target MSE of 1e−12, indicating a high-precision fit. Input-output data for training were derived from the AVR system’s simulation results, ensuring the ANN mimics the desired control behavior.

Figure 3. AVR system with PID controller.

3.3. AVR with ANN

Based on Figure 4, the experimental setup emphasizes the implementation of the ANN. In addition, input and output blocks are positioned before and after the ANN block to identify the values that will be encoded within the ANN. The setup also incorporates the Vref step, amplifier, exciter, generator, and sensor components.

Figure 4. AVR system with ANN.

The Artificial Neural Network (ANN) employed in this study is a feed-forward network consisting of three layers with [3, 5, 1] neurons in the first hidden layer, second hidden layer, and output layer, respectively. The activation functions used are logsig (log-sigmoid), tansig (hyperbolic tangent sigmoid), and purelin (linear) in sequence, while the network was trained using the Levenberg-Marquardt (trainlm) algorithm with 10,000 epochs and a target mean squared error (MSE) of 1 × 1012. The input and target data were extracted from the Simulink simulation outputs and converted into training pairs (I = out.input, T = out.output). The dataset was randomly divided into 70% for training, 15% for validation, and 15% for testing. The setup also incorporates the Vref step, amplifier, exciter, generator, and sensor components.

4. Results and Discussion

The current section presents the results and analysis of the creation of the Standard Automatic Voltage Regulator. The study tests AVRs with PID controllers, regular AVRs, and Artificial Neural Networks (ANNs). Four performance metrics are highlighted in these tests. The time it takes for a signal to go from a lower voltage threshold to an upper voltage threshold is known as the rise time. The second is peak time, which is the amount of time needed to reach maximum voltage. Third, the amount of time required for the voltage to remain in the error band following a disturbance is known as the settling time. Lastly, during a brief reaction, the output signal’s percentage overshoot shows how much it deviates from its steady-state value. A steady-state graph provides crucial information about output voltage.

The metrics include rise time, peak time, settling time, percentage overshoot, mean squared error (MSE), and regression coefficient (R). These are standard indicators in control system analysis, chosen for their ability to reflect system behavior and performance. Specifically, MSE and R-value are crucial for assessing ANN accuracy, as they measure prediction error and the correlation between predicted and actual outputs. The statistical results demonstrate the ANN’s effectiveness, with a perfect regression coefficient of R = 1.0 and an exceptionally low MSE of 1.4002 × 109, indicating a highly accurate model with minimal deviation from expected outcomes. However, to further confirm the robustness of the findings, a Monte Carlo analysis with ±10% variation in block parameters is recommended, where comparative results could be evaluated using non-parametric tests such as the Wilcoxon rank-sum test to determine whether the improvements achieved by ANN are statistically significant.

4.1. Regular AVR

This experiment’s results are in Table 1. Figure 5 shows that the graph starts to climb around 0.254 seconds. At 0.699 seconds, the voltage peaks at 1.622 p.u., much above steady-state. After the observation, the settling time was 20.895 seconds. While decreasing toward stability, the voltage reached 0.901 p.u. The system eventually converges despite the initial overshoot.

Table 1. Value of regular AVR.

Rise time (s)

Peak time (s)

Settling time (s)

Overshoot (%)

0.254

0.699

20.895

77.679

Figure 5. Regular AVR profile.

4.2. AVR with PID Controller

This experiment’s findings are in Table 2. The beginning rise time was 0.178 seconds, showing the graph begins to rise (Figure 6). The voltage peaks at 1.00 p.u. at 0.427 seconds. The output stays at 1.00 p.u. after this peak until the graph ends. Despite a minor steady-state error at peak time, the voltage output remains 1.00 p.u. throughout the system, indicating good performance and stability.

Table 2. Value of using PID controller.

Rise time (s)

Peak time (s)

Settling time (s)

Overshoot (%)

0.178

0.427

4.454

27.564

Figure 6. AVR with PID controller profile.

4.3. AVR with ANN

The results of AVR experiment are summarized in Table 3. At the initial stage, the rise time was recorded as 1.773 seconds, demonstrating a rapid response. The system exhibited a minimal overshoot of 0.496%, well below 1%, which indicates excellent control performance. Additionally, the output stabilized at 1.038 p.u., reflecting a high degree of consistency. The settling time was observed to be 2.664 seconds, ensuring the system reached a steady state quickly. These characteristics highlight the system’s stability and efficiency from an early stage as shown in Figure 7.

Table 3. Value of using ANN.

Rise time (s)

Peak time (s)

Settling time (s)

Overshoot (%)

1.773

21.623

2.664

0.496

Figure 7. Result of using ANN.

4.4. Comparative Analysis

The AVR results from three method simulate in one graph to shows the differences between ANN, PID and AVR.

According to Figure 8, the ANN performs best, settling quickly with minimum overshoot and no oscillations after stabilization. This shows its versatility and accuracy, making it ideal for nonlinear and dynamic systems. PID controllers are slower than ANNs but give reliable responses with minimal overshoot and slight oscillations before achieving steady state. However, it is less accurate and adaptable than ANN. The standard AVR has the worst control performance, with substantial overshoot, extended settling time, and persistent oscillations, suggesting inadequate damping and stability.

Figure 8. Simulation of AVR, ANN and PID.

5. Conclusion

This study has demonstrated that ANN-based AVR outperforms both conventional AVR and PID controllers in regulating output voltage, particularly under nonlinear and dynamic operating conditions. Through MATLAB/Simulink simulations, ANN showed superior adaptability, faster settling time, minimal overshoot, and improved stability, making it a more reliable control strategy for modern power systems. These findings not only address the limitations of traditional controllers but also contribute to advancing energy efficiency and stability in line with sustainable power system development. Future work should focus on real-time hardware validation and integration into smart grid environments to confirm scalability and practical applicability.

Acknowledgements

The authors would like to express gratitude to the Centre for Research and Innovation Management of Universiti Teknikal Malaysia Melaka (UTeM) for the financial support this work under the Grant Tabung Penerbitan Fakulti dan Tabung Penerbitan CRIM UTeM.

Conflicts of Interest

The authors declare no conflicts of interest regarding the publication of this paper.

References

[1] Stenger, R.L. (2014) Voltage Regulators. In McGraw-Hill Concise Encyclopedia of Engineering, McGraw-Hill.
[2] Malvino, A.P. and Bates, D.J. (2016) Electronic Principles. McGraw-Hill Education.
[3] Rizzoni, G. (2015) Electrical Engineering: Principles & Applications. Pearson.
[4] Das, J.C. (2019) Power System Analysis: Short-Circuit Load Flow and Harmonics. CRC Press.
[5] Alamgir, M.S. and Dev, S. (2015) Design and Implementation of an Automatic Voltage Regulator with a Great Precision and Proper Hysteresis. International Journal of Advanced Science and Technology, 75, 21-32.[CrossRef
[6] Åström, K.J. and Hägglund, T. (1995) PID Controllers: Theory, Design, and Tuning. Instrument Society of America.
[7] Batmani, Y. and Golpîra, H. (2019) Automatic Voltage Regulator Design Using a Modified Adaptive Optimal Approach. International Journal of Electrical Power & Energy Systems, 104, 349-357.[CrossRef
[8] Hang, C.C. (2005) PID Control: New Identification and Design Methods. Springer.
[9] Elgerd, O.I. (1982) Electric Energy Systems Theory: An Introduction. McGraw-Hill
[10] Tziouvaras, D.A. and Karakasis, V.G. (2011) Design of an Automatic Voltage Regulator System Using MATLAB/SIMULINK. International Journal of Electrical and Computer Engineering, 5, 1301-1305.
[11] Sedra, A.S. and Smith, K.C. (2014) Microelectronic Circuit. 7th Edition, Oxford University Press.
[12] Rashid, M.H (2018) Power Electronics: Circuits, Devices, and Applications. 5th Edition, Pearson.
[13] Mohan, N., Undeland, T.M. and Robbins, W.P. (2002) Power Electronics: Converters, Applications, and Design. Wiley.
[14] Amin, M.S., Attia, M.A., Khamees, A.K., Mekhamer, S.F., Kotb, H., AboRas, K.M., et al. (2024) Development of AVR Controller Performance Using Exponential Distribution and Transit Search Optimization Techniques. Frontiers in Energy Research, 12, Article 1356978.[CrossRef
[15] Sonfack, L.L., Kuate-Fochie, R., Fombu, A.M., Douanla, R.M., Njomo, A.F.T. and Kenné, G. (2024) Design of a Novel Neuro-Adaptive Excitation Control System for Power Systems. IET Generation, Transmission & Distribution, 18, 983-998.[CrossRef
[16] Jabari, M., Ekinci, S., Izci, D., Bajaj, M. and Zaitsev, I. (2024) Efficient DC Motor Speed Control Using a Novel Multi-Stage FOPD(1+PI) Controller Optimized by the Pelican Optimization Algorithm. Scientific Reports, 14, Article No. 22442.[CrossRef] [PubMed]
[17] Idir, A., Canale, L., Bensafia, Y. and Khettab, K. (2022) Design and Robust Performance Analysis of Low-Order Approximation of Fractional PID Controller Based on an IABC Algorithm for an Automatic Voltage Regulator System. Energies, 15, Article 8973.[CrossRef
[18] Michel, Y., Saveriano, M. and Lee, D. (2023) A Passivity-Based Approach for Variable Stiffness Control with Dynamical Systems. IEEE Transactions on Automation Science and Engineering, 21, 6265-6276.[CrossRef
[19] Pressman, A.I., Billings, K. and Morey, D. (2015) Switching Power Supply Design. 3rd Edition, McGraw-Hill Education.
[20] Ogata, K. (2010) Modern Control Engineering. 5th Edition, Pearson.
[21] Karris, S.T. (2009) Signals and Systems: With MATLAB Computing and Simulink Modeling. 4th Edition, Orchard Publications.
[22] Lathi, B.P. and Ding, Z. (2009) Modern Digital and Analog Communication Systems. 4th Edition, Oxford University Press.

Copyright © 2025 by authors and Scientific Research Publishing Inc.

Creative Commons License

This work and the related PDF file are licensed under a Creative Commons Attribution 4.0 International License.