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.


Introduction
Considered as one of the most conventional widelyknown problems in the discipline of control, inverted pendulum (IP) systems are highly nonlinear and unstable systems that have been extensively investigated in the past decade.Different linear and nonlinear identification approaches are used to develop an accurate IP model.Recently, there has been much more interest in two-wheeled machines (TWMs).Chan et al. [1] reviewed various modeling and control methods that have been applied to both investigate and control these highly nonlinear systems.

Inverted pendulum-based systems
In a number of robotic laboratories around the world, the research on wheeled inverted pendulum (WIP) robots has significantly expanded.Chinnadurai and Ranganathan [2] applied the concept of an inverted pendulum by developing a two-wheeled self-supporting robot.This low power consuming robot is equipped with an infra red (IR) sensor, attitude sensor, and tilt sensor.Using an internet-on-a chip (IOC) controller, the robot can be controlled worldwide.Mayr et al. [3] took the concept of inverted pendulum and developed a three-dimensional (3D) pendulum, also known as the inertia wheel cube (IWC), which has the shape of a cube and is able to balance on its edges and tip.Similar to the two-dimensional (2D) inverted pendulum systems, the IWC uses its reaction wheels for balancing.Other research studies, such as Lee et al. [4] , focused on developing a novel one-wheeled inverted pendulum system that balances itself around its equilibrium position using air power.The roll angle was regulated by air pressure released from ducted fans controlled by linear control approaches, while the pitch angle was controlled by a direct current (DC) motor.
On the other hand, Dai et al. [5] presented a low-cost two-wheel inverted pendulum robot with friction compensation.A market-available accelerometer and gyro sensors were implemented on the robotic platform and the sensed data were filtered by means of a Kalman filter.Experimental results showed the effectiveness of the signal processing method, robot and controller design, and the friction compensation.
Based on the two-wheeled IP's principle, Goher and Tokhi [6] developed a novel configuration of wheeled robotic machines with an extended intermediate body (IB).The proposed machine is equipped with a linear actuator in order to provide, for a carried payload, various lifting levels.Despite the fact that the designed wheeled robotic machine (WRM) provided an additional degree of freedom (DOF) through the linear actuator connected to its IB, the workspace was still limited by the IB's extension in one single vertical direction.Almeshal et al. [7] improved the previously mentioned vehicle by increasing both the flexibility and workspace and came up with a five DOFs two-wheeled double IP-based vehicle with an additional extended link.

Control of inverted pendulum-based systems
A significant number of studies have been conducted for determining the optimal control method for stabilizing various kinds of underacutuated IP.Bettayeb et al. [8] presented a novel controller design based on pole placement fractional PI-state feedback for controlling an integer order system.The developed control method was applied on an proportional integral (PI)-cart system and illustrated satisfactory results in terms of robustness, stability, and accuracy while applying external disturbances on the pendulum and also while varying the cart mass.On the other hand, Boussaada et al. [9] focused on considering stabilization issues related to systems that have multiple zero eigenvalues at the origin.To overcome the problem, a multi-delayed-proportional controller was proposed.The controller was tested numerically on an IP on a cart moving horizontally model.The study's simulation results revealed a substantial improvement in the performance of the system′s closed loop, considering noisy measurements and/or system uncertainties.A nonlinear control strategy was presented by Brisilla and Sankaranarayanan [10] for maneuvering a four degrees of freedom mobile inverted pendulum robotic system while stabilizing the pendulum.Using a nonlinear co-ordinate transformation that led to a three-step navigation design procedure, the controller was developed.Compared to available control techniques, the developed controller does not require any switching between controllers and showed good results in terms of stability.An adaptive backstepping control for a wheeled inverted pendulum model was proposed by Cui et al. [11] .The Lagrangian approach was utilized for deriving the nonlinear model and through a coordinate transformation, the system was divided into three sub-systems.The proposed control method was applied on each sub-system.Simulation results revealed that the proposed control was effective and the output trajectory was able to track as close as to the reference trajectory.Vinodh Kumar and Jerome [12] focused on developing a control strategy based on robust linear quadratic regulator (LQR) and proportional velocity (PV) controllers for stabilizing and trajectory tracking of self-erecting single inverted pendulum.For swinging up the pendulum to upright position, a PV controller based on energy based method was implemented.A stabilizing controller based on robust LQR immediately activates once the system reaches the vertical position, in order to catch the pendulum and force it to track the predefined reference signal.Prasad et al. [13] also utilized LQR and developed a simple approach comprising proportional-integral-derivative (PID) controller and LQR to control an inverted pendulum-cart dynamical system.The analysis of the responses of control schemes showed that the performance of the proposed PID+LQR control method was better than the PID control only approach.Lee et al. [14] pro-posed an output feedback control design that provides both equilibrium stabilization in the presence of significant uncertainties and also a large region of attraction.Olivares and Albertos [15] investigated multiple control methods for controlling a flywheel inverted pendulum, which is an underactuated mechanical system.At first, a simple PID controller was tested and led to an internally unstable controlled plant.To overcome the stability issue, two control options were introduced and developed.These developed methods were an internal stabilizing controller and an observer-based state feedback control that replaced the PID controller.Raffo et al. [16] developed a nonlinear H ∞ controller for stabilizing twowheeled self-balanced vehicles.The proposed controller takes into consideration the whole dynamics of the system into its structure, ensuring the stability of the overall system′s closed loop.On the other hand, studies such as Al-Janan et al. [17] focused on performance optimization of double inverted pendulum systems.Using a novel algorithm that combines neural networks (NNs), a uniform design (UD), and multi-objective genetic algorithm (MOGA), the proposed UniNeuro-hybrid UD multi objective genetic algorithm (HUDMOGA) approach proved to be much faster compared to using a trial and error method for obtaining the optimum input setting for a double inverted pendulum system.

Fuzzy logic control (FLC)
The idea of FLC was initiated by Zadeh [18] and presented not as a control methodology, but as a way of processing data by allowing partial set membership instead of crisp set membership or non-membership.As a result of insufficient small computer capability, this approach to set theory was not applied to control systems until the 1970s.Zadeh [18] reasoned that people do not require precise, numerical information input, and yet they are capable of highly adaptive control.If feedback controllers could be programmed to accept imprecise, noisy input, they would be much more effective and effortless to implement.
Nowadays, despite the fact that fuzzy logic′s basic concept was developed in the 1960s, FLC has been applied extensively in industrial applications (Precup and Hellendoorn [19] ).The FLC approach has been widely utilized to stabilize two-wheeled inverted pendulum systems.A smart fuzzy control approach for two-wheeled human transporter was developed by Azizan et al. [20] .The developed control scheme showed a high robustness when implemented on a sample two-wheeled transporter and tested against the change of the rider′s mass.For the same purpose, Xu et al. [21] designed a fuzzy logic controller which acquires fuzzy rules from a simplified look up table.Yue et al. [22] , for a wheeled inverted pendulum vehicle, developed an error data-based trajectory planner and indirect adaptive fuzzy control.Numerical results re-flected the effectiveness of the proposed control method.On the other hand, Yue et al. [23] proposed a novel composite controller for an underactuated two-wheeled inverted pendulum vehicle with an unstable suspension, subjected to a nonholonomic constraint.The developed control scheme consists of an adaptive sliding mode technique in order to generate an additional disturbance-like signal, and a direct fuzzy controller that approximates the optimal velocity tracking control effort by the adaptive mechanism.
Tremendous research studies focused on investigating and developing hybrid controllers for different types of IP models.Combining sliding mode controllers with energy shaping controllers, merging FLC with neural networks, etc. are all examples of hybrid controllers.A hybrid controller for swinging up and stabilizing an inverted pendulum on a cart system from natural position was designed by Nundrakwang et al. [24] .For an IP on a cart system, Amir and Chefranov [25] developed a novel hybrid swingup and stabilization controller (HSSC) consists of three basic controllers: fuzzy switching controller, swing-up controller, and fuzzy stabilization controller.
In addition to the previously mentioned tools, adaptive neural fuzzy inference systems (ANFIS) has also been utilized to control double inverted pendulum.Starting with Tatikonda et al. [26] , their research focused on applying ANFIS controller on an IP system and presented a comparative performance assessment between ANFIS and the conventional PID controller.Simulation and test results revealed that the ANFIS was more robust than the PID controller and within 6 s, the controller managed to balance the pendulum around its equilibrium upright position.Liu et al. [27] considered ANFIS and applied the controller on an IP system in laboratory experimentation for controlling both the angle and position of the pendulum by means of Matlab/Simulink real-time workshop.On the other hand, a feedback-error-learning controller for stabilizing a double IP system was developed by Kiankhah et al. [28] .The intelligent control scheme consists of a neurofuzzy controller, state-feedback controller, and feedback error learning.The system's stability is provided by the state-feedback, where the outputs are utilized for learning the neuro-fuzzy controller's weights.Along with the system dynamics′ modelling and simulation, the study's results showed that the proposed controller provided system stabilization with a fast settling time.
A novel FLC for stabilization of an IP based on the single input rule modules (SIRMs) was proposed by Yi et al. [29,30] .Given that the IP angular control has priority over cart position control, each controller has four input items.A SIRM and a dynamic importance degree were assigned for each of the four input items.Yi et al. [31] followed the same approach and designed a FLC with 6 input/1 output items for stabilizing a parallel-type double IP system.The study of Czogała et al. [32] focused on presenting a rough FLC with application to the stabiliza-tion of a pendulum-car system.Cheng et al. [33] , on the other hand, developed a real-time high-resolution and high-accuracy FLC in order to stabilize a double IP.The composition coefficient was calculated by combining the optimal control theory with the FLC theory.Based on the concept of expanding the usable region of a linear control design technique for swinging-up and balancing of a rotational inverted pendulum, Yurkovich and Widjaja [34] described in details a controller synthesis procedure.The study investigated three aspects of FLC: auto-tuning, direct, and supervisory fuzzy control.The mechanism employed LQR-auto-tuned fuzzy controller for the purpose of modelling system uncertainties, LQRbased linear control strategy for designing nonlinear direct fuzzy control, and an energy pumping strategy reinforced by a fuzzy supervisory mechanism.
An intelligent fuzzy inference control architecture with neural network (NN) as an auxiliary part for two-wheeled robot was designed by Su et al. [35] .The total sliding surface and the translation width in the FLC were adopted in order to minimize the chattering phenomena.A neural uncertainty observer was added for error accumulation reduction and stability improvement.Developing a FLC for an IP system was the main aim for Becerikli and Celik [36] .The development was carried out in two stages: fuzzy modelling investigation and the system′s solution by employing Java programming for internet-based control education.As for Oh et al. [37] , their conducted study mainly focused on presenting an estimation approach for scaling a fuzzy based-PID controller factors using genetic algorithm (GA) and estimation algorithm.The estimation was carried out using neuro-fuzzy networks, HCM (hard C-means) clustering-based regression polynomial, and regression polynomials.Li and Liu [38] presented a multi-local linear model based on the Takakgi-Sugeno (TS) approach for controlling an inverted pendulum system.Using a fuzzy approximation method, nonlinear multi-variance behaviors were transformed to a multi-local linear model.On the other hand, a fuzzy hierarchical swing-up and sliding position controller of an IP-cart system was proposed by Tao et al. [39] .The designed controller includes: a fuzzy swing-up controller for the pendulum and cart balance robustness at the desired positions, a fuzzy switching controller for smoothing the switching between position controls and the swing-up, and a twinfuzzy-sliding-position controller to guarantee the precision of both the sliding mode and stability of the fuzzy sliding position control systems.
Based on fuzzy c-means, Gustafson-Kessel (GK), and Gath Geva clustering techniques, Sivaraman and Arulselvi [40] developed the Takagi-Sugeno (TS) model for an inverted pendulum.This algorithm′s main objective relied on designing a feedback controller that stabilizes the system before system identification.The developed algorithm showed good results in terms of experimental data collection from system that reflects information about the dynamics of the system.As for the field of path planning, Peng et al. [41] proposed a FLC for path planning of a two-wheeled robot.The principle of golden mean was employed in order to optimize the membership functions.The study compared the proposed controller with a traditional fuzzy controller and showed that the golden mean optimized controller led to a real-timing and shorter global path and better control effect.
A PI-fuzzy path planner and associated low-level control system for a linear discrete dynamic model of omnidirectional mobile robots was designed by Hashemi et al. [42] in order to obtain optimal inputs for drivers.On the other hand, Ahmad et al. [43] proposed and verified using Visual Nastran software® a two-level modular fuzzy logic controller for stabilizing and controlling a wheelchair model.By employing an adaptive self-constructing fuzzy neural network (ASCFNN) controller, Mahalanobis distance (M-distance), and Lyapunov theory, Lu et al. [44] investigated a tracking control of an IP real system.The proposed algorithm consists of an ASCFNN identifier to estimate parameters of the system, a computation controller to sum up the outputs of the identifier, and a robust controller which is adapted for achieving robust stability and to compensate for the system parameters' uncertainties.As for Ahmad and Tokhi [45] , their study focused on developing a cross compensator which is augmented to an existing fuzzy-proportional derivative (Fuzzy-PD) type controller for controlling a wheelchair's steering motion while moving on two wheels.The compensator showed good performance in reducing steering motion steady state error.
The use of an interval type-2 fuzzy logic (IT2F-PID) to control IP systems using particle swarm optimization, genetic algorithms, and ant colony optimization was investigated by Castillo and Melin [46] in order to find the appropriate parameter and structure of the fuzzy systems.As for El-Nagar and El-Bardini [47] , El-Nagar et al. [48] , and El-Bardini and El-Nagar [49] , their studies concentrated on utilizing IT2F-PID control algorithms for controlling an IP-cart system with an uncertain model using a simplified type-reduction method.Wu and Karkoub [50] designed a fuzzy adaptive tracking control using variable structure systems (VSS), two-layer fuzzy observers, and H ∞ control algorithm for nonlinear systems with output delays, external disturbances and plant uncertainties.Sun et al. [51] proposed a hybrid ribonucleic acid (RNA) genetic algorithm-optimized type-2 fuzzy logic system architecture for double inverted pendulum systems.In terms of improving the control performance by uncertainty of membership function, the developed algorithm illustrated better results compared to type-1 fuzzy logic system.

Overview and contribution
Although there are numerous new self-balanced twowheeled machines' (TWMs) configurations, their work-space is still constrained to handle a payload in one single direction (Goher and Tokhi [6] ; Almeshal et al. [7] ).This is due to their limited designs and configurations.The current work′s main aim is to extend and increase both workspace and flexibility of TWMs by developing a novel configuration with five degrees of freedom (DOF) that allows handling of payloads in two mutually perpendicular directions while attached to the TWM's intermediate body.Industrial and service robotic applications, such as material handling and objects' assembly, will significantly improve due to the gained flexibility, not to mention the opportunities provided by the new configuration in terms of new applications.The potential of fuzzy logic, as revealed in the literature, has motivated the authors to explore and investigate the implementation FLC on the novel 5 DOF two-wheeled machine.PID control strategy is also applied in order to stabilize the system and compare their robustness to get the most efficient controller for the system.

Paper organization
The paper is organised as follows: Section 1 summarizes the development in the field of IP-based robotic machines associated with their control methods for stabilizing these systems, focusing on fuzzy-based control approaches.Section 2 explains the system with the proposed novel configuration and a brief description of the system's DOFs.The mathematical model of the developed system is presented in Section 3. As for Section 4, it covers the control system design including multiple courses of motion and different control strategies, with and without switching mechanism.At last, the paper is concluded and the work's achievements are highlighted in Section 5.

System description
Fig. 1 demonstrates the fully-developed two-wheeled robotic machine (TWRM), including all the main components, sensors, and motors that the system consists of.The design targets multiple features including: a symmetrical mass distribution for the entire parts and components of the robot at initial position, light weight without affecting the robot stiffness in order to be able to carry payload mass, and compactness with providing appropriate rooms for system electronics and accessories.Referring to Fig. 2, which represents the TWRM schematics diagram, the system mainly consists of a chassis with center of gravity at point P 1 and the linear actuators' mass with center of gravity at point P 2 .P 1 and P 2 coordinates will alter as long as the robotic machine relocates away from its initial location in the XY plane.The dynamics of the five DOF′s TWRM are fully described by these variables.The two motors attached to each wheel are responsible for providing a proper torque, τ R and τ L , so the two-wheeled robot can be controlled.The TWRM uses two encoders embedded in the motors to measure the position and velocity of the system, and an accelerometer and a gyroscope to sense the tilt angular rate of the body.The signals measured from these sensors allow the TWRM's control system to maintain the robot at the upright position continuously.
As shown in Fig. 2 and with respect to both the X and Z axes, the proposed system′s DOFs are defined by four types of translations: the angular rotation's angular displacement of the right and left wheels δ R and δ L respectively, and the linear displacement of the attached pay-load in vertical and horizontal directions h 1 and h 2 , respectively.Moving to the 5th remaining DOF, it is represented by the IB's tilt angle θ around the Z axis.
Object picking and placing, assembly lines, etc. are all applications that can be served by the new TWRM configuration, especially in applications that require working in limited spaces.Fig. 3 represents the mobility of the TWRM in multiple modes of operation.Considering the picking up and placing scenario, the explanation of the vehicle′s course of motion is summarized in Table 1.

Table 1 TWRM courses of motion
TWRM course of motion 1.The robotic machine starts manoeuvring on its two-wheels until it reaches the desired location for picking the object while maintaining a balance condition.During this stage, the two control torque signals from the motors connected to the robot′s wheels are the dominant control efforts.
2. The linear actuators of the TWRM begin the IB′s extension process in the vertical direction up to the object′s position by a vertical link displacement (h1).The vehicle′s centre of mass (COM) during this stage shifts up and the controlled wheels′ motors are responsible for keeping a balance condition.
3. The linear actuator extends the end-effector in a direction lateral to the object′s position by a command from the control system.The entire vehicle′s COM, as a result, changes its position and the wheels′ motors are responsible for developing the motor torque necessary to compensate for the COM′s position alteration.The robotic machine, while picking the object, will most likely experience a sudden disturbance caused by the impact with the object.The wheels motors′ control signals should overcome this disturbance.
4. At this stage, the end-effector undergoes a reverse motion back to its original position.The vehicle′s linear actuator, throughout this course of motion, should apply the suitable force signal with the proper speed in order to provide safety for the TWRM against tipping over.Based on the developed torque signals from the wheels′ motors, the TWRM needs to maintain balancing.

5.
Once the linear actuator′s rod returns back to its original position, the robotic machine′s IB starts shifting down to the desired elevation to place the picked object in the assigned location.The motor wheels′ control effort increases when the COM gets closer to the vehicle chassis.
6.The vehicle′s end-effector extends until it reaches the desired location for placing the object.To perform this task properly, manoeuvring the entire TWRM might be required for the sake of adjusting the end-effector.2 illustrates, for an object picking and placing motion scenario, the activation of each of the TWRM's actuators against each sub-task, as well as the degrees of freedom involved in each process.As can be seen, the motors connected to the robot's wheels remain activated throughout the entire process as a result of the continuous change in the COM's position, along with the external disturbances occurring during the object picking and/or placing task.Both of the wheels' motors require developing a sufficient torque signal in order to maintain the TWRM's balance position (upright vertical position).Activating the robotic machine's linear actuators will depend on the sub-task selected.For determining the engagement period of each of the TWRM's actuators in service, switching mechanisms are developed as a main element of the control algorithms.

System modelling
There are several methods to derive the equations of motion.Based on the fact that it delivers a powerful technique for deriving any complicated system's equations of motion, the Lagrangian modelling method is used for modelling the TWRM.Using the TWRM parameters described in Table 3 and referring to the TWRM schematics diagram in Fig. 2, the vehicle's mathematical model is derived in order to relate the mechanical system's kinematics to the forces/torques applied to its links and to examine different model behaviours.The system equations of motion, details are provided in previous research that describes the system dynamics (Goher [52] ; Goher and Fadlallah [53,54] ), are demonstrated in the following highlycoupled differential equations: ) ) (5)

Control system design
After deriving the TWRM equations of motion in the previous section, the model is tested in order to obtain its response and to manage to control it.Different control strategies are implemented and compared for the purpose of obtaining a suitable response for the system.

Open loop system response
An open-loop system response has to be investigated in order to study the behaviour of the developed model.Employing the simulation parameters listed in Table 4, the model is simulated in Matlab Simulink® environment and the simulation results are illustrated in Fig. 4. It is clear from the response of pitch angel (θ), right wheel displacement (δ R ), left wheel displacement (δ L ), vertical link displacement (h 1 ), and horizontal link displacement (h 2 ) that the system is an unstable nonlinear system.The obtained response in Fig. 4 is actually expected.Fig. 5 describes the obtained response.Although the angle of IP moves the same as the chassis movement, they are different in terms of magnitude.When the tilt angle starts oscillating to the left (positive tilt angle), it affects the wheels and forces them to maneuver in the direction of the frame of reference.The same occurs on the other side as well but with negative sign (the wheels maneuver in the opposite side of the frame of reference when the chassis tilts with a negative angle).These oscillations are very small at the beginning and cannot be visualized if an actual system was behaving like that.With time, the amplitude of these oscillations increase until the system loses its balance completely.Based on the previous analysis and the fact that the system outputs reach infinity, a closed loop system is essential for stabilizing the system and improving its performance.

PID control scheme design
Fig. 6 demonstrates the strategy schematics to control the TWRM.The strategy is based on developing a feed-   Five main PID control loops are utilized to control the system's five outputs; the angular position of the IB(θ), the left and right wheels' angular positions (δ R , δ L ), and the object's linear displacements (h 1 , h 2 ).

PID control without switching mechanisms
In this part, and based on the mathematical model derived in Section 3, the developed control approach is implemented on the TWRM model.As a start, testing the following simulation exercises will not include switching mechanisms.Two various conditions are considered in testing both the control scheme and the behaviour of the system: the free motion of the payload and while activat-ing the two linear actuators associated with the payload's both horizontal and vertical motion.After employing switching mechanisms, which are developed to decide when the TWRM's linear actuators should operate, the same exercise is repeated.

Payload free movement (Vertical and
horizontal linear actuators not activated) Fig. 7 demonstrates the TWRM simulation output considering the tilt angle θ = 5° and setting the linear actuators' effect h 1 and h 2 to zero during the stabilization mode.Based on Fig. 7, the control mechanism takes less than 2 s to stabilize the vehicle to reach the balancing position.It has been noticed that for preserving stability, the vehicle motion is unbounded and keeps moving.For these types of vehicles that serve in applications with limited working space, this behaviour is unsatisfactory and the vehicle, once it achieves stability, is considered to manoeuver with a fixed velocity.
The controller is modified for the sake of minimizing the TWRM motion by restricting the wheels′ linear displacement.The modified controller allows the wheels to rotate a pre-defined fraction.As demonstrated in Fig. 8, the control method has the capability, within 2 s, to achieve the TWRM′s balance position (upright vertical position).On the other hand, the wheels′ steady state po- sition is reached in approximately 4 s.Compared to the previous case, bounding the rotation of the system′s wheels has an effective impact on the vehicle's stabilization.

Payload simultaneous horizontal and vertical motion (Vertical and horizontal linear actuators activated)
In this part, the effect of changing the robotic machine's COM by activating the linear actuator and extending simultaneously in two mutually perpendicular axes is investigated.As illustrated in Fig. 9 and without considering a payload, the TWRM experiences a longer transient period in comparison to the previously examined case.As a result of the COM's position change in two different directions, the system took longer to reach stability with an increase in the overshoot.The system takes around 4 s to achieve stability, which is similar to the time spent by both actuators to extend.While comparing these results to previous simulation results, it has been noticed that the system experiences a significant amount of vibration throughout the duration of changing the COM in the two directions.This will result in dramatic changes in the control effort needed.Until the system reaches stability, the torques provided by both motor wheels are anticipated to be influenced by the aforementioned long transient period of instability.

Switching mechanism design
Given that the developed TWRM is primarily developed for picking and/or placing applications, stabilizing the robotic machine first is highly desirable in order to prevent, especially at the start of working, any disturbances that result from lifting the object.This will cause a movement in the system's COM, affecting the TWRM's stability condition.Such situation can be prevented by modifying the control scheme as shown in Fig. 10.The control approach's adjustment was based on adding two switching mechanisms to the system to guarantee the achievability of the system stability prior initiating the object picking and placing motion scenario.The development of the two mechanisms will ensure that the linear actuators will remain at rest until the vehicle's IB reaches the upright vertical position (balance position).In this part of the analysis, three cases are investigated: payload horizontal movement only, payload vertical movement only, and simultaneous horizontal and vertical motion.

Payload horizontal movement only
The TWRM system, in this case, is simulated to investigate the effect of changing h 2 in the X direction, which is perpendicular to the IB′s axis.This case is almost similar to wheeled systems maneuvering up/down a slope motion scenarios and also the IB′s inclination for- ward or back.Setting θ = 5°, h 1 = 0.28 m and h 2 = 0 m as initial conditions, the system was simulated.During this stage, the actuator along the IB is kept deactivated.
As for the other linear actuator, it does not operate until a balance condition is achieved as demonstrated in Fig. 11.Changing h 2 by only 10 cm at 5 s, as observed from Fig. 11, acted as an instant impact disturbance that hit the system′s IB.This resulted in a serious alteration in the system′s direction to the Z axis′s counter side, causing the control algorithm to fail in bringing the IB to the upright vertical position.Instead, the algorithm kept the IB inclined with a fixed angle of inclination (approximately 7° on the opposite side).

Payload vertical movement only
The linear actuator, for this motion scenario, is permitted to operate and perform an up and down movement by extension and contraction of the linear actuator rod along the Z axis and the robotic vehicle's IB.This will shift the entire COM up and down depending on the actuator′s developed control signal.The system's output simulation is demonstrated in Fig. 12 with the following initial conditions: θ = 5°, h 1 = 0.28 m and h 2 = 0 m.Right after 5 s from the start of the simulation, the actuator starts extending its rod to approximately 0.4 m.As can be seen in Fig. 12, the proposed control mechanism was firm and within 7 s, the linear actuator rod reaches the desired position with no interruption in the IB's stabilization condition.

Payload simultaneous horizontal and vertical motion
The proposed control algorithm′s robustness is tested and Fig. 13 demonstrates the system output considering the case where h 1 and h 2 change sequentially.For approximately 5.5 s, h 1 is maintained fixed at 0.28 m prior starting the alteration process to the aimed elevation.The IB′s stabilization condition was not interrupted and at about 9.5 s, h 2 starts to change and results in unanticipated changes in the IB′s stabilization along with a minor disturbance in h 1 .Associated with the changes in h 2 , the IB inclines in the opposite direction to overcome the COM′s position change due to the extension of h 2 .

FLC algorithm design
In this part, the authors developed and implemented another control method comprised of a robust PD-like FLC strategy with five independent control loops illustrated in Fig. 14 for the sake of controlling the TWRM by keeping the system in the upright vertical position and to counteract the disturbances caused by the TWRM′s different courses of motion while implementing the PID control strategy.Because of its intuitive nature, along with its capability to deal with highly nonlinear systems, FLC is selected in this study as a control method.FLC has number of advantages including: utilizing human′s expertise rather than the need of precise knowledge about the system and the inherent robustness properties that makes the variation in system parameters easily handled.The fuzzy logics used in the control of 5DTWRM are a simple Mamdani fuzzy approach that considers the robotic machine′s angle and velocity as inputs and the multiplication factor as an output.The multiplication factor will be multiplied by the data obtained from the potentiometer.The output of this multiplication will influence the right and left wheels' velocity.Fuzzy control will be combined with the feedback value of the pitch angle (as demonstrated in Fig. 15(a)) and the feedback value of the angular velocity (as illustrated in Fig. 15(b)).The output of this combination is a multiplication factor that represents each wheel's actuation values.The pitch angle of the system consists in 5 membership functions and the same goes with the wheels′ angular velocity.The steering sys-tem′s value will have an independent and simultaneous effect on each wheel (left and right).In Fig. 15(c), the multiplication factor consists of 5 membership functions (NB = negative big, NS = negative small, Z = Zero, PS = positive small, PB = positive big) from 0 to 1. Balancing the TWRM's body to execute left and right turns requires data obtained from the multiplication of the fuzzy output with the steering value.Table 5 demonstrates the total rules applied to the 5DTWRM.
The 5DTWRM controlled variables are: angle of the robot′s chassis θ, both right and left wheels' angular positions δ R and δ L respectively, and the linear displacements of the attached payload in both vertical and horizontal directions h 1 and h 2 respectively.For the five measured variables δ L , δ R , θ, h 1 and h 2 , the error (( 6)-( 10)) and the derivatives of error (( 11)-( 15)) are defined as inputs to the control system.On the other hand, the TWRM motors torques are the control outputs.
where the subscripts m and d represent actual measured and desired variables, respectively A linear straight line motion is considered in this study; the two feedback loops′ control signals are identical and thus the motor output is a summation of the left and right wheels′ torques.As mentioned before, triangular membership functions are selected for inputs and output as shown in Figs. 15 (a)-15 (c).To establish a rule base, the tilt angle, the wheels′ angular position motion, and the attached payload's linear displacements in vertical and horizontal directions are partitioned into five primary fuzzy sets as described in Figs.16 (a   The TWRM is considered to commence at θ = -5° and ignoring the linear actuators' effect h 1 and h 2 by setting them to zero throughout the TWRM stabilization process.As can be seen, the control approach stabilizes the robotic machine within less than approximately 1.5 s and the steady state position of both wheels were achieved within almost 5 s.

Payload horizontal movement only
In order to complete a handling task of and placing, the machine is permitted to move the carried payload in a direction parallel to the chassis' axis (horizontal direction).The system's output response considering the activation of the horizontal linear actuator only is shown in Figs.18 (a) and 18 (b).The attached load is maintained fixed at an elevation of 0.28 m.On the other hand and prior settling again at a fixed position, it is allowed to move the attached load horizontally for a distance of 0.07 m.With the following initial conditions: θ = -5°, h 1 = 0.28 m and h 2 = 0 m, the controller was not capable of retrieving the robotic machine's IB back to the equilibrium upright position as can be seen in Fig. 17 (a).Rather than maintaining stability, the control mechanism kept it inclined with a fixed angle of inclination (approximately 7° on the opposite side).

Payload vertical movement only
The stability of the robotic machine was tested against the effect of vertical motion of the attached payload.For a period of approximately 12 s, the carried payload is maintained fixed.Subsequently, and for a distance of 0.1 m, the machine is permitted to move the carried payload in a direction along the IB (vertical direction) prior settling again at an elevation of approximately 0.38 m away from the robotic machine's chassis.Neglecting the horizontal linear actuator′s effect h 2 and considering the following initial conditions: θ = -5°, h 1 = 0.28 m, Figs.19 (a show the output response of the system considering the two linear actuators′ simultaneous activation.Setting the simulation′s initial conditions to θ = -5°, h 1 = 0.28 m and h 2 = 0 m, the system remains stable without any interruptions throughout the process of activating the vertical actuator.However, sudden changes in the IB's stabilization have been noticed the instant that the horizontal actuator commences extending its end-effector, with a small disturbance in h 1 .For the sake of overcoming the COM's position alteration because of the extension of h 2 , the IB tilts to the opposite direction.

1-meter straight line trajectory investigation
In addition, the stability of the TWRM was tested throughout the robotic machine′s 1 m movement in a straight line after stabilizing the machine in the equilibrium upright position.From the results associated with this scenario (Fig. 21), the control effort used for man- Fig. 18 PD-FLC controlled system performance and control efforts for payload horizontal movement only system stabilization will affect its stability, control conditions should be considered through the operation of the system by avoiding the movement of the COM during the stabilization process and initiate it after reaching the steady state.Therefore, the FLC Matlab/Simulink model was modified, as shown in Fig. 22, by adding switching conditions to ensure the system's stability before moving any of the linear links.The stability of the system was examined against both vertical and horizontal linear motions of the TWRM′s COM.Figs.23 (a) and 23 (b) demonstrate the system′s output simulation that commences initially at θ = -5°, h 1 = 0.28 m, and h 2 = 0 m.After balancing the system, the TWRM′s model is simulated to examine the effect of moving h 1 and h 2 in sequence.After balancing the system, the vertical actuator moves to its final displacement then, the horizontal actuator starts to move till it reaches its final displacement.For the first stage, the system′s stabilization condition is not affected by the vertical linear actuator′s activation.As for the second stage, which starts at 10 s, operating the horizontal actuator yields to an observable steady tilt in the IB found to be approximately 5°.

System response comparison between PD-like FLC and PID
In this part, a comparison between the control techniques is carried out.FLC and PID controller are applied on the system for various motion scenarios, considering the switching mechanism, for the sake of examining the robotic system's response and control effort developed by the associated actuators.For the aforementioned control algorithms, Table 6 summarizes the control gain parameters that are used in each control loop.The gain parameters are calculated to achieve a desirable system performance.Fig. 24 up to Fig. 28 show the simulated system model's performance results and control efforts for the following motion scenarios: free motion of From Fig. 23 mentioned, it is clear that the PD-like FLC provides better performance for the system and decreases the applied force needed for the machine to stabilize.Considering the case of payload free movement (h 1 = h 2 = 0), as an example of how the PD-like FLC provides better performance than the PID, the tabulated results in Table 7 summarizes a comparison, for this specific case, between the two control strategies by the values of overshoots, rise time, settling time, and peak time.The PD-like FLC method gives better value for overshoot of 38.6%, which is less than the overshoots resultant from the PID by 10%.In short, it is clear that PDlike FLC produces much better percentage overshoot than PID.The value of settling time is summarized in Table 7, where it is observable that the PD-FLC′s settling time value is 1.44 s which is lower than the PID scheme's value.Therefore, the settling time is optimized by PD-like FLC.In addition, the best result of the rise time is given by FLC, 0.217 s compared to PID (0.279 s).Comparing the two methods in terms of rise time and peak time, it can be observed that the results reveal almost the same values but with small differences.The PID controller has the highest value, where the PD-like FLC approach′s value (0.4 s) is the lowest.The PD-like FLC method produces peak time better than PID.In general,  the PD-like FLC produces much better system performance than PID.However, in the case of the payload's horizontal motion only scenario (Fig. 25), it has been noticed that the PID control scheme performed better in terms of stabilizing the robot wheels during the process.The PD-like FLC could not withstand the change in the horizontal motion and allowed the vehicle to move almost 10 cm.In Fig. 26, a payload in a vertical motion only is considered.The developed control algorithm again showed robustness.The same behaviour was noticed in the case of the simultaneous horizontal and vertical motion of the payload scenario (Fig. 27).

Investigating control system robustness
In order to examine the control algorithm′s robustness, an impulse disturbance force is applied on the TWRM as indicated in Fig. 29.The disturbance is applied two times: at 12 s and 13 s.These periods are selected after the system reached a stable position and the payload motions in horizontal and vertical are performed.As can be noticed in the system performance, Fig. 30 (a), the system returned to its stable range around the vertic-   al axis in a few seconds.However, the vehicle linear motion took time as can be noticed from rotations of the right and left wheels.The impact on the horizontal and vertical motion of the payload is limited similar to the disturbance which happened on the tilting of the entire vehicle.The control efforts are also affected by the application of the disturbance.However, stable behaviour of the actuators is achieved in a short time as illustrated in Fig. 30 (b).
Comparing the performance of both PID and PD-like FLC, it is observable that both controllers managed to stabilize the system′s IB in the upright position within a short period.As for the wheels′ angular displacement, the performance of PD-like FLC was better than PID in terms of robustness and how quickly the controller reacts and minimizes the instability of the TWRM.However, the PD-like FLC was not robust enough to withstand the effect of disturbance on the horizontal linear actuator displacement (h 2 ).In fact, the PID controller performed better and faster for this case.

Conclusions
In this paper, a novel 5 DOFs TWRM has been presented.The new configuration of the TWRM delivers solutions for both industrial and service robotic applications that involve working in limited spaces such as object picking and placing, assembly lines, etc.The system′s mathematical model has been derived by means of the Lagrangian modelling approach.Considering the nonlinear model of the system, closed-loop PID and fuzzy logic controllers were designed to control the unstable 5 DOF TWRM.The stability of the nonlinear system was examined against different initial conditions and with moving the center of mass during the system stabilization process.In addition, the controlling process was modified using a switching mechanism to avoid moving the center of mass during the system stabilization in order to reach a steady state balancing position.It has been proved that the PD-like FLC method has improved the system response compared to the PID controller.This was shown by the simulation results associated with each case.
Further studies may be applied considering optimization methods for optimizing the PID and the fuzzy logic controller.In addition, more trajectory and different disturbance forces may be applied on the TWRM to investigate its performance and stability.Moreover, the hardware model of the system can be built and the system′s performance will be investigated against real disturbance forces.Also, the mechanical design may be modified by adding extra degrees of freedom and testing the robot using different types of end-effectors.Moreover, an extra degree of freedom may be applied to maintain the end effector in a horizontal position while moving the horizontal actuator.This can be done either by adding another horizontal link moving in the reverse direction of the horizontal actuator or by adding a revolute joint that will keep the rotation of the horizontal actuator in parallel with the ground.These modifications are shown in Fig. 31.

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′s 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.

Fig. 5 Fig. 7
Fig. 5 System inclination with respect to the vertical axis

Fig. 9
Fig. 8 System output considering bounded wheels′ displacement (Vertical and horizontal linear actuators not activated)

Fig. 11
Fig. 10 Adjusted control algorithm with switching mechanisms

Fig. 13
Fig. 12 System output for payload vertical movement only )-16 (e).4.3.1 Implementation of PD-like FLC algorithm 4.3.1.1Payload free motion (Vertical and horizontal linear actuators not activated) Considering various motion scenarios, the behaviour of

Fig. 15
Fig. 14 Simulink model of the FLC implementation ) and 19 (b), demonstrate the system′s outputs and inputs simulation results.It appears clearly from the results, given that no interruption affected the IB's stabilization condition, that the developed control mechanism was robust enough to maintain the robotic machine′s stability.4.3.1.4Payload simultaneous horizontal and vertical motion (Vertical and horizontal linear actuators activated) Figs.20 (a) and 20 (b)

Fig. 19 Fig. 20
Fig.19PD-FLC controlled system performance and control efforts for payload vertical movement only

Fig. 22 FLC
Fig. 21 PD-FLC controlled system performance and control efforts for a 1-meter straight line motion

TimeFig. 23
Fig.23PD-FLC controlled system performance and control efforts considering switching mechanism (Vertical and horizontal linear actuators activated)

Fig. 24 Fig. 25
Fig.24 System performance and control efforts comparison for payload free movement (Vertical and horizontal linear actuators not activated) (PID versus FLC)

Fig. 26 Fig. 27
Fig. 26 System and control efforts comparison for payload vertical movement only (PID versus FLC)

Fig. 28 Fig. 29
Fig. 28 System performance and control efforts comparison for a 1-meter straight line motion (PID versus FLC)

Fig. 30
Fig. 30 performance and control efforts, with disturbance force Horizontal link moves in the reverse direction Revolute joint to maintain the horizontal position

Fig. 31
Fig. 31 Proposed modification to the system design

Table 2
Sub-tasks against activation of individual actuators

Table 3
TWRM parameters associated with their description

Table 5
FLC rules of navigation

Table 6
Control gain parameters values for different control algorithms

Table 7
Comparison between the performance of system using PID and PD-like FLC approaches