Robust Neural Network-Based Trajectory Tracking Control for Mobile Vehicles
Abstract:
The ability of neural network-based control systems for trajectory tracking in wheeled mobile vehicles was evaluated in this study. A significant challenge often encountered is the deviation from the desired trajectory, particularly in high-speed motion. A robust control scheme, designed using the Nonlinear Auto-Regressive Moving Average-Level 2 (NARMA-L2) approach, was employed to enhance the tracking performance under dynamic conditions. The NARMA-L2 controller, a well-established technique for nonlinear systems, was utilized to improve the accuracy and robustness of trajectory tracking in the presence of external disturbances and noise. In heavy-duty mobile vehicles, such as agricultural machines, maintaining straight-line motion at high speeds is particularly susceptible to external load effects and system noise. The proposed control strategy integrates several stages, including system modeling, controller design, and the training of the neural network. To optimize the parameters of a proportional-integral-derivative (PID) controller, the Particle Swarm Optimization (PSO) algorithm was applied, ensuring precise regulation of the vehicle’s speed. The controller generates a reference velocity, which is fed as a signal to control the motion of the left and right wheels, enabling effective steering and trajectory adherence. Simulation results demonstrate the effectiveness of the proposed controller in mitigating the impact of disturbances and load effects. The optimization of control parameters successfully minimizes the discrepancy between the left and right wheel positions, bringing them closer to zero. The robust parameter optimization approach, which was employed to counteract the influence of external loads, can significantly improve system performance under varying conditions.1. Introduction
Heavy-duty machines, such as excavators, cranes, and bulldozers, are characterized by complex nonlinear dynamics. The modeling of such systems can be achieved through system identification techniques [1], which are employed to accurately capture the system’s behavior in the presence of varying loads, noise, and external disturbances [1]. The study of system parameters is critical for addressing these challenges, with a particular focus on improving performance metrics such as stability, error rate, and robustness to external perturbations [2], [3]. A tunable feedback proportional-integral (PI) controller and a NARMA-L2 controller were compared to show the linearization and neural network effect on system parameters. To ensure the robustness of the design, the neural network was trained with a wide range of operating conditions, including disturbances and uncertainty [4]. Previous research has studied the trade-off between standard accuracy and robust accuracy, revealing the fundamental tension between robustness and generalization obtained [5], [6]. To move the mobile vehicle in a straight line, a PI controller was used to produce the same speed for the left and right wheels. An optical encoder sensor was used to measure each wheel’s velocity [7].
2. Research Methodology
The proportional and integral control algorithm is most widely in motion control. The digital integrators produce error to develop a prototype design. PI controller. It is a closed-loop feedback control mechanism for gain adjustment, interacting with set point. It leads to achieving a balance between speeds of response to deviations and reducing errors in the long term. By setting the required value, the control unit can be adjusted [8]. The control system component with an equation:
where, $K_p$ is the proportional gain and $K_i$ is the integral gain. The proportional component responds to the error, while the integral component accumulates past errors to eliminate steady state error.
The mobile vehicle is represented in Figure 1, which illustrates the motion of the vehicle along a straight path and its turning angle during manoeuvres. The path of desired position is denoted by $d$ to notify the straight line of the mobile vehicle motion and the angle of mobile vehicle turning is $\theta_f$.

The analogue output of the sensor was digitized and integrated to measure the coinstantaneous speed difference $V_{d(n)}$. An error was obtained by subtracting the two encoder measurements, as shown in Eq. (2).
where, $E_{(n)}$ is the error of the right and left wheels. An error signal was supplied to the PI controller to generate the active signal controller to reduce the input of the source, aiming to equalize the mobile vehicle wheel's speed [9]. With the tunable PID controller employed, the suitable gain can be chosen to overcome unstable signal noise integrators.
Tuning the proportional and integral controller, by adjusting the parameters of system gain $K_p$ and $K_i$. If the installation considers the time constant $\Delta t$, then $\omega=\frac{1}{\Delta t}$ and $v_R=r \omega_R, v_L=r \omega_L$, where $r$ is the radius of wheel, $\omega_R, \omega_L$ is an angular speed of the right and left wheels, measured by rad/sec.
To specify the motion of the mobile vehicle when it travels from a current known position $\left(x_o, y_o, \theta_o\right)$ to a new location $\left(x_f, y_f, \theta_f\right)$, the distance $d$ and the slope $\theta$ of the straight line and final location can be calculated as follows [10]:
The slope $\theta$ of the straight line and final location is given by:
For modeling the mobile vehicle in Matlab, two Direct Current (DC) motors with integrated gears and additional sensors were represented. The purpose of the control system is to provide a mobile vehicle for moving in a straight line, correcting the input voltage to two DC motors. Each speed of the sprockets was sensed by the sensor and counted in the counters. The analogue output of the sensor was digitized and integrated to measure the displacement of the wheels. The instantaneous speed difference by the wheels is called an error signal.
3. The Controller and Mobile Vehicle Parameters
The control system can be classified as a classical controller (e.g., PID controller) and a modern controller (e.g., neural network NARMA-L2 controller). The tuning of the PID controller was obtained by using PSO to satisfy the controller parameters [11]. That enables the system to generate data used for the training phase of the NARMA-L2 controller.
The general form of the PSO method is given by a differential equation [11]. In this study, the PSO technique was employed to fine-tune the parameters of the PID controller, aiming to mitigate the noise present in the measured signal following integration [12], [13]. Figure 2 shows the tuning procedure, where $e$ represents the error between the input and the output of the system. The integral time of squared error (ITSE) criterion was used to minimize the difference between the desired input signal and the output [14]. In tuning phase the parameters of differential is low and can be neglected in this work.
where, $i=1,2 \ldots m ; j=1,2 \ldots$; $m, L$ and $p$ are the number of particles, variables, and iteration; $X_{i, j}^{(p)}, V_{i, j}^{(p)}$ are the position and velocity of particles; and $R_1$ and $R_2$ is an arbitrary number. $c_1=1.1, c_2=1.2$
where, $W$ is the weight factor. Maximum iteration number used is 100 iteration. Function of (ITSE) is given by,
After running PSO program with n= 20 and 100 iterations, the obtained nonlinear controller gains for $K_p$ and $K_i$ are 160 and 100 respectively. After tuning the differential effect is very low and can be neglected in this work.

The vehicle hardware contains two optical encoders connected to the motors to measure the speed of the vehicle. The system and the controller implementation are presented in Figure 3. As shown in the figure, a discrete time integrator is located in the feedback path to amplify the speed measurement from the encoder. The speed and position are controlled by the PI control system.
By using PSO method and setting the PI controller parameters, the controller response can be used to generate a sufficient data used for NARMA-L2 controller training. The simulated result of PI controller, as shown in Figure 4, is used to train the NARMA-L2 controller.


The controller calculates the desired speed of the left and right wheels and sends commands to the robot. The speed regulator NARMA-L2 represents the construction of a neural network based on the inverse linearization controller for two degrees of freedom [15], [16]. The nonlinear NARMA-L2 neurocontroller equation was used to follow the reference trajectory by equalizing the two output parameters, i.e., the reference output $y r(k+d)$ and the desired output $y(k+d)$ [17].
Most popular activation function of the networks neurons is (trainlm) function with 9 hidden layers. 100 training sample has used to train 1000 times of epochs is obtained.
4. Mobile Vehicle Analysis and Simulation Results
The simulation and analysis of the mobile vehicle are to determine the variables necessary for the operation to provide the desired results. Continuous and discrete time design frameworks for vehicle navigation were developed foremost with trajectory tracking. In order to follow specific paths, the system parameters were adjusted and the parameters of the PI controller were set, where $K_p$=160 and $K_i$=100, which are generally described as speed and position profiles. The proposed design uses the motion equation written as follows [18], [19]:
where, $\mathrm{V}_{\mathrm{R}}, \mathrm{V}_{\mathrm{L}}$ is the linear vehicle velocity (meter/second), b=1 is the width of the mobile vehicle $(\mathrm{m})$, and $\theta_f$ is the angular speed of the mobile vehicle.
Figure 5 shows a simulated flowchart equivalent to the mobile vehicle, where $H$ is the optical sensor, and $F_1$ and $F_2$ are the noise. Discrete Time Integrator (DTI) is used in feedback path in this design. The input to the system is desired speed in $x$ and $y$ position $V_x$ and $V_y$.

Table 1 shows the training of NARMA-L2 with suitable values, which can yield a suitable response after 1,000 training epochs.
Parameters | Parameter Values | Parameters | Parameter Values |
Hidden layer size | 9 | Delayed plant input | 3 |
Sample interval (sec) | 0.005 | Delayed plant output | 2 |
Min interval (sec) | 0.1 | Max interval value (sec) | 3 |
Training sample | 100 | ||
Training epochs | 1,000 |
In the system identification phase, a neural network model of the plant to be controlled was designed. In the controller design phase, the plant model identified was used. The vehicle uses a simple kinematic model of differentially steered wheels, as shown in Eq. (10) [20]. The Simulink model is shown in Figure 6.

The trained network was validated on unseen data to ensure that it generalizes well. The controller was tested in the simulation before deploying it to the real model to follow a reference track (e.g., a track centerline or a track from a motion map) while taking into account vehicle dynamics and constraints. Lane keeping ensures that the vehicle stays within the track limits by adjusting the steering angle. The vehicle’s speed was regulated, enabling smooth and safe navigation in complex environments. The optical encoder type was used to measure pulses of sprockets per second, with the time interval to measure the vehicle speed. Figure 7 shows the left and right outputs of the encoder, which represent the angular velocities of the two encoders in volts, with the band limiting achieved by using the analog low-pass filter.
Figure 8 shows the difference in speed between the two wheels and the displacement of the vehicle.


The model was used in simulation to obtain a theoretical speed and position displacement of the mobile vehicle. The result is shown in Figure 9, which represents two components of speed measured in $v_x$ and $v_y$.
After reaching the desired position, the reset controller can get a new position or line for the vehicle to follow. From the simulation results, it can be noticed that the output speed difference of the left and right wheels is minimized to zero after setting the PI controller parameters and applying the NARMA-L2 controlling effect. For the position at any moment, the mobile vehicle’s displacement can be noticed from the graph of motion, as shown in Figure 10.
The system response in the centimeter distance can be shown in Figure 10. It is noticed that the vehicle can move to a desired location. The mobile vehicle is capable of moving in a precise position and its speed allows cooperative parameter control adjustments, enabling smoother traffic.


5. Conclusions
The speed and position of the mobile vehicle were effectively controlled through the integration of a neural network and a PI controller, enabling the vehicle to follow a desired trajectory. This trajectory was determined by a differential equation that models both the target and actual positions of the vehicle. The reference velocity, used to regulate the vehicle's motion, was fed into the control system. Left and right DC motors were used for steering the mobile vehicle. Lane keeping enabled the vehicle to stay within the track limits by adjusting the steering angle. The vehicle’s speed was regulated for smooth navigation in complex environments. Optical encoders were used to measure the speed of the vehicle. The simulation result is good in terms of the adopted variables. Furthermore, the Simulink model clearly indicated that disturbances and load effects could be effectively rejected, with the system achieving near-zero deviation in pursuit of the reference trajectory. That enables the mobile vehicle to follow a desired trajectory. The simulation result of the required input with noise shows that the control scheme is robust and the designed NARMA-L2 controller is effective.
A motion map could be used for tracking while taking into account vehicle dynamics and constraints. A practical microcontroller with an optical encoder board could be used to compare with the simulated model of the vehicle.
Hasan H. Juhi, Nihad M. Ameen, Sarab A. Mahmood, Ammar A. Yahya, Writing – original draft, Visualization, Validation, Resources, Methodology, and Investigation. Yousra A. Mohammed: Writing – original draft and data curation. Hasan H. Juhi: Editing, and Validation.
The data used to support the research findings are available from the corresponding author upon request.
The authors declare no conflict of interest.
