Control of a Two-wheeled Machine with Two-directions Handling Mechanism Using PID and PD-FLC Algorithms


This paper presents a novel five degrees of freedom (DOF) two-wheeled robotic machine (TWRM) that delivers solutions for both industrial and service robotic applications by enlarging the vehicle’s workspace and increasing its flexibility. Designing a two-wheeled robot with five degrees of freedom creates a high challenge for the control, therefore the modelling and design of such robot should be precise with a uniform distribution of mass over the robot and the actuators. By employing the Lagrangian modelling approach, the TWRM’s mathematical model is derived and simulated in Matlab/Simulink®. For stabilizing the system’s highly nonlinear model, two control approaches were developed and implemented: proportional-integral-derivative (PID) and fuzzy logic control (FLC) strategies. Considering multiple scenarios with different initial conditions, the proposed control strategies’ performance has been assessed.


  1. [1]

    R. P. M. Chan, K. A. Stol, C. R. Halkyard. Review of modelling and control of two-wheeled robots. Annual Reviews in Control, vol. 37, no. 1, pp. 89–103, 2013. DOI:

    Google Scholar 

  2. [2]

    G. Chinnadurai, H. Ranganathan. IOT controlled two wheel self supporting robot without external sensor. Middle-East Journal of Scientific Research (Sensing, Signal Processing and Security), vol. 23, pp. 286–290, 2015. DOI:

    Google Scholar 

  3. [3]

    J. Mayr, F. Spanlang, H. Gattringer. Mechatronic design of a self-balancing three-dimensional inertia wheel pendulum. Mechatronics, vol. 30, pp. 1–10, 2015. DOI:

    Google Scholar 

  4. [4]

    J. H. Lee, H. J. Shin, S. J. Lee, S. Jung. Balancing control of a single-wheel inverted pendulum system using air blowers: evolution of Mechatronics capstone design. Mechatronics, vol. 23, no. 8, pp. 926–932, 2013. DOI:

    Google Scholar 

  5. [5]

    F. Q. Dai, X. S. Gao, S. G. Jiang, W. Z. Guo, Y. B. Liu. A two-wheeled inverted pendulum robot with friction compensation. Mechatronics, vol. 30, pp. 116–125, 2015. DOI:

    Google Scholar 

  6. [6]

    K. M. K. Goher, M. O. Tokhi. Balance control of a TWRM with a dynamic payload. In Proceedings of the 11th International Conference on Climbing and Walking Robots and the support Technologies for Mobile Machines, World Scientific, Coimbra, Portugal, 2008. DOI:

    Google Scholar 

  7. [7]

    A. M. Almeshal, K. M. Goher, M. O. Tokhi. Dynamic modelling and stabilization of a new configuration of two-wheeled machines. Robotics and Autonomous Systems, vol. 61, no. 5, pp. 443–472, 2013. DOI:

    Google Scholar 

  8. [8]

    M. Bettayeb, C. Boussalem, R. Mansouri, U. M. Al-Saggaf. Stabilization of an inverted pendulum-cart system by fractional PI-state feedback. ISA Transactions, vol. 53, no. 2, pp. 508–516, 2014. DOI:

    Google Scholar 

  9. [9]

    I. Boussaada, I. C. Morărescu, S. I. Niculescu. Inverted pendulum stabilization: characterization of codimension-three triple zero bifurcation via multiple delayed proportional gains. Systems & Control Letters, vol. 82, pp. 1–9, 2015. DOI:

    MathSciNet  MATH  Google Scholar 

  10. [10]

    R. M. Brisilla, V. Sankaranarayanan. Nonlinear control of mobile inverted pendulum. Robotics and Autonomous Systems, vol. 70, pp. 145–155, 2015. DOI:

    Google Scholar 

  11. [11]

    R. X. Cui, J. Guo, Z. Y. Mao. Adaptive backstepping control of wheeled inverted pendulums models. Nonlinear Dynamics, vol. 79, no. 1, pp. 501–511, 2015. DOI:

    MathSciNet  MATH  Google Scholar 

  12. [12]

    E. Vinodh Kumar, J. Jerome. Robust LQR controller design for stabilizing and trajectory tracking of inverted pendulum. Procedia Engineering, vol. 64, pp. 169–178, 2013. DOI:

    Google Scholar 

  13. [13]

    L. B. Prasad, B. Tyagi, H. O. Gupta. Optimal control of nonlinear inverted pendulum system using PID controller and LQR: performance analysis without and with disturbance input. International Journal of Automation and Computing, vol. 11, no. 6, pp. 661–670, 2014. DOI:

    Google Scholar 

  14. [14]

    J. Lee, R. Mukherjee, H. K. Khalil. Output feedback stabilization of inverted pendulum on a cart in the presence of uncertainties. Automatica, vol. 54, pp. 146–157, 2015. DOI:

    MathSciNet  MATH  Google Scholar 

  15. [15]

    M. Olivares, P. Albertos. Linear control of the flywheel inverted pendulum. ISA Transactions, vol. 53, no. 5, pp. 1396–1403, 2014. DOI:

    Google Scholar 

  16. [16]

    G. V. Raffo, M. G. Ortega, V. Madero, F. R. Rubio. Two-wheeled self-balanced pendulum workspace improvement via underactuated robust nonlinear control. Control Engineering Practice, vol. 44, pp. 231–242, 2015. DOI:

    Google Scholar 

  17. [17]

    D. H. Al-Janan, H. C. Chang, Y. P. Chen, T. K. Liu. Optimizing the double inverted pendulum’s performance via the uniform neuro multiobjective genetic algorithm. International Journal of Automation and Computing, vol. 14, no. 6, pp. 686–695, 2017. DOI:

    Google Scholar 

  18. [18]

    L. A. Zadeh. Fuzzy sets. Information and Control, vol. 8, no. 3, pp. 338–353, 1965. DOI:

    MathSciNet  MATH  Google Scholar 

  19. [19]

    R. E. Precup, H. Hellendoorn. A survey on industrial applications of fuzzy control. Computers in Industry, vol. 62, no. 3, pp. 213–226, 2011. DOI:

    Google Scholar 

  20. [20]

    H. Azizan, M. Jafarinasab, S. Behbahani, M. Danesh. Fuzzy control based on LMI approach and fuzzy interpretation of the rider input for two wheeled balancing human transporter. In Proceedings of the 8th IEEE International Conference on Control and Automation, IEEE, Xiamen, China, pp. 192–197, 2010. DOI:

    Google Scholar 

  21. [21]

    J. X. Xu, Z. Q. Guo, T. H. Lee. Synthesized design of a fuzzy logic controller for an underactuated unicycle. Fuzzy Sets and Systems, vol. 207, pp. 77–93, 2012. DOI:

    MathSciNet  MATH  Google Scholar 

  22. [22]

    M. Yue, C. An, Y. Du, J. Z. Sun. Indirect adaptive fuzzy control for a nonholonomic/underactuated wheeled inverted pendulum vehicle based on a data-driven trajectory planner. Fuzzy Sets and Systems, vol. 290, pp. 158–177, 2016. DOI:

    MathSciNet  MATH  Google Scholar 

  23. [23]

    M. Yue, S. Wang, J. Z. Sun. Simultaneous balancing and trajectory tracking control for two-wheeled inverted pendulum vehicles: a composite control approach. Neurocomputing, vol. 191, pp. 44–54, 2016. DOI:

    Google Scholar 

  24. [24]

    S. Nundrakwang, T. Benjanarasuth, J. Ngamwiwit, N. Komine. Hybrid controller for swinging up inverted pendulum system. In Proceedings of the 5th International Conference on Information Communications & Signal Processing, IEEE, Bangkok, Thailand, pp. 488–492, 2005. DOI:

    Google Scholar 

  25. [25]

    D. Amir, A. G. Chefranov. An effective hybrid swing-up and stabilization controller for the inverted pendulum-cart system. In Proceedings of IEEE International Conference on Automation, Quality and Testing, Robotics, Cluj-Napoca, Romania, 2010. DOI:

    Google Scholar 

  26. [26]

    R. C. Tatikonda, V. P. Battula, V. Kumar. Control of inverted pendulum using adaptive neuro fuzzy inference structure (ANFIS). In Proceedings of IEEE International Symposium on Circuits and Systems, Paris, France, pp. 1348–1351, 2010. DOI:

    Google Scholar 

  27. [27]

    G. C. Liu, M. T. Li, W. Guo, H. G. Cai. Control of a biped walking with dynamic balance. In Proceedings of IEEE International Conference on Mechatronics and Automation, IEEE, Chengdu, China, pp. 261–267, 2012. DOI:

    Google Scholar 

  28. [28]

    E. Kiankhah, M. Teshnelab, M. A. Shoorehdeli. Feedback-error-learning for stability of double inverted pendulum. In Proceedings of IEEE International Conference on Systems, Man and Cybernetics, San Antonio, USA, pp. 4496–4501, 2009. DOI:

    Google Scholar 

  29. [29]

    J. Yi, N. Yubazaki. Stabilization fuzzy control of inverted pendulum systems. Artificial Intelligence in Engineering, vol. 14, no. 2, pp. 153–163, 2000. DOI:

    Google Scholar 

  30. [30]

    J. Q. Yi, N. Yubazaki, K. Hirota. Upswing and stabilization control of inverted pendulum system based on the SIRMs dynamically connected fuzzy inference model. Fuzzy Sets and Systems, vol. 122, no. 1, pp. 139–152, 2001. DOI:

    MathSciNet  MATH  Google Scholar 

  31. [31]

    J. Q. Yi, N. Yubazaki, K. Hirota. A new fuzzy controller for stabilization of parallel-type double inverted pendulum system. Fuzzy Sets and Systems, vol. 126, no. 1, pp. 105–119, 2002. DOI:

    MathSciNet  MATH  Google Scholar 

  32. [32]

    E. Czogała, A. Mrózekb, Z. Pawlak. The idea of a rough fuzzy controller and its application to the stabilization of a pendulum-car system. Fuzzy Sets and Systems, vol. 72, no. 1, pp. 61–73, 1995. DOI:

    Google Scholar 

  33. [33]

    F. Y. Cheng, G. M. Zhong, Y. S. Li, Z. M. Xu. Fuzzy control of a double-inverted pendulum. Fuzzy Sets and Systems, vol. 79, no. 3, pp. 315–321, 1996. DOI:

    MathSciNet  Google Scholar 

  34. [34]

    S. Yurkovich, M. Widjaja. Fuzzy controller synthesis for an inverted pendulum system. Control Engineering Practice, vol. 4, no. 4, pp. 455–469, 1996. DOI:

    Google Scholar 

  35. [35]

    K. H. Su, Y. Y. Chen, S. F. Su. Design of neural-fuzzy-based controller for two autonomously driven wheeled robot. Neurocomputing, no. 13–15, pp. 2478–2488, 2010. DOI:

    Google Scholar 

  36. [36]

    Y. Becerikli, B. K. Celik. Fuzzy control of inverted pendulum and concept of stability using Java application. Mathematical and Computer Modelling, no. 1–2, pp. 24–37, 2007. DOI:

    MathSciNet  MATH  Google Scholar 

  37. [37]

    S. K. Oh, W. Pedrycz, S. B. Rho, T. C. Ahn. Parameter estimation of fuzzy controller and its application to inverted pendulum. Engineering Applications of Artificial Intelligence, vol. 17, no. 1, pp. 37–60, 2004. DOI:

    Google Scholar 

  38. [38]

    G. H. Li, X. Liu. Dynamic characteristic prediction of inverted pendulum under the reduced-gravity space environments. Acta Astronautica, no. 5–6, pp. 596–604, 2010. DOI:

    Google Scholar 

  39. [39]

    C. W. Tao, J. S. Taur, C. M. Wang, U. S. Chen. Fuzzy hierarchical swing-up and sliding position controller for the inverted pendulum-cart system. Fuzzy Sets and Systems, vol. 159, no. 20, pp. 2763–2784, 2008. DOI:

    MathSciNet  MATH  Google Scholar 

  40. [40]

    E. Sivaraman, S. Arulselvi. Modeling of an inverted pendulum based on fuzzy clustering techniques. Expert Systems with Applications, vol. 38, no. 11, pp. 13942–13949, 2011. DOI:

    Google Scholar 

  41. [41]

    S. H. Peng, C. Hao, D. H. Li. Fuzzy path planning of two-wheeled robot optimized by gold mean. Informatics in Control, Automation and Robotics, D. H. Yang, Ed., Berlin, Heidelberg, Germany: Springer, pp. 477–484, 2011. DOI:

    Google Scholar 

  42. [42]

    E. Hashemi, M. Ghaffari Jadidi, N. Ghaffari Jadidi. Model-based PI-fuzzy control of four-wheeled omni-directional mobile robots. Robotics and Autonomous Systems, vol. 59, no. 11, pp. 930–942, 2011. DOI:

    Google Scholar 

  43. [43]

    S. Ahmad, N. H. Siddique, M. O. Tokhi. Modular fuzzy logic controller for motion control of two-wheeled wheel-chair. Fuzzy Logic, Intech, pp. 37–58, 2012. DOI: 10.5772/37584.

    Google Scholar 

  44. [44]

    H. C. Lu, M. H. Chang, C. H. Tsai. Adaptive self-constructing fuzzy neural network controller for hardware implementation of an inverted pendulum system. Applied Soft Computing, vol. 11, no. 5, pp. 3962–3975, 2011. DOI:

    Google Scholar 

  45. [45]

    S. Ahmad, M. O. Tokhi. Steering motion control enhancement scheme of two wheeled wheelchair in confined spaces. International Journal of Automation and Control Engineering, vol. 2, no. 4, pp. 179–189, 2013.

    Google Scholar 

  46. [46]

    O. Castillo, P. Melin. A review on interval type-2 fuzzy logic applications in intelligent control. Information Sciences, vol. 279, pp. 615–631, 2014. DOI:

    MathSciNet  MATH  Google Scholar 

  47. [47]

    A. M. El-Nagar, M. El-Bardini. Practical Implementation for the interval type-2 fuzzy PID controller using a low cost microcontroller. Ain Shams Engineering Journal, vol. 5, no. 2, pp. 475–487, 2014. DOI:

    Google Scholar 

  48. [48]

    A. M. El-Nagar, M. El-Bardini, N. M. EL-Rabaie. Intelligent control for nonlinear inverted pendulum based on interval type-2 fuzzy PD controller. Alexandria Engineering Journal, vol. 53, no. 1, pp. 23–32, 2014. DOI:

    Google Scholar 

  49. [49]

    M. El-Bardini, A. M. El-Nagar. Interval type-2 fuzzy PID controller for uncertain nonlinear inverted pendulum system. ISA Transactions, vol. 53, no. 3, pp. 732–743, 2014. DOI:

    Google Scholar 

  50. [50]

    T. S. Wu, M. Karkoub. H fuzzy adaptive tracking control design for nonlinear systems with output delays. Fuzzy Sets and Systems, vol. 254, pp. 1–25, 2014. DOI:

    MathSciNet  MATH  Google Scholar 

  51. [51]

    Z. Sun, N. Wang, Y. R. Bi. Type-1/Type-2 fuzzy logic systems optimization with RNA genetic algorithm for double inverted pendulum. Applied Mathematical Modelling, vol. 39, no. 1, pp. 70–85, 2015. DOI:

    MathSciNet  MATH  Google Scholar 

  52. [52]

    K. M. Goher. A two-wheeled machine with a handling mechanism in two different directions. Robotics and Biomimetics, vol. 3, Article number 17, 2016. DOI:

    Google Scholar 

  53. [53]

    K. M. Goher, S. O. Fadlallah. Bacterial foraging-optimized PID control of a two-wheeled machine with a two-directional handling mechanism. Robotics and Biomimetics, vol. 4, Article number 1, 2017. DOI:

    Google Scholar 

  54. [54]

    K. M. Goher, S. O. Fadlallah. PID, BFO-optimized PID, and PD-FLC control of a two-wheeled machine with two-direction handling mechanism: a comparative study. Robotics and Biomimetics, vol. 5, pp. Article number 6, 2018. DOI:

    Google Scholar 

Download references

Author information



Corresponding authors

Correspondence to Khaled M. Goher or Sulaiman O. Fadlallah.

Additional information

Recommended by Associate Editor Min Cheol Lee

Khaled M. Goher received the Ph. D. degree in control engineering at Department of Automatic Control and Systems Engineering, University of Sheffield, UK in 2010. He, Ph. D., PGCertHE (postgraduate certificate in higher education), MIET (member of the Institute of Engineering and Technology), is currently working as a senior lecturer in robotics & automation at University of Lincoln, UK. Before that date, he was a lecturer in biomedical engineering at Aston University, UK, a lecturer of robotics and autonomous systems at Lincoln University, New Zealand and an assistant professor at Sultan Qaboos University, Oman. He has an extensive publication record in peer-reviewed journals, international conferences and a recently published book on mobile wheeled machines.

His research interests include kinematics, dynamics and control of mobile robotics, assistive technologies and rehabilitation engineering for elderly and disabled people and vibration suppression in high speed machines. He is particularly interested in design, building and investigating scientific and engineering reconfigurable mechanisms serving disabled people and elderly.

Sulaiman O. Fadlallah received the B. Sc. degree in mechatronics engineering and the M. Sc. degree in mechanical engineering from Sultan Qaboos University, Oman in 2013 and 2015, respectively. During his Master’s thesis, he developed a novel portable leg rehabilitation system to assist patients with lower limb disabilities and elderly people with knee and ankle difficulties. He is currently a Ph. D. degree candidate in mechanical engineering at Auckland University of Technology (AUT), New Zealand.

His research interests include bio-mechanics, rehabilitation engineering and design and control of robotic systems.

Rights and permissions

Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made.

The images or other third party material in this article are included in the article’ Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article’s Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder.

To view a copy of this licence, visit

Reprints and Permissions

About this article

Verify currency and authenticity via CrossMark

Cite this article

Goher, K.M., Fadlallah, S.O. Control of a Two-wheeled Machine with Two-directions Handling Mechanism Using PID and PD-FLC Algorithms. Int. J. Autom. Comput. 16, 511–533 (2019).

Download citation


  • Two-wheeled inverted pendulum (IP) with two direction handling
  • Lagrangian formulation
  • proportional-integral-derivative (PID)
  • fuzzy logic control (FLC)
  • under-actuated systems