1. Introduction
Nowadays, Autonomous Mobile Robots (AMRs) play an important role in a wide range of applications and fields, including, but not limited to, institutions, airports, malls, hospitals, and factories. AMR is a type of robot that is programmed to avoid obstacles and perform complex tasks in flexible and intelligent ways with little human interaction, so it can be considered an innovative technology able to improve efficiency and ensure precision, enhance speed, and increase safety in many fields [
1]. AMRs usually operate in an unknown and unpredictable environment, so they are designed to be capable of understanding, scanning, and navigating the surrounding environment, thus differing from Autonomous Guided Vehicles (AGVs), which rely on a predefined path and physical guidance [
2,
3,
4]. Multiple AMRs, called Multi-Agent Robot Systems (MARSs), can perform complex missions by distributing the tasks and sharing data between multiple collaborating robots physically engaged with each other, providing the benefits of reduced time and energy consumption, robustness, and efficiency of the system, achieving better results than each robot individually [
5,
6,
7,
8].
AMRs use a sophisticated set of sensors and actuators, and different types of control algorithms to perform various tasks, such as obstacle avoidance (OA) [
9,
10,
11,
12], navigation [
13,
14], and simultaneous localization and mapping (SLAM) [
15,
16,
17,
18]. SLAM is a method where the robot builds a 2D map of an unknown environment and simultaneously localizes itself in that map. Then, it can plan the shortest collision-free path to its location goal [
19]. Hence, the robot’s positioning is an important aspect for the tasks AMRs can perform, either indoors or outdoors. There are various sensors used to collect data for the abovementioned tasks, such as cameras [
20,
21,
22], depth sensors [
23], LIDAR [
21,
24], laser range sensors [
17,
25], and ultrasonic sensors [
26,
27]. After collecting the data from the robot, then comes the issue of making it able to direct itself from the current position to the desired destination following the predefined path. This is the control algorithm’s role. Different control strategies have been proposed to control the robot’s trajectory planning. Path planning and robot motion can be controlled by classical control methods such as PID/PI controller [
28,
29,
30]; modern control methods such as fuzzy control [
31,
32]; the visual odometry technique, which estimates the robot’s movement in the third dimension and updates the robot’s position continuously [
1]; deep reinforcement learning (DRL), which can deal effectively with uncertain environments [
2]; and several optimization algorithms, such as the Kalman filter [
18,
33,
34] and genetic algorithms [
35,
36]. The construction of control rules for the angular, linear, and acceleration of the nonholonomic wheeled mobile to trace the desired path is the control problem for trajectory tracking. The control strategy seeks to reduce the discrepancy between the intended and actual track. Sensor errors that are measured from both internal and external sources are the cause. Additionally, slippage, disruptions, and noise are to blame. The nonholonomic constraint prevents the mobile robot from moving quickly in the direction orthogonal to its wheel axis.
Advanced control methods, including adaptive control, variable structure control, fuzzy control, and neural networks, can be used to solve this issue. Implementing self-tuning adaptive control systems presents many challenges, including the inability to maintain trajectory control in the midst of jarring disruptions or loud noises. This is due to the possibility that the parameter estimator could produce false findings in the face of jarring shocks or significant noise. The implementation of a variable structure controller is simple but challenging. This is due to the potential for a sudden shift in the control signal, which could have an impact on how the system functions [
37]. Although it takes greater computer power and data storage space, a neural-network-based motor control system has a strong ability to solve the system’s structure uncertainty and disturbance [
38]. The majority of the time, fuzzy control theory offers nonlinear controllers that can execute a variety of complicated nonlinear control actions, even for uncertain nonlinear systems [
39]. An FLC does not necessitate exact knowledge of the system model, such as the poles and zeroes of the system transfer function, unlike conventional control designing [
40]. Fewer calculations are required by a fuzzy logic control system based on an expert knowledge database, but it is unable to accommodate the new rules. The fundamental challenge in using conventional PID controllers is selecting the control parameters accurately [
41]. Random or even manual configuration of these control parameters may result in the system not responding as anticipated, especially when there are system uncertainties [
42,
43]. Only when the plant model is defined as first-order with dead time is the Ziegler–Nichols method used. Algorithms for optimization have recently been created. Examples include fruit fly optimization, particle swarm optimization, and genetic algorithms (GAs) (FFO) [
44]. In [
45], GA optimization is used to find the optimal PID control parameters for a multi-input multi-output (MIMO) nonlinear system for the twin rotor of the helicopter.
This paper is an extension of the work in [
33]. Real input/output data are collected experimentally from a six-wheel autonomous differential wheelchair that operates a SLAM task. The robot wheelchair uses different input devices, indicating its ability to operate in both manual and automatic modes, such as a joystick for speed/position control, an ultrasonic sensor for detecting and avoiding obstacles, and a PRLIDAR (SLAMTECH, Shanghai, China) sensor for map construction, and it is controlled using an ROS framework that allows the user to choose the predefined goal position by using the touchscreen or voice recognition mode. Right and left wheel PWM signals are measured using feedback encoders taken as the input data. Two system identification methods are estimated using the collected data with Matlab software version 9.9 (US). Several candidate models are designed to simulate the actual wheelchair, and a SIMULINK model is obtained to build a closed-loop form using the PID control. Two PID controllers are used where one of them is for the robot’s linear speed control and the other is for angular speed control, and their output is applied to the kinematics equations of the differential drive mobile robot. Tuning these PID controllers can be achieved using trial and error, which can consume a large amount of time, so this paper presents one of the alternative and more accurate methods, the genetic algorithm (GA) optimization method, to find the optimal PID gains, and a comparison between the performance of the estimated model and the actual robot is obtained based on experimental results.
The paper is prepared as follows. Firstly, the experimental setup is presented. Secondly, system identification is explained. Thirdly, the proposed controller techniques are demonstrated. Fourthly, the experimental results are illustrated. Finally, the conclusion is discussed. The paper is prepared as follows. Firstly, the experimental setup is presented. Secondly, system identification is explained. Thirdly, the proposed controller techniques are demonstrated. Fourthly, the experimental results are illustrated. Finally, the conclusion is discussed.
3. System Identification
Using experimental input and output data, system identification aims to establish the model system’s parameters. There are three fundamental steps in the process of developing a model. The input and output data come first. This information is gathered through the experiment. The set of candidate models comes next. From the pool of potential models, we must study the most suited model.
The general linear transfer function of the wheelchair system may be written as the following Equations (47) and (48).
where
is the linear speed of the wheelchair,
is the angular speed of the wheelchair,
is the input voltage for the right motor, and
is the input voltage for the left motor. The n is the system order and
,
,
, and
are the estimated parameters of the approximate transfer function.
It is well-known that linear models cannot accurately describe a nonlinear system [
3]. By raising the order of the linear system, the model’s accuracy can be improved. However, it is frequently the case that increasing order is unable to substantially increase model accuracy. As a result, the nonlinearities (such as friction and backlash) must be explicitly included in the system [
16].
In this study, we attempt to model such systems using the nonlinear ARX model structure, where AR denotes the autoregressive portion and X denotes the additional input. As seen in
Figure 3, a nonlinear ARX model can be thought of as an expansion of a linear model.
These models are defined as those that have a nonlinear dependence on their parameters. For example, see Equation (49).
To illustrate how this is achieved, first the relationship between the nonlinear equation and the data can be expressed generally as
where
is a measured value of the dependent variable,
is a function of the independent variable
and a nonlinear function of the parameters
, and
is a random error.
This model can be expressed in an abbreviated form by omitting the parameters
The nonlinear model can be expanded in a Taylor series around the parameter values:
where
j = the initial guess,
j + 1 = the prediction,
, and
, and substituting Equation (51) into Equation (52) will result in Equation (53).
or in matrix form
where
is the matrix of partial derivatives of the function evaluated at the initial guess j,
where n = the number of data points.
The vector {
D} contains the differences between the measurements and the function values,
The vector
contains the changes in the parameter values,
Applying linear least-squares theory to Equation (10),
for {∆
H}, which can be employed to compute improved values for the parameters, as in
Two input/two output data had been collected using Arduino and ROS. The right and left motors receive a PWM command ranging from −255 to 255 as demonstrated in
Figure 4. The output position and orientation data are calculated using differential drive robot kinematics equations as follows: each motor has an Omron E6B2-CWZ6C incremental rotary encoder that provides 2000 PPR resolution with two channels 90o out of phase to determine the direction of rotation. The collected data are summarized in
Figure 5.
A black box that takes two inputs and two outputs is needed. A MIMO model was estimated using the system identification toolbox to adapt to the nonlinearities in the mapping from inputs to outputs. The NLARX model will be used and compared with three-transfer function models (three poles and two zeros, six poles and three zeros, twelve poles and six zeros) (
Appendix A). The NLARX could achieve a lower mean squared error and was more suitable to use with SIMULINK for optimizing PID controller gains, as demonstrated in
Table 1.
Figure 6 shows the four models’ comparison and fitness to training data. Transfer function models were better at estimating the angular speed output but could not capture the relation between inputs and the linear speed; thus, we used the NLARX model. It can noted that the zoomed-in area confirms that the NLARX model can track the actual behavior of the wheelchair experimental setup.
4. GA-Based PID Control
The transfer function of the PID controller is
, where
,
,
are proportional, integral, and differential gains, respectively. Each component of a PID controller serves the following purpose: the proportional component lowers the system’s error reactions to disturbances, the integral component removes the steady-state error, and the derivative component dampens the dynamic response and increases system stability [
8]. Selecting the three parameters for the PID controller that are appropriate for the controlled plant is a challenge. There are other ways to establish the PID controller’s parameters, such as Ziegler–Nichols and trial-and-error; however, the majority of these approaches are unreliable. The GA serves as a tool for various design processes to solve complex optimization challenges. It overcomes the problems with traditional optimization methods, such as using broad ranges rather than generating millions of probabilities to obtain the optimum function. Convergence is slow and occurs at local minima and maxima based on an educated guess. Calculation of derivatives takes time. Additionally, the GA does numerous parallel optimum point searches. So, the parameters for PID controllers were found using distinct cost function genetic algorithm techniques in this work.
This cost function as shown in Equation (60) minimizes the integrated square error e(t).
The systematic diagram for the wheelchair in a closed-loop form is illustrated in
Figure 7. It can be noted that the system consists of two PID controllers. The first is for the angular speed, and the second is for the linear speed. In addition, the output of the controllers is a pulse width modulation (PMW) which can adapt to the motor speed.
A highly helpful technique for searching and optimizing a variety of engineering and scientific challenges is the genetic algorithm (GA). In this thesis, the GA is used to adjust the PID controller parameters in order to employ distinct cost functions to identify the best solutions. Here, we model it using the MATLAB Genetic Algorithm Toolbox. The first and most important stage is to encode the issue onto the appropriate GA chromosomes, followed by population construction. Some studies advise having 20–100 chromosomes per population. The likelihood of obtaining the best outcomes will increase with the number of chromosomes. We employ 80 chromosomes in each generation, though, because we have to take the execution time into account.
The six parameters
,
,
,
,
, and
of each chromosome have different value constraints depending on the cost functions utilized. In order to achieve the best results, the starting values of
,
, ,
,
, and
are derived from the Ziegler–Nichols rule. According to Equation (61), the population in each generation is represented by an 80 × 7 matrix, depending on the population’s chromosomal count.
where
n: number of chromosomes.
Each row is one chromosome that comprises
,
,
,
,
, and
values, and the last column is added to accommodate fitness values (F) of corresponding chromosomes. The final values of
,
,
,
,
, and
are determined by minimizing a certain cost function, as demonstrated in
Figure 8.
The GA steps can be summarized as follows: the first step is selecting the search interval. This stage necessitates knowledge, experimentation, or assumption based on the system eigenvalues that characterize the system stability region. In the second step, the population is created at random inside the search window. In the third step, based on the cost function, chromosomes from the present generation (population) are chosen (reproduced) to be parents to the following generation. In the fourth step, children’s new chromosomes retain a lot of their parents’ traits.
Having a model to control, we applied PID controllers using the same scheme used with the Arduino; that is, one PID takes on the linear speed error, and another one handles the angular speed error. Then, the optimization was applied using the genetic algorithm and the Integral Time Weighted Absolute Error, ITAE, as an objective function.
The resulting PID gains were as follows for the linear speed PID = 64.3182, = 5.6344, = 4.0823) and for the angular speed PID = 40.061, = 24.0089, = 1.0923).
5. Experimental Results
This section illustrates the experimental results where the obtained parameters of the PID’s controllers will be applied practically and then compared with the simulated results with MATLAB Simulink to validate the identified model. In addition, the navigation experiment results will be presented.
Figure 9 demonstrates a comparison between the wheelchair linear and angular speed responses in two cases. The first case considers the response of the identified model based on the NLARX model. The second case is the actual autonomous wheelchair response. It can be noted that the actual response is approximately identical to the simulated results, which ensures that the obtained identified model is accurate and can simulate the actual autonomous wheelchair. Moreover, the actual response suffers from shuttering due to the measured signal noise of the encoder and wheel vibration.
Autonomous robot navigation refers to giving the robot a goal position inside a map, and the robot should move from its initial position to the goal position without any input from the user, achieving the constraint of following the shortest and safest collision-free path, as well as parameter constraints such as when accelerations and velocities are limited within a certain range. Autonomous navigation requires a number of tasks to be performed.
Figure 10 summarizes the subproblems in autonomous navigation, along with some famous algorithms that solve these problems.
The navigation methodology steps of the wheelchair is demonstrates in
Figure 11.
For a robot to autonomously navigate in an unknown environment, it needs to localize itself inside this environment and find out what this environment looks like at the same time, a problem referred to as the simultaneous localization and mapping problem, or SLAM for short. SLAM is a well-known problem in robotics, and many approaches to solving it have been made. Scan matching algorithms, such as hector_slam, are one of the algorithms of interest, as an implementation of this algorithm is available as an open-source ROS package. Scan matching makes use of the high scanning rate of modern laser scanners; it tries to align new scans with the existing map built from previous scans to best describe the environment and find the robot’s position. hector_slam uses Gauss–Newton optimization to align the scans with each other; the coordinates of the scan endpoints are a function of the robot’s position in the world, which is described using a rigid transformation as follows:
where
represents the robot’s pose and
is the vector representing the scan endpoint coordinates, in 2D. hector_slam aims to find the transformation described by
which would best align the new scans to the map built from the previous scans, which also represents the robot’s position and is represented by
where
returns the map value at the given coordinates of
.
A famous representation of maps used in robotics is grid occupancy maps, where maps consist of grid cells that hold the probability of each cell being occupied. After the robot has built its map and found itself inside it, it is given a goal position to move to; starting from an estimated initial position, path planning algorithms find the shortest path to follow that is collision-free. A famous algorithm that is used to find the shortest path between two points is Dijkstra’s algorithm. The algorithm finds the shortest distance to all points from the starting point, which is computationally inefficient. An improvement of Dijkstra’s algorithm is the A* algorithm, which uses the same principles but adds a heuristic function to the algorithm; this allows the algorithm to find a path that may not be optimal, but is good enough, and does that much faster in terms of computational time.
With the knowledge of the set of points that the robot must follow with certain velocities, the path, there must a low-level controller that makes sure the robot’s linear and angular speeds are correctly updated and adjusted to track the given path. This is the most significant contribution of our work.
Input from the user is given using a GUI that is shown on a 5” touchscreen, which we use as our desktop environment. A photo of our simple, proof-of-concept GUI is shown next (
Figure 12).
The user can select one of the places as the go-to destination, and predetermined position and orientation inside the destination are then sent to the ROS navigation stack as a new navigation goal. As for the ease-of-access feature, we added the ability to choose the destination number using voice recognition. We used a TensorFlow [
2] deep learning library to build a speech command recognition model that recognizes digits 0–9. The model was trained on the public speech command dataset [
3]. The model was converted to the tf.lite format to be able to perform inference on the Raspberry Pi.
Using the LIDAR, and after having the odometry and required transforms ready, navigation trials started. Using the hector slam package, multiple maps of different environments were created, and we faced a problem in that sometimes the map became distorted, which affected the navigation stack performance.
Figure 13 shows a map of the workshop created by hector slam.
Figure 12 also shows an example of the maps becoming distorted, depending on how the robot is moved and how the scanning occurs. As a solution to this problem, we tried to use Gmapping to perform a SLAM alternative to hector slam. Although it achieved better maps, Gmapping uses Odometry as opposed to hector slam, which means it is highly affected by the encoder reading, which has noise.
Figure 14 shows some of the experiments using the ROS navigation stack. The robot planned a global path and a local path to arrive at the given goal; however, the performance was not accurate, as the navigation stack requires many parameters to be set, and more tuning was needed.
Navigation testing proceeded by gathering parameters from the LIDAR (SLAMTECH, China) sensor and the encoder to properly perform navigation. An issue during testing was that once synchronization was lost between the Arduino and Raspberry Pi, the wheelchair activated recovery behavior mode. It may move in a circular path around its center or try to find the path with the least obstacles to move on. Another issue was that obstacles appearing on the map remained on the map. This issue caused the errors in navigation and the path planning process. Moreover, once in recovery mode, the wheelchair might start to rotate around itself as obstacles remain around it on the map. The autonomous mode was tested in an indoor environment. A map was built by the robot using the hector slam mapping package. It was then loaded by the map server package and received by the amcl localization package, and moved base to perform the navigation goal.
Figure 15 displays the room where tests were conducted. Features of the map generated are highlighted and shown in
Figure 16.
Costmaps were performed by the move_base package.
Figure 17 shows the global costmap and the local costmap, highlighted in the blue color scheme.
First, navigation trials showed that move_base parameters needed more tuning, especially the speed and acceleration limits. The robot was taken to several different areas to proceed with testing. The navigation system showed great results in wide areas; however, in smaller areas and narrow paths, the results show the need for extra testing and tunning of the navigation stack parameters.