- Open Access
PID, BFO-optimized PID, and PD-FLC control of a two-wheeled machine with two-direction handling mechanism: a comparative study
Robotics and Biomimetics volume 5, Article number: 6 (2018)
In this paper; three control approaches are utilized in order to control the stability of a novel five-degrees-of-freedom two-wheeled robotic machine designed for industrial applications that demand a limited-space 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.
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 two-wheeled 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 . 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.  presented a motion control and stability analysis study of a two-wheeled vehicle (TWV). For providing a motion control system that balances the TWV and enables the vehicle to track a predefined path, a self-tuning PID control strategy is proposed. By employing the same PID control approach with an observer-based state feedback control algorithm, Olivares and Albertos  presented and controlled an under-actuated flywheel IP system. The study conducted by Wang  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 , bacterial foraging optimization (BFO) algorithm has been utilized in multiple research aspects and in different applications. Kalaam et al.  implemented BFO algorithm in a cascaded control scheme designed for controlling a grid-connected photovoltaic system. For modeling a single-link flexible manipulator system, Supriyono and Tokhi  developed an adaptable chemotactic step size bacterial foraging optimization (BFO) technique. Almeshal et al.  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 .
Focusing on IP-based systems, Agouri et al.  developed a control scheme based on quadratic adaptive bacterial foraging algorithm (QABFA) for controlling a two-wheeled robot with an extendable intermediate body (IB) moving on an inclined surface. Al-rashid et al.  applied a constrained adaptive bacterial foraging optimization strategy for optimizing the control gains of a single-link inverted pendulum on cart system. On the other hand, Jain et al.  implemented BFO algorithm in tuning a PID controller utilized in controlling an inverted pendulum system on field-programmable gate array (FPGA).
Fuzzy logic control (FLC) method
Although the concept of fuzzy logic controller (FLC) was initiated in the 1960s , tremendous research studies applied this type of control scheme on IP-based systems because of its ability to deal with nonlinear systems, not to mention its intuitive nature. Czogała et al.  presented a rough fuzzy logic controller for stabilizing a pendulum-car system. As for Cheng et al. , 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.  designed a FLC which obtains fuzzy rules from a simplified lookup table to stabilize a two-wheeled inverted pendulum. For the same aim, Azizan et al.  proposed a smart fuzzy control scheme for two-wheeled human transporter. The applied control method, when tested against different mass values that represent the transporter’s rider, revealed a high robustness. For an under-actuated two-wheeled inverted pendulum vehicle with an unstable suspension that is subjected to non-holonomic constraint, Yue et al.  developed a composite control approach that consists of a direct fuzzy controller and an adaptive sliding mode technique. Amir et al. , for an IP on a cart, developed an effective hybrid swing-up and stabilization controller (HSSC) that consists of three controllers: swing-up controller, fuzzy stabilization controller, and fuzzy switching controller. As for Yue et al. , their study aimed to develop an indirect adaptive fuzzy control that is based on an error data-based trajectory planner for controlling a wheeled inverted pendulum vehicle. Other research studies, such as Tinkir et al. , focused on comparing a conventional PID controller and an interval type 2 fuzzy logic (IT2FL) control method in order to control the swing-up position of a double IP.
Research objective and paper organization
In order to provide the optimal control strategy for IP-based 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 five-degrees-of-freedom (DOF) two-wheeled robotic machine (TWRM) introduced by Goher . 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 five-DOF TWRM. The developed five-DOF two-wheeled 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: "Two-wheeled robotic machine system description" section demonstrates a detailed description of the five-DOF two-wheeled 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.
Two-wheeled robotic machine system description
The schematics diagram of the developed two-wheeled robotic machine (TWRM) is illustrated in Fig. 1. The robotic system consists of chassis, with center of gravity at point P1, and the linear actuators’ mass, with center of gravity at point P2. As long as the wheeled machine maneuvers far from its initial position, along the X-axis, P1 and P2 coordinates will vary. Each wheel has been connected to a motor that provides the substantial torque, τR and τL, needed to control the TWRM. Both accelerometer and gyroscope sensors were fit to the robotic system in order to provide the necessary state variables that enables the applied control scheme to preserve the TWRM’s position at the upright position uninterruptedly. With respect to the X- and Z-axis and referring to Fig. 1, the TWRM’s five DOFs can be defined as the following:
The attached payload linear displacement in vertical direction (h1).
The attached payload linear displacement in horizontal direction (h2).
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 Z-axis (θ).
For a picking and placing scenario, Table 1 demonstrates the engagement of each of the wheeled machine’s actuators for each sub-task, along with the DOFs associated with the corresponding process task. The reason behind the continuous activation of the TWRM wheels’ motors is due to the external disturbances taking place while performing the picking and/or placing task, as well as the center of mass’s continuous variation. Therefore, it is crucial to the wheels’ motors to develop the necessary torque signal in order to maintain the upright vertical position of the TWRM. Moving to the linear actuators, their engagement is related to the appointed sub-task. Switching mechanisms are designed, as a major part of the three investigated control schemes, in order to define the period of engagement of each individual actuator in service.
TWRM mathematical modeling
The TWRM’s mathematical model, explained in detail by Goher , is derived by employing Lagrangian modeling approach, which is considered as one of the powerful techniques for obtaining the equations of motion for any sophisticated system. Referring to the two-wheeled robotic machine’s schematics diagram in Fig. 1 and its physical parametric specifications listed in Table 2, the system’s kinematics was related to the torques/forces applied to its links and the five highly coupled differential equations of motion are represented as follows:
The developed mathematical model of the TWRM, considering the simulation parameters listed in Table 2, is simulated in MATLAB/Simulink® environment, and an open-loop response investigation was carried out in order to examine the behavior of the developed model. Figure 2 illustrates the system’s open-loop simulation results. It is clear from the simulation results of the five targeted control variables [i.e., pitch angle (θ), vertical link displacement (h1), horizontal link displacement (h2), right wheel displacement (δR), and left wheel displacement (δL)] that the TWRM is a nonlinear unstable system that requires a closed-loop configuration in order to achieve the desired performance in terms of stabilizing the TWRM.
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 five-DOF 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 (h1), linear displacements of the attached payload in horizontal direction (h2)].
PID control design
The strategy schematics which are based on designing a feedback control mechanism mainly consist of five control loops, for controlling the TWRM by employing PID control scheme which is demonstrated in Fig. 3. By measuring the error in the tilt angle of the IB, the angular position of the IB is controlled. Out of the five feedback control loops, two are designed in order to control the position of the object by considering the object position’s error as an input and the actuation force as an output. As for the two remaining control loops, they are designed with a view to mobilize the TWRM to follow a certain planner motion in the XY plane. For these two feedback loops, the error in the angular position of each wheel is considered as an input. Referring to Fig. 3, both the linear actuator forces (F1, F2) and the driving torques of the right and left wheels’ motors (τR, τL) are defined as inputs to the TWRM. In order to prevent any disturbance at the start of working as a result of lifting an object, since the TWRM is designed for the applications of picking and/or placing, two switching mechanisms are added to the system to insure the occurrence of system stability before proceeding with the object handling task and to prevent any disturbance that might affect the control effort. The mechanisms are designed in a way that the linear actuators will activate only when the TWRM’s IB reaches the stable upright position.
BFO-PID control design
This part deals with employing bacterial foraging optimization technique on the five-DOF TWRM’s PID control scheme, employed at earlier stages of this research, in order to control the vehicle by maintaining the TWRM’s IB in the upright position while counteracting the disturbances occurring due to various motion scenarios. The BFO main parameters are listed in Table 3, whereas Fig. 4 demonstrates the algorithm’s flowchart.
In applying optimization techniques, the most crucial part is to select the objective functions that will be employed to evaluate the fitness function. Using performance indices to evaluate the controlled loops’ errors, the objective functions can be created. These performance indices, that have been utilized to optimize the system’s errors, can be defined as the following:
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).
Based on the study conducted by Goher and Fadlallah , the best optimized PID controller was the one optimized by IAE for the low percent overshoot and minimum settling time. MATLAB/Simulink model of the BFO-PID control method built to control the TWRM is illustrated in Fig. 5. Table 4 lists the controller gain parameters boundary limits for each of the five control loops that are implemented in MATLAB/Simulink environment with a view to optimize these gains.
PD-FLC control design
For the five-DOF TWRM, the author propose a control scheme that consists of a robust PD-like fuzzy logic control strategy (FLC), as demonstrated in Fig. 6, with five independent control loops designed to control the vehicle for multiple-motion scenarios. Simple Mamdani fuzzy approach are implemented in the control of the two-wheeled robotic machine, where the inputs are the angle and velocity and the output is multiplication factor. This factor will be multiplied with the potentiometer data and will affect the TWRM’s both right and left wheels’ velocity. The vehicle’s pitch angle and angular velocity feedback values are combined with fuzzy control, where the output is a multiplication factor that represents each wheel’s actuation values. Both the wheels’ angular velocity and the pitch angle consist of five membership functions. It is worth to mention that the steering system’s value will impact each wheel (left and right) independently but simultaneously. The multiplication factor consists of five membership functions from 0 to 1 [i.e., negative big (NB), negative small (NS), zero (Z), positive small (PS), and positive big (PB)]. The fuzzy output is multiplied with the steering value so it has two conditions for both right and left wheels. Each of the data will be combined in order to balance the vehicle’s IB while performing left and right turns. The total rules implemented to the five-DOF TWRM are listed in Table 5.
Comparison between implementation of PID, BFO-PID, and PD-FLC
This section carries out a system response comparison, for various motion scenarios, between the three implemented control methods: PID controller, bacterial foraging-optimized PID controller, and PD-like fuzzy logic controller. Table 6 lists the control gain parameters utilized in each control loop for the three control methods with a view to attain a satisfactory system performance.
Figures 7, 8, 9, 10, and 11 illustrates the two-wheeled robotic machine mathematical model simulation output results, including the applied control effort, for five different case scenarios: payload free movement, payload vertical movement only, payload horizontal movement only, simultaneous horizontal and vertical motion, and 1-m straight line vehicle motion. As visualized in the previous figures, the BFO-PID control scheme has a superior performance and optimized behavior compared to the PID- and PD-like FLC control methods. It is also observable that the optimized controller by BFO algorithm reduces the applied input forces required to stabilize the robotic machine.
Taking the first motion scenario of payload free movement (h1 = h2 = 0) (Fig. 7) as an example, Table 7 lists a performance comparison between PID, PID-BFO, and PD-FLC control methods characterized by percentage overshoot, settling, rise, and peak times. Beginning with the system’s percentage overshoot, the PID controller optimized by bacterial foraging algorithm gives better overshoot value (27.9%), which is much lower than the recorded overshoot values for both PID- and PD-like FLC control schemes, 48.1% and 38.6%, respectively. As for the system’s settling time, the control strategy which is based on PID-BFO settles the vehicle in 0.78 s, which is three times less than the PID control method’s settling time (2.287 s) and two times less than the PD-FLC scheme (1.441 s). Moving to rise time values, the best result is given by PD-FLC (0.217 s), followed by BFO-PID method (0.23 s), and finally PID control scheme (0.2790 s). It can be seen that the rise time values are almost the same for all methods with small difference between them. As for peak time values, the PID controller has the highest peak value (0.5710 s), where the PD-FLC method value is the lowest but almost the same as the BFO scheme (0.4 s).
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 BF-optimized 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
Since the TWRM is developed to be employed in industrial applications, Fig. 12 demonstrates the application where the robot will be used to manoeuver in a straight line and then activates both vertical and horizontal actuators in order to pick an object and return it to its initial position. As can be seen in Fig. 12a, the robot starts moving in straight line after achieving stabilization and the controllers act to maintain the robot’s stability. At the time the robot handles the load object, the stability of the system is not affected. Therefore, the controllers provide a good performance. Based on Fig. 12b, which represents the applied forces of the actuators, the PID control method consumes more forces than the forces applied by both BFO-PID and PD-FLC.
Control system robustness investigation
For the three proposed control methods, the TWRM stability was tested against the impact of disturbance force shown in Fig. 13a and the system performance is illustrated in Fig. 13b, c. As can be seen for the three control approaches, the vehicle in few seconds achieved its stability region about the vertical axis. However, the BF-optimized PID control method surpassed both PID and PD-FLC approaches in terms of withstanding the impact of disturbance on the vehicle wheels’ displacement (δR, δL) and the horizontal linear actuator displacement (h2). Therefore, in terms of robustness and instability minimization, BF-optimized PID control approach has a superior performance.
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 five-DOF two-wheeled 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 1-m straight line vehicle motion), the BFO-PID 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 BFO-PID 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 real-time tuning for solving a complex real-world 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.
Chan RPM, Stol KA, Halkyard CR. Review of modelling and control of two-wheeled robots. Annu Rev Control. 2013;37(1):89–103.
Ren TJ, Chen TC, Chen CJ. Motion control for a two-wheeled vehicle using a self-tuning PID controller. Control Eng Pract. 2008;16:365–75.
Olivares M, Albertos P. Linear control of the flywheel inverted pendulum. ISA Trans. 2014;53(5):1396–403.
Wang J. Simulation studies of inverted pendulum based on PID controllers. Simul Model Pract Theory. 2011;19(1):440–9.
Passino KM. Biomimicry of bacterial foraging for distributed optimization and control. In: Proceedings of the IEEE control system magazine; 2002. p. 52–67.
Kalaam RN, Hasanien HM, Al-Durra A, Al-Wahedi 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.
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.
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.
Nasir ANK, Tokhi MO. A novel hybrid bacteria-chemotaxis spiral-dynamic algorithm with application to modelling of flexible systems. Eng Appl Artif Intell. 2014;33:31–46.
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.
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.
Agouri SA, Tokhi MO, Almeshal AM, Goher KM. BFA optimisation of control parameters of a new structure two-wheeled robot on inclined surface. In: Paper presented at the nature-inspired 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.
Al-rashid N, Alfarsi Y, Al-Khudhier 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.
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.
Zadeh LA. Fuzzy sets. Inf Control. 1965;8:353–83.
Czogała E, Mrózekb A, Pawlakc Z. The idea of a rough fuzzy controller and its application to the stabilization of a pendulum-car system. Fuzzy Sets Syst. 1995;72:61–73.
Cheng F, Zhong G, Li Y, Xu Z. Fuzzy control of a double inverted pendulum. Fuzzy Sets Syst. 1996;79:315–21.
Xu J, Guo Z, Heng T. Synthesized design of a fuzzy logic controller for an underactuated unicycle. Fuzzy Sets Syst. 2012;207:77–93.
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.
Yue M, Wang S, Sun JZ. Simultaneous balancing and trajectory tracking control for two-wheeled inverted pendulum vehicles: a composite control approach. Neurocomputing. 2016;191:44–54.
Amir D, Chefranov AG. An effective hybrid swing-up and stabilization controller for the inverted pendulum-cart system. In: IEEE international conference on automation quality and testing robotics (AQTR); 2010. p. 1–6.
Yue M, An C, Du Y, Sun J. Indirect adaptive fuzzy control for a nonholonomic/underactuated wheeled inverted pendulum vehicle based on a data-driven trajectory planner. Fuzzy Sets Syst. 2016;290:158–77.
Tinkir M, Onen U, Kalyoncu M, Botsali FM. PID and interval type-2 fuzzy logic control of double inverted pendulum system. In: The 2nd international conference on computer and automation engineering (ICCAE); 2010, p. 117–21.
Goher KM. A two-wheeled machine with a handling mechanism in two different directions. Robot Biomim. 2016;3(17):1–22.
Goher KM, Fadlallah SO. Bacterial foraging-optimized PID control of a two-wheeled machine with a two-directional handling mechanism. Robot Biomim. 2017;4(1):1.
KMG initiated the concept of two-wheeled machine with the two-direction 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.
The authors of this paper would like to thank the University of Lincoln for offering the funding support for this publication.
The authors declare that they have no competing interests.
This research has been funded by Sultan Qaboos University (Oman) for the simulation studies and the University of Lincoln (UK) for publication charges.
Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
About this article
Cite this article
Goher, K.M., Fadlallah, S.O. PID, BFO-optimized PID, and PD-FLC control of a two-wheeled machine with two-direction handling mechanism: a comparative study. Robot. Biomim. 5, 6 (2018). https://doi.org/10.1186/s40638-018-0089-3
- Inverted pendulum
- Two-wheeled machine
- Two-direction handling