Articulated vehicle tracking control method based on multi-thread distributed execution
By using a nonlinear MPC algorithm with multi-threaded distributed execution, the problems of low control accuracy and poor robustness in articulated vehicle control are solved, achieving higher control accuracy and system safety while reducing computational load and error accumulation.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HUNAN XUEN ELECTRONIC TECHNOLOGY CO LTD
- Filing Date
- 2026-04-08
- Publication Date
- 2026-06-19
Smart Images

Figure CN122239784A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of Internet of Things (IoT) technology, and in particular to a tracking control method for articulated vehicles based on multi-threaded distributed execution. Background Technology
[0002] Articulated trucks, as a special type of vehicle, are widely used in engineering transportation, mining, and other fields. An articulated truck can be viewed as a front and rear vehicle connected by an articulation point, exhibiting relatively complex dynamic characteristics. Due to its unique structure, traditional control methods such as PID (Proportional Integral-Derivative) control often suffer from low control accuracy and poor robustness when handling the control problems of articulated trucks.
[0003] Model predictive control (MPC) is an advanced control strategy that predicts the system's state over a future period and makes control decisions based on the objective function, effectively handling system constraints and uncertainties. Therefore, MPC algorithms exhibit high accuracy in trajectory control, providing a new approach to the control of articulated vehicles.
[0004] Linear MPC algorithms linearize the nonlinear system around the operating point and then use linear control theory for design, offering advantages such as low computational cost and good real-time performance, but relatively low accuracy. Nonlinear MPC algorithms directly handle nonlinear systems, providing a more accurate description of the system's dynamic characteristics, but with higher computational complexity.
[0005] In articulated vehicle control applications, the MPC control algorithm is commonly used for global path trajectory control. Traditional control methods often have the following technical defects when dealing with vehicles with complex dynamic characteristics, such as articulated vehicles: (1) low control accuracy, which cannot meet the requirements of high-precision control; (2) poor robustness, which is sensitive to changes in system parameters and external disturbances; (3) inability to effectively handle system constraints, such as control quantity constraints and state quantity constraints; (4) for hydraulic articulated vehicles that respond to control commands relatively slowly, the global path control method cannot adjust for large errors between the pose and the desired pose in a timely manner; (5) reading real-time pose information frame by frame results in a large amount of computation and data transmission delay; (6) the error cannot be effectively converged after being affected by noise in the global path trajectory prediction. Summary of the Invention
[0006] This invention addresses the technical problems existing in the prior art by providing a multi-threaded distributed execution-based articulated vehicle tracking control method. Through multi-threaded parallel computing and the use of nonlinear MPC algorithms, it effectively solves the trajectory tracking control problem of articulated vehicles traveling in tunnels, significantly reduces vehicle swaying, and improves driving stability and safety.
[0007] According to a first aspect of the present invention, a method for tracking and controlling an articulated vehicle based on multi-threaded distributed execution is provided, comprising: Step 1: Construct a nonlinear kinematic model of the articulated vehicle; the nonlinear kinematic model includes the relationship function between the state variables and control variables of the front and rear vehicles of the articulated vehicle; Step 2: Based on the nonlinear MPC algorithm and the nonlinear kinematic model, predict the state and control quantities of the articulated vehicle from the initial moment to the time range of a+b; where a and b are the set time intervals. Step 3: Collect the real-time attitude of the articulated vehicle at each ai time step with a time step a. Based on the real-time attitude at ai time step, calculate the state and control variables of the articulated vehicle in a multi-threaded distributed manner within each time range from ai+b to a(i+1)+b; i is a positive integer representing the thread number.
[0008] Based on the above technical solution, the present invention can also be improved as follows.
[0009] Optionally, the articulated vehicle motion model is represented as: state variables Control quantity ; in, These represent the rates of change of the position of the preceding vehicle in the Cartesian coordinate system. The heading angle of the vehicle in front. It is the hinge angle. Let the linear velocity of the vehicle in front be . This refers to the hinge angular velocity.
[0010] Optionally, the position of the preceding vehicle in the Cartesian coordinate system is: ; ; When the front and rear wheels are relatively stationary with respect to the front and rear vehicle bodies during steady-state steering, the rate of change of the heading angle of the vehicle in front. for: ; When turning in place with both vehicles stationary relative to the ground, the rate of change of the heading angle of the vehicle in front. for: ; in, , These are the lengths from the center point of the front vehicle and the rear vehicle to the hinge point, respectively.
[0011] Optionally, step 1 further includes: constructing the discrete-time state update equation as follows: .
[0012] in, Sampling time, for Time-state quantity, for Control the amount at all times. This is a motion model for an articulated vehicle. The extended state vector is constructed as follows: ; in, for Expand the state vector at any time. for Constantly control the increase or decrease of the quantity. and It is a Jacobian matrix function that depends on the current state.
[0013] Optionally, the process of predicting the state variables and control variables of the articulated vehicle based on the nonlinear MPC algorithm and the nonlinear kinematic model includes: Step 201: Construct an objective function representing the performance index and set constraints based on the safe operation of the articulated vehicle; Step 202: In the nonlinear MPC algorithm, a multi-step prediction method is used to calculate the motion state of the articulated car at the current moment based on the motion state of the articulated car at the previous moment: ; Where i is the time index. and These are the parameters to be determined; The actual output is determined to be: C is the output matrix; Step 203: Solve using a nonlinear optimization algorithm.
[0014] Optionally, the objective function is: ; in, The system output at time k+i is predicted at time k. This is the reference output at time k+i. Let Q be the control increment predicted at time k+i, Q be the error weight matrix, and R be the control weight matrix.
[0015] Optionally, the constraints include: control quantity constraints and state quantity constraints; The control constraints are: st in, and These are the minimum and maximum values of the control quantity, respectively. and These are the minimum and maximum values of the control quantity increment, respectively; The state variable constraints are as follows: st in, and These are the minimum and maximum values of the heading angle, respectively. and These are the minimum and maximum values of the change in heading angle.
[0016] According to a second aspect of the present invention, an articulated vehicle tracking control system based on multi-threaded distributed execution is provided, comprising: a nonlinear kinematics model construction module, an initial motion planning module, and a multi-threaded distributed execution module; The nonlinear kinematics model construction module is used to construct a nonlinear kinematics model of the articulated vehicle; the nonlinear kinematics model includes the relationship function between the state variables and control variables of the front and rear vehicles of the articulated vehicle; The initial motion planning module is used to predict the state and control variables of the articulated vehicle from the initial moment to the time range of a+b, based on the nonlinear MPC algorithm and the nonlinear kinematic model; where a and b are the set durations. The multi-threaded distributed execution module is used to sequentially collect the real-time attitude of the articulated vehicle at each ai time step with a time step a. Based on the real-time attitude at ai time step, the multi-threaded distributed method is used to calculate the state variables and control variables of the articulated vehicle in each time range from ai+b to a(i+1)+b. i is a positive integer representing the thread number.
[0017] According to a third aspect of the present invention, an electronic device is provided, including a memory and a processor, wherein the processor is configured to implement a multi-threaded distributed execution-based articulated vehicle tracking control method when executing a computer management program stored in the memory.
[0018] According to a fourth aspect of the present invention, a computer-readable storage medium is provided, on which a computer management class program is stored, wherein when executed by a processor, the computer management class program implements the steps of an articulated vehicle tracking control method based on multi-threaded distributed execution.
[0019] This invention provides a multi-threaded distributed execution-based articulated vehicle tracking control method, system, electronic device, and storage medium. Its advantages include: eliminating the need to read the real-time pose of the loader frame-by-frame via sensors, thus avoiding some delays caused by data transmission. Instead, real-time data transmission and calculation are performed during the overlapping time between different threads. This method significantly reduces computation and improves system real-time performance. It avoids the problem of ineffective convergence of errors in global path trajectory prediction due to noise, as each thread recalculates based on the actual vehicle pose at the start. Through segmented prediction and real-time correction, error accumulation is effectively suppressed. A nonlinear MPC algorithm is used to directly handle nonlinear systems, avoiding errors caused by linearization and improving control accuracy. Compared to linear MPC algorithms, nonlinear MPC algorithms can more accurately describe the dynamic characteristics of the articulated vehicle. Optimizing the multi-step prediction process makes the motion state at each time point continuous and dependent, enabling better perception of changes in the curvature of the real path and subsequent response. Compared to traditional methods, it is more sensitive to changes in path curvature and achieves higher control accuracy. By employing multi-threaded distributed execution, one thread can calculate the current control command while another calculates the control command for the next path segment based on the latest pose information, improving the system's real-time performance and robustness. Compared to single-threaded methods, it better handles computational latency and system uncertainties. Decomposing long-distance global paths into multiple short-distance local paths shortens the prediction time domain and reduces prediction errors. Furthermore, the repetition of partial paths in adjacent road segments ensures the continuity of control commands. The solution method for nonlinear optimization problems is more flexible, allowing for the selection of appropriate optimization algorithms based on the specific application scenario, achieving a balance between computational accuracy and time. The system's constraint handling is more accurate; nonlinear constraints more realistically reflect the actual control problem, improving the system's safety and reliability. Attached Figure Description
[0020] Figure 1 A flowchart of an articulated vehicle tracking control based on multi-threaded distributed execution is provided for this invention; Figure 2 A schematic diagram illustrating an embodiment of a multi-threaded distributed nonlinear MPC algorithm for trajectory prediction provided by the present invention; Figure 3 The trajectory prediction result diagram is obtained from a specific application of the articulated vehicle tracking control method based on multi-threaded distributed execution provided in the embodiments of the present invention. Figure 4 A structural block diagram of an articulated vehicle tracking control based on multi-threaded distributed execution is provided for this invention; Figure 5 A schematic diagram of the hardware structure of a possible electronic device provided by the present invention; Figure 6 This is a schematic diagram of the hardware structure of a possible computer-readable storage medium provided by the present invention. Detailed Implementation
[0021] The principles and features of the present invention are described below with reference to the accompanying drawings. The examples given are only for explaining the present invention and are not intended to limit the scope of the present invention.
[0022] Figure 1 A flowchart of an articulated vehicle tracking control method based on multi-threaded distributed execution provided by the present invention is shown below. Figure 1 As shown, the tracking control method includes: Step 1: Construct a nonlinear kinematic model of the articulated vehicle; the nonlinear kinematic model includes the relationship functions between the state variables and control variables of the front and rear vehicles of the articulated vehicle.
[0023] An articulated vehicle can be viewed as a front vehicle and a rear vehicle connected by an articulation point.
[0024] Step 2: Based on the nonlinear MPC algorithm and nonlinear kinematic model, predict the state and control variables of the articulated vehicle from the initial moment to the time range of a+b; a and b are the set time durations.
[0025] In practice, the durations of a and b can be set according to the model's computing power and the complexity of the actual route, such as... Figure 2 The diagram shown is a schematic of an embodiment of a multi-threaded distributed nonlinear MPC algorithm for trajectory prediction provided by the present invention. Figure 2 In the given embodiment, the mapping and (re)location of the underground mine roadway and global path planning have been completed. a can be set to 5T, b can be set to 2T, and the length of T can be flexibly adjusted according to the running time of the nonlinear MPC model. Usually, T is set to 1 second.
[0026] Step 3: Collect the real-time attitude of the articulated vehicle at each ai time step with a time step a. Based on the real-time attitude at ai time step, calculate the state and control variables of the articulated vehicle in a multi-threaded distributed manner within each time range from ai+b to a(i+1)+b. i is a positive integer representing the thread number.
[0027] The multi-threaded distributed execution architecture sets the runtime of each thread, especially the runtime of the first thread, which needs to be distinguished from other threads. In the actual code, the predicted total runtime of the first thread is 7 seconds, the runtime of the other threads is 5 seconds, and the overlap time of each thread is 2 seconds.
[0028] Taking a loader as an example, the current lateral control system of loaders in underground mine roadways cannot reliably ensure a smooth adjustment of the vehicle's direction when yaw is required. This results in significant overall swaying of the loader. To reduce this swaying and ensure the loader travels smoothly along the route planned in the path, real-time pose acquisition is performed when the loader is not in motion and is stopped at the roadway entrance. A nonlinear MPC algorithm is then used to predict all state variables and the corresponding optimal control variables every 0.05 seconds within a 7T time period after the loader starts moving.
[0029] After the loader has been running for 5 tons, real-time pose data is collected and another thread is started to run a nonlinear MPC algorithm to predict all state variables and corresponding optimal control variables every 0.05 seconds within the 5-ton time period.
[0030] The model's prediction length is kept consistent with the time length 'a' of the real-time data collection, ensuring that the interval 'b' remains consistent. This interval can be flexibly adjusted. Figure 2 The interval delay is 2T. As long as the nonlinear MPC model can predict 5T of vehicle information and the vehicle can respond to the corresponding issued instructions within this time, it is guaranteed.
[0031] Traditional methods, which iterate through a window to find the optimal route, use a fixed vehicle state value at all time points along each path, equal to the initial state value of the loader at the beginning of the current path. This method is insensitive to changes in path curvature, resulting in low control accuracy. This invention provides a multi-threaded distributed execution-based articulated vehicle tracking control method. It proposes a nonlinear MPC control algorithm based on optimized multi-step predictive control, utilizing multi-threaded parallel computation and a nonlinear MPC algorithm to effectively solve the trajectory tracking control problem of articulated vehicles traveling in tunnels. This significantly reduces vehicle sway and improves driving stability and safety. Example 1
[0032] Embodiment 1 provided by this invention is an embodiment of articulated vehicle tracking control based on multi-threaded distributed execution, combined with... Figure 2 It can be seen that the embodiments include: Step 1: Construct a nonlinear kinematic model of the articulated vehicle; the nonlinear kinematic model includes the relationship functions between the state variables and control variables of the front and rear vehicles of the articulated vehicle.
[0033] The main parameters involved in the articulated vehicle motion model include: the lengths from the center points of the front and rear vehicles to the articulation points, respectively. , The heading angles of the front and rear vehicles are respectively , The angle between the front and rear vehicle bodies .
[0034] The steering of an articulated vehicle can be viewed as a combination of steady-state steering motion and stationary steering motion.
[0035] In one possible embodiment, the articulated vehicle motion model is represented in a nonlinear form: Based on the nonlinear kinematic model of the articulated vehicle, the model parameters can be divided into state variables and control variables: Among them, state variables Control quantity The nonlinear MPC algorithm directly uses the nonlinear model and does not require linearization.
[0036] These represent the rates of change of the position of the preceding vehicle in the Cartesian coordinate system. The heading angle of the vehicle in front. It is the hinge angle. Let the linear velocity of the vehicle in front be . This refers to the hinge angular velocity.
[0037] The position of the vehicle in front in the Cartesian coordinate system is: .
[0038] .
[0039] When the front and rear wheels are relatively stationary with respect to the front and rear vehicle bodies during steady-state steering, the rate of change of the heading angle of the vehicle in front. for: .
[0040] When turning in place with both vehicles stationary relative to the ground, the rate of change of the heading angle of the vehicle in front. for: .
[0041] In practical implementation, although linearization is not required for nonlinear MPC algorithms, discretization is still necessary. The Euler piecewise linear method or other numerical integration methods can be used to discretize the continuous-time model. In one possible embodiment, using the Euler piecewise linear method, the discrete-time state update equation can be obtained: .
[0042] in, This is the sampling time, which is usually set to 0.05 seconds. for Time-state quantity, for Control the amount at all times. This is a motion model for an articulated vehicle.
[0043] To facilitate multi-step prediction, an extended state vector can be constructed, which includes the state variables at the current time step and the control variables from the previous time step: .
[0044] in, for The extended state vector at time step 1, and the extended state vector at the next time step, can be represented as: To handle control increments, it can be further expressed as: .
[0045] in, for Constantly control the increase or decrease of the quantity. and It is a Jacobian matrix function that depends on the current state.
[0046] Step 2: Based on the nonlinear MPC algorithm and nonlinear kinematic model, predict the state and control variables of the articulated vehicle from the initial moment to the time range of a+b; a and b are the set time durations.
[0047] In one possible embodiment, the process of predicting the state variables and control variables of the articulated vehicle based on a nonlinear MPC algorithm and a nonlinear kinematic model includes: Step 201: Construct an objective function representing the performance index and set constraints based on the safe operation of the articulated vehicle.
[0048] In one possible implementation, the goal of the nonlinear MPC algorithm is to optimize the system's performance metrics by optimizing the control input. For the control of an articulated vehicle, the objective function can be constructed as follows: .
[0049] in, The system output at time k+i is predicted at time k. This is the reference output at time k+i. Let Q be the control increment predicted at time k+i, Q be the error weight matrix, and R be the control weight matrix. Both Q and R are diagonal matrices. The larger the corresponding value, the greater the importance attached to the corresponding value during the design.
[0050] The output prediction obtained based on the objective function can be expressed as: .
[0051] ... The predicted output can be represented in matrix form: .
[0052] Where O and M are Jacobian matrix functions that depend on all states in the prediction time domain.
[0053] To ensure the safe operation of the articulated vehicle, the system's constraints must be considered. By continuously optimizing the objective function and satisfying the constraints, the nonlinear MPC algorithm can design suitable inputs for the articulated vehicle at each set time point.
[0054] In one possible implementation, the constraints include: control quantity constraints and state quantity constraints.
[0055] Control constraints include constraints on the change in control quantity in each time increment, as well as the maximum tolerance of the system as a whole for the control quantity input itself.
[0056] The control constraints are: st in, and These are the minimum and maximum values of the control quantity, respectively. and These are the minimum and maximum values of the control quantity increment, respectively.
[0057] State constraints include the state variables in each time increment. Constraints on the amount of change, and the overall system's... Its own maximum tolerance limit.
[0058] The state constraints are: st in, and These are the minimum and maximum values of the heading angle, respectively. and These are the minimum and maximum values of the change in heading angle.
[0059] Step 202: In the nonlinear MPC algorithm, a multi-step prediction method is used to calculate the motion state of the articulated car at the current moment based on the motion state of the articulated car at the previous moment.
[0060] In the multi-step prediction process of the nonlinear MPC algorithm model, unlike the traditional MPC algorithm's multi-step prediction process where the vehicle state value used at all time points along each path is fixed and equal to the state value of the loader at the beginning of the current path when traversing and iterating within the window to find the optimal route, this invention provides an optimized multi-step prediction process that makes the motion states of the NP time nodes after k continuous and dependent. The motion state of the articulated vehicle at the next time node must be based on the motion state of the previous time node. What remains unchanged is the control quantity at each moment within the window.
[0061] Assume the prediction time is NP time steps, and the current time point is k. The optimized multi-step prediction process is as follows: ; ; ... .
[0062] Where i is the time index. and The parameters to be determined; the matrix at each time step. and All of these depend on the state variables at that moment, exhibiting nonlinear characteristics. This continuous dependency allows the algorithm to better perceive changes in the curvature of the real-world path and respond accordingly.
[0063] The relationship between the actual output η of the system and the state vector is determined as follows: C is the output matrix.
[0064] Step 203: Solve using a nonlinear optimization algorithm.
[0065] Since both the objective function and constraints are nonlinear, nonlinear optimization algorithms are required for solving them. Examples of nonlinear optimization algorithms include Sequential Quadratic Programming (SQP), interior-point methods, and gradient descent. For real-time control applications, computationally efficient optimization algorithms must be selected. Sequential Quadratic Programming (SQP) is a commonly used method that transforms the nonlinear optimization problem into a series of quadratic programming subproblems, which are then solved iteratively to obtain the optimal solution.
[0066] Step 3: Collect the real-time attitude of the articulated vehicle at each ai time step with a time step a. Based on the real-time attitude at ai time step, calculate the state and control variables of the articulated vehicle in a multi-threaded distributed manner within each time range from ai+b to a(i+1)+b. i is a positive integer representing the thread number.
[0067] like Figure 3The image shown is a trajectory prediction result obtained from a specific application of a multi-threaded distributed execution-based articulated vehicle tracking control method provided in an embodiment of the present invention. The advantage of the multi-threaded distributed execution nonlinear MPC algorithm method is that, compared to methods using only local path control, it does not require reading the real-time pose information of the articulated vehicle in every frame and calculating the deviation from the global path planning, thus reducing the computational load. Furthermore, it avoids delays and track errors. For example, while the loader is still responding to the trajectory prediction command issued by the previous wheel, another thread can already calculate new adjustment commands for multiple future time points based on the most recently acquired real-time pose. The multi-threaded distributed execution nonlinear MPC algorithm can be implemented using `threads` in C++ code.
[0068] When running a nonlinear MPC algorithm model, multi-step predictive control is required to predict the state of the articulated vehicle over a future period. The optimized multi-step prediction process ensures that the motion state at each time point is continuous and dependent; the motion state of the articulated vehicle at a later time point must be based on the motion state at the previous time point. This method is more sensitive to changes in curvature because the state update matrix includes nonlinear terms such as the vehicle's yaw angle and articulation angle during operation.
[0069] The nonlinear MPC algorithm directly uses a nonlinear motion model without requiring linearization, thus more accurately describing the dynamic characteristics of the articulated vehicle. Through multi-threaded distributed execution, while one thread calculates the current control command, another thread calculates the control command for the next path segment based on the latest pose information, improving the system's real-time performance and robustness.
[0070] The model collects data from a certain roadway and performs trajectory prediction. The results are as follows: Figure 2 As shown, the articulated loader moves from the lower left coordinate to the upper right coordinate. The red dots represent the trajectory points of the loader in the tunnel, and the blue dots represent the vehicle state variables output by the model. The horizontal and vertical axes in the figure are in a Cartesian coordinate system. It can be seen that compared to current control methods that do not rely on nonlinear MPC algorithms, the control trajectory output by this nonlinear MPC algorithm is smoother, effectively alleviating the problem of excessive swaying of the articulated loader during operation. Example 2
[0071] Embodiment 2 provided by this invention is an embodiment of an articulated vehicle tracking control system based on multi-threaded distributed execution. Figure 4 This invention provides a structural diagram of an articulated vehicle tracking control system based on multi-threaded distributed execution, combined with... Figure 4 It is known that the embodiment of the tracking control system includes: a nonlinear kinematics model construction module, an initial motion planning module, and a multi-threaded distributed execution module.
[0072] The nonlinear kinematics model building module is used to construct the nonlinear kinematics model of the articulated vehicle; the nonlinear kinematics model includes the relationship functions between the state variables and control variables of the front and rear vehicles of the articulated vehicle.
[0073] The initial motion planning module is used to predict the state and control variables of the articulated vehicle from the initial moment to the time range of a+b, based on the nonlinear MPC algorithm and nonlinear kinematic model; a and b are the set time durations.
[0074] The multi-threaded distributed execution module is used to sequentially collect the real-time attitude of the articulated vehicle at each ai time step with a time step a. Based on the real-time attitude at ai time step, the state variables and control variables of the articulated vehicle are calculated in a multi-threaded distributed manner within each time range from ai+b to a(i+1)+b. i is a positive integer representing the thread number.
[0075] It is understood that the articulated vehicle tracking control system based on multi-threaded distributed execution provided by the present invention corresponds to the articulated vehicle tracking control method based on multi-threaded distributed execution provided in the foregoing embodiments. The relevant technical features of the articulated vehicle tracking control system based on multi-threaded distributed execution can be referred to the relevant technical features of the articulated vehicle tracking control method based on multi-threaded distributed execution, and will not be repeated here. Example 3
[0076] Embodiment 3 of the present invention is a specific operational embodiment of the articulated vehicle tracking control method based on multi-threaded distributed execution provided by the present invention. This specific operational embodiment includes: Action Relationship: Prerequisites: Mapping, (re)location, and global path planning of the underground mine roadways have been fully achieved. The kinematic parameters (lf, lr, etc.) of the articulated vehicle have been accurately calibrated. The parameters of the nonlinear MPC algorithm (prediction time domain NP, control time domain NC, weight matrices Q and R, etc.) have been reasonably set. Constraints (control constraints, state constraints, etc.) have been determined according to the actual application scenario.
[0077] Triggering condition: The loader is in a non-departing state and is located at the initial position at the entrance of the tunnel.
[0078] Operational Procedure: Collect real-time pose information (xf, yf, θf, γ) of the loader to ensure data accuracy and real-time performance. Initialize the first thread and run a nonlinear MPC algorithm to predict the loader's state over a 7T time interval after departure. Solve the nonlinear optimization problem to obtain the optimal control sequence. Execute the control command for the current moment to initiate the loader's movement.
[0079] Triggering condition: The loader has been running continuously for 5 tons since its startup. Operation procedure: Real-time pose data of the loader is collected again to provide accurate data for subsequent control decisions. A separate second thread is started to run a nonlinear MPC algorithm to predict the loader's operating status over the next 5 tons. While the second thread is calculating, the first thread continues to execute control commands for the remaining 2 tons. Once the second thread completes its calculation, the control commands are switched to the second thread for a smooth transition.
[0080] Data correlation: The time interval for model prediction must be consistent with the time interval for real-time data acquisition. Control commands are recalculated in a new thread each time based on the latest pose information until the loader reaches its destination. Thread synchronization: Ensure data synchronization between multiple threads to avoid data races and conflicts. Exception handling: When a thread times out or encounters an exception, the system should be able to switch to a backup solution promptly to ensure system safety.
[0081] Please see Figure 5 , Figure 5 This is a schematic diagram illustrating an embodiment of the electronic device provided in this invention. For example... Figure 5 As shown, this embodiment of the invention provides an electronic device, including a memory 1310, a processor 1320, and a computer program 1311 stored in the memory 1310 and executable on the processor 1320. When the processor 1320 executes the computer program 1311, it performs the following steps: constructing a nonlinear kinematic model of an articulated vehicle; the nonlinear kinematic model includes a relationship function between the state variables and control variables of the front and rear vehicles of the articulated vehicle; predicting the state variables and control variables of the articulated vehicle from the initial moment to the time range of a+b based on the nonlinear MPC algorithm and the nonlinear kinematic model; a and b are set time intervals; sequentially collecting the real-time attitude of the articulated vehicle at each ai moment with a time step of a; and calculating the state variables and control variables of the articulated vehicle from each ai+b to a(i+1)+b time range using a multi-threaded distributed method based on the real-time attitude at ai moment; i is a positive integer representing the thread number.
[0082] Please see Figure 6 , Figure 6 This is a schematic diagram illustrating an embodiment of a computer-readable storage medium provided by the present invention. (See diagram below.) Figure 6As shown, this embodiment provides a computer-readable storage medium 1400, on which a computer program 1411 is stored. When the computer program 1411 is executed by a processor, it performs the following steps: constructing a nonlinear kinematic model of an articulated vehicle; the nonlinear kinematic model includes a relationship function between the state variables and control variables of the front and rear vehicles of the articulated vehicle; predicting the state variables and control variables of the articulated vehicle from the initial moment to the time range of a+b based on the nonlinear MPC algorithm and the nonlinear kinematic model; a and b are set time intervals; sequentially collecting the real-time attitude of the articulated vehicle at each ai moment with a time step of a; and calculating the state variables and control variables of the articulated vehicle from each ai+b to a(i+1)+b time range using a multi-threaded distributed method based on the real-time attitude at ai moment; i is a positive integer representing the thread number.
[0083] This invention provides a multi-threaded distributed execution-based articulated vehicle tracking control method, system, electronic device, and storage medium. It divides the operating tunnel into segments, shortening the predicted path length of the MPC algorithm and thus reducing prediction errors. The method uses multiple threads to segment the entire tunnel according to a fixed time interval for the loader's operation, with some paths overlapping between adjacent segments. At the beginning of each segment, the MPC algorithm is executed using real-time coordinates as a reference to predict the trajectory. The multi-step prediction process of the MPC algorithm is optimized. In the multi-step prediction process of the MPC control algorithm, when traversing and looping within a window to find the optimal route, the vehicle state value used for each path is calculated from the previous time step, making the motion states of the next k time nodes continuous and dependent. The motion state of the articulated vehicle at the next time node must be based on the motion state of the previous time step. This optimization allows the MPC algorithm model to better perceive the curvature changes of the real-world path and respond accordingly. It eliminates the need to read the loader's real-time pose frame by frame through sensors; instead, it uses the overlapping time intervals between different threads for real-time data transmission and calculation, avoiding some of the latency caused by data transmission. This approach avoids the problem of ineffective error convergence in global path trajectory prediction due to noise, as each thread recalculates based on the actual vehicle pose at the start. It employs a nonlinear MPC algorithm to directly handle nonlinear systems, improving control accuracy. Furthermore, multi-threaded distributed execution and optimized multi-step prediction processes reduce computational complexity and enhance real-time performance.
[0084] This invention provides a method, system, electronic device, and storage medium for articulated vehicle tracking control based on multi-threaded distributed execution. The design and implementation of the multi-threaded distributed execution architecture include: setting the execution time of each thread, especially distinguishing the execution time of the first thread from other threads. In the actual code, the total prediction time for the first thread is 7 seconds, and for the remaining threads it is 5 seconds, with each thread overlapping for 2 seconds. That is, T equals 1 second. This setting needs to consider the model's computing power and the complexity of the actual route.
[0085] The time synchronization mechanism between multiple threads ensures a smooth transition of control commands when switching between different threads, avoiding sudden changes in control commands that could cause vehicle vibration.
[0086] Inter-thread data sharing and communication mechanisms ensure that real-time pose information can be transmitted to the computation thread in a timely manner, while avoiding data races.
[0087] Optimize the implementation of the multi-step prediction process: Referencing the DWA dynamic programming window method, optimize the calculation method of the multi-step prediction matrix of the nonlinear MPC algorithm to improve the model's sensitivity to curvature.
[0088] When iterating through the window to find the optimal route, the vehicle state value used for each path is calculated from the previous time step, making the motion states of the next NP time steps continuous and dependent. The motion state of the articulated car at the next time step must be based on the motion state of the previous time step.
[0089] The state update matrices A_i and B_i at each time step depend on the state variables at that time step, reflecting nonlinear characteristics and enabling a more accurate description of the system dynamics.
[0090] Implementation of the nonlinear MPC algorithm: It directly uses a nonlinear motion model, eliminating the need for linearization and avoiding errors introduced by linearization. Solution methods for nonlinear optimization problems include efficient optimization algorithms such as Sequential Quadratic Programming (SQP). The nonlinear form of the objective function and constraints allows for a more accurate description of practical control problems.
[0091] Establishment of the nonlinear kinematic model of the articulated car: The nonlinear form of the articulated car kinematic model includes the coupling of steady-state steering and stationary steering. The selection of state and control variables, and the nonlinear relationship between them. Model discretization method, transforming the continuous-time model into a discrete-time model.
[0092] Balancing real-time performance with computational efficiency: Improving real-time performance while maintaining control precision through multi-threaded distributed execution. Optimizing algorithm selection to achieve a balance between computational accuracy and computation time. Appropriately setting the prediction and control time domains to ensure both control effectiveness and real-time performance requirements.
[0093] This invention provides a multi-threaded distributed execution-based articulated vehicle tracking control method, system, electronic device, and storage medium. Its advantages include: eliminating the need to read the real-time pose of the loader frame-by-frame via sensors, thus avoiding some delays caused by data transmission. Instead, real-time data transmission and calculation are performed during the overlapping time between different threads. This method significantly reduces computation and improves system real-time performance. It avoids the problem of ineffective convergence of errors in global path trajectory prediction due to noise, as each thread recalculates based on the actual vehicle pose at the start. Through segmented prediction and real-time correction, error accumulation is effectively suppressed. A nonlinear MPC algorithm is used to directly handle nonlinear systems, avoiding errors caused by linearization and improving control accuracy. Compared to linear MPC algorithms, nonlinear MPC algorithms can more accurately describe the dynamic characteristics of the articulated vehicle. Optimizing the multi-step prediction process makes the motion state at each time point continuous and dependent, enabling better perception of changes in the curvature of the real path and subsequent response. Compared to traditional methods, it is more sensitive to changes in path curvature and achieves higher control accuracy. By employing multi-threaded distributed execution, one thread can calculate the current control command while another calculates the control command for the next path segment based on the latest pose information, improving the system's real-time performance and robustness. Compared to single-threaded methods, it better handles computational latency and system uncertainties. Decomposing long-distance global paths into multiple short-distance local paths shortens the prediction time domain and reduces prediction errors. Furthermore, the repetition of partial paths in adjacent road segments ensures the continuity of control commands. The solution method for nonlinear optimization problems is more flexible, allowing for the selection of appropriate optimization algorithms based on the specific application scenario, achieving a balance between computational accuracy and time. The system's constraint handling is more accurate; nonlinear constraints more realistically reflect the actual control problem, improving the system's safety and reliability.
[0094] It should be noted that the descriptions of each embodiment in the above embodiments have different focuses. For parts that are not described in detail in a certain embodiment, please refer to the relevant descriptions in other embodiments.
[0095] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0096] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0097] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0098] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0099] Although preferred embodiments of the invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including both the preferred embodiments and all changes and modifications falling within the scope of the invention.
[0100] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. Therefore, if these modifications and variations fall within the scope of the claims of this invention and their equivalents, this invention also intends to include these modifications and variations.
Claims
1. A tracking control method for an articulated vehicle based on multi-threaded distributed execution, characterized in that, The tracking control method includes: Step 1: Construct a nonlinear kinematic model of the articulated vehicle; the nonlinear kinematic model includes the relationship function between the state variables and control variables of the front and rear vehicles of the articulated vehicle; Step 2: Based on the nonlinear MPC algorithm and the nonlinear kinematic model, predict the state and control quantities of the articulated vehicle from the initial moment to the time range of a+b; where a and b are the set time intervals. Step 3: Collect the real-time attitude of the articulated vehicle at each ai time step with a time step a. Based on the real-time attitude at ai time step, calculate the state and control variables of the articulated vehicle in a multi-threaded distributed manner within each time range from ai+b to a(i+1)+b; i is a positive integer representing the thread number.
2. The tracking control method according to claim 1, characterized in that, The articulated vehicle motion model is represented as: state variables Control quantity ; in, These represent the rates of change of the position of the preceding vehicle in the Cartesian coordinate system. The heading angle of the vehicle in front. It is the hinge angle. Let the linear velocity of the vehicle in front be . This refers to the hinge angular velocity.
3. The tracking control method according to claim 2, characterized in that, The position of the preceding vehicle in the Cartesian coordinate system is: ; ; When the front and rear wheels are relatively stationary with respect to the front and rear vehicle bodies during steady-state steering, the rate of change of the heading angle of the vehicle in front. for: ; When turning in place with both vehicles stationary relative to the ground, the rate of change of the heading angle of the vehicle in front. for: ; in, , These are the lengths from the center point of the front vehicle and the rear vehicle to the hinge point, respectively.
4. The tracking control method according to claim 2, characterized in that, Step 1 further includes: constructing the discrete-time state update equation as follows: ; in, Sampling time, for Time-state quantity, for Control the amount at all times. This is a motion model for an articulated vehicle. The extended state vector is constructed as follows: ; in, for Expand the state vector at any time. for Constantly control the increase or decrease of the quantity. and It is a Jacobian matrix function that depends on the current state.
5. The tracking control method according to claim 4, characterized in that, The process of predicting the state variables and control variables of the articulated vehicle based on the nonlinear MPC algorithm and the nonlinear kinematic model includes: Step 201: Construct an objective function representing the performance index and set constraints based on the safe operation of the articulated vehicle; Step 202: In the nonlinear MPC algorithm, a multi-step prediction method is used to calculate the motion state of the articulated car at the current moment based on the motion state of the articulated car at the previous moment: ; Where i is the time index. and These are the parameters to be determined; The actual output is determined to be: C is the output matrix; Step 203: Solve using a nonlinear optimization algorithm.
6. The tracking control method according to claim 5, characterized in that, The objective function is: ; in, The system output at time k+i is predicted at time k. This is the reference output at time k+i. Let Q be the control increment predicted at time k+i, Q be the error weight matrix, and R be the control weight matrix.
7. The tracking control method according to claim 5, characterized in that, The constraints include: control quantity constraints and state quantity constraints; The control constraints are: s.t. in, and These are the minimum and maximum values of the control quantity, respectively. and These are the minimum and maximum values of the control quantity increment, respectively; The state variable constraints are as follows: s.t. in, and These are the minimum and maximum values of the heading angle, respectively. and These are the minimum and maximum values of the change in heading angle.
8. A tracking control system for an articulated vehicle based on multi-threaded distributed execution, characterized in that, The tracking and control system includes: a nonlinear kinematics model construction module, an initial motion planning module, and a multi-threaded distributed execution module; The nonlinear kinematics model construction module is used to construct a nonlinear kinematics model of the articulated vehicle; the nonlinear kinematics model includes the relationship function between the state variables and control variables of the front and rear vehicles of the articulated vehicle; The initial motion planning module is used to predict the state and control variables of the articulated vehicle from the initial moment to the time range of a+b, based on the nonlinear MPC algorithm and the nonlinear kinematic model; where a and b are the set durations. The multi-threaded distributed execution module is used to sequentially collect the real-time attitude of the articulated vehicle at each ai time step with a time step a. Based on the real-time attitude at ai time step, the multi-threaded distributed method is used to calculate the state variables and control variables of the articulated vehicle in each time range from ai+b to a(i+1)+b. i is a positive integer representing the thread number.
9. An electronic device, characterized in that, The system includes a memory and a processor, wherein the processor is used to execute computer management programs stored in the memory to implement the steps of the articulated vehicle tracking control method based on multi-threaded distributed execution as described in any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, It stores a computer management program, which, when executed by a processor, implements the steps of the articulated vehicle tracking control method based on multi-threaded distributed execution as described in any one of claims 1-7.