1. Introduction
Currently, society has entered the era of artificial intelligence, and construction machinery in various fields is making significant progress toward autonomous operation. Naturally, a diverse range of engineering vehicles are also embracing this trend [
1,
2,
3]. Currently, among the various vehicle motion control models, the rear-wheel drive Car-like model and the differential drive Tank-like model are widely employed [
4,
5,
6]. The Tank-like model primarily exemplifies the two-wheel differential car as its prototypical representative. It is evident that delving into the motion control of a two-wheel differential car holds immense significance for fostering the intelligent development of construction machinery.
In order to enhance the precision of the control and operational stability of the two-wheel differential car, it is imperative to devise a well-structured control system. Numerous scholars have conducted extensive research to address the control issue of a two-wheel differential car. The Proportional Integral Derivative (PID) control theory, a fundamental concept in classical control theory, is commonly employed to achieve closed-loop control of specific control objectives. By implementing the PID control algorithm, Fu Zuoli [
7] effectively regulated the adjustment time of the corn sowing suppression system to 1.9 s and limited the overshoot to 2.0%, thereby achieving a commendable control effect in terms of stable output for pressure stabilization. The PID algorithm was employed by Dong Zhisheng [
8] to regulate the horizontal stabilizer bar, resulting in a 10% enhancement in the vehicle’s attitude angle stability. Yang Hangxu [
9] utilized the pitch angle of the car as an input and implemented a PID control algorithm to regulate the lifting mechanism of agricultural machinery, effectively addressing issues such as sensitivity to ground fluctuations and operational instability. Liu Tengfei [
10] incorporated the PID algorithm into the maglev system, effectively addressing the issue of system instability caused by uneven track conditions and significant load disturbances. Lv Haoyu [
11] employed a PID algorithm to calculate the adjustment of driving torque, successfully achieving precise steering in situ for distributed drive electric vehicles. Chen Bing [
12] developed a track tensioning force control system based on the PID algorithm, enabling a precise adjustment of the track tightness through the rotation of the induction idler wheel crankshaft. Chen Yuanling [
13] employed a fuzzy PID algorithm to effectively regulate the rotational speed of the cutter head, driven by the dual hydraulic motors. This approach resulted in a reduction of 2.5 s in the starting time and a decrease of 24 r/min in the rotation speed difference, thereby significantly enhancing its control performance. Although the PID control algorithm is employed in the aforementioned examples, the tuning of the PID parameters typically relies on empirical knowledge or reference to prior research findings, which does not guarantee an optimal and rational parameter configuration.
PID parameter adjustment is not only time-consuming and laborious, but also requires users to have rich experience in parameter adjustment. At present, the academic community generally believes that the use of optimization algorithms to adjust the PID parameters is the most time-saving and labor-saving parameter adjustment method. Therefore, a large number of scholars have begun to use various optimization algorithms to adjust the PID parameters, and these algorithms have their own advantages and disadvantages. In order to solve the problem of the unstable operation of the pumps in intelligent irrigation systems, Xu Jinghui [
14] used the Seeker optimization algorithm (SOA) to realize the automatic optimization of the PID parameters, but the final experiment showed that the population search optimization algorithm had more iterations when optimizing parameters. Zhang Jinhui [
15] designed a synchronous measurement system for a tractor body and machine attitude based on a neural network PID algorithm, which improved the reliability of the tractor attitude adjustment in mountainous and hilly areas. However, using a neural network to optimize the PID parameters requires a very complex and detailed control system model, which undoubtedly increases the difficulty of using this method. The above two cases reflect the two major limitations of the current optimization algorithm: a slow calculation speed and the need for a detailed and complete system model. In order to avoid the establishment of complex system models and improve the optimization rate, many scholars choose to use a particle swarm optimization algorithm. Li Huanhuan [
16] designed a set of PID steering controllers based on a particle swarm optimization algorithm to solve the problems of inflexible steering and the low control accuracy of electric-tracked vehicles. The research content of Li Huanhuan’s study does not involve the complex model establishment process, and in the final real vehicle test verification stage of the article, it is also proven that the use of the particle swarm optimization PID parameters can greatly improve the accuracy of the control system.
In this paper, the issue of the difficulty of adjusting the parameters when using the PID algorithm to control the speed of the DC motor is studied. By using the position of the center point of the curve motion of the two-wheel differential car, the position update equation and the position error update equation of the car are derived. According to the DC motor circuit, the transfer function of the DC motor is derived by using Kirchhoff’s law and the Laplace transform. The particle swarm optimization algorithm was used to optimize the PID parameters in the vehicle speed control strategy. In order to verify the control effect of the optimized parameters, the DC motor speed control experiment was carried out using an L298N chip and an STM32 single chip microcomputer. The trajectory tracking numerical simulation of the two-wheel differential vehicle was carried out using MATLAB, Simulink and other software. Finally, the trajectory tracking control of the two-wheel differential car was realized.
2. The Fundamental Principle Governing the Operation of a Two-Wheel Differential Car
The drive system of the two-wheel differential car is symmetrically arranged, as depicted in
Figure 1: an external power supply provides a voltage of 12 V to energize the driving module for propulsion. The DC motors on both sides are individually connected to the driving module to ensure autonomous operation. The encoder is powered by the controller with a 3.3 V power supply, continuously acquiring speed data from the DC motor during normal operations and transmitting the acquired data to the controller. The controller regulates the speed of the DC motor by generating a PWM waveform to control the driving module, while transmitting the received speed data to the computer terminal via the serial port.
The driving system autonomously regulates the velocity of the two DC motors, thereby facilitating precise control over the car’s linear motion and turning maneuvers.
Assuming that the centroid of the two-wheel differential car is precisely positioned at the axis center of the two driving wheels and functions as the centroid coordinate for the car, we can subsequently determine the pose vector of said car .
In accordance with the fundamental principles of rigid body mechanics, the kinematic equation governing a two-wheel differential car can be deduced in the following manner [
17].
where
is the velocity of the car in motion, m/s;
is the right wheel speed of the car, m/s;
is the left wheel speed of the car, m/s;
is the angular velocity of a car rotation, r/min;
is car orientation, °;
is the reorientation of the vehicle, m;
is the distance between the car and the center of the moving circle, m.
The formula reveals that the pertinent parameters of the car’s mechanical structure are constant values, while the velocity of the car’s trajectory, the angular velocity, and the turning radius solely depend on the speed of its left and right driving wheels, i.e., the speed of the DC motor. By regulating the speed of these motors individually, it becomes feasible to maneuver the vehicle in a straight line or along a curved path. The moving model of a two-wheel differential car is shown in
Figure 2.
3. Motion Analysis of a Two-Wheel Differential Car
In order to realize the motion control of the two-wheel differential car, a complete car drive motor model, car motion position update model, and position error model are needed. For this reason, this chapter starts with the motor circuit and uses Kirchhoff’s law and the Laplace transform to derive the DC motor transfer function. Using the car motion equation in the previous chapter, the motion position update equation and the position error update equation of the two-wheel differential car based on the curve motion center are derived.
3.1. Modeling of the Drive Motor
In order to achieve precise speed control of a DC motor, an analysis is conducted on the circuit model of the motor.
The circuit depicted in
Figure 3 primarily consists of a power supply, resistors, capacitors, and a DC motor, including the following representations:
is the power supply, ;
is the resistance, ;
is the inductance, ;
revers the electrical potential of the motor, ;
is the motor torque, ;
is the viscous friction torque, ;
is the motor rotation angle, ;
is the electric current, .
The system equation is established based on the aforementioned circuit composition [
18,
19,
20].
According to Kirchhoff’s law, in any closed loop, the algebraic sum of the voltages across each component is equal to zero. Hence, we can derive the following:
The back electromotive force is directly proportional to the motor speed, and the coefficient of the back electromotive force can be derived.
where
is the electromotive force coefficient,
.
The torque intensity of a DC motor is directly proportional to both the current and the magnetic field. By introducing the coefficient for magnetic field intensity, we can derive the following:
where
is the motor torque constant,
.
The motor will experience viscous friction in addition to the aforementioned torque during rotation. The torque is directly proportional to the angular velocity of the motor’s rotation. The viscous friction torque can be determined by the following equation:
where
is the viscous friction coefficient of motor,
.
Let the coefficient
. According to Newton’s second law, the product of angular acceleration and the moment of inertia is equivalent to the summation of all the moments acting on the shaft:
where
is the moment of inertia,
.
In conclusion, the mathematical model of a DC motor can be derived as follows:
The Laplace transform of the aforementioned Equations (9) and (10) can be derived as follows:
The open-loop transfer function of the DC motor can be derived by utilizing Formulas (11) and (12):
After obtaining the open-loop transfer function of the DC motor, the PID algorithm can be used to control the motor speed.
3.2. Car Movement Pose Renewal
The motion of the two-wheel differential car can be decomposed into linear and curvilinear components, with the former being relatively straightforward in terms of driving dynamics. The focus of this section lies in the analysis of curve driving. To facilitate the study of the motion model for a two-wheel differential car, we propose the following assumptions:
The influence of ground fluctuations on the car’s motion state is not taken into account during its movement.
The shape of the driving wheel remains unchanged and there is no occurrence of slippage.
The procedure for updating the position of curve motion can be outlined as follows. The coordinates of the rotation center for the car’s curve motion can be determined based on its current position and motion state. The position of the car at the subsequent moment is determined by calculating it based on the rotation center coordinates, motion duration, and the car’s motion model.
The world coordinate system, as depicted in
Figure 4, is established. Assuming the car’s position at
is
, the coordinates of the rotation center for the car’s motion can be computed based on the car’s motion equation.
The variables and represent the coordinates of the rotation center.
The position of the car at the subsequent moment can be inferred by applying the curve motion equation and considering the coordinates of the rotation center:
.
The use of the above car motion pose update equation can predict the car’s pose and provide accurate coordinate information.
Figure 4.
Curve motion position update.
Figure 4.
Curve motion position update.
3.3. Error Renewal
The primary objective of motion control for the two-wheel differential car is to ensure that the vehicle reaches the designated target point. Therefore, it is imperative to investigate and analyze the driving error exhibited by the car.
As shown in
Figure 5, it is assumed that the two-wheel differential trolley moves in a three-degree-of-freedom plane during movement.The body coordinate system is established with the center point of the car driving wheel serving as the origin, while considering the forward direction as the
-axis and designating the left direction of the car as the
-axis. The current position of the car in the world coordinate system is assumed to be
, while the final target position of the car is denoted as
. As for the error setting, the target point is projected onto the body coordinate system, with an error
in the abscissa, an error
in the ordinate, and errors
in both the car’s heading angle and the target point’s heading angle.
Based on the geometric operation, the target point is projected onto the body coordinate system, enabling the expression of three pose errors.
In the formula, the following are included:
is the heading angle of the car in the current position;
is the heading angle of the car at the target point.
The derivative of the aforementioned formula yields the rate of change in the errors.
After completing the error update research, based on the error variation of the two-wheel differential car and employing the PID algorithm, precise control can be achieved to navigate the car towards its desired pose. The PID algorithm, however, exhibits the drawback of a challenging parameter adjustment, necessitating the incorporation of alternative algorithms to compensate for this limitation.
4. Optimization of PID Parameters Using the Particle Swarm Optimization Algorithm
The particle swarm optimization algorithm is a swarm intelligence-based optimization technique that emulates the collective movement patterns observed in birds and fish during predation. This algorithm makes use of individual information sharing in the group and constantly updates the target information to achieve the overall optimal output, which has the advantages of a simple algorithm, a small workload, and rapid convergence [
21,
22].The mathematical formulation of the particle swarm optimization algorithm is as follows [
23,
24]:
where
is the velocity of the m-th individual in the n-dimension space over the previous k iterations;
, are the factors of learning;
, are the random values within the range of [0, 1] that are generated;
is the optimal value of the m-th individual in the n-dimension space over the previous k iterations;
is the optimal value of the entire population in the preceding k iterations;
is the iteration rate of the m-th individual on n-dimension in the (k − 1)th iteration;
is the time.
The formula for updating the individual positions is as follows:
where
is the k + 1 iteration position of the m-th individual on the n-dimension;
is the k + 1th iteration rate of the m-th individual on n-dimension;
is unit time of the iteration.
The procedural steps of the particle swarm optimization algorithm are as follows:
Step 1: initialize the particle swarm by determining the learning factor, search space latitude, particle swarm size, number of iterations, particle velocity range, and adjustment target parameter range.
Step 2: the particle velocity and position are iteratively updated based on the fitness value, while simultaneously updating the optimal individual particle position and the group’s optimal value.
Step 3: “determines whether the current particle swarm has reached the maximum number of iterations or if the global optimal position satisfies the predefined criterion and terminates the operation if either condition is met; otherwise, repeat steps 1 and 2”.
By integrating the particle swarm optimization algorithm with the PID algorithm, the particle swarm optimization algorithm can be utilized to calculate the optimal PID parameters, thereby compensating for the limitations of the PID algorithm.
5. Experiment and Simulation
The feasibility of the particle swarm optimization PID parameters is verified through a joint simulation using MATLAB and Simulink, in order to determine the optimal PID parameters. The specific procedure is illustrated in
Figure 6. The particle swarm is initially generated in MATLAB, with the following basic settings: the individual learning factor is
, the search space dimension is 3, the particle swarm size is 10, the number of iterations is 40, and the particle velocity range is [−1, 1]. The subsequent step involves the sequential assignment of distinct particles to the parameters
,
, and
followed by the execution of the Simulink model for the computation of the performance index. After reaching a conclusive decision based on the outcomes, determine whether to terminate the cycle. The Simulink model is constructed as depicted in
Figure 7. The core component is the PID control model. The system error is determined by comparing the expected value with the actual value. The error is combined with the PID parameters to execute proportional, integral, and derivative operations in order to acquire the controller output. The controller’s output is obtained by applying the system transfer function to the controlled system, and this process is iterated until the actual value matches the expected value.
5.1. Optimized DC Motor PID Control Experiment
Usually, the PID parameters need to be manually adjusted by the experimental personnel based on their own experience. Based on this, the conventional PID parameters used in this experiment are manually adjusted by the experimental personnel.
In order to compare the control effectiveness of the particle swarm optimization PID parameters and the conventional PID parameters, a series of experiments were conducted using a STM32 single-chip microcomputer from Shenzhen Chuangjisi Electronics Co., Ltd., Shenzhen, China, an L298N driving module, an MG310 DC motor, and other components. The experimental procedure is as follows:
Step 1: by employing MATLAB and Simulink for a joint simulation, the PID parameters are optimized using particle swarm optimization.
Step 2: by employing the KEIL V5.24.2.0 software, we develop a control code for the single-chip microcomputer to regulate the speed of the MG310 DC motor by substituting both the optimized and conventional PID parameters in the experimental settings. Subsequently, the speed data are transmitted to a computer via the serial port.
Step 3: employ the VOFA software to observe and compare the motor speed, thereby evaluating the actual performance of both control strategies.
According to the joint simulation of MATLAB and Simulink, the PID parameters are denoted as
,
, and
, respectively. The adaptive values are illustrated in
Figure 8. From
Figure 8, it can be observed that the adaptive value of the particle swarm optimization-optimized PID parameters approaches zero, indicating a favorable control effect.
The actual control effect of the PID parameters is verified by constructing a experimental platform for DC motor speed control, as illustrated in
Figure 9. The single chip microcomputer is STM32F103C8T6 from Shenzhen ChuangJisi Electronics Co., Ltd., the DC motor model is MG310 (with a reduction ratio of 1:20), the encoder used is a Hall encoder, the driver chip model is L298N, the battery is DGY18650-3S, and the serial port converter is CH340. The STM microcontroller compilation software used is Keil uvision5, and the programming language used in this software is Combined Programming Language of C90 version. Firstly, a 12 V lithium battery is utilized to power the L298N driver board to acquire the driving capability, while employing OUT1 and OUT2 to drive the MG310 DC motor. The PA1 port of the STM32 single-chip microcontroller is utilized for transmitting a PWM signal to regulate the L298N enable port, thereby facilitating the motor speed adjustment. The PB14 and PB15 ports are utilized for establishing a connection between the IN1 and IN2 ports of L298N, facilitating the forward rotation of the motor. The positive electrode of the motor encoder is then connected to the 3.3 V terminal of the single-chip microcomputer, while the negative electrode is connected to the GND terminal. Additionally, the data transmission lines of the encoder are linked to ports PA4 and PA5 on the single-chip microcomputer, respectively, enabling the seamless execution of the counting and data transmission tasks by the encoder. Finally, the single chip microcontroller is connected to STLINK and a serial port converter using conventional methods, enabling the transmission of the data received by the microcontroller to the computer via the serial port. The experimental wiring corresponding to this is illustrated in
Figure 10.
To facilitate a more intuitive observation of the changes in motor speed, the real-time speed data are displayed using VOFA software. The control results of the two groups are then compared against the convergence speed, overshoot, and anti-interference indices. The utilization of the optimized PID parameters for controlling the speed of the DC motor, as depicted in
Figure 11, enables an attainment of the target value within a mere 10 ms. Additionally, there is only a negligible overshoot of approximately 1 r/min and minimal fluctuations in the speed even when subjected to external force interference. From
Figure 12, it can be observed that the conventional PID parameters require 3000 ms to regulate the speed rise of the DC motor, resulting in an overshoot of approximately 5 raand a failure to reach the target value. The stability of the speed is also susceptible to external interference. The specific evaluation results are presented in
Table 1. The experimental results demonstrate that the PID parameters, optimized through particle swarm optimization, exhibit superior performance in regulating the speed of a DC motor.
5.2. Simulation of Motion Control of Two-Wheel Differential Car
To assess the control effectiveness of the vehicle, a range of trajectories are defined within the MATLAB software platform to simulate car motion control, with a subsequent evaluation of the control outcomes based on positional error. MATLAB is a commercial mathematical software produced by MathWorks in the United States. It is used in data analysis, wireless communication, deep learning, image processing and computer vision, signal processing, quantitative finance and risk management, robots, control systems, and other fields. Simulink is a visual simulation tool in MATLAB. Simulink is a modular diagram environment for multi-domain simulations and model-based designs. It supports system design, simulation, automatic code generation, and the continuous testing and verification of embedded systems. Simulink provides a graphical editor, a customizable module library, and a solver for dynamic system modeling and simulation. The MATLAB version used in this numerical simulation is MATLAB R2022a.
5.2.1. Circular Trajectory
The world coordinate system is established with the center of the circle as the coordinate origin, the east as the X axis, and the north as the Y axis. A circular trajectory with a radius of 6 m is preset in the coordinate system using MATLAB software. In order to facilitate the calculation of the distance between the car and the set trajectory, it is necessary to discretize the circular trajectory. The circular trajectory is discretized into 1500 copies.
The initial position of the car is set at the center of the circle, the initial coordinate is set to (0, 0), and the initial heading angle is set to 0°. According to the program, the car will calculate the shortest distance to the circular trajectory at the initial point, and issue control instructions based on the distance. The control instructions are divided into three types, namely, straight, left turn, and right turn. The PID algorithm is used to control the speed of the car, in which the left wheel speed and the right wheel speed are set to 10 m/s when the car goes straight. When the car turns left, the left wheel speed is set to −1 m/s, and the right wheel speed is set to 1 m/s. When the car turns right, the left wheel speed is set to 1 m/s, and the right wheel speed is −1 m/s.
After the completion of the program setting, the first group uses the optimized PID parameters to control the trajectory of the car. The second group uses the unoptimized PID parameters to control the trajectory of the car. The control results are shown in
Figure 13. The control error is shown in
Figure 14 and
Table 2. Among them, because the second set of numerical simulations fails to follow the preset trajectory, the error is no longer calculated.
5.2.2. Function Trajectory
The circular trajectory simulation effect is satisfactory; however, the trajectory exhibits a relatively simplistic pattern with gradual changes in the heading angle, resulting in less persuasive simulation outcomes. The function trajectory with a more intricate change in the heading angle is devised to simulate the motion control of the car, and subsequently, the motion control effectiveness of the car under complex trajectories is further examined.
The coordinate system is set to continue in
Section 5.2.1, and the coordinate origin is transferred to the initial point of the trajectory. Use MATLAB software to set the trajectory according to the function. In order to facilitate the calculation of the distance between the car and the function trajectory, the trajectory is discretized into 1500 copies.
The initial position of the car is set at the starting point of the function. The initial heading angle of the car is 45°. Other program settings continue in
Section 5.2.1.
6. Results and Discussion
After the numerical simulation of trajectory tracking for the circular trajectory and function trajectory, it is found that the control effect of the first group is good for the circular trajectory, and the second group cannot complete the control task. In the numerical simulation of the function trajectory, both groups can complete the control task of the car driving along the trajectory. The following is an analysis of the numerical simulation results.
6.1. Numerical Simulation Results and Discussion of Circular Trajectory
From
Figure 13a, it can be seen that the car starts from the initial position under the action of the control system, quickly draws the distance from the control route through the approximation route, and then follows the control route. According to the specific analysis of the car’s driving process, it can be seen that at the initial stage of the car’s start-up, it simply drives the car forward and does not control the heading, so the approaching route is inclined; after the car enters the control route, the controller begins to implement heading control and speed control for the target point. At this time, the car’s trajectory coincides with the height of the control route.
The heading angle deviation is observed to be minimal as the vehicle enters the approaching route, accompanied by a rapid increase in the X coordinate value, as depicted in
Figure 14. After approximately 60 s, the vehicle enters the controlled trajectory. At this juncture, the displacement curve in the X-axis direction exhibits a cosine function, while the displacement curve in the Y-axis direction demonstrates an inverse sine function, aligning precisely with the simulated outcomes. The results presented in
Figure 14 and
Table 2 demonstrate that the car exhibits a maximum positioning error of 0.0033 m, with a standard deviation of 0.000674 m and an average error of 0.0012 m, all well within the engineering requirement of not exceeding 50 mm for positioning accuracy. Furthermore, the heading angle error consistently remains between −0.2 rad and 0.2 rad.
It can be seen from
Figure 13b that the control effect of the controller with the unoptimized PID parameters is not good. The car starts from the initial position under the action of the control system, but does not move forward in a straight line, but runs directly along the circular trajectory. The analysis shows that the unoptimized PID parameters can not control the speed of the car to reach the preset size, resulting in a large difference in the speed of the left and right wheels, which can not be driven along the straight line to close to the preset trajectory, so that the car starts from the starting point to perform a circular arc motion.
6.2. Numerical Simulation Results and Discussion of Function Trajectory
It can be seen from
Figure 15a that since the initial position of the car is on the trajectory route, it always travels along the control route. Upon observing the trajectory of the car at four sharp turns on the route, it can be seen that the car motion control effect is good.
After observing
Figure 16a, it is found that in the X-axis direction, the trajectory of the car shows a linear transformation with time. In the Y-axis direction, the transformation trend of the car’s moving trajectory with time is also consistent with the function trajectory. Further observation of the heading angle transformation shows that the heading angle of the car changes periodically during operation, and there are many small fluctuations during the period, especially during each steering. After the analysis, it is believed that due to the large steering amplitude of the drawn function trajectory, the car needs to issue control instructions several times during the steering period to adjust the heading and gradually complete the steering task, so the fluctuation of the heading angle during steering is more obvious. From
Figure 16 and
Table 3, it can be seen that the maximum error during the operation of the car is not more than 0.004 m, the standard deviation and average error are controlled within 0.0001 m, and the heading angle error is controlled within 0.02 rad. According to the above analysis, it can be seen that the two-wheel differential car performs well in the function trajectory route control and meets the engineering requirements.
It can be seen from
Figure 15b that the controller with the unoptimized PID parameters can also control the car to travel along the function curve, but it cannot walk smoothly at the same time. Because the initial position of the car is on the function trajectory, it avoids the process of the car approaching the preset trajectory in the circular trajectory, so that the car can drive according to the preset trajectory. By observing
Figure 16b, it can be seen that the number of car-heading angle adjustments in the second group of the numerical simulations is significantly more than that in the first group. The analysis shows that because the unoptimized PID cannot control the wheel speed at the ideal value, the steering radian of the car is too large or too small during each steering motion. Therefore, it is necessary to continuously adjust the heading angle of the car, so that the car cannot walk smoothly at the same time.
7. Conclusions
The PID parameters optimized by particle swarm optimization are very good for the speed control of a DC motor, which can not only control the speed at an ideal value, but also have a strong resistance to external interference. In the numerical simulation of trajectory tracking, whether it is a circular trajectory or a function trajectory, the control effect of the optimized PID parameters is better than that of the unoptimized PID parameters. The benefit of their specific performance is that they can quickly and stably approach the preset trajectory and smoothly adjust the course of the car. The specific conclusions are as follows:
- (1)
Utilizing MATLAB and Simulink as the platforms, the particle swarm optimization algorithm is employed to optimize the PID parameters, resulting in a set of optimized values for , , and .
- (2)
The experimental platform is built by an STM32 microcontroller, an L298N, and other components to verify the control effect of the optimized parameters. The VOFA software shows that the convergence speed of the optimized PID parameters is 10 ms, the overshoot does not exceed 1 r/min, and the control effect is good.
- (3)
MATLAB software is used to simulate the movement of the car. The results show that the optimized PID parameters have a good control effect on the movement of the car, whether in the circular trajectory or the function trajectory. The maximum position error is controlled at about 0.003 m, and the standard deviation and average error are not more than 0.001 m.
- (4)
The influence of the low-speed control accuracy of the two-wheel differential trolley on the linear motion of the trolley is much greater than that of the curvilinear motion.