is the lateral offset distance of a point on the lane line ahead relative to the straight line where the camera is located, and
is the longitudinal distance of a point on the lane line from the camera.
,
,
and
are cubic polynomial coefficients. For a vehicle traveling along this polynomial, the trajectory curvature corresponds to the longitudinal distance as follows:
The rate of change of the curvature is constant, which is equivalent to the constant rotational speed of one side track and the constant rate of change of the rotational speed of the other track when the tracked vehicle is traveling. In order to be closer to actual driving conditions, the rotational speed response of one side track is constrained by the mechanical structure and other constraints, and its rate of change is difficult to maintain at a constant, so a quartic polynomial is considered to fit the driving trajectory.
3.2. Collision Constraints for Trajectory Planning
represents the sampling moment. Since the quartic polynomial curve is continuous and smooth, the interpolation optimization function ensures that the whole curve is close to the optimal curve as long as the sampling frequency is sufficient and each interpolation satisfies the constraints. In order to meet the engineering requirements,
and
are replaced by interpolation: the coordinates of the geometric center point of the tracked vehicle along the trajectory are
, and the tracked vehicle swings across at an angle
, as shown in
Figure 2. In order to make the tracked vehicle travel without collision with the road surface to be constructed, it is necessary to make restrictions on the position of the apex of the track, setting the width of the road surface to be constructed as
and the safety distance as
, as shown in
Figure 3.
Then, the distance of the vertical coordinates of
,
,
and
from the central axis should all be greater than
:
3.3. Optimized Function Design for Trajectory Planning
To ensure that the tracked vehicle travels smoothly and stably and stops smoothly at the end of the step, the equation was defined. In summary, the quartic polynomial trajectory planning optimization function is given by the following:
is the maximum curvature of the trajectory, is the maximum sharpness of the trajectory, is the end curvature of the trajectory and , and are the weighting coefficients. limits the minimum radius of the curvature of the trajectory to make the overall trajectory smoother, while limits the rate of change of lateral acceleration to make the velocity change of the left and right tracks smoother, which reduces the difficulty of trajectory tracking and motor control.
In order to meet the engineering requirements,
and
are replaced by interpolation:
represents the sampling moment. Since the quartic polynomial curve is continuous and smooth, the interpolation optimization function ensures that the whole curve is close to the optimal curve as long as the sampling frequency is sufficient and each interpolation satisfies the constraints.
If we define
as the vehicle motion state at moment
and
as the motion state ensemble:
,
denote the motion state constraints of the vehicle at the sampling moment
and use
and
to denote the upper and lower boundary conditions, respectively:
In summary, the quartic polynomial trajectory planning optimization function is given as follows.
The optimized quartic polynomial trajectory can be obtained using the fmincon function provided by MATLAB 2023A, using the default interior point method or the effective set method.
3.4. Verification of Trajectory Planning Simulation
The main parameters in the simulation are as follows: mass of construction machinery = 15,000 , lateral track gauge of bilateral track = 7 , grounding length of track = 4 m, track width = 1 , reduction ratio of transmission system = 25, transmission efficiency = 0.85, road width = 3 , maximum steering resistance coefficient = 0.68, coefficient of rolling friction = 0.04, coefficient of internal resistance of crawler = 0.04, minimum safety distance between track and road surface to be constructed is 0.2 , step distance is 6 , the rotational inertia of engineering machinery = 40,000 , the target state of the crawler’s position at the end of the road surface is and the longitudinal speed of the crawler is constant at under the ideal state. The starting point inputs for the two typical working conditions are verified separately. The end point transverse swing angle is less than , the absolute value of the end point longitudinal coordinate of the tracked vehicle’s geometric center is less than and the track does not touch the safety limit throughout the whole process; good trajectory optimization is judged by the curvature at the end point being less than and the curvature maxima being less than .
For the first common working condition, the vehicle has a large lateral distance deviation before stepping and traveling. Assuming that the initial position of the vehicle obtained by image processing before stepping and driving is
and the sampling step size is 0.1
, the weight coefficients of the optimization function are
,
, and the optimization algorithm adopts the interior point method. The output result is as follows:
The curvature at the end point is , the transverse pendulum angle is and the longitudinal coordinate of the geometric center of the tracked vehicle is , so it can be seen that the trajectory planning meets the end point motion state requirements.
The trajectory curve, the area swept by the inside of the left and right tracks, the minimum distance of the left and right tracks from the center of the road surface to be constructed and the curvature change curve of the trajectory are shown in
Figure 4 as
and
, respectively. Among them, the blue straight line in
Figure 4b,c indicates the boundary of the road to be constructed, and the red dashed line indicates the safety limit, i.e., the point of the inner side of the track that is closest to the road to be constructed (the yellow area) cannot enter into the red dashed line.
The initial position of the vehicle obtained by image processing is
. The sampling steps of curvature and snap in the optimization function are both 0.1
. The weight coefficients of the optimization function are as follows:
,
, and the optimization algorithm adopts the interior point method. The output of quartic polynomial trajectory planning is as follows:
The curvature at the end point is , the yaw angle is , and the vertical coordinate of the geometric center of the track vehicle is . It can be seen that the trajectory planning meets the constraint and optimization requirements of the motion state of the end point.
The trajectory curve, the area swept by the inside of the left and right tracks, the minimum distance of the left and right tracks from the center of the pavement to be constructed and the curvature change curves of this trajectory are shown in
Figure 5,
,
and
, respectively.
In
Figure 4 and
Figure 5, the minimum distance between the left and right tracks and the center of the pavement to be constructed does not exceed the safety limit, the trajectory meets the constrained boundary conditions, the absolute value of the curvature of the trajectory is within 0.5 and the trajectory at the end is stable, achieving the optimization objective of the optimization function.
3.5. Trajectory Tracking Control Based on MPC
3.5.1. Basic Principles of Model Predictive Control
The model predictive control mechanism is shown in
Figure 6, which can be roughly summarized as follows: at the current sampling moment, solve an open-loop optimization problem within the prediction step according to the current moment state and the prediction model; next, apply the first element in the optimization output to the controlled object, and at the next sampling moment, use the new actual state quantity as the initial condition and repeat the above steps until the end of the problem. Model predictive control consists of three important components: predictive modeling, rolling optimization and feedback correction.
The biggest advantage of the MPC control method lies in its explicit multi-constraint processing ability, which can easily and effectively represent constraints in quadratic programming or nonlinear optimization problems by adding constraints to control, state and prediction quantities. However, the MPC method itself is online to solve the optimization problem, and if the solution problem is more complex, it is difficult to meet the requirements of the response speed of the control algorithm in practical engineering. According to whether the control system is linear or not, MPC can be categorized into linear MPC and nonlinear MPC.
3.5.2. Nonlinear Model Predictive Control
In the nonlinear MPC control algorithm:
The first term in this objective function reflects the tracking ability of this control algorithm to the target trajectory, the second term reflects the smoothness of the change in the control quantity in this control algorithm, is the weight and is the relaxation factor, which is designed to avoid the situation of no solution to the optimization problem. In the optimization solution process, the control quantity, control increment and state quantity should satisfy the constraints. The above nonlinear optimization problem is solved by taking as a parameter. The nonlinear MPC control can be achieved by applying the first element of the optimized result sequence to the controlled object and repeating the above steps at the next moment.
3.5.3. Linear Model Predictive Control
Similarly, the optimization objective function is defined as follows:
The ideal control effect of the simulation and experiment is that the vehicle running the trajectory and the target trajectory coincide, so
. Combined with Equation (16), the optimization function can be rewritten as follows:
Taking as a parameter, the above objective function is transformed into a quadprog quadratic programming problem, the first element in the optimized sequence of results is applied to the controlled object and the above steps are repeated at the next moment to realize the model predictive control. Since the quadratic programming problem has a more complete and efficient solution method, the model is faster and can be combined with PID auxiliary control in practical applications to realize constant speed in the longitudinal direction as much as possible.
3.5.4. CoppeliaSim and MATLAB-Based Model Prediction Co-Simulation
Previously, in the MATLAB-based simulation, the integral of the velocity was used instead of the actual vehicle position, but in real working conditions, due to the interference of mechanical structure, road conditions, etc., there will be a deviation between the actual position of the tracked vehicle and the integral position of the velocity; therefore, the model prediction based on MATLAB 2023A and CoppeliaSim V4.5.1 is considered a joint simulation to validate the algorithm’s performance of the target in real physical scenarios.
The model of the tracked vehicle in CoppeliaSim V4.5.1 gives the main parameters: four grounded wheels on the left and right and four joints on the left and right, corresponding to four grounded wheels on the left and right of the tracked vehicle, with the rest of the tracked vehicle weighing 200
. The rest are driven wheels, and the weight of the left and right tracks is 200
. The model is symmetrical and only considers the mechanical relationship between the body and the tires, ignoring the suspension and other tracked vehicle transmission structures. The ground friction factor is 0.68, and the ground is horizontal and isotropic.
is used as the synchronous simulation step, and the CoppeliaSim V4.5.1 interface is used in MATLAB 2023A to control the model and read the model motion data in real time. The read position and velocity data are used as the actual state quantities, and the reference points of each step in the nonlinear model prediction are set as follows: control step
= 3, prediction step
and sampling step
= 0.06
. The boundary values are set as velocity
(−2, 2 m/s), angular velocity
(−0.5, 0.5 rad/s), acceleration
(−0.2, 0.2 m/
), angular acceleration
(−0.1, 0.1 rad/
) and both left and right wheel velocities
. The reference point for each step in the linear model prediction and PID coupled control is the point on the reference trajectory that is closest to the actual position. The typical working condition I in
Section 3.4 is simulated and verified, and the output of the joint simulation is shown in
Figure 7.
As can be seen in
Figure 7, both models can track the trajectory better, and the nonlinear model prediction control has a smaller amount of change in speed and no obvious oscillation due to the addition of PID coupling control. The analysis of the joint simulation results and their deviations are shown in
Figure 8. On the whole, the speed curve of linear model prediction and PID coupling control is more stable, but the angular speed difference between the two control methods at the end point is not much, and both meet the expectation of smooth stopping. The lateral position deviation in linear model prediction and PID coupling control is within
, and that in nonlinear model prediction control is within
, both of which are much smaller than the safety limit of
, so both controls satisfy the collision limit requirements. The amplitude of the transverse swing angle deviation in the nonlinear model prediction control is larger, which is because the vehicle position deviation is larger and the linear velocity is smaller in the starting stage, which easily has small overshoots and oscillation. The linear model prediction algorithm joins the PID speed controller to reduce the instability in the starting stage effectively. Both the linear model prediction and PID coupling algorithm and the nonlinear model prediction algorithm can excellently accomplish the trajectory tracking task, but the former is better than the latter in terms of speed tracking, smoothness and tracking performance in the start phase.