Design, Tuning, and Experimental Validation of Switched Fractional-Order PID Controllers for an Inverted Pendulum System
Abstract
1. Introduction
- The design, tuning, and experimental validation of an SW FOPID-PID controller for an InvP system is addressed for the first time.
- The optimization procedure used for controller tuning allows us to take into account the control energy used, along with the system performance. This leads to a controller with improved performance and balanced control energy compared to equivalent non-switched controllers.
2. Preliminaries
2.1. Fractional Calculus
2.2. Fractional-Order Proportional Integral Derivative Controllers
2.3. Inverted Pendulum System Description
2.4. Mathematical Model of the Plant
3. Controller Design and Tuning
3.1. Controllers Included in the InvP System by the Manufacturer
3.2. Design of the Switched Fractional-Order Proportional Integral Derivative Controller
3.3. Tuning of Controller Parameters
4. Experimental Validation of Controllers
4.1. Results and Discussion of Experimental Validation
- The SW FOPI-PID controller has the lowest ITAE, with a significant margin compared to the other controllers. This is illustrated in Figure 11, which shows that this controller stabilizes both states fairly quickly. Additionally, Figure 12 shows that ITAE converges rapidly and reaches a much lower value compared to the rest of the controllers.
- In addition to having the lowest ITAE value, the SW FOPID-PID controller presents the lowest peak values and settling times for both the cart position and the pendulum angular position. Furthermore, this controller produced the lowest variances in both the pendulum angular position and cart position. Together with the previously mentioned results, this indicates that the switched controller performs the best.
- The only downside of this controller, as shown in Figure 11, is that its control signal saturates briefly at the beginning of the experiment and exhibits oscillations throughout the entire control process, leading to an increase in the ISI indicator. Nevertheless, the control energy used in this case lies in between the values obtained with the proposed PID and FOPID controllers, as can be corroborated from Figure 13 and Table 4. Note that this brief saturation does not have any significant effect in the controlled variables of the inverted pendulum, as can be observed from Figure 11, where both the cart position x and the pendulum angular position have smooth behaviors during that initial time and throughout the whole experiment. Moreover, the PIDBASE and the FOPID also saturate for time periods even longer than the switched controller, with the PIDBASE controller being the one that saturates for the longest time. Only the PID tuned in this work does not present saturation at the beginning of the simulation, but again, the switched controller exhibits better performance indicators for the controlled variables, which makes its brief saturation something that can be tolerated, since it does not represent risks for system actuators. Also, the switched controller outperforms the PIDBASE controller provided by the manufacturer and the designed FOPID controller in every single performance metric shown in Table 4. To summarize, it can be concluded that the switched controller not only achieves the best performance but also does so with a balanced use of control energy, compared to the non-switched controllers.
- The proposed PID controller exhibits the lowest ISI due to a smoother control signal with smaller oscillations, as shown in Figure 11. However, this leads to longer rise times compared to the FOPID and SW FOPID-PID controllers. Nevertheless, the proposed PID outperforms the manufacturer’s PIDBASE controller in every single indicator.
- The FOPID controller, as previously mentioned, presented several difficulties during the experimental tests, generating very abrupt responses, and despite managing to control the pendulum, the test had to be suspended due to very rapid oscillations of the cart. This was largely mitigated by retuning the controller, allowing for complete tests to be carried out without major issues, but as seen in Figure 11, the described tendency remains when observing the control signal of the controller. It saturated on more than one occasion and exhibited a greater number of oscillations with larger magnitudes, a behavior that can also be seen in the angular position of the pendulum, which showed small ripples throughout the experiment. Still, looking at the performance indicator data in Table 4, this controller outperforms the proposed PID in ITAE and has pretty similar values for settling times; it outperforms the manufacturer PIDBASE controller in every indicator.
- Finally, we refer to the analysis of the variances of the signals during the control process, which were added to visualize the magnitude of the parameter and provide valuable information about the stability and accuracy of the controlled system. Table 4 shows the values obtained for this indicator for the cart position, pendulum angular position, and control signal for each of the controllers under study. The PID controller has the lowest variance for the control signal, followed by the switched SW FOPID-PID controller. This result is consistent with what is observed in Figure 11, where the control signals of these two controllers show the smallest magnitudes in their oscillations. In contrast, controllers like FOPID and PIDBASE show an increase in this indicator compared to the others, making more frequent and larger adjustments, a situation that could cause wear on the system’s actuators.
- For both the cart position and the pendulum’s angular position, the variances for the PID and SW FOPID-PID controllers are quite similar, with the latter exhibiting the lowest values. This indicates that both controllers maintain both state positions with little deviation, resulting in good control performance. The FOPID and PIDBASE controllers, on the other hand, exhibit higher magnitudes for these variances, with lower values for the FOPID in the pendulum angular position and fairly similar values for the cart position in both. This means they show greater fluctuations in the positions and that the control exerted is effective but inferior in terms of performance compared to the switched SW FOPID-PID and PID controllers. The lower values of these indicators for these latter controllers may indicate that the controlled system is more robust against disturbances.
4.2. Results and Discussion of Experimental Validation in the Presence of Disturbances
- Similar to cases without disturbances, the switched controller resulted in the lowest ITAE and settling times for both the cart position and the pendulum’s angular position. It also yielded the lowest value for the variance of x. Although the lowest peak values and the variance of were achieved with the manufacturer PIDBASE, this does not mean the PID was actually better in these performance indices, due to the points discussed in the following section.
- Although the PIDBASE controller provided by the manufacturer showed the lowest peak values and variance for , outperforming SW FOPID-PID, and many of the remaining performance indicators were better than with PID and FOPID controllers, this result is not completely representative and cannot allow full conclusions to be drawn. This is because in the case of PIDBASE, several tests were needed to finish this experiment successfully. In most experiments, applying a second strike caused the pendulum to fall, or the cart, while trying to control it, would move to the end of the rail, triggering a limit switch and stopping the simulation. It can be seen from Figure 14 that disturbances applied to this controller were of lower magnitude, as that was the only way for the controller to recover after two strikes. Thus, it was obvious that the peak values and variance of would be lower for this controller. It is important to note that although in this test the depicted PIDBASE used a lot of control energy in attempting to stabilize the pendulum after the strikes, once the pendulum was stable, it required less energy compared to the other controllers. This can be seen in the ISI plot in Figure 16, where the slope after the disturbances is the lowest.
- Although the strikes applied to the PID tuned in this work were of higher magnitude than those for the PIDBASE, it also encountered issues in successfully completing the experiments. Several attempts were necessary in order to achieve a test in which the PID was able to stabilize completely after two strikes, due to the same reasons explained in the previous point for PIDBASE. Still, as can be seen from Table 5 and Figure 16, the PID is the controller with the lowest ISI, as in the case without disturbances. However, the differences with respect to the ISI for the rest of the controllers are not as representative as in the previous experiments.
- The FOPID controller demonstrated greater robustness than the previous two controllers. This was confirmed by its ability to apply multiple disturbances to the system without the pendulum falling or the cart deviating too much (three strikes can be seen in Figure 14 for this controller). However, it was necessary to include a speed filter in the generated control signal, as the system oscillated faster than the actuator could handle in the steady state, which could have caused problems with the setup. This filter helped in improving the steady state, achieving a low slope in both ITAE (see Figure 15) and ISI (see Figure 16). Nevertheless, the filter also negatively affected the controller’s performance in the transient states, as reflected in the slopes of ISI and ITAE at those moments and leading to this controller being the one with the highest values for both ITAE and ISI.
- Although the switched SW FOPID-PID controller was not the best in terms of energy performance, as seen in Figure 16, which shows a steeper slope in the steady state, the resulting value for ISI was in between the values used for PID and FOPID controllers, as it was in the case without disturbances. Considering all the previous analyses, it can be concluded that the SW FOPID-PID controller resulted in the best overall performance. Moreover, it was evident during the tests that it was the most robust controller, as it withstood stronger strikes and managed to remain stable in all cases.
4.3. Limitations and Future Work
5. Conclusions
Author Contributions
Funding
Data Availability Statement
Conflicts of Interest
References
- Tepljakov, A.; Alagoz, B.B.; Yeroglu, C.; Gonzalez, E.A.; Hosseinnia, S.H.; Petlenkov, E.; Ates, A.; Cech, M. Towards Industrialization of FOPID Controllers: A Survey on Milestones of Fractional-Order Control and Pathways for Future Developments. IEEE Access 2021, 9, 21016–21042. [Google Scholar] [CrossRef]
- Pataro, I.M.L.; Gil, J.D.; Alvarez, J.D.; Guzmán, J.L.; Berenguel, M. Robust Fractional Order PID Controller Coupled with a Nonlinear Filtered Smith Predictor for Solar Collector Fields. IFAC-PapersOnLine 2025, 58, 234–239. [Google Scholar] [CrossRef]
- Ghamari, S.M.; Molaee, H.; Ghahramani, M.; Habibi, D.; Aziz, A. Design of an Improved Robust Fractional-Order PID Controller for Buck–Boost Converter using Snake Optimization Algorithm. IET Control Theory Appl. 2025, 19, e70008. [Google Scholar] [CrossRef]
- Basil, N.; Mohammed, A.F.; Sabbar, B.M.; Marhoon, H.M.; Dessalegn, A.A.; Alsharef, M.; Ali, E.; Ghoneim, S.S.M. Performance analysis of hybrid optimization approach for UAV path planning control using FOPID-TID controller and HAOAROA algorithm. Sci. Rep. 2025, 15, 4840. [Google Scholar] [CrossRef]
- Paliwal, S. Stabilization of Mobile Inverted Pendulum Using Fractional Order PID Controllers. In Proceedings of the 2017 International Conference on Innovations in Control, Communication and Information Systems (ICICCI), Greater Noida, India, 12–13 August 2017; pp. 1–4. [Google Scholar] [CrossRef]
- Asadollahi, M.; Rikhtegar ghiasi, A.; Dehghani, H. Excitation control of a synchronous generator using a novel fractional-order controller. IET Gener. Transm. Dis. 2015, 9, 2255–2260. [Google Scholar] [CrossRef]
- Oróstica, R.; Duarte-Mermoud, M.A.; Jáuregui, C. Stabilization of inverted pendulum using LQR, PID and fractional order PID controllers: A simulated study. In Proceedings of the 2016 IEEE International Conference on Automatica (ICA-ACCA), Curico, Chile, 19–21 October 2016; pp. 1–7. [Google Scholar] [CrossRef]
- Mishra, S.K.; Chandra, D. Stabilization and Tracking Control of Inverted Pendulum Using Fractional Order PID Controllers. J. Eng. 2014, 2014, 752918. [Google Scholar] [CrossRef]
- Acevedo Anabalón, N.; Otárola Tapia, J. Diseño y Ajuste de Estrategias de Control Conmutado para un Regulador Automático de Voltaje a Nivel de Simulaciones. Tesis de Pregrado para Optar al Título de Ingeniero Civil en Electrónica, Universidad Tecnológica Metropolitana, Santiago, Chile, 2022. [Google Scholar]
- Aguila-Camacho, N.; Farias-Ibañez, S.E. Level Control of a Conical Tank System Using Switched Fractional Order PI Controllers: An Experimental Application. In Proceedings of the 2022 10th International Conference on Control, Mechatronics and Automation, ICCMA 2022, Belval, Luxembourg, 9–12 November 2022; pp. 82–87. [Google Scholar] [CrossRef]
- Bettayeb, M.; Boussalem, C.; Mansouri, R.; Al-Saggaf, U.M. Stabilization of an inverted pendulum-cart system by fractional PI-state feedback. ISA Trans. 2014, 53, 508–516. [Google Scholar] [CrossRef]
- Ju, D.; Lee, T.; Lee, Y.S. Transition Control of a Rotary Double Inverted Pendulum Using Direct Collocation. Mathematics 2025, 13, 640. [Google Scholar] [CrossRef]
- Pak, U.S.; Nam, G.H.; Paek, M.R.; Kim, Y.S.; Won, I.S. Variable universe triangular cloud model-based controller design for real-time control of rotary parallel inverted pendulum. Int. J. Dyn. Contr. 2025, 13, 116. [Google Scholar] [CrossRef]
- Tian, B.; Peng, H.; Kang, T. RBF-ARX model-based predictive control approach to an inverted pendulum with self-triggered mechanism. Chaos Soliton Fract. 2024, 186, 115291. [Google Scholar] [CrossRef]
- Dwivedi, P.; Pandey, S.; Junghare, A. Performance Analysis and Experimental Validation of 2-DOF Fractional-Order Controller for Underactuated Rotary Inverted Pendulum. Arab. J. Sci. Eng. 2017, 42, 5121–5145. [Google Scholar] [CrossRef]
- Dwivedi, P.; Pandey, S.; Junghare, A.S. Robust and novel two degree of freedom fractional controller based on two-loop topology for inverted pendulum. ISA Trans. 2018, 75, 189–206. [Google Scholar] [CrossRef]
- Shalaby, R.; El-Hossainy, M.; Abo-Zalam, B. Fractional order modeling and control for under-actuated inverted pendulum. Commun. Nonlinear Sci. Numer. 2019, 74, 97–121. [Google Scholar] [CrossRef]
- Mehedi, I.M.; Al-Saggaf, U.M.; Mansouri, R.; Bettayeb, M. Stabilization of a double inverted rotary pendulum through fractional order integral control scheme. Int. J. Adv. Robot. Syst. 2019, 16, 1–9. [Google Scholar] [CrossRef]
- Mondal, R.; Chakraborty, A.; Dey, J.; Halder, S. Optimal fractional order PIλDμ controller for stabilization of cart-inverted pendulum system: Experimental results. Asian J. Control 2020, 22, 1345–1359. [Google Scholar] [CrossRef]
- Mondal, R.; Dey, J. Performance Analysis and Implementation of Fractional Order 2-DOF Control on Cart–Inverted Pendulum System. IEEE Trans. Ind. Appl. 2020, 56, 7055–7066. [Google Scholar] [CrossRef]
- Mondal, R.; Dey, J. A novel design methodology on cascaded fractional order (FO) PI-PD control and its real time implementation to Cart-Inverted Pendulum System. ISA Trans. 2022, 130, 565–581. [Google Scholar] [CrossRef]
- Tomar, B.; Kumar, N.; Sreejeth, M. Robust Control of Rotary Inverted Pendulum Using Metaheuristic Optimization Techniques Based PID and Fractional Order PIλDμ Controller. J. Vib. Eng. Technol. 2024, 12, 1–20. [Google Scholar] [CrossRef]
- Nguyen, T.V.A.; Dao, Q.T.; Bui, N.T. Optimized fuzzy logic and sliding mode control for stability and disturbance rejection in rotary inverted pendulum. Sci. Rep. 2024, 14, 31116. [Google Scholar] [CrossRef]
- Awan, A.A.; Khan, U.S.; Awan, A.U.; Hamza, A. Tracking Control and Backlash Compensation in an Inverted Pendulum with Switched-Mode PID Controllers. Appl. Sci. 2024, 14, 10265. [Google Scholar] [CrossRef]
- Afghoul, H.; Krim, F.; Chikouche, D.; Beddar, A. Robust switched fractional controller for performance improvement of single phase active power filter under unbalanced conditions. Front. Energy 2016, 10, 203–212. [Google Scholar] [CrossRef]
- Afghoul, H.; Krim, F.; Chikouche, D.; Beddar, A. Design and real time implementation of fuzzy switched controller for single phase active power filter. ISA Trans. 2015, 58, 614–621. [Google Scholar] [CrossRef] [PubMed]
- Beddar, A.; Bouzekri, H.; Babes, B.; Afghoul, H. Real time implementation of improved fractional order Proportional-Integral controller for grid connected wind energy conversion system. Rev. Roum. Sci. Tech. 2016, 61, 402–407. [Google Scholar]
- Afghoul, H.; Krim, F.; Beddar, A.; Houabes, M. Switched fractional order controller for grid connected wind energy conversion system. In Proceedings of the 2017 5th International Conference on Electrical Engineering-Boumerdes (ICEE-B), Boumerdes, Algeria, 29–31 October 2017; pp. 1–5. [Google Scholar] [CrossRef]
- Kilbas, A.A.; Srivastava, H.M.; Trujillo, J.J. Theory and Applications of Fractional Differential Equations; Elsevier: Amsterdam, The Netherlands, 2006. [Google Scholar]
- Diethelm, K. The Analysis of Fractional Differential Equations: An Application-Oriented Exposition Using Differential Operators of Caputo Type; Springer Science & Business Media: Berlin/Heidelberg, Germany, 2010. [Google Scholar]
- Feedback Instruments Ltd. Digital Pendulum Control Experiments, Manual: 33-936S; Feedback Instruments Ltd.: Crowborough, UK, 2022. [Google Scholar]
- Fernández Jorquera, M.A.; Zepeda Rabanal, M.I. Diseño, Ajuste y Validación de Controladores Enteros, Fraccionarios y Conmutados para la Estabilización de un Sistema de Péndulo Invertido. Tesis de Pregrado para Optar al Título de Ingeniero Civil en Electrónica, Universidad Tecnológica Metropolitana, Santiago, Chile, 2024. [Google Scholar]
- Chapman, S.J. Electric Machinery Fundamentals; McGraw-Hill: New York, NY, USA, 2005. [Google Scholar]
Parameter | Value | Unit | Description |
---|---|---|---|
Cart–Pendulum System | |||
g | 9.81 | [m/s2] | Gravitational acceleration |
l | 0.36 | [m] | Pendulum length |
M | 2.4 | [kg] | Mass of the cart |
m | 0.23 | [kg] | Mass of the pendulum |
I | 0.099 | [kg m2] | Moment of inertia |
b | 0.05 | [N/rad/s] | Friction coefficient of the cart |
d | 0.005 | [Nms/rad] | Viscous friction coefficient of the pendulum |
DC Motor | |||
Kt | 0.05 | [Nm/A] | Torque constant |
Kb | 0.05 | [Vs/rad] | Electromotive constant |
R | 2.5 | [Ω] | Electrical resistance |
L | 0.0025 | [H] | Electrical inductance |
J | 0.000014 | [Nms2/rad] | Rotor’s moment of inertia |
B | 0.000001 | [Nms/rad] | Friction coefficient |
7 | 0.5 | 4 | 25 | 0.2 | 1.5 |
SW-FOPID-PID controller | ||||||
8.85 | 0.86 | 6.82 | - | - | 0.12 | |
19.11 | 5.25 | 3.61 | - | - | ||
−2.25 | 2.43 | 0.88 | 0.91 | 0.40 | ||
33.41 | 0.78 | −2.17 | 1.56 | 0.56 | ||
PID controller | ||||||
4.53 | 0.58 | 4.82 | - | - | - | |
8.95 | 1.61 | 2.44 | - | - | - | |
FOPID controller | ||||||
2.02 | 3.32 | 11.13 | 0.86 | 0.56 | - | |
48.36 | −0.03 | 6.27 | 1.08 | 0.69 | - |
PIDBASE | 4.75 | 7.34 | 0.18 | 0.19 | 5.99 | 17 | 2.79 | 1.90 | 1.10 |
SW FOPID-PID | 2.91 | 0.20 | 0.07 | 0.015 | 0.45 | 0.94 | 1.71 | 1.71 | 1.09 |
FOPID | 3.66 | 3.85 | 0.13 | 0.13 | 4.38 | 17 | 2.15 | 1.50 | 3.35 |
PID | 1.46 | 6.57 | 0.09 | 0.05 | 4.35 | 16.8 | 8.53 | 7.26 | 1.82 |
PIDBASE | 5.24 | 23.85 | 0.13 | 0.14 | 33.58 | 36.86 | 0.13 | 1.1 | 3.3 |
SW FOPID-PID | 5.09 | 15.81 | 0.14 | 0.18 | 24.64 | 25.62 | 0.12 | 4.16 | 5.8 |
FOPID | 8.82 | 53.05 | 0.36 | 0.15 | 39.31 | 39.46 | 0.22 | 9.0 | 6.9 |
PID | 4.54 | 30.43 | 0.15 | 0.16 | 33.76 | 40 | 0.11 | 1.0 | 3.4 |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2025 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Fernández-Jorquera, M.; Zepeda-Rabanal, M.; Aguila-Camacho, N.; Bárzaga-Martell, L. Design, Tuning, and Experimental Validation of Switched Fractional-Order PID Controllers for an Inverted Pendulum System. Fractal Fract. 2025, 9, 234. https://doi.org/10.3390/fractalfract9040234
Fernández-Jorquera M, Zepeda-Rabanal M, Aguila-Camacho N, Bárzaga-Martell L. Design, Tuning, and Experimental Validation of Switched Fractional-Order PID Controllers for an Inverted Pendulum System. Fractal and Fractional. 2025; 9(4):234. https://doi.org/10.3390/fractalfract9040234
Chicago/Turabian StyleFernández-Jorquera, Matias, Marco Zepeda-Rabanal, Norelys Aguila-Camacho, and Lisbel Bárzaga-Martell. 2025. "Design, Tuning, and Experimental Validation of Switched Fractional-Order PID Controllers for an Inverted Pendulum System" Fractal and Fractional 9, no. 4: 234. https://doi.org/10.3390/fractalfract9040234
APA StyleFernández-Jorquera, M., Zepeda-Rabanal, M., Aguila-Camacho, N., & Bárzaga-Martell, L. (2025). Design, Tuning, and Experimental Validation of Switched Fractional-Order PID Controllers for an Inverted Pendulum System. Fractal and Fractional, 9(4), 234. https://doi.org/10.3390/fractalfract9040234