Abstract
Two-wheeled wheelchairs have been used as alternatives for the elderly and disabled people to perform physical activities due to their restriction of movement. Significant challenges posed by two-wheeled wheelchairs control due to their inherent instability, resembling that inverted pendulum system. This research addresses these challenges by developing a dynamic non-linear model and stability control using computational algorithms. A neural network-based Nonlinear Autoregressive model with Exogenous Inputs (NARX) was developed, capturing and behaving similar to the complex dynamics of the wheelchair system with the identification on the experimental input–output data. Ensuring stable and responsive control, design of optimized PD-type and PID-type fuzzy logic controllers using Particle Swarm Optimization (PSO) were established and were tested under a simulation environment. The performance was evaluated across various metrics, including Integral Squared Error (ISE), Integral Absolute Error (IAE), Mean Squared (MSE), and Integral Time Absolute Error (ITAE). The result demonstrates that the PSO Optimized PID-type fuzzy logic controller with scaling factor from MSE index performance come out as best overall, significantly outperforms PD-type fuzzy logic controller, reducing its settling time by 12.5% to 35 s, minimizing overshoot to 0.81°, and achieving a negligible steady-state error of 0.046%. These results highlight the significant of integrating fuzzy logic control and PSO to the neural network model in enhancing the stability and performance of two-wheeled wheelchair systems, offering user safety and comfort.
Keywords
Introduction
A wheelchair is an effective instrument for elderly and disabled people since it will provide them with autonomy in their daily mobility tasks. There are 35.2% of disabled people in Malaysia who are physically handicapped. 1 It is well-recognized that a wheelchair is a significant way for the elderly and handicapped to travel from place to place. 2 Normally, a four-wheeled wheelchair configuration is used for disabled people, however, the standard four-wheeled wheelchairs have some limitations in their design, namely, they are bulky, the user cannot reach higher heights and are difficult to maneuver in narrow/confined spaces. By using a two-wheeled wheelchair, the users can reach a higher level of height, confidently perform eye-to-eye level of conversation with normal people, 3 and maneuver easily in confined spaces.
A two-wheeled wheelchair mimics an inverted pendulum system, known to be a complex, unstable, and highly non-linear system. Thus, the stability of a two-wheeled wheelchair poses control challenge, and it becomes more complicated during maneuvering and has the same dynamics as a self-balancing inverted pendulum system, which is known as a precarious system.4–9 Its popularity follows the fact that it is unstable without control, the upper part of the inverted pendulum will fall over if the lower part is not moved to balance it. The goal of controlling this system is to balance the pendulum by applying a force to the lower part, for instance, the cart. Extensive research on balancing the inverted pendulum has been conducted due to its importance in the control engineering field. 10 Few control approaches have been developed to stabilize a two-wheel inverted double-link pendulum mechanism. These include fuzzy logic-based control,11–13 Neural network-based control,14,15 swing-up scheme control, 16 and hybrid LQR-fuzzy control.17,18 Moreover, these approaches have involved the cascading of Proportional Integral Derivative (PID) control,19–21 group of Sliding Mode Control (SMC),22,23 and Proportional Derivative (PD) control. 24 Changes can be made on the inverted pendulum system, for instance, the increment of links system for an additional degree of freedom, and different types of actuators to move the system; these changes will increase the complexity of the system. For example, there are single link inverted pendulum, 25 double link inverted pendulum, 4 and triple link inverted pendulum, 26 while their actuator could be on a cart, 25 on two wheels, 26 on a rotary wheel or inertia wheel. In general, all these systems share the same characteristic; they are inherently unstable. Although there are various successful cases on controlling the inverted pendulum by using conventional controllers such as PID and Linear Quadratic Regulator (LQR), however, most of these have been developed and evaluated only in simulation studies.26–30
The complexity and uncertainties of an actual system in real scenarios become a significant issue in maintaining system stability to ensure user’s comfort and safety through reduction of overshoot and steady state error minimization. From previous literature studies, it is found that the two-wheeled wheelchair system lacks in utilizing an intelligent approach to model and control the stability of the tilt angle in real hardware platform. Therefore, intelligent controller-based optimization algorithm is proposed to overcome the close-loop unstable problem and stabilize the two-wheeled wheelchair in an upright position specifically in real two-wheeled wheelchair hardware system model and control testing scenarios.
Recently, optimization techniques-based Particle Swarm (PSO) algorithm is adopted to determine optimum control performances specifically for stability of inverted pendulum system.31,32 Particle Swarm Optimization is an evolutionary computation method inspired by the swarming or collaborative behavior of biological populations. PSO is initialized with a collection of random particles or solutions and then the generations are altered to check for optimum. In iteration, the two “best” values are used to update each particle. Moreover, in this work, the designed controller is also optimized using well and established PSO algorithm to achieve optimum result due to these two best values compared to other optimization algorithms.
System identification has been introduced to overcome the limitation of knowledge on system dynamics, it leverages the experimental data of system to obtain an authentic dynamic model during testing and characterizing the system behaviors. System identification on a two-wheel self-balanced mobile robot is conducted by collecting the input-output data from open-loop system and carry out. 33 It conducted system identification with linear models such as Autoregressive with Exogenous Input (ARX), Autoregressive Moving Average Model (ARMAX), Box Jenkin (BJ), and Output Error (OE), as well as nonlinear models like Wiener and Hammerstein. The nonlinear models able to describe the nonlinearity of a dynamic system effectively and Wiener type model structure is the best model to modelling highly nonlinear system with acceptable accuracy. Previous literature discusses the system identification of a MISO two-wheel inverted pendulum mobile robot. It starts from collecting input–output data from closed-loop system which have LQR controller as stabilization control. Then, system identification with models such as ARX, ARMAX, BJ, and OE are carried out, and results showed that ARX model is the best in representing the two-wheel inverted pendulum mobile robot. 34
The main contribution of this work is the development of an optimized controller based on PSO for the two-wheeled wheelchair system model obtained from real hardware. The dynamic behavior of the system is modelled using input-output data acquired directly from the experimental rig. A system identification based on neural network approach is adopted to model the system as the system exhibits highly non-linear behavior. This neuro-modelling technique and optimized controller specifically for two-wheeled wheelchair problem has not been found in any previous literature study.
System identification and neuro-modeling of two-wheeled wheelchair hardware
A system identification method is adopted here for obtaining a dynamic model of the two-wheeled wheelchair. The input and output system data are collected and utilized for training, testing, and validation purposes. The experimental data were collected from the two-wheeled wheelchair for development of the system model for use through this research. The input and output data of the two-wheeled wheelchair were the motor speed and angular position of wheelchair, respectively. These data were fetched into a non-linear autoregressive model with exogenous Inputs (NARX) Neural Network (NN) constructed in MATLAB for the system identification process. This step was crucial as the model generated represented the actual system dynamics. The data fetched were trained and tested for different NN configurations to obtain an accurate system model with the lowest mean-squared error (MSE). Fuzzy logic controllers (FLCs) were then developed for balancing the wheelchair in the upright position. In this study, two FLCs (PD-type fuzzy logic and PID-type fuzzy logic) were developed and designed with normalized membership function and compensated with a scaling factor to scale the membership function range. Finally, as the controllers are built with normalized membership function, gains will be needed to scale the membership function to suit the needs of stabilization control. Therefore, particle swarm optimization (PSO) was utilized to obtain the optimal gains for the controller. During this process, four different fitness functions, namely, Integral Squared Error (ISE), Integral Absolute Error (IAE), Integral Time Absolute Error (ITAE), and Mean Squared Error (MSE) were tested to determine the optimal scaling gains. Figure 1 shows a block diagram representation of the control structure. Block diagram of the control structure.
Two-wheeled wheelchair specification.
Firstly, system identification was carried out with a closed-loop system. Since the two-wheeled wheelchair was open-loop unstable, a stabilization controller implemented so to increase system run time and that the experimentally collected data will show the system dynamics. Figure 2 shows the components that were used to collect the input–output data. Components of two-wheeled wheelchair.
Data collection method was used as in Figure 2,
35
with the motor speed as the input of two-wheeled wheelchair and the angular position as the output data. The input and output data were procured to the neural network for system identification. Firstly, the two-wheeled wheelchair was lifted and maintained in an upright position manually. Then the gyroscope was activated, and the calibration of its angular position automatically began. The calibration will take a few seconds to complete, and the two-wheeled wheelchair will stabilize itself. Although the PID controller was not able to stabilize the system it attempted to prevent the wheelchair from falling off instantly, which is vital for the system dynamics collection. The system was then left to run for a few minutes to collect the system’s dynamics in the form of motor speed and angular position. A chain set was connected from a hoist to the two-wheeled wheelchair body, as a safety precaution, to ensure that the wheelchair will not fall off but loose enough to let the wheelchair move freely. The input–output data thus collected is presented in Figure 3. The collected input–output data.
The input and output data were captured and displayed via a serial monitor in Arduino IDE as in Figure 3. The input data, the motor speed and the output data, angular position was captured in the same interval of time. The gyroscope sensor was used to send the angular position of the wheelchair to the microcontroller, whereas the input data were the controlled effort of the PID controller. The motor speed data was measured in revolution per second (RPS) and the angular position was measured in degree. These datasets then will be used to train the neuro-model to develop similar to simulation of two-wheel wheelchair.
In this work, the neuro-modelling employs a perceptron-based artificial neural network (ANN) with embedded neuron-based function and is referred to as the perceptron of the neuro model. A linear combiner calculates the product of input vector, x of the neuron and the parameter vector, whereas a non-linear activation function is subjected to the output of the linear combiner.
Since the two-wheeled wheelchair is highly non-linear, NARX model was chosen as the model framework due to its simplicity. For estimating the non-linear part of the ARX structure, the NN is utilized, which has the ability to learn a set of data.36,37 It includes nodes organized into two or more separate layers.38,39 NNs are mathematically designed to mimic the biological neurons in the brain. They have been used extensively for identification of nonlinear dynamic systems.
A NARX neural network is set up by using the MATLAB neural network toolbox. The configuration of the network is realized with plant input-output data, hidden neurons, and number of delay signals. The training parameters, such as the number of neurons and the number of delay signals, are adjusted to obtain the best model. The NARX NN was created with 10 neurons in the hidden layer and 2 delay signals.
A total of 5773 datasets were used for the neural network training, testing, and validation. The data was distributed into three blocks where the training data consisted of 70% of the dataset, and the testing and validating data constituted 15% each. The validation step was crucial to determine the accuracy of the model estimated in resembling an actual two-wheeled wheelchair. After the network was trained, it underwent testing and validating process, and the final MSE was used to determine the best model. A heuristic method was used for the NN construction since there was no prior information about the appropriate number of delay signals and model structure. There were three main factors for consideration during the process: delay signals, the number of neurons in the hidden layer, and the error. The third factor was assessed along with the process of getting the best number of delay signals and the structure for each model. 40
Fuzzy logic control (FLC) systems imitate the human decision-making process based on rules to solve complicated non-linear control problems. Most human knowledge is imprecise, uncertain, and usually expressed in linguistic terms. In addition, human ways of reasoning are approximate, and non-quantitative in nature. Fuzzy logic is a tool for transforming such linguistically expressed knowledge into a workable algorithm.
Using the corresponding membership functions, the output of a fuzzy controller is generated from a combination of both fuzzified inputs and outputs. A crisp input is translated based on its value into various members of the corresponding membership functions. From this viewpoint, a fuzzy logic controller’s output is dependent on its membership of the various membership functions, which can be viewed as a set of inputs.
Both the FLCs are built using the MATLAB Fuzzy Logic toolbox. This toolbox simplifies the development of controller by changing the parameters in the GUI. Membership function and fuzzy rules can be altered in the toolbox easily, and the produced controller can be seamlessly used in MATLAB Simulink. All the membership functions are generalized in the range of -1 to 1 so that they create a scaling factor for optimization to take place. The following subsections elaborate on two types of FLC used in this study.
PD-FLC and PID-FLC
PD-FLC
Rule base for PD-type FLC.
PID-FLC
This controller is designed to adhere to the PID-type FLC design using Sugeno type fuzzy logic. 42 All the input crisp data are sent into the fuzzy logic controller, and they go through triangular membership while the output data go through a constant membership function.
Simulink setup
The goal for this study is to maintain a two-wheeled wheelchair in the upright position and this is realized with the neuro-model and FLC described in the previous section. Figure 4 shows the block diagram of the closed-loop two-wheeled wheelchair system with PD-type and PID-type controllers. The simulink block diagrams of the FLCs (a) PD-type FLC (b) PID-type FLC.
PD-type FLC has two scaling factors for controller inputs and one scaling factor for controller output. On the other hand, PID-type controller has two scaling factors for controller input and two scaling factors for controller output.
PSO algorithm
An optimization algorithm is used in this work for efficient determination of optimal scaling factors of the FLC, as a trial-and-error approach is time-consuming and nearly impossible for such a task. PSO is chosen in this study to carry out the optimization process. PSO is an evolutionary computation method inspired by the swarming or collaborative behavior of biological species.43,44 PSO is initialized with a collection of random particles (potential solutions), and they evolved and checked for their fitness through several iterations until convergence to an acceptable set is achieved. The PSO algorithm is based on the following two equations: -
Settings for PSO algorithm.
Range of scaling factors for PD-type and PID-type FLC.
Various performance indexes such as ISE, IAE, ITAE, and MSE are accessed with the optimization of PD-PI controller for the control of the inverted pendulum. 45 Modern complex control systems usually oblige performance requirements that are more complicated than those provided so far. Error and time are critical factors that must be considered at the same time. A performance index is a single measure of the performance of a system that highlights the response characteristics that are considered important. In an estimator design using linear-state variable feedback, the notion of a performance index is very important.
The ISE, IAE, ITAE and MSE are determined, and they are used in the optimization of the controller for two-wheeled wheelchair stabilization. These are implemented for individual controller optimization as given below. Here,
Results: hardware testing and model validation
The identification process was initially carried out by changing the number of delay signals to predict the one-step-ahead (OSA) reaction. OSA is coherent with the dynamical structure of the system modelling as forecasting, involving with future state of the system referring on the current and past inputs. Accuracy of each prediction is paramount to ensure stability and performance of the control system.
To evaluate and fine-tune the predictive accuracy of this model, MSE indexes was chosen as the primary indicator. MSE quantifies the average of the squared differences between the predicted and actual values which appropriate with OSA predictions. Specifically emphasizing larger errors helps in identifying and minimize the deviation of those predictions. The sensitivity characteristics of MSE ensure not just an accurate model on average but also provide robust features in scenarios where it is necessary to have precise prediction to maintain system stability. This makes MSE a fitting metric of assessing model effectiveness in predicting the dynamic behavior of the two-wheeled wheelchair system.
Performance of ANN with different number of delay signals.
Performance of NN with different number of hidden neurons.
It is noted in Table 5 that as the number of delays increased to up to 7, the MSE decreased and for delay signal settings greater than 7 there was an increasing trend in the value of MSE. Therefore, it can be concluded that using the input and output signals of 7 delays, the excellent one-step-ahead prediction is acquired.
The NN performance was then evaluated with different number of neurons in the hidden layer. Table 6 displays the results of the system prediction as the number of neurons in the hidden layer was varied. It is noted that the best MSE value was achieved with 8 neurons in the hidden layer. Hence, given both the configuration of the model and the number of delays, the best results are obtained with a combination of 7 input-output delays and 8 neurons in the hidden layer. The model with this structure was used in further evaluations.
Figure 5 shows the NN structure thus devised and used in the research. The network architecture consists of input layers that take past inputs (motor speed data) and past outputs (angular position), hidden layer with eight number of neurons that apply non-linear activation functions, an output layer that predicts the current output (angular position). NARX neural network with 8 neurons in the hidden layer and 7 delay signals.
The controllers were optimized by manipulating the scaling factors and simulated in MATLAB Simulink. The performance indices for both controllers were different, as shown below, due to the different control efforts from the controllers.
A configuration with 50 iterations and 100 number of particles was used to obtain the scaling factor for both controllers. The cost function decreased as the iteration increased because the new gbest values tended to produce smaller errors. Hence, the cost function became smaller. As is evident in the convergence graphs in Figure 6, the PSO algorithm converged after 15th iteration and settled at 50th iteration. Performance for PD-type FLC (a) ISE performance. (b) IAE performance. (c) ITAE performance. (d) MSE performance.
Scaling factor after optimized for PD-type FLC.
Scaling factor after optimized for PID-type FLC.

Performance for PID-type FLC (a) ISE performance. (b) IAE performance. (c) ITAE performance. (d) MSE performance.
Figures 8 and 9 show the performance of the developed system with PD-type and PID-type controllers, respectively. System response with optimized PD-type FLC. System response optimized PID-type FLC.

Tabulated response with optimized PD-type FLC.
Tabulated response with optimized PID-type FLC.
Thus, a two-wheeled inverted pendulum has been successfully developed and controlled with an optimized fuzzy logic controller. As discussed above, although the PD-type FLC was able to stabilize the system in closed-loop form, it could not maintain the 0° tilt angle; it had a slight steady-state error even with four optimization criteria. PID-type FLC was superior to its PD-type counterpart in terms of settling time and steady-state error, MSE optimization as the best overall which allocate improvement at 12.5% of settling time and achieved negligible steady-state error at an average of 0.046%.
Conclusions
A control approach based on fuzzy logic for stabilization of a two-wheeled wheelchair to aid people with disabilities has been presented. The system has been modeled using ANN and both PD-type FLC and PID-type FLC have been considered in the investigation. The controllers have been designed and optimized using PSO and the developed controllers have been tested and evaluated using different performance evaluation criteria pertaining to the stabilization error. It has been shown that the control system thus developed is able to stabilize the wheelchair at an upright position and the FLC optimized with PSO makes the system performance superior. It has been further shown that the system with PID -type FLC with MSE optimization performs better that manage to attain of 35 s of settling time and a satisfying steady-state error at 0.046% than what PD-type FLC able to achieve which can be defined a 12.5% improvement in settling time and maintain a 0 degree of tilt angle. Moreover, these performances will determine the user’s comfort and contribute to safety aspect as the crucial element for a two-wheeled wheelchair system.
Footnotes
Declaration of conflicting interests
The author(s) declared no potential conflicts of interest with respect to the research, authorship, and/or publication of this article.
Funding
The author(s) disclosed receipt of the following financial support for the research, authorship, and/or publication of this article: This work has been financially supported by the Postgraduate Research Grant Scheme PGRS230341. It has been awarded by the Research and Innovation Department, Universiti Malaysia Pahang Al-Sultan Abdullah, Malaysia.
