 Research
 Open Access
PID, BFOoptimized PID, and PDFLC control of a twowheeled machine with twodirection handling mechanism: a comparative study
 K. M. Goher^{1}Email author and
 S. O. Fadlallah^{2}
 Received: 11 April 2018
 Accepted: 24 October 2018
 Published: 3 November 2018
Abstract
In this paper; three control approaches are utilized in order to control the stability of a novel fivedegreesoffreedom twowheeled robotic machine designed for industrial applications that demand a limitedspace working environment. Proportional–integral–derivative (PID) control scheme, bacterial foraging optimization of PID control method, and fuzzy logic control method are applied to the wheeled machine to obtain the optimum control strategy that provides the best system stabilization performance. According to simulation results, considering multiple motion scenarios, the PID controller optimized by bacterial foraging optimization method outperformed the other two control methods in terms of minimum overshoot, rise time, and applied input forces.
Keywords
 Inverted pendulum
 Twowheeled machine
 Twodirection handling
 PID
 BFO
 FLC
Introduction
For a tremendous amount of research studies, providing the ideal control strategy for inverted pendulum (IP)based systems has been and still remains a field of interest. This can be related to the incomparable increase in the twowheeled machines (TWMs) that serves nowadays in many applications, especially in applications that demand working in bounded spaces. For these types of highly unstable nonlinear systems, divergent control approaches have been established [1]. Some of these control methods include proportional–integral–derivative (PID) control scheme, bacterial foraging optimization (BFO) of PID control method, and fuzzy logic control (FLC) method.
Proportional–integral–derivative (PID) control method
This control loop feedback mechanism has been commonly utilized in various control systems, specifically in systems that are based on the inverted pendulum principle. Ren et al. [2] presented a motion control and stability analysis study of a twowheeled vehicle (TWV). For providing a motion control system that balances the TWV and enables the vehicle to track a predefined path, a selftuning PID control strategy is proposed. By employing the same PID control approach with an observerbased state feedback control algorithm, Olivares and Albertos [3] presented and controlled an underactuated flywheel IP system. The study conducted by Wang [4] addressed in detail the issue of adjusting multiple PID controllers simultaneously for the purpose of stabilization and tracking control of three types of IPs.
Bacterial foraging optimization (BFO) algorithm
Initiated by Passino [5], bacterial foraging optimization (BFO) algorithm has been utilized in multiple research aspects and in different applications. Kalaam et al. [6] implemented BFO algorithm in a cascaded control scheme designed for controlling a gridconnected photovoltaic system. For modeling a singlelink flexible manipulator system, Supriyono and Tokhi [7] developed an adaptable chemotactic step size bacterial foraging optimization (BFO) technique. Almeshal et al. [8] utilized the BFO algorithm on a smart fuzzy logic control scheme applied on a unicycle class of differential drive robot on irregular rough terrain.
Significant research studies focused on improving the BFO algorithm’s performance. These improvements were achieved either by combining BFO with another optimization approach [9, 10] or by modifying the algorithm’s actual parameters [11].
Focusing on IPbased systems, Agouri et al. [12] developed a control scheme based on quadratic adaptive bacterial foraging algorithm (QABFA) for controlling a twowheeled robot with an extendable intermediate body (IB) moving on an inclined surface. Alrashid et al. [13] applied a constrained adaptive bacterial foraging optimization strategy for optimizing the control gains of a singlelink inverted pendulum on cart system. On the other hand, Jain et al. [14] implemented BFO algorithm in tuning a PID controller utilized in controlling an inverted pendulum system on fieldprogrammable gate array (FPGA).
Fuzzy logic control (FLC) method
Although the concept of fuzzy logic controller (FLC) was initiated in the 1960s [15], tremendous research studies applied this type of control scheme on IPbased systems because of its ability to deal with nonlinear systems, not to mention its intuitive nature. Czogała et al. [16] presented a rough fuzzy logic controller for stabilizing a pendulumcar system. As for Cheng et al. [17], their study focused on developing a FLC, with a high accuracy and resolution, for the purpose of stabilizing a double IP. On the other hand, Xu et al. [18] designed a FLC which obtains fuzzy rules from a simplified lookup table to stabilize a twowheeled inverted pendulum. For the same aim, Azizan et al. [19] proposed a smart fuzzy control scheme for twowheeled human transporter. The applied control method, when tested against different mass values that represent the transporter’s rider, revealed a high robustness. For an underactuated twowheeled inverted pendulum vehicle with an unstable suspension that is subjected to nonholonomic constraint, Yue et al. [20] developed a composite control approach that consists of a direct fuzzy controller and an adaptive sliding mode technique. Amir et al. [21], for an IP on a cart, developed an effective hybrid swingup and stabilization controller (HSSC) that consists of three controllers: swingup controller, fuzzy stabilization controller, and fuzzy switching controller. As for Yue et al. [22], their study aimed to develop an indirect adaptive fuzzy control that is based on an error databased trajectory planner for controlling a wheeled inverted pendulum vehicle. Other research studies, such as Tinkir et al. [23], focused on comparing a conventional PID controller and an interval type 2 fuzzy logic (IT2FL) control method in order to control the swingup position of a double IP.
Research objective and paper organization
In order to provide the optimal control strategy for IPbased machines and to improve their stability performance, this paper sets a comparison between three control methods: PID controller, bacterial foraging optimization of PID controller, and fuzzy logic controller applied to control and stabilize a fivedegreesoffreedom (DOF) twowheeled robotic machine (TWRM) introduced by Goher [24]. Despite the tremendous amount of control methods, the potential of the three selected approaches when it comes to dealing with highly unstable nonlinear systems such as inverted pendulums, as demonstrated in the literature, has encouraged the authors to investigate their implantation on the new fiveDOF TWRM. The developed fiveDOF twowheeled machine, compared to current TWRMs, delivers payload handling in two mutually perpendicular directions while attached to the intermediate body (IB). This feature, as a result, increases the vehicle’s flexibility and workspace and permits the employment of TWRMs in service and industrial robotic applications (i.e., material handling, objects assembly). The rest of the paper is organized as follows: "Twowheeled robotic machine system description" section demonstrates a detailed description of the fiveDOF twowheeled machine that the control approaches were implemented on. The system’s derived mathematical model is presented in "TWRM mathematical modeling" section. As for "Control system design" section, it illustrates the control system design and the implementation of the three control methods: PID controller, bacterial foraging optimization of PID controller, and fuzzy logic controller on the TWRM’s derived mathematical model. "Conclusions" section concludes the paper by highlighting the findings of the research.
Twowheeled robotic machine system description

The attached payload linear displacement in vertical direction (h_{1}).

The attached payload linear displacement in horizontal direction (h_{2}).

The angular displacement of the angular rotation of the right wheel (δ_{R}).

The angular displacement of the angular rotation of the left wheel (δ_{L}).

The tilt angle of the intermediate body around the vertical Zaxis (θ).
TWRM mathematical modeling
TWRM parameters description [24]
Terminology  Description  Value  Unit 

θ  Tilt angle of the intermediate body around the vertical Zaxis  –  ° 
δ _{R} , δ _{L}  Angular displacement of right and left wheels  –  m 
h_{1}, h_{2}  Vertical and horizontal linear link displacement  –  m 
F_{1}, F_{2}  Force generated by the vertical and horizontal linear actuators  –  N 
τ _{R} , τ _{L}  Right and left wheels torque  –  N/m 
m _{1}  Mass of the chassis  3.1  kg 
m _{2}  Mass of the linear actuators  0.6  kg 
m _{w}  Mass of wheel  0.14  kg 
R  Wheel radius  0.05  m 
J _{1}  Chassis moment of inertia  0.068  kg m^{2} 
J _{2}  Moving mass moment of inertia  0.0093  kg m^{2} 
J _{w}  Wheel moment of inertia  0.000175  kg m^{2} 
Ɩ  Distance of chassis’ center of mass for wheel axle  0.14  m 
µ _{1}  Coefficient of friction of vertical linear actuator  0.3  Ns/m 
µ _{2}  Coefficient of friction of horizontal linear actuator  0.3  Ns/m 
µ _{w}  Coefficient of friction between wheel and ground  0  Ns/m 
µ _{c}  Coefficient of friction between chassis and wheel  0.1  Ns/m 
g  Gravitational acceleration  9.81  m/s^{2} 
Control system design
This section concentrates on implementing and comparing the three control strategies (i.e., PID, bacterial foraging optimization of PID, and fuzzy logic control) for the sake of providing the optimal control strategy that improves the stability performance of the fiveDOF TWRM by controlling the system’s main variables [i.e., angle of the robot’s chassis (θ), angular position of the right wheel (δ_{R}), angular position of the left wheel (δ_{L}), linear displacement of the attached payload in vertical direction (h_{1}), linear displacements of the attached payload in horizontal direction (h_{2})].
PID control design
BFOPID control design
BFO algorithm parameters [5]
Parameter symbol  Description 

p  Search space dimension 
S  Total number of bacteria in the population 
N _{s}  Number of bacteria swims in the same direction 
N _{c}  Number of chemotactic steps 
N _{re}  Number of reproduction steps 
N _{ed}  Number of elimination and dispersal events 
P _{ed}  Probability of the elimination and dispersal of bacterium 
C  Step size of the bacterium tumble 
J  Cost function value 

Mean of the squared error (MSE).

Integral of time multiplied by absolute error (ITAE).

Integral of absolute magnitude of the error (IAE).

Integral of the squared error (ISE).

Integral of time multiplied by the squared error (ITSE).
Controller gain parameters boundary limits
Controlled parameter  Gain parameter  Upper boundary  Lower boundary 

Loop 1  
δ _{R}  Kp _{1}  20  − 20 
Kd _{1}  20  − 20  
Ki _{1}  0.1  − 0.1  
Loop 2  
δ _{L}  Kp _{2}  20  − 20 
Kd _{2}  20  − 20  
Ki _{2}  0.1  − 0.1  
Loop 3  
θ  Kp _{3}  50  − 50 
Kd _{3}  10  − 10  
Ki _{3}  0.1  − 0.1  
Loop 4  
h _{1}  Kp _{4}  20  − 20 
Kd _{4}  10  − 10  
Ki _{4}  0.1  − 0.1  
Loop 5  
h _{2}  Kp _{5}  60  − 60 
Kd _{5}  50  − 50  
Ki _{5}  0.1  − 0.1 
PDFLC control design
Rules of navigation using fuzzy logic
Error  Change of error  

NB  NS  Z  PS  PB  
NB  NB  NB  NB  NS  Z 
NS  NB  NB  NS  Z  PS 
Z  NB  NS  Z  PS  PB 
PS  NS  Z  PS  PB  PB 
PB  Z  PS  PB  PB  PB 
Comparison between implementation of PID, BFOPID, and PDFLC
Gain values for the three control schemes
Output parameter  Gain parameter  PID  BFOPID  PDFLC 

Loop 1  
δ _{R}  Kp _{1}  80  10.255  7 
Kd _{1}  75  0.016  3.5  
Ki _{1}  0.05  15.05  0  
Loop 2  
δ _{L}  Kp _{2}  80  10.255  7 
Kd _{2}  75  0.016  3.5  
Ki _{2}  0.05  15.05  0  
Loop 3  
θ  Kp _{3}  80  − 1.733  7 
Kd _{3}  9  − 0.0693  1.5  
Ki _{3}  0.02  0.0835  0  
Loop 4  
h _{1}  Kp _{4}  8  10.3279  4.5 
Kd _{4}  10  7.3378  6  
Ki _{4}  0.01  0.013  0  
Loop 5  
h _{2}  Kp _{5}  27  50.1502  14 
Kd _{5}  32  30.7237  16  
Ki _{5}  0.05  0.027  0 
System performance comparison between PID, PIDBFO, and PDFLC control methods
Control method  Percent overshoot (%)  Settling time (s)  Rise time (s)  Peak time (s) 

PID  48.1  2.2870  0.2790  0.5710 
PIDBFO  27.9  0.7800  0.2300  0.4400 
PDFLC  38.6  1.4410  0.2170  0.4070 
A phenomenon has been noticed in the scenarios of payload horizontal movement only case (Fig. 9) and the simultaneous horizontal and vertical motion case (Fig. 10). The TWRM’s stability was disturbed by the horizontal actuator’s activation, and the vehicle continues maneuvering instead of maintaining its initial position. This issue was only compensated by the BFoptimized PID controller, where it produced a satisfactory performance and robustness against the disturbance excited by the horizontal actuator’s activation.
Investigating real path trajectory with payload mass
Control system robustness investigation
Conclusions
Proportional–integral–derivative (PID) control scheme, bacterial foraging optimization (BFO) of PID control method, and fuzzy logic control (FLC) method have been applied on a novel fiveDOF twowheeled robotic machine (TWRM), and their performance has been compared in order to determine the optimum control strategy that provides the best stabilization performance for the system. The proposed TWRM’s nonlinear equations of motion have been derived using Lagrangian modeling approach and simulated with the assistance of MATLAB/Simulink^{®} environment. Based on the five case scenarios’ simulation results (i.e., payload free movement, payload vertical movement only, payload horizontal movement only, simultaneous horizontal and vertical motion, and 1m straight line vehicle motion), the BFOPID control scheme has a superior performance compared to the other two control methods. This performance has been reflected through the reduction in percent overshoot, rise time, and the applied input forces. The same performance was expected from the BFOPID method when the system was tested against external disturbance forces. Despite the satisfactory performance of the system using BFO technique, BFA has a slow convergence speed and longer computation time which makes the implementation unrealistic in realtime tuning for solving a complex realworld problem. In this research, only simulation scenarios have been considered and hence little concern has been considered about the limitations of BFO. Future considerations of this work will consider implementing and comparing various optimization techniques such as genetic algorithm (GA), spiral dynamics (SD), hybrid spiral dynamics bacterial chemotaxis (HSDBC), and particle swarm optimization algorithm (PSO) for optimizing the TWRM’s PID controller gains in order to improve the system’s stabilization performance. Furthermore, investigating the robustness of the system will be considered not only in the application scenario, but also in the system itself. By changing the system’s physical parametric specifications, the performance of the proposed control methods in different parameters of the system will be evaluated.
Moreover, the TWRM’s hardware model can be built and the performance of the control approaches implemented on the system will be examined against real disturbance forces for real industrial applications.
Declarations
Authors’ contributions
KMG initiated the concept of twowheeled machine with the twodirection handling mechanism. He derived the mathematical model in the linear and nonlinear forms. KMG simulated the system model and designed and implemented the control approach. SOF helped in writing the final format of the paper and analyzing and interpreting the results. SOF also led the work during the revision process and responded to the reviewer’s comments. Both authors read and approved the final manuscript.
Acknowledgements
The authors of this paper would like to thank the University of Lincoln for offering the funding support for this publication.
Competing interests
The authors declare that they have no competing interests.
Funding
This research has been funded by Sultan Qaboos University (Oman) for the simulation studies and the University of Lincoln (UK) for publication charges.
Publisher’s Note
Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Open AccessThis article is distributed under the terms of the Creative Commons Attribution 4.0 International License (http://creativecommons.org/licenses/by/4.0/), which permits unrestricted use, distribution, and reproduction in any medium, provided you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license, and indicate if changes were made.
Authors’ Affiliations
References
 Chan RPM, Stol KA, Halkyard CR. Review of modelling and control of twowheeled robots. Annu Rev Control. 2013;37(1):89–103.View ArticleGoogle Scholar
 Ren TJ, Chen TC, Chen CJ. Motion control for a twowheeled vehicle using a selftuning PID controller. Control Eng Pract. 2008;16:365–75.View ArticleGoogle Scholar
 Olivares M, Albertos P. Linear control of the flywheel inverted pendulum. ISA Trans. 2014;53(5):1396–403.View ArticleGoogle Scholar
 Wang J. Simulation studies of inverted pendulum based on PID controllers. Simul Model Pract Theory. 2011;19(1):440–9.View ArticleGoogle Scholar
 Passino KM. Biomimicry of bacterial foraging for distributed optimization and control. In: Proceedings of the IEEE control system magazine; 2002. p. 52–67.Google Scholar
 Kalaam RN, Hasanien HM, AlDurra A, AlWahedi K, Muyeen SM. Optimal design of cascaded control scheme for PV system using BFO algorithm. In: International conference on renewable energy research and applications (ICRERA), Palermo; 2015. p. 907–12.Google Scholar
 Supriyono H, Tokhi MO. Parametric modelling approach using bacterial foraging algorithms for modelling of flexible manipulator systems. Eng Appl Artif Intell. 2012;25(5):898–916.View ArticleGoogle Scholar
 Almeshal A, Goher K, Alenezi MR, Almazeed A, Almatawah J, Moaz M. BFA optimized intelligent controller for path following unicycle robot over irregular terrains. Int J Curr Eng Technol. 2015;5(2):1199–204.Google Scholar
 Nasir ANK, Tokhi MO. A novel hybrid bacteriachemotaxis spiraldynamic algorithm with application to modelling of flexible systems. Eng Appl Artif Intell. 2014;33:31–46.View ArticleGoogle Scholar
 Nasir ANK, Tokhi MO, Ghani NMA. Novel hybrid bacterial foraging and spiral dynamics algorithms. In: 13th UK workshop on computational intelligence (UKCI), Guildford; 2013. p. 199–205.Google Scholar
 Nasir ANK, Tokhi MO, Ghani NMA. Novel adaptive bacterial foraging algorithms for global optimisation with application to modelling of a TRS. Expert Syst Appl. 2015;42(3):1513–30.View ArticleGoogle Scholar
 Agouri SA, Tokhi MO, Almeshal AM, Goher KM. BFA optimisation of control parameters of a new structure twowheeled robot on inclined surface. In: Paper presented at the natureinspired mobile robotics: proceedings of the 16th international conference on climbing and walking robots and the support technologies for mobile machines, CLAWAR 2013; 2013. p. 189–96.Google Scholar
 Alrashid N, Alfarsi Y, AlKhudhier H. Application of constrained quadratic adaptive bacterial foraging optimisation algorithm on a single link inverted pendulum. Int J Curr Eng Technol. 2015;5(5):3301–4.Google Scholar
 Jain T, Patel V, Nigam MJ. Implementation of PID controlled SIMO process on FPGA using bacterial foraging for optimal performance. Int J Comput Electr Eng. 2009;1(2):107–10.View ArticleGoogle Scholar
 Zadeh LA. Fuzzy sets. Inf Control. 1965;8:353–83.View ArticleGoogle Scholar
 Czogała E, Mrózekb A, Pawlakc Z. The idea of a rough fuzzy controller and its application to the stabilization of a pendulumcar system. Fuzzy Sets Syst. 1995;72:61–73.View ArticleGoogle Scholar
 Cheng F, Zhong G, Li Y, Xu Z. Fuzzy control of a double inverted pendulum. Fuzzy Sets Syst. 1996;79:315–21.MathSciNetView ArticleGoogle Scholar
 Xu J, Guo Z, Heng T. Synthesized design of a fuzzy logic controller for an underactuated unicycle. Fuzzy Sets Syst. 2012;207:77–93.MathSciNetView ArticleGoogle Scholar
 Azizan H, Jafarinasab M, Behbahani S, Danesh M. Fuzzy control based on LMI approach and fuzzy interpretation of the rider input for two wheeled balancing human transporter. In: Proceeding of the 8th IEEE international conference on control and automation (ICCA); 2010. p. 192–7.Google Scholar
 Yue M, Wang S, Sun JZ. Simultaneous balancing and trajectory tracking control for twowheeled inverted pendulum vehicles: a composite control approach. Neurocomputing. 2016;191:44–54.View ArticleGoogle Scholar
 Amir D, Chefranov AG. An effective hybrid swingup and stabilization controller for the inverted pendulumcart system. In: IEEE international conference on automation quality and testing robotics (AQTR); 2010. p. 1–6.Google Scholar
 Yue M, An C, Du Y, Sun J. Indirect adaptive fuzzy control for a nonholonomic/underactuated wheeled inverted pendulum vehicle based on a datadriven trajectory planner. Fuzzy Sets Syst. 2016;290:158–77.MathSciNetView ArticleGoogle Scholar
 Tinkir M, Onen U, Kalyoncu M, Botsali FM. PID and interval type2 fuzzy logic control of double inverted pendulum system. In: The 2nd international conference on computer and automation engineering (ICCAE); 2010, p. 117–21.Google Scholar
 Goher KM. A twowheeled machine with a handling mechanism in two different directions. Robot Biomim. 2016;3(17):1–22.Google Scholar
 Goher KM, Fadlallah SO. Bacterial foragingoptimized PID control of a twowheeled machine with a twodirectional handling mechanism. Robot Biomim. 2017;4(1):1.View ArticleGoogle Scholar