Fuzzy-PID Control for Balancing a Two-Wheeled Inverted Pendulum Robot
DOI:
https://doi.org/10.59247/jfsc.v4i1.390Keywords:
Fuzzy-PID Controller, Two-Wheeled Inverted Pendulum Robot, Self-Balancing Control, Fuzzy Logic, PID ControllerAbstract
A two-wheeled inverted pendulum robot (TWIPR) requires continuous control action because its upright position is inherently unstable and highly sensitive to disturbances. This research proposes the use of a fuzzy-PID controller to keep the TWIPR balanced. Although PID has several advantages, its performance can degrade when the system is subjected to changing conditions. To address this, fuzzy logic is applied to enhance the adaptive capabilities of the PID controller. The fuzzy system dynamically generates PID parameters based on predetermined fuzzy rules, effectively maintaining system stability. The fuzzy membership functions used, namely MF3, MF5, and MF7, were compared through no-load and loaded tests. In the no-load test, the fuzzy-PID with MF7 reduced rise time, settling time, overshoot, peak value, and peak time by 1.229%, 0.673%, 86.703%, 7.232%, and 2.952%, respectively, compared with those of the conventional PID. However, the MF3 configuration only excels in overshoot and peak time, while the MF5 configuration only shows improvements in settling time, overshoot, and peak value. Further testing results show that Fuzzy-PID with MF7 provides the most stable performance under load conditions.
References
F. Fahmizal, A. Priyatmoko, E. Apriaskar, and A. Mayub, “Heading control on differential drive wheeled mobile robot with odometry for tracking problem,” in 2019 International Conference on Advanced Mechatronics, Intelligent Manufacture and Industrial Automation, ICAMIMIA 2019 - Proceeding, pp. 47–52, 2019, https://doi.org10.1109/ICAMIMIA47173.2019.9223412.
I. I. Hamarash, “Robotic Systems: Introduction Robotic Systems, Chapter I,” 2022, https://doi.org10.13140/RG.2.2.24679.98722.
G. A. Bekey, “Current Trends in Robotics: Technology and Applications,” IEEE Robotics & Automation Magazine, vol. 12, no. 1, pp. 20–23, 2005, https://doi.org10.1109/MRA.2010.935852.
S. W. Nawawi, M. N. Ahmad, and J. H. S. Osman, “Development of a two-wheeled inverted pendulum mobile robot,” in 2007 5th Student Conference on Research and Development, SCORED, 2007 https://doi.org10.1109/SCORED.2007.4451379.
F. Ur Rehman, E. Anderlini, and G. Thomas, “Assessment of collision avoidance strategies for an underwater transportation system,” Journal of Robotics and Control (JRC), vol. 2, no. 5, pp. 385–394, 2021, https://doi.org10.18196/jrc.25112.
R. P. M. Chan, K. A. Stol, and C. R. Halkyard, “Review of modelling and control of two-wheeled robots,” Annual Reviews in Control, vol. 37, no. 1, pp. 89–103, 2013, https://doi.org10.1016/j.arcontrol.2013.03.004.
F. Dai, X. Gao, S. Jiang, W. Guo, and Y. Liu, “A two-wheeled inverted pendulum robot with friction compensation,” Mechatronics, vol. 30, pp. 116–125, 2015, https://doi.org10.1016/j.mechatronics.2015.06.011.
F. Rubio, F. Valero, and C. Llopis-Albert, “A review of mobile robots: Concepts, methods, theoretical framework, and applications,” International Journal of Advanced Robotic Systems, vol. 16, no. 2, pp. 1–22, 2019, https://doi.org10.1177/1729881419839596.
S. Miasa, M. Al-Mjali, A. A. H. Ibrahim, and T. A. Tutunji, “Fuzzy control of a two-wheel balancing robot using DSPIC,” in 2010 7th International Multi-Conference on Systems, Signals and Devices, SSD-10, pp. 1–6, 2010, https://doi.org10.1109/SSD.2010.5585525.
B. Mahler and J. Haase, “Mathematical model and control strategy of a two-wheeled self-balancing robot,” in IECON 2013 - 39th Annual Conference of the IEEE Industrial Electronics Society, IEEE, pp. 4198–4203, 2013, https://doi.org10.1109/IECON.2013.6699809.
A. Shimada and N. Hatakeyama, “Movement control of two-wheeled inverted pendulum robots considering robustness,” in Proceedings of the SICE Annual Conference, pp. 3361–3365, 2008, https://doi.org10.1109/SICE.2008.4655245.
B. H. Prasetio, “Ensemble Kalman filter and PID controller implementation on self balancing robot,” in Proceedings - 2015 International Electronics Symposium: Emerging Technology in Electronic and Information, IES 2015, pp. 105–109, 2016, https://doi.org10.1109/ELECSYM.2015.7380823.
H. Maghfiroh, C. Hermanu, M. H. Ibrahim, M. Anwar, and A. Ramelan, “Hybrid fuzzy-PID like optimal control to reduce energy consumption,” Telkomnika (Telecommunication Computing Electronics and Control), vol. 18, no. 4, pp. 2053–2061, 2020, https://doi.org10.12928/TELKOMNIKA.V18I4.14535.
H. Maghfiroh, M. Nizam, and S. Praptodiyono, “PID optimal control to reduce energy consumption in DC-drive system,” International Journal of Power Electronics and Drive Systems, vol. 11, no. 4, pp. 2164–2172, 2020, https://doi.org10.11591/ijpeds.v11.i4.pp2164-2172.
S. W. Shneen, J. M. D. Alkhasraji, and M. Q. Sulttan, “Internet-based Control of Thermo-optical Plant Improvement based on the PID-GWO System,” Journal of Fuzzy Systems and Control, vol. 2, no. 3, pp. 197–202, 2024, https://doi.org10.59247/jfsc.v2i3.257.
F. N. Abdullah, G. A. Aziz, and S. W. Shneen, “GWO-PID of Two-phase Hybrid Stepping Motor for Robotic Grinding Force,” Journal of Fuzzy Systems and Control, vol. 1, no. 3, pp. 71–79, 2023, https://doi.org10.59247/jfsc.v1i3.91.
T.-D. Huynh et al., “Implementation of Fuzzy-PID Controller for 2-DOF Helicopter,” Journal of Fuzzy Systems and Control, vol. 2, no. 2, pp. 74–80, May 2024, https://doi.org10.59247/jfsc.v2i2.204.
H.-T. Nguyen et al., “Experiment Ball Levitation with Fuzzy PID and PID Implementation,” Journal of Fuzzy Systems and Control, vol. 2, no. 3, pp. 129–134, 2024, https://doi.org10.59247/jfsc.v2i3.221.
X. Jin, K. Chen, Y. Zhao, J. Ji, and P. Jing, “Simulation of hydraulic transplanting robot control system based on fuzzy PID controller,” Measurement: Journal of the International Measurement Confederation, vol. 164, p. 108023, 2020, https://doi.org10.1016/j.measurement.2020.108023.
Q.-T. Do et al., “Modeling and Optimal Control for Two-Wheeled Self-Balancing Robot,” Journal of Fuzzy Systems and Control, vol. 2, no. 1, pp. 22–28, 2024, https://doi.org10.59247/jfsc.v2i1.162.
P. Chotikunnan et al., “Genetic Algorithm-Optimized LQR for Enhanced Stability in Self-Balancing Wheelchair Systems,” Control Systems and Optimization Letters, vol. 2, no. 3, pp. 327–335, 2024, https://doi.org10.59247/csol.v2i3.161.
A. Fahmi, M. Bin Sulaiman, I. Siradjuddin, and A. D. Risdhayanti, “Fish swarmed kalman filter for state observer feedback of two-wheeled mobile robot stabilization,” International Journal of Robotics and Control Systems, vol. 3, no. 3, pp. 470–484, 2023, https://doi.org10.31763/ijrcs.v3i3.1087.
H. Maghfiroh, M. Nizam, M. Anwar, and A. Ma’Arif, “Improved LQR control using PSO optimization and Kalman filter estimator,” IEEE Access, vol. 10, pp. 18330–18337, 2022, https://doi.org10.1109/ACCESS.2022.3149951.
J. Jahaya, S. W. Nawawi, and Z. Ibrahim, “Multi input single output closed loop identification of two wheel inverted pendulum mobile robot,” in 2011 IEEE Student Conference on Research and Development, IEEE, pp. 138–143, 2011,https://doi.org10.1109/SCOReD.2011.6148723.
Qin Yong, Liu Yanlong, Zang Xizhe, and Liu Ji, “Balance control of two-wheeled self-balancing mobile robot based on TS fuzzy model,” in Proceedings of 2011 6th International Forum on Strategic Technology, IEEE, pp. 406–409, 2011, https://doi.org10.1109/IFOST.2011.6021051.
Various, “System Identification ToolboxTM: Getting Started Guide,” MATLAB Manual, Natick, MA, USA, pp. 1–237, 2011, https://www.mathworks.com/help/pdf_doc/ident/ident_gs.pdf/.
E. S. Ghith and F. A. A. Tolba, “Design and Optimization of PID Controller using Various Algorithms for Micro-Robotics System,” Journal of Robotics and Control (JRC), vol. 3, no. 3, pp. 244–256, 2022, https://doi.org10.18196/jrc.v3i3.14827.
Z. Y. Zhao, M. Tomizuka, and S. Isaka, “Fuzzy Gain Scheduling of PID Controllers,” IEEE Transactions on Systems, Man and Cybernetics, vol. 23, no. 5, pp. 1392–1398, 1993, https://doi.org10.1109/21.260670.
K. L. Tang and R. J. Mulholland, “Comparing fuzzy logic with classical controller designs,” IEEE Transactions on Systems, Man and Cybernetics, vol. SMC-17, no. 6, pp. 1085–1087, 1987, https://doi.org10.1109/tsmc.1987.6499321.
Downloads
Published
How to Cite
Issue
Section
License
Copyright (c) 2026 Fahmizal, Afrizal Mayub, Lintang Fathia Rafanah, Smail Latifa

This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.