An automatic driving hardware-in-the-loop simulation verification method and device

By linking the vehicle dynamics simulation terminal, the interface coordination terminal, and the real-time control hardware module in a closed loop, the timing deviation and quantization problems in the on-loop simulation verification of autonomous driving hardware are solved, realizing full-dimensional simulation verification of control algorithms and hardware performance, and improving the realism and comprehensiveness of simulation verification.

CN123137100APending Publication Date: 2026-11-20XIAN TECH UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611514871.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-28
Publication Date
2026-11-20

AI Technical Summary

Technical Problem

Existing autonomous driving hardware-in-the-loop simulation verification suffers from problems such as data transmission timing deviation, inaccurate quantification of control algorithm operation status, incomplete verification of system load and real-time constraints, timing misalignment of simulation results, and difficulty in quantifying and evaluating closed-loop response characteristics.

Method used

Through a closed-loop linkage architecture of vehicle dynamics simulation terminal, interface coordination terminal and real-time control hardware module, unified framing, byte order transmission and timing synchronization of data frames are realized, kinematic extrapolation calculation and timing alignment processing are performed, the sub-stage and full process execution time of the control algorithm are quantified, and telemetry data is generated for comprehensive evaluation.

Benefits of technology

It improves the accuracy of input data for control algorithm operation, provides comprehensive quantitative evaluation of hardware load and real-time performance, enhances the authenticity and comprehensiveness of simulation verification, supports real-time performance verification in multiple scenarios, and provides accurate data support.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123137100A_ABST
    Figure CN123137100A_ABST
Patent Text Reader

Abstract

The application discloses an automatic driving hardware-in-the-loop simulation verification method and device, and relates to the technical field of automatic driving simulation testing.The vehicle and environment state parameters are output by a vehicle dynamics simulation end, are transmitted to a real-time control hardware through an interface coordination end, and are subjected to kinematics extrapolation compensation after being frame-decomposed and restored by the hardware end, so that time delay errors are eliminated, the measured control algorithm is run, and each stage execution time is collected in detail, and telemetry data such as sub-stage, system load and cutoff satisfaction state are quantitatively obtained.The interface coordination end synchronously collects and time-aligns vehicle response data and telemetry data, and calculates control performance and real-time constraint verification results.The application can realize multi-cycle working condition testing and disturbance comparison and quantitative evaluation, solves the problems of traditional simulation time deviation, one-sided performance evaluation and insufficient real-time verification, and effectively improves the accuracy and comprehensiveness of automatic driving hardware-in-the-loop simulation verification.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of testing technology for autonomous driving control systems, and in particular to a method and apparatus for hardware-in-the-loop simulation verification of autonomous driving systems. Background Technology

[0002] Autonomous driving control system testing is used to verify the functionality, performance, and fault handling capabilities of the autonomous driving system under various operating conditions, identify defects, and ensure the safe and reliable operation of the vehicle in autonomous driving mode.

[0003] Existing autonomous driving controllers mainly use pure software simulation or hardware-in-the-loop verification: Pure software simulation can obtain control function indicators such as vehicle trajectory and error, but it relies entirely on software model calculations and cannot collect the actual running sequence of real hardware, the calculation time of each stage and the hardware load status. It cannot quantify the real-time execution constraints of hardware, and the reliability of real-time verification is extremely low.

[0004] While conventional hardware-in-the-loop (HIL) testing establishes a closed-loop test link between the dynamics simulation end and the real-time control hardware, enabling basic verification of autonomous driving control functions, the test process is limited in functionality and lacks verification dimensions. It cannot simultaneously complete the quantitative acquisition and verification of real-time hardware execution constraints such as hardware computation time, system load, and execution deadlines within the same closed-loop test process. This results in the control function verification and hardware real-time verification being carried out separately and in stages, making it impossible to achieve time-series synchronization matching and joint analysis of the two types of data. Ultimately, this leads to insufficient completeness and comprehensiveness of simulation verification, making it impossible to accurately and comprehensively verify the actual operating state of the autonomous driving control system. Summary of the Invention

[0005] The main objective of this invention is to provide a method and apparatus for hardware-in-the-loop simulation verification of autonomous driving, which aims to solve the technical problems existing in the hardware-in-the-loop simulation verification process of autonomous driving, such as data transmission timing deviation, inaccurate quantification of control algorithm running state, incomplete verification of system load and real-time constraints, timing misalignment of simulation results, and difficulty in quantifying and evaluating closed-loop response characteristics.

[0006] To achieve the above objectives, this invention provides a hardware-in-the-loop simulation verification method for autonomous driving, comprising the following steps: A vehicle dynamics simulation terminal updates the vehicle dynamics model based on the control instructions output from the previous control cycle, outputting vehicle state parameters and environmental state parameters for the current control cycle; an interface coordination terminal performs parameter packaging and framing on the vehicle state parameters and environmental state parameters according to a preset field sorting rule, generating input data frames and sending them to the real-time control hardware; the real-time control hardware performs frame de-framing and parameter restoration processing on the received input data frames, performs kinematic extrapolation calculations on the vehicle state parameters based on a preset compensation duration, and obtains compensated state quantities; the real-time control hardware uses the compensated state quantities to run the control algorithm under test, outputs the control instructions for the current control cycle, and collects the execution duration of each sub-stage of the control calculation and the overall execution time. The process involves calculating the sub-stage load, system load, and execution deadline satisfaction status based on the execution duration of each sub-stage, the total execution duration, and the control cycle duration, generating computational telemetry data. The control commands and computational telemetry data are encapsulated into a composite output data frame and sent back to the interface coordination end. The interface coordination end parses the control commands from the composite output data frame and sends them to the vehicle dynamics simulation end. The vehicle dynamics simulation end responds to the control commands by generating vehicle response data, and the interface coordination end synchronously collects and records the vehicle response data and computational telemetry data carrying synchronization timestamps. The interface coordination end performs time-series alignment processing on the vehicle response data and computational telemetry data carrying synchronization timestamps, calculates the control performance indicators and real-time execution constraint satisfaction results, and completes the hardware-in-the-loop simulation verification of autonomous driving.

[0007] Optionally, the vehicle state parameters output by the vehicle dynamics simulation terminal include: vehicle longitudinal position, vehicle lateral position, vehicle heading angle, vehicle longitudinal velocity, steering wheel steering amount, vehicle lateral velocity, vehicle yaw rate, and vehicle lateral acceleration; the environmental state parameters include the road surface adhesion coefficient; the vehicle state parameters are used for real-time control hardware to perform kinematic extrapolation calculations.

[0008] Optionally, before generating the input data frame from the vehicle state parameters, a random disturbance signal with a preset mean and a preset variance is superimposed on at least one of the vehicle state parameters; after completing the simulation verification, the control performance index obtained before and after the disturbance is applied is compared with the real-time execution constraint satisfaction result to obtain the quantitative evaluation result of the hardware-in-the-loop system closed-loop response characteristics.

[0009] Optionally, the kinematic extrapolation calculation includes: performing extrapolation calculations on the vehicle's longitudinal position and lateral position based on the vehicle's longitudinal velocity, lateral velocity, heading angle, and preset compensation duration to obtain the compensated longitudinal and lateral positions; and performing extrapolation calculations on the vehicle's heading angle based on the vehicle's yaw rate and preset compensation duration to obtain the compensated heading angle.

[0010] Optionally, both the input data frame and the composite output data frame are encapsulated using single-precision floating-point data fields; the data sending end decomposes each single-precision floating-point field into multi-byte data and sends it according to a preset standard byte order; the data receiving end matches the same byte order rule, reassembles and restores the received multi-byte data to obtain the original single-precision floating-point value.

[0011] Optionally, the encapsulated data of the composite output data frame may further include: target longitudinal velocity, steering control command, lateral position error, heading angle error, intermediate state parameters of the control algorithm, execution time of each control calculation sub-stage, control calculation time of non-target sub-stages, sub-stage load, calculation load of other modules, and system load.

[0012] Optionally, the acquisition and control calculation of the execution time of each sub-stage and the total execution time includes: reading the count value of the hardware decrement timing unit at the start and end times of each target control calculation sub-stage; calculating the execution time of the corresponding sub-stage based on the difference between the two count values ​​and the inherent clock frequency of the hardware; and acquiring the total execution time of a single complete control calculation process using the same timing logic.

[0013] Optionally, the calculation of the sub-stage execution duration, the total process execution duration, the sub-stage load, the system load, and the execution deadline satisfaction status includes: using the ratio of the sub-stage execution duration to the current control cycle duration as the sub-stage load; using the ratio of the total process execution duration to the current control cycle duration as the system load; and determining that the execution deadline satisfaction status is satisfied when the total process execution duration is less than or equal to the current control cycle duration, otherwise determining that it is not satisfied.

[0014] Optionally, it also includes configuring at least two different control cycle durations to conduct simulation verification; comparing the control performance indicators, full process execution time, system load, and execution deadline satisfaction status corresponding to different control cycle durations to obtain real-time performance verification results under multiple operating conditions.

[0015] Furthermore, to achieve the above objectives, the present invention also provides an autonomous driving hardware-in-the-loop simulation verification device, comprising: a vehicle dynamics simulation module, an interface coordination module, and a real-time control hardware module; the vehicle dynamics simulation module is used to update the vehicle dynamics model based on the control instructions output in the previous control cycle, and output the vehicle state parameters and environmental state parameters of the current control cycle; the interface coordination module is used to perform parameter packaging and framing on the vehicle state parameters and environmental state parameters according to a preset field sorting rule, generate input data frames, and send them to the real-time control hardware module; the real-time control hardware module is used to perform frame de-framing and parameter restoration processing on the received input data frames, and perform kinematic extrapolation calculation on the vehicle state parameters based on a preset compensation duration to obtain compensation state quantities; the real-time control hardware module is also used to run the control algorithm under test using the compensation state quantities, output the control instructions of the current control cycle, and collect the execution duration of each sub-stage of the control calculation and the total execution duration; The real-time control hardware module is further configured to calculate the sub-stage load, system load, and execution deadline satisfaction status based on the execution duration of each sub-stage, the total execution duration, and the control cycle duration, and generate calculated telemetry data. The real-time control hardware module is also configured to encapsulate the control commands and the calculated telemetry data into a composite output data frame and send it back to the interface coordination module. The interface coordination module is further configured to parse the control commands from the composite output data frame and send the control commands to the vehicle dynamics simulation module. The vehicle dynamics simulation module is further configured to generate vehicle response data in response to the control commands. The interface coordination module is further configured to synchronously collect and record vehicle response data and calculated telemetry data carrying synchronization timestamps. The interface coordination module is further configured to perform time-series alignment processing on the vehicle response data and calculated telemetry data carrying synchronization timestamps, calculate control performance indicators and real-time execution constraint satisfaction results, and complete the hardware-in-the-loop simulation verification of autonomous driving.

[0016] The beneficial effects that this invention can achieve are as follows: The autonomous driving hardware-in-the-loop simulation verification method and apparatus proposed in this invention form a closed-loop linkage architecture through a vehicle dynamics simulation module, an interface coordination module, and a real-time control hardware module. Relying on a multi-module collaborative working mechanism, it effectively solves the technical problems of timing deviation, data asynchrony, one-sided performance evaluation, and low real-time verification accuracy in existing hardware-in-the-loop simulations. First, by performing kinematic extrapolation calculations on the real-time control hardware, it compensates for transmission and calculation delays, eliminating simulation errors caused by data transmission timing deviations and improving the accuracy of the input data for the control algorithm. Second, by finely collecting the execution time of control calculation sub-stages and the entire process, it quantifies the sub-stage, system load, and deadline satisfaction states, achieving a comprehensive quantitative evaluation of the real-time performance of the control algorithm hardware. This solves the problem that traditional simulations only verify control effects and cannot quantify hardware load and real-time constraints. Simultaneously, the interface coordination module achieves accurate timing matching of simulation data, control data, and telemetry data through unified framing, byte order transmission, timing synchronization labeling, and alignment processing, eliminating timing misalignment problems in simulation results.

[0017] Building upon this foundation, this invention achieves quantitative evaluation of closed-loop response characteristics by superimposing random disturbance signals and completes real-time performance verification across multiple scenarios through comparison of multiple control cycle operating conditions. This significantly enriches the dimensions of simulation verification and overcomes the limitations of traditional hardware-in-the-loop simulation verification, which suffers from a single scenario and one-sided evaluation results. The overall solution realizes integrated, high-precision, and multi-dimensional simulation verification of the control performance of autonomous driving control algorithms, hardware operating load performance, and real-time constraint satisfaction capabilities. This effectively improves the realism, reliability, and comprehensiveness of autonomous driving hardware-in-the-loop simulation, providing precise data support for iterative optimization of autonomous driving control algorithms and hardware adaptation verification. Attached Figure Description

[0018] Figure 1 This is a flowchart illustrating the hardware-in-the-loop simulation verification method of the present invention; Figure 2 This is a diagram of the hardware-in-the-loop physical experimental platform of the present invention; Figure 3 This is a diagram of the MATLAB / Simulink hardware-in-the-loop simulation model of the present invention; Figure 4a A schematic diagram illustrating lane changing (Cut-in) for the vehicle of this invention; Figure 4b A schematic diagram illustrating lane changing (Cut-out) for the vehicle of this invention; Figure 4c This is a schematic diagram of the vehicle correction direction according to the present invention; Figure 4d This is a schematic diagram illustrating the vehicle's return to the main road according to the present invention; Figure 4e This is a schematic diagram illustrating the end of vehicle travel according to the present invention; Figure 4f This is a schematic diagram of the Carsim input for the controller output of this invention; Figure 4g This is a schematic diagram of the controller input and Carsim output of the present invention; Figure 4h This is a schematic diagram of the basic parameters of the vehicle in this invention; Figure 4i This is a schematic diagram of vehicle tire information according to the present invention; Figure 5 This is a data interaction block diagram of the simulation control system of the present invention. Detailed Implementation

[0019] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present invention.

[0020] In the development of autonomous driving control algorithms, a large amount of hardware-in-the-loop simulation verification work is required to simultaneously complete two core assessments: first, to evaluate the closed-loop control performance of the vehicle; and second, to verify the timing execution capability of the control algorithm under test on the target real-time hardware. Specifically, this includes indicators such as the time consumption of each computational sub-stage of the algorithm, CPU resource load, and the satisfaction of control cycle deadline constraints.

[0021] Current hardware-in-the-loop verification solutions for autonomous driving have several technical shortcomings, as follows: First, the state synchronization accuracy is low, resulting in poor verification accuracy. In the existing closed-loop verification process, the vehicle dynamics simulation terminal outputs the vehicle motion state, which is transmitted to the real-time control hardware via a communication link. The hardware runs the algorithm to generate control commands and sends them back to the simulation terminal, forming a simulation closed loop. However, the communication transmission and algorithm calculation processes introduce inherent time lags, causing a timing deviation between the vehicle state output by the simulation and the actual vehicle state at the time of hardware computation. If the original state data is directly used for control calculations, the control performance indicators obtained from the verification will not match the actual operating conditions, significantly reducing the accuracy of the simulation verification.

[0022] Secondly, the data are independent, making fault tracing difficult. Existing solutions use a separate data acquisition and independent recording model for vehicle closed-loop control performance and hardware real-time timing performance. Control performance indicators are obtained from the dynamics simulation logs, while timing data such as hardware sub-stage execution time, resource load, and deadline exceedance status are collected separately through controller debugging tools. These two sets of data belong to different timelines and lack a unified synchronization timestamp binding relationship. This makes it impossible to accurately correlate and analyze vehicle control errors and trajectory response effects within a single control cycle with the algorithm sub-stage timeout, hardware load, and deadline compliance status within the same cycle. When vehicle control performance deteriorates, it becomes difficult to quickly distinguish whether the root cause is an algorithm logic defect or a hardware computation timeout or excessive local load leading to substandard real-time performance.

[0023] Third, the detection dimensions are limited, and the verification scenarios are singular. Existing solutions can only obtain the total execution time of the algorithm as a whole, but cannot break down the execution time and corresponding load of each computational sub-stage, making it difficult to locate functional modules with high computational consumption. At the same time, they only support verification of a fixed single control cycle, and cannot horizontally compare the coupled impact of different control frequencies on the closed-loop control effect and the hardware real-time execution constraints. In addition, for input disturbance scenarios such as sensor noise, there is currently no verification method to quantitatively analyze the dual impact of disturbances on control performance and hardware computational load in the same closed-loop link.

[0024] Fourth, the high degree of hardware-software coupling results in poor general portability. Most verification systems on the market are deeply bound to specific simulation software, chip SDKs, or autonomous driving control algorithms, leading to poor platform adaptability. When ported to other real-time hardware platforms or dynamic simulation environments, significant modifications to the program framework are required, resulting in high reuse costs and weak versatility.

[0025] To address the aforementioned issues, there is an urgent need to propose a hardware-in-the-loop simulation verification method and device for autonomous driving, which can achieve synchronous evaluation of the vehicle's closed-loop control performance and the hardware's phased execution time, resource load, and deadline satisfaction status under the same control cycle and simulation time axis.

[0026] The first embodiment of the present invention provides a hardware-in-the-loop simulation verification method for autonomous driving. The method is implemented based on a hardware-in-the-loop simulation verification system. The system consists of three parts: a vehicle dynamics simulation terminal, an interface coordination terminal, and real-time control hardware, forming a complete closed-loop verification link.

[0027] Among them, the vehicle dynamics simulation terminal is used to simulate real controlled vehicles. It has a built-in vehicle dynamics model and can iteratively update the model state according to the hardware control instructions of the previous control cycle, and output the vehicle state parameters and environmental state parameters of the current cycle in real time.

[0028] The interface coordination terminal serves as the core data relay channel between the simulation terminal and the real-time control hardware. Its core functions include: packaging and framing vehicle and environmental state parameters according to preset field rules, generating standardized input data frames and sending them to the real-time control hardware; receiving composite output data frames returned by the hardware, parsing and extracting control commands and sending them to the vehicle dynamics simulation terminal; and performing time-series alignment and calibration on vehicle response data and algorithm-calculated telemetry data carrying synchronization timestamps to achieve accurate correlation and matching of the two types of data.

[0029] The real-time control hardware is used to deploy and run the autonomous driving control algorithm under test. The core execution flow is as follows: Upon receiving the input data frame, the hardware performs frame deconstruction and parameter restoration; based on a preset compensation duration, it performs kinematic extrapolation calculations on the original vehicle state parameters to obtain accurate vehicle compensation state quantities; based on these compensation state quantities, the hardware runs the algorithm under test and outputs the vehicle control command for the current control cycle. Simultaneously, the hardware collects the execution time of each sub-stage and the entire process of the algorithm, calculates the load of each sub-stage, the overall system load, and the compliance status at the deadline, generates standardized telemetry data, and finally encapsulates the control commands and telemetry data into a composite data frame, which is then transmitted back to the interface coordination end.

[0030] This embodiment relies on a multi-terminal collaborative architecture to complete closed-loop verification: the vehicle dynamics simulation terminal generates the vehicle's operating state, the interface coordination terminal uniformly implements data sampling, communication transmission, command forwarding, and timing data recording, and the external real-time control hardware independently runs the algorithm under test. The control algorithm under test has a wide range of adaptability, supporting various autonomous driving control algorithms such as model predictive control, linear quadratic control, PID control, and control programs containing neural network inference. The DHA-MPC algorithm is used as an example to complete command generation and staged timing; however, this invention is not limited to specific algorithm types. The real-time control hardware used can be various real-time microcontrollers such as the TIC2000 series digital signal processor, demonstrating strong hardware adaptability.

[0031] like Figure 1 As shown, in this embodiment, the autonomous driving hardware-in-the-loop simulation verification method is performed according to the following steps: Step S1: The vehicle dynamics simulation terminal updates the vehicle dynamics model based on the control command output in the previous control cycle, and outputs the vehicle state parameters and environmental state parameters for the current control cycle.

[0032] In this step, the vehicle dynamics model built into the vehicle dynamics simulation terminal receives control commands (such as steering control commands and target longitudinal velocity) issued by the interface coordination terminal in the previous control cycle. These control commands are used as model inputs to update the vehicle's motion state, and vehicle state parameters and environmental state parameters are output in the current control cycle. The vehicle state parameters reflect the kinematic and dynamic state of the controlled vehicle in the current control cycle, while the environmental state parameters reflect the characteristics of the environment in which the controlled vehicle is located.

[0033] In step S2, the interface coordination terminal performs parameter packaging and framing on the vehicle status parameters and environmental status parameters according to the preset field sorting rules, generates input data frames, and sends them to the real-time control hardware.

[0034] In this step, the interface coordination end samples the parameters output by the vehicle dynamics simulation end at a set period, arranges the parameters into a fixed field sequence according to the preset field sorting rules, and packages the fields into an input data frame, which is then sent to the real-time control hardware through the serial interface.

[0035] Step S3: The real-time control hardware performs frame de-framing and parameter restoration processing on the received input data frames, and performs kinematic extrapolation calculation on the vehicle state parameters based on the preset compensation time to obtain the compensation state quantity. The preset compensation time is the total lag time obtained by pre-calibration, which includes the sum of serial communication transmission delay and the inherent calculation delay of the real-time control hardware; it can be obtained through offline calibration test, or it can be pre-configured according to system communication and hardware parameters.

[0036] In this step, the real-time control hardware receives input data frames byte by byte, performs frame deconstruction on the input data frames, and restores each field within the frame to its original numerical value type to obtain the vehicle state parameters for the current control cycle. Since serial communication transmission and control calculations both require time, the vehicle state parameters obtained by the real-time control hardware lag behind the actual vehicle state. Therefore, this step performs kinematic extrapolation on the vehicle state parameters based on a preset compensation time to compensate for the lag and obtain the compensated state quantity.

[0037] Step S4: The real-time control hardware uses the compensation state variables to run the control algorithm under test, outputs the control command for the current control cycle, and collects the execution time of each sub-stage of the control calculation as well as the total execution time of the entire process.

[0038] In this step, the real-time control hardware uses the compensation state variables as input to run the control algorithm under test, calculates the control command for the current control cycle, and simultaneously collects the execution time of each sub-stage of the control calculation as well as the total execution time of a single complete control calculation process.

[0039] Step S5: Based on the execution duration of each sub-stage, the total execution duration, and the control cycle duration, calculate the sub-stage load, system load, and execution deadline satisfaction status, and generate telemetry data.

[0040] In this step, the real-time control hardware takes the execution duration of each sub-stage, the total execution duration, and the current control cycle duration as inputs to calculate the load of each sub-stage, the system load, and the execution deadline satisfaction status. The above real-time execution-related data are then summarized into telemetry data.

[0041] Step S6: The control command and the calculated telemetry data are encapsulated into a composite output data frame and sent back to the interface coordination end. The interface coordination end parses the control command from the composite output data frame and sends the control command to the vehicle dynamics simulation end.

[0042] In this step, the real-time control hardware encapsulates the control commands and calculated telemetry data into a composite output data frame and sends it back to the interface coordination end. The interface coordination end performs frame de-framing on the composite output data frame, parses out the control commands, and sends the control commands to the vehicle dynamics simulation end as the input of the vehicle dynamics model for the next control cycle.

[0043] In step S7, the vehicle dynamics simulation terminal generates vehicle response data in response to the control command, and the interface coordination terminal synchronously collects and records the vehicle response data carrying the synchronization timestamp and calculates the telemetry data.

[0044] In this step, the vehicle dynamics simulation terminal receives control commands and drives the vehicle dynamics model to generate vehicle response data; the interface coordination terminal adds synchronization timestamps to the vehicle response data and calculated telemetry data according to the simulation time axis, and synchronously collects and records them in the form of time series, so that the hardware calculation state and the vehicle response correspond one-to-one in time.

[0045] Step S8: The interface coordination end performs timing alignment processing on the vehicle response data carrying the synchronization timestamp and the calculated telemetry data, calculates the control performance index and the real-time execution constraint satisfaction result, and completes the hardware-in-the-loop simulation verification of autonomous driving.

[0046] In this step, the interface coordinator aligns the vehicle response data and calculated telemetry data to the same simulation time axis based on the synchronization timestamp, and calculates the control performance indicators and real-time execution constraint satisfaction results accordingly. For example, the control performance indicators include at least one of the following: maximum lateral position error, error convergence time, yaw response, or vehicle lateral acceleration; the real-time execution constraint satisfaction results include at least one of the following: sub-stage execution duration, total process execution duration, system load, or execution deadline satisfaction status.

[0047] It should be noted that the timing alignment processing and the calculation of control performance indicators and real-time execution constraint satisfaction results described in this embodiment can be performed by the interface coordination end; in other embodiments, they can also be performed by the verification processing unit connected to the interface coordination end, that is, the verification processing unit calculates the control performance indicators and real-time execution constraint satisfaction results based on the timing-aligned data provided by the interface coordination end.

[0048] The beneficial effects of this embodiment are as follows: First, since the control commands and telemetry data are transmitted back in the same composite output data frame, the interface coordination end can simultaneously obtain the control commands and the corresponding real-time hardware execution data within the same control cycle. This allows the hardware calculation state to establish a one-to-one correspondence with the vehicle response in the same control cycle. Thus, the vehicle closed-loop control performance and the phased execution time, resource load, and deadline satisfaction status of the real-time control hardware can be evaluated within the same control cycle and on the same simulation time axis. This overcomes the problem of the control performance evaluation and real-time execution index evaluation being separate and difficult to correlate in the existing verification methods.

[0049] Second, since the kinematic extrapolation calculation based on the preset compensation time is performed on the received vehicle state parameters before the control calculation, and the state is compensated in advance by using the vehicle kinematic relationship, the state asynchrony caused by serial communication transmission and control execution lag can be reduced, so that the state obtained by the tested control algorithm is closer to the actual state of the vehicle, which is conducive to improving the accuracy of closed-loop control performance evaluation.

[0050] Third, because the real-time control hardware collects the execution time of each sub-stage and the total execution time while running the control algorithm under test, and calculates the sub-stage load, system load and execution deadline satisfaction status, the phased execution time, total execution time, load and deadline status are jointly output with the vehicle control performance. This allows for the simultaneous judgment of control effect and real-time feasibility of the target hardware, providing a direct basis for control algorithm design, control cycle configuration and hardware platform selection.

[0051] Fourth, since the overall process of this embodiment does not depend on specific control algorithms, chip models or simulation software, the interface coordination end decouples the vehicle dynamics simulation end and the real-time control hardware through a unified data frame, which is convenient for implementation in different real-time control hardware and vehicle dynamics simulation environments.

[0052] As a preferred implementation method, the vehicle state parameters and environmental state parameters are as follows: The vehicle state parameters include the vehicle's longitudinal position, lateral position, heading angle, longitudinal velocity, steering wheel steering amount, lateral velocity, yaw rate, and lateral acceleration; the environmental state parameters include the road surface adhesion coefficient.

[0053] Specifically, the vehicle dynamics simulation terminal outputs nine parameters: vehicle longitudinal position, vehicle lateral position, vehicle heading angle, vehicle longitudinal velocity, steering wheel steering amount, vehicle lateral velocity, vehicle yaw rate, vehicle lateral acceleration, and road adhesion coefficient. The interface coordination terminal uses the above-mentioned arrangement as the preset field sorting rule to form a nine-field input data frame. These vehicle state parameters are used by the real-time control hardware to perform kinematic extrapolation calculations.

[0054] The beneficial effects of this implementation are as follows: the vehicle state parameters include both the vehicle's longitudinal motion state (vehicle longitudinal position, vehicle longitudinal velocity) and lateral motion state (vehicle lateral position, vehicle lateral velocity, vehicle lateral acceleration), as well as the attitude state (vehicle heading angle, vehicle yaw rate) and steering input state (steering wheel steering amount). At the same time, the road adhesion coefficient reflects the environmental characteristics, providing the necessary state quantities such as vehicle longitudinal velocity, vehicle lateral velocity, vehicle heading angle, and vehicle yaw rate for kinematic extrapolation calculations, and providing complete closed-loop response information for control performance evaluation.

[0055] One implementation method for kinematic extrapolation: Kinematic extrapolation is performed according to formulas (1) to (3): in, The longitudinal position of the vehicle before compensation. The compensated longitudinal position of the vehicle; The vehicle's lateral position before compensation. ψ represents the lateral position of the vehicle after compensation; ψ represents the heading angle of the vehicle before compensation. The compensated vehicle heading angle; The longitudinal speed of the vehicle; The vehicle's lateral speed; The yaw rate of the vehicle body; The preset compensation duration.

[0056] Specifically, based on the vehicle's longitudinal speed, the vehicle's lateral speed, the vehicle's heading angle, and the preset compensation duration, extrapolation calculations are performed on the vehicle's longitudinal position and the vehicle's lateral position to obtain the compensated longitudinal position and lateral position; based on the vehicle's yaw rate and the preset compensation duration, extrapolation calculations are performed on the vehicle's heading angle to obtain the compensated vehicle's heading angle.

[0057] The beneficial effects of this implementation method are as follows: the extrapolation calculation only involves algebraic calculations of vehicle kinematic parameters, which can be completed by the real-time control hardware within the control cycle, with low computational overhead and no impact on the real-time execution of the control algorithm under test; by synchronously extrapolating the vehicle's longitudinal position, lateral position and heading angle, the compensation state quantity is kept consistent with the actual state of the vehicle within the preset compensation time, further reducing the impact of state lag on closed-loop control and performance evaluation.

[0058] One implementation of data frame encapsulation and byte order: Both the input data frame and the composite output data frame are encapsulated using single-precision floating-point data fields; the data sending end decomposes each single-precision floating-point field into multi-byte data and sends it according to a preset standard byte order; the data receiving end matches the same byte order rule, reassembles the received multi-byte data to obtain the original single-precision floating-point value.

[0059] Specifically, each field of the input data frame is a 32-bit single-precision floating-point number, split into 4 bytes and sent in little-endian (i.e., a specific form of the preset standard byte order). The real-time control hardware receives the input data frame byte by byte, reassembles every 4 bytes into a 32-bit unsigned value, and restores it to a single-precision floating-point value through shared bits. The restored vehicle longitudinal speed is uniformly converted to meters per second, and the vehicle heading angle and yaw rate are uniformly converted to radians to unify the unit system used in subsequent extrapolation and control calculations. The composite output data frame uses the same floating-point byte conversion rules as the input data frame.

[0060] The beneficial effects of this implementation are as follows: the length of each data field is fixed, the arrangement rules and byte order are unified, and the data frame length is determined, which facilitates different software and hardware platforms to parse and restore data according to the same rules, ensuring data consistency in cross-platform real-time communication; single-precision floating-point data can meet the data precision requirements of parameters such as vehicle status and control commands, and at the same time, it reduces the number of bytes transmitted compared to double-precision floating-point data, reducing the transmission overhead of the serial communication link, which is beneficial to meeting the real-time requirements under high control frequency; the byte order of the data sending end and the data receiving end is consistent, which can avoid data restoration errors caused by inconsistent byte order.

[0061] One implementation of the composite output data frame: The encapsulated data of the composite output data frame also includes: target longitudinal velocity, steering control command, lateral position error, heading angle error, intermediate state parameters of the control algorithm, execution time of each control calculation sub-stage, control calculation time of non-target sub-stages, sub-stage load, calculation load of other modules, and system load.

[0062] Specifically, the composite output data frame is an 11-field data frame, which includes, in sequence, the target longitudinal velocity, steering control command, lateral position error, heading angle error, intermediate state parameters of the two control algorithms, sub-stage execution time, control calculation time of non-target sub-stages, sub-stage load, calculation load of other modules, and system load. After receiving the composite output data frame, the interface coordination end applies the steering control command and the target longitudinal velocity to the vehicle dynamics simulation end, and simultaneously records the vehicle longitudinal position, vehicle lateral position, lateral position error, heading angle error, steering wheel steering amount, vehicle lateral acceleration, intermediate state parameters of the control algorithm, road adhesion coefficient, sub-stage execution time, control calculation time of non-target sub-stages, and load data in time series form.

[0063] The beneficial effects of this implementation are as follows: the composite output data frame carries control commands and calculated telemetry data simultaneously in the same data frame. The control commands are used to drive the vehicle dynamics model, the target longitudinal speed, lateral position error, heading angle error and intermediate state parameters of the control algorithm are used to describe the control results and control process, and the execution time of the sub-stage, the control calculation time of the non-target sub-stage, the sub-stage load, the calculation load of the other modules and the system load are used to describe the real-time execution status of the hardware. Thus, a one-to-one correspondence between control commands, control process information and real-time execution information is established in a single data frame, providing a complete data source for subsequent timing alignment processing and joint evaluation.

[0064] One implementation method for timing acquisition: Acquiring the execution time of each sub-stage of the control calculation and the total execution time of the entire process, including: reading the count value of the hardware decrement timing unit at the start and end times of each target control calculation sub-stage; calculating the execution time of the corresponding sub-stage based on the difference between the two count values ​​and the inherent clock frequency of the hardware; and acquiring the total execution time of a single complete control calculation process using the same timing logic.

[0065] Specifically, the real-time control hardware reads the count value of the hardware decrement timing unit before the start of the complete control program, reads the count value of the hardware decrement timing unit again at the start and end of the target control calculation sub-stage, and reads the count value of the hardware decrement timing unit after the end of the complete control program. The execution time of the sub-stage and the execution time of the whole process are obtained according to formula (4): (4) in, This is the count value of the hardware decrementing timing unit read at the start of a sub-stage or the complete control calculation process. This refers to the count value of the hardware decrementing timing unit read at the corresponding end time. The inherent clock frequency of the hardware. This refers to the execution time of the corresponding sub-stage or the total execution time of the entire process.

[0066] The beneficial effects of this implementation are as follows: by reading the count value of the hardware decrement timing unit and converting the duration using the inherent clock frequency of the hardware, the timing resolution is determined by the inherent clock frequency of the hardware, resulting in high timing accuracy and almost no occupation of the software computing resources of the real-time control hardware; the execution duration of the sub-stage and the execution duration of the entire process adopt the same timing logic, both based on the same hardware decrement timing unit and the same inherent clock frequency of the hardware, and are on the same timing benchmark, which can ensure that the load of the subsequent sub-stage, the system load, and the execution deadline meet the consistency of the state calculation results.

[0067] One implementation method for load and deadline calculation: The calculation of sub-stage execution duration, total process execution duration, sub-stage load, system load, and execution deadline satisfaction status includes: taking the ratio of the sub-stage execution duration to the current control cycle duration as the sub-stage load; taking the ratio of the total process execution duration to the current control cycle duration as the system load; when the total process execution duration is less than or equal to the current control cycle duration, the execution deadline satisfaction status is determined to be satisfied; otherwise, it is determined to be unsatisfied.

[0068] Specifically, the sub-stage load is obtained according to formula (5), the system load is obtained according to formula (6), and the execution deadline satisfaction status is obtained according to formula (7): (5) (6) (7) when When the execution deadline is met, the status is satisfied; when When the execution deadline is met, the status is not met; in, To control the execution time of sub-stages in the computational sub-stage, The total execution time is [time]. This is the duration of the current control cycle. For sub-stage load, For system load, The execution deadline has been met.

[0069] The beneficial effects of this implementation are as follows: by using the ratio of the execution time of each sub-stage and the total execution time to the control cycle duration, the resource occupancy of each computational sub-stage and the overall control computation on the control cycle can be quantified. The sub-stage load can reflect the computational resource occupancy and margin of each sub-stage, and the system load can reflect the overall computational resource utilization of the real-time control hardware. By directly comparing the total execution time with the control cycle duration to obtain the execution deadline satisfaction status, a clear and quantifiable criterion is provided for judging whether the target real-time control hardware meets the real-time deadline requirements under the current control cycle configuration.

[0070] In one specific implementation, CarSim is used for vehicle dynamics simulation, MATLAB / Simulink is used for interface coordination, TIC2000F28P55X is used for real-time control hardware, and CodeComposerStudio is used for development and debugging. The interface coordination terminal and the real-time control hardware are connected via a serial interface with a baud rate of 921600, 8 data bits, 1 stop bit, no parity, and little-endian byte order. The above-mentioned hardware and software can be replaced by equivalent components with corresponding vehicle simulation, interface communication, and real-time control capabilities.

[0071] Joint verification under multiple control cycles and random disturbance conditions: In one implementation, at least two different control cycle durations are configured for simulation verification; the control performance indicators, full process execution time, system load, and execution deadline satisfaction status corresponding to different control cycle durations are compared horizontally to obtain real-time performance verification results under multiple operating conditions.

[0072] Specifically, this embodiment selects control frequencies of 20Hz, 50Hz, and 100Hz, corresponding to control cycle durations of 50ms, 20ms, and 10ms, respectively, thus configuring three different control cycle durations of 20Hz, 50Hz, and 100Hz. For each control cycle duration, the process is repeated. Figure 1 The verification process of the first embodiment shown records the vehicle trajectory, lateral position error, heading response, vehicle lateral acceleration, sub-stage execution time, total execution time, sub-stage load, and system load. The interface coordination end (or the verification processing unit connected to it) calculates the control performance index for each control cycle duration and compares the total execution time with the corresponding control cycle duration to obtain the execution deadline satisfaction status. The simulation software MATLAB / Simulink is designed as follows... Figure 3 As shown, the actual hardware-in-the-loop experiment is as follows: Figure 5 As shown.

[0073] Under the specific real-time control hardware, specific program version, and specific vehicle operating conditions mentioned above, the average execution time of the measured neural network inference stage is approximately 26.72 to 26.80 microseconds, with a peak value of approximately 32.01 to 32.13 microseconds; the complete control calculation time and CPU load vary with the control frequency.

[0074] The beneficial effects of this implementation method are as follows: by configuring at least two different control cycle durations and comparing the control performance indicators, full-process execution time, system load, and execution deadline satisfaction status corresponding to different control cycle durations, it is possible to obtain real-time performance verification results under multiple operating conditions, clarify the impact trend of control cycle duration changes on closed-loop control performance and hardware real-time execution capability, and provide data basis for control cycle selection, design of the control algorithm under test, and selection of real-time control hardware.

[0075] In one implementation, before generating an input data frame from the vehicle state parameters, a random disturbance signal with a preset mean and a preset variance is superimposed on at least one of the vehicle state parameters. For example, the mean is 0, and the variance is set according to the noise level of the corresponding sensor. No specific value is required; only the configuration logic is described. After completing the simulation verification, the control performance indicators obtained before and after the disturbance are applied are compared with the results of satisfying the real-time execution constraints to obtain a quantitative evaluation result of the closed-loop response characteristics of the hardware-in-the-loop system.

[0076] Specifically, random disturbance signals with preset mean and preset variance can be superimposed on selected states such as vehicle lateral position, vehicle lateral velocity, or vehicle body yaw rate to simulate sensor measurement noise or external disturbances. The interface coordination end maintains the same data frame format, byte order rules, and time correspondence rules, and executes the verification process of the first embodiment for the operating conditions before and after the disturbance is superimposed. After the simulation verification is completed, the control performance indicators obtained before and after the disturbance are applied are compared with the real-time execution constraint satisfaction results, thereby distinguishing the impact of input disturbances on closed-loop performance and hardware computation real-time performance, and obtaining quantitative evaluation results of the hardware-in-the-loop system closed-loop response characteristics.

[0077] The beneficial effects of this implementation are as follows: by superimposing a random disturbance signal with a preset mean and a preset variance onto the selected vehicle state parameters, and by comparing the control performance indicators and real-time execution constraint satisfaction results before and after the disturbance is applied while keeping the data frame format and time correspondence rules unchanged, the influence of the input disturbance can be separated from the system's own characteristics. The influence of the input disturbance on the closed-loop control performance and hardware real-time execution constraints can be quantitatively examined, thereby quantitatively evaluating the closed-loop response characteristics of the hardware-in-the-loop system and providing a verification means for the robust design of the control algorithm and the disturbance suppression strategy.

[0078] refer to Figure 5 : Figure 5This is a data interaction block diagram of the simulation control system of the present invention; the dynamics simulation module outputs simulation data, which is then adapted to the data format and timing by the interface coordination module and input to the real-time control hardware module; the real-time control hardware module outputs feedback data, which is then transmitted back to the dynamics simulation module by the interface coordination module, forming a closed-loop data interaction.

[0079] The second embodiment of the present invention provides an autonomous driving hardware-in-the-loop simulation verification device, which is adapted to the closed-loop real-time performance and control performance joint verification scenario of autonomous vehicle control algorithms. The device consists of three core units: a vehicle dynamics simulation module, an interface coordination module, and a real-time control hardware module. Each module interacts with data at each level and runs in a closed-loop iterative manner, which can realize the simulation of the control effect of autonomous driving control algorithms, real-time hardware load detection, execution timing verification, and data timing alignment analysis. It solves the technical problems of state lag, lack of real-time quantization, disordered data timing, and inability to verify performance and load synchronously in traditional hardware-in-the-loop simulation.

[0080] Vehicle Dynamics Simulation Module: In this embodiment, the vehicle dynamics simulation module preferably uses the CarSim high-precision vehicle dynamics simulation platform, which can accurately build whole vehicle dynamics models, tire models, road surface adhesion models, and vehicle driving environment models, providing a realistic vehicle operation simulation environment for the verification of autonomous driving control algorithms. This module serves as the data source and execution response end for the device's closed-loop simulation, possessing core functions such as periodic iterative updates, real-time status output, and command response simulation.

[0081] The specific working process is as follows: The vehicle dynamics simulation module receives the autonomous driving control commands from the previous control cycle issued by the interface coordination module, imports command parameters such as steering control quantity and target vehicle speed control quantity into the built-in vehicle dynamics model, drives the model to complete the iterative update of the vehicle's motion state, and simulates the vehicle's actual driving response under the corresponding control commands. After the iterative calculation is completed, the module outputs the complete state parameters of the current control cycle in real time, including two types of core data: vehicle state parameters and environmental state parameters. Among them, the vehicle state parameters specifically include the vehicle's longitudinal position, lateral position, heading angle, longitudinal velocity, lateral velocity, yaw rate, lateral acceleration, and steering wheel steering amount; the environmental state parameters are mainly the road surface adhesion coefficient, which can adapt to the simulation verification needs of different road conditions.

[0082] Meanwhile, the vehicle dynamics simulation module can generate vehicle response data in real time according to control commands, and intuitively provide simulation results such as vehicle trajectory tracking accuracy, attitude response status, and dynamic driving stability, providing original simulation data support for subsequent control performance analysis. It also completes iterative calculations according to a fixed control cycle throughout the process, ensuring the consistency of the simulation timing of the entire system.

[0083] Interface Coordination Module: In this embodiment, the interface coordination module adopts the MATLAB / Simulink real-time simulation system. As the core data transfer, timing scheduling, data storage and alignment unit between the vehicle dynamics simulation module and the real-time control hardware module, it plays a pivotal role in uplink and downlink data interaction, ensuring accurate data transmission, timing synchronization and regularization between the simulation end and the hardware end.

[0084] In the data delivery process, the interface coordination module receives vehicle and environmental state parameters output by the vehicle dynamics simulation module in real time. It strictly follows a preset 9-field fixed sorting rule to sort the parameters, with the fields ordered as follows: vehicle longitudinal position, vehicle lateral position, heading angle, longitudinal velocity, steering input, lateral velocity, yaw rate, lateral acceleration, and road adhesion coefficient. After parameter normalization, the module performs standardized packetization and framing, splitting each field's 32-bit single-precision floating-point data into 4 bytes, encapsulating the data using little-endian byte order, generating standardized input data frames, and sending them in real time to the real-time control hardware module via a high-speed serial communication interface (921600 baud rate, 8 data bits, 1 stop bit, no parity), ensuring the integrity and standardization of the data received by the hardware.

[0085] In the data feedback and closed-loop scheduling process, the interface coordination module receives composite output data frames from the real-time control hardware module, parses and deframes the data frames, and accurately extracts the encapsulated current cycle control commands and telemetry data. The parsed autonomous driving control commands are then immediately sent to the vehicle dynamics simulation module to drive the next cycle's iterative vehicle dynamics calculations, forming a complete closed-loop simulation logic.

[0086] Meanwhile, the interface coordination module is equipped with a high-precision timing synchronization unit to collect vehicle response data output by the vehicle dynamics simulation module and computational telemetry data output by the real-time control hardware module in real time. Each set of collected data is marked with a unified synchronization timestamp to avoid timing misalignment between simulation data and actual hardware measurement data. Finally, the module performs timing alignment, data matching, and classification storage on the two types of timestamped data, providing a standardized timing dataset for subsequent control performance calculations, real-time index analysis, and load characteristic analysis.

[0087] Real-time control hardware module: In this embodiment, the real-time control hardware module uses the TIC2000 series F28P55X industrial-grade real-time microcontroller, equipped with a high-precision hardware timing unit. It can run various autonomous driving test control algorithms (model predictive control, PID control, linear quadratic control, intelligent control algorithms with neural network inference, etc.). It is the core execution hardware for control calculation, real-time detection, load quantization, and data feedback, and has high-precision real-time calculation and performance self-testing capabilities.

[0088] Hardware data preprocessing and state compensation: The real-time control hardware module receives input data frames from the interface coordination module byte by byte, performs frame-by-frame de-framing, byte reassembly, and parameter restoration, re-parses the split byte data into 32-bit single-precision floating-point vehicle original state parameters, and uniformly performs physical dimension calibration. Addressing the fixed timing lag issue caused by serial communication transmission and algorithm computation, the module performs high-precision kinematic extrapolation calculations on the calibrated vehicle original state parameters based on a preset compensation duration, correcting state lag errors and obtaining vehicle compensation state quantities that closely match the current real simulation moment. This effectively improves the state input accuracy and closed-loop control accuracy of the autonomous driving control algorithm.

[0089] Control calculation and duration acquisition: Based on the corrected vehicle compensation state variables, the module runs the tested autonomous driving control algorithm in its entirety, completing control calculations such as trajectory tracking, attitude correction, and vehicle speed adjustment, and outputting precise control commands for the current control cycle. Simultaneously, relying on the hardware timing unit, the module performs phased timing of the entire control algorithm process, collecting the execution time of each sub-stage (such as the neural network inference sub-stage, error calculation sub-stage, and instruction solving sub-stage) and the total execution time of the entire algorithm process, accurately recording the timing consumption data of the hardware computation.

[0090] Real-time performance and load calculation: The module has built-in load and real-time judgment logic. Combining the execution time of each sub-stage, the total execution time, and the system's preset control cycle time, it calculates the hardware load rate of each control sub-stage and the overall system load rate using the load calculation formula. At the same time, it compares the total execution time with the control cycle cutoff threshold to accurately determine whether the current control cycle's execution cutoff period is met. Finally, it integrates all duration data, load data, and cutoff period judgment results to generate standardized hardware calculation telemetry data.

[0091] Data encapsulation and feedback stage: The real-time control hardware module encapsulates the autonomous driving control commands and all generated telemetry data of the current cycle, combines them into a composite output data frame according to the preset 11-field frame format, and uses the little-endian floating-point byte conversion rule to ensure data format uniformity. Finally, the composite output data frame is fed back to the interface coordination module in real time to complete the single-cycle hardware operation and data interaction process, and waits for the input data frame of the next cycle to trigger iterative operation.

[0092] The device's three main modules form a closed-loop data link: simulation output, data relay, hardware calculation, command feedback, and simulation iteration. This link is characterized by rigorous timing logic and precise data correlation. The raw state data output by the vehicle dynamics simulation module is organized and packaged by the interface coordination module, providing algorithm input to the real-time control hardware module. After completing state compensation, control calculation, and performance self-testing, the real-time control hardware module sends back control commands and telemetry data. The interface coordination module, on the one hand, forwards control commands to drive simulation iteration; on the other hand, it simultaneously collects and aligns simulation response data with actual hardware measurement data, enabling simultaneous verification of autonomous driving control performance, real-time hardware computing performance, and system load characteristics.

[0093] based on Figure 2 Figure 3 The experimental platform is built using the architecture shown, and the technical effects of the verification method and device of this invention are explained by combining simulation and physical hardware-in-the-loop experiments.

[0094] This experimental platform adopts the three-layer architecture disclosed in the first embodiment of the present invention: a vehicle dynamics simulation terminal, an interface coordination terminal, and a real-time control hardware terminal. The functions, data interaction logic, data frame definitions, kinematic extrapolation compensation rules, timing and load, and deadline determination calculation rules for each terminal are all described in the first embodiment and will not be repeated here. The tested object can be adapted to various autonomous vehicle control algorithms, such as model predictive control, linear quadratic optimal control, PID control, and intelligent control with neural network inference. This experiment exemplarily uses the DHAMPC algorithm for testing.

[0095] The hardware and software configuration for this experiment is as follows: the vehicle dynamics simulation terminal uses CarSim dynamics simulation software, the interface coordination terminal uses the MATLAB / Simulink real-time simulation platform, the real-time control hardware uses the TIC2000 series F28P55X microcontroller, and the development and debugging environment uses CodeComposerStudio. Serial communication is used between the interface coordination terminal and the real-time control hardware, with the following communication parameters: baud rate 921600, 8 data bits, 1 stop bit, no parity, little-endian byte order. All of the above hardware and software can be replaced with equivalent components possessing the same vehicle dynamics simulation, serial interface communication, and real-time control computation capabilities without affecting the core implementation logic of this invention.

[0096] Based on the aforementioned closed-loop verification architecture, comparative verification experiments were conducted under multiple control frequencies and multiple input disturbance conditions. Three typical control frequencies—20Hz, 50Hz, and 100Hz—were selected for the experiments, corresponding to control periods of 50ms, 20ms, and 10ms, respectively. For each control frequency, the following steps were performed: Figure 1The complete hardware-in-the-loop verification process is shown, synchronously collecting experimental data such as vehicle trajectory, lateral position error, heading response characteristics, lateral acceleration, control sub-stage execution time, complete control program execution time, control sub-stage hardware load, and overall system hardware load; the MATLAB / Simulink simulation model architecture is as follows. Figure 2 As shown, the physical hardware-in-the-loop experimental platform and test scenarios are as follows: Figure 3 As shown.

[0097] The verification processing unit batch calculates the quantitative indicators of vehicle control performance for different control frequency conditions, and compares the complete execution time of the control program with the corresponding control cycle threshold to complete the real-time constraint verification. Under the given operating conditions, F28P55X hardware platform and corresponding program version conditions of this experiment, the average execution time of the neural network inference stage of the tested algorithm is 26.72-26.80μs, and the peak execution time is 32.01-32.13μs; the complete calculation time of the control program and the CPU hardware load show regular fluctuations with the control frequency.

[0098] Further verification under input disturbance conditions was conducted: at least one vehicle state variable, including lateral position, lateral velocity, and yaw rate, was selected and superimposed with a random disturbance signal having a preset mean and a preset variance to simulate external input disturbances such as sensor noise. The experiment maintained the original data frame format, timing alignment rules, and data recording logic. By comparing the control performance indicators before and after the disturbance application with the results of satisfying real-time hardware execution constraints, the differential impact of input disturbances on closed-loop control performance and hardware computation real-time performance can be quantitatively distinguished.

[0099] The verification and evaluation index system adopted in this experiment is divided into two main categories: control performance indexes and real-time execution indexes. Control performance indexes include at least one of the following: maximum lateral error, error convergence time, yaw response characteristics, and lateral acceleration. Real-time execution indexes include at least one of the following: execution time of control sub-stages, execution time of the complete control program, system hardware load, and execution deadline satisfaction status. This is to achieve a comprehensive joint verification of the algorithm's control effect and the hardware's real-time execution capability.

[0100] Based on the Carsim vehicle dynamics simulation model shown in Figures a-i, this paper provides a complete explanation of the vehicle trajectory tracking and yaw stability control simulation example from three dimensions: vehicle basic parameters, controller interface, and simulation animation conditions. The specific implementation content is as follows.

[0101] Basic parameters for vehicle dynamics simulation; This simulation uses Carsim to build a whole vehicle dynamics model, with core vehicle parameters and tire dynamics parameters corresponding to... Figure 4h , Figure 4iThe specific parameter configuration is as follows, which provides basic data support for vehicle dynamics simulation.

[0102] Basic parameters of the vehicle ( Figure 4h The simulation model uses a standard dynamics model of a Class B four-wheeled passenger vehicle. Core structural and mass dynamic parameters are: wheelbase 2600 mm, body width 1889 mm, sprung mass 1110 kg; longitudinal distance of the sprung center of gravity from the front axle 1040 mm, center of gravity height 540 mm. Vehicle rotational inertia parameters are: roll moment of inertia 440.6 kg·m², pitch moment of inertia 1343.1 kg·m², yaw moment of inertia 1343.1 kg·m², accurately matching the dynamic characteristics of a typical family passenger vehicle.

[0103] Tire dynamic parameters ( Figure 4i The vehicle's dynamic tire specifications are 185 / 65 R15, with an effective rolling radius of 298 mm, a single tire mass of 18 kg, and a vertical stiffness of 232 N / mm, providing accurate basic parameter support for the simulation of the vehicle's lateral dynamics, vertical load transfer, and adhesion characteristics.

[0104] Controller bidirectional closed-loop interface configuration; This simulation uses a bidirectional closed-loop co-simulation interface between Carsim and Matlab / Simulink to implement closed-loop control logic for uplink feedback of vehicle status information and downlink execution of control commands. The interface transmission mechanism and variable definitions are as follows. Figure 4f , Figure 4g It achieves vehicle trajectory tracking and yaw stability control through precise variable interaction.

[0105] Vehicle status uplink output interface ( Figure 4g The Carsim vehicle model outputs core feedback variables such as the vehicle's motion state and road surface adhesion state to the Simulink controller in real time. Based on these state variables, the controller calculates the lateral tracking error, heading error, and centroid sideslip angle. Combined with road surface adhesion constraints, it completes the coordinated control of trajectory tracking and yaw stability. The physical meaning of each output interface variable and the application of the controller are shown in the table below.

[0106] Interface variables Physical meaning Uses in controllers Xo Vehicle global longitudinal position Determining the vehicle's real-time position within the Dual Lane Change (DLC) path provides a basis for trajectory tracking and baseline positioning. Yo Vehicle global lateral position Real-time calculation of vehicle trajectory lateral tracking error provides feedback for lateral displacement correction control. Yaw Yaw angle / vehicle heading angle Calculate vehicle heading deviation, correct driving attitude, and ensure trajectory and heading consistency. Vx vehicle longitudinal speed Used for predicting dynamic model parameters, control gain scheduling, and longitudinal velocity closed-loop feedback control. Steer_SW Steering wheel angle Collect the driver's steering intention, or use it as a reference input for steering control. Vy Vehicle lateral speed Real-time calculation of vehicle center of gravity sideslip angle to determine vehicle lateral stability. AVz yaw rate The core feedback quantity of vehicle yaw stability closed-loop control is used to suppress yaw attitude instability. Ay lateral acceleration Characterizes the vehicle's steering response characteristics and tire-road grip utilization, constraining lateral dynamic limits. MuX_L1 Left front wheel longitudinal road adhesion coefficient Achieve road surface adhesion state recognition, adaptive adjustment of control gain, and calculation of tire force constraints. Control command downlink input interface ( Figure 4f After the Simulink controller completes the control algorithm calculation, it outputs vehicle speed commands and four-wheel independent steering angle commands through the downlink interface. The Replace mode is used to directly overwrite the corresponding variables inside Carsim, realizing precise closed-loop control of vehicle speed and four-wheel steering. The physical meaning, initial value and control function of each input interface variable are shown in the table below.

[0107] Interface variables Physical meaning initial value effect IMP_SPEED Vehicle speed input command 70 Set and cover the vehicle's driving speed to ensure constant speed operation throughout the simulation. IMP_STEER_L1 First axle left wheel rotation command 0 Achieve independent steering control for the left front wheel and complete lateral trajectory correction. IMP_STEER_R1 First axle right wheel rotation command 0 Achieve independent steering control of the right front wheel and coordinate steering actions. IMP_STEER_L2 Second axle left wheel rotation command 0 Achieve independent steering control for the left rear wheel and optimize overall vehicle yaw stability. IMP_STEER_R2 Second axle right wheel rotation command 0 Achieve independent steering control for the right rear wheel to suppress overshoot and oscillation of vehicle body posture. Analysis of Dual Line-Changing (DLC) Simulation Conditions and Animation Process; This simulation uses the classic Double Lane Change (DLC) maneuvering scenario, with the vehicle set to a constant speed of 70 km / h. The road surface adhesion coefficient is set with segmented abrupt changes: the coefficient is 0.85 in the high-adhesion section, then drops abruptly to 0.5 in the low-adhesion section; after the vehicle passes through the low-adhesion section, the coefficient returns to 0.85. Combined with... Figure 4a – Figure 4e The simulation animation illustrates the vehicle's dynamic response and the controller's control effect in stages.

[0108] Initial entry phase ( Figure 4a The vehicle is in the initial driving phase of a double lane change maneuver, traveling entirely on a high-adhesion main road surface with a road adhesion coefficient maintained at 0.85. Under the control of the controller, the vehicle initiates a lane cut-in maneuver, smoothly turning towards the target lane, gradually establishing lateral velocity, yaw rate, and lateral acceleration, while the vehicle body synchronously generates a lateral tilt movement matching the steering posture. During this phase, the road surface adhesion is sufficient, and the tire lateral force margin is large. Relying on ample tire force reserves, the controller quickly completes the initial lateral displacement, realizing the basic action of the vehicle cutting into the target lane, laying the foundation for subsequent lane-changing maneuvers.

[0109] Lane change and reverse steering phase ( Figure 4b After the vehicle completes its initial lateral entry, it initiates a lane-out maneuver with reverse steering, preparing to leave the target lane and return to the main road. At this point, the vehicle has traveled approximately 62 meters and entered a low-adhesion surface area, where the road adhesion coefficient drops abruptly from 0.85 to 0.5. Due to the degraded road adhesion, the tire's maximum available lateral force is significantly reduced, and the lateral force safety margin is substantially decreased. During this phase, the controller must precisely coordinate the vehicle's yaw motion and lateral displacement changes under limited adhesion conditions to effectively suppress overshoot of the vehicle's posture during reverse steering and ensure a smooth transition in lane changes.

[0110] Low adhesion path correction stage ( Figure 4c The vehicle continuously travels on a low-adhesion road section for approximately 103 meters, with the road adhesion coefficient remaining stable at 0.5. This is the most challenging stage for lateral stability control in this DLC scenario. Under this condition, the vehicle must simultaneously meet dual control requirements: first, maintain a stable reverse lateral force to ensure the vehicle has the trajectory correction capability to return to the main road; second, precisely constrain the yaw rate, center of gravity sideslip angle, and body roll amplitude as they continuously increase to avoid lateral instability risks. During this process, the wheel steering angle, body lateral acceleration, overall vehicle yaw rate, and wheel vertical load continuously and dynamically change, fully demonstrating the complex dynamic characteristics of vehicle path correction and axle load transfer coupling under low-adhesion road conditions, as well as the dynamic adjustment capability of the controller.

[0111] High adhesion return to normal transition stage ( Figure 4d The vehicle has traveled 120 m on a low-adhesion section, and has now traveled approximately 165 m. The road surface adhesion coefficient has recovered to 0.85, and the tire lateral force output capability has fully recovered. Relying on the restored road surface adhesion reserve, the controller continuously optimizes its control output, gradually eliminating the vehicle's lateral position and heading errors, and driving the vehicle smoothly back to the center of the main road. This stage primarily assesses the controller's adaptive adjustment performance, focusing on verifying whether the controller can smoothly return the vehicle to its correct posture after the adhesion conditions are restored, avoiding secondary yaw oscillations caused by excessive steering correction and control gain mismatch.

[0112] The operating condition convergence and stabilization phase ( Figure 4e The vehicle traveled approximately 194 meters, entirely on a high-friction surface, and completed the double lane change and straightening maneuvers. The vehicle then proceeded straight along the main road at a constant speed, with the steering control input gradually returning to zero. Yaw rate, lateral acceleration, and body roll angle all converged rapidly and remained stable, and the vertical loads on the left and right wheels returned to equilibrium. This stage was used to comprehensively evaluate the steady-state convergence performance of the controller, verifying whether the vehicle could recover a stable driving state after experiencing low-friction surface disturbances and complex lane-change dynamics impacts, while keeping trajectory and attitude errors within reasonable limits, thus completing the stable closed-loop operation for the entire DLC scenario.

[0113] The above are merely preferred embodiments of the present invention and do not limit the scope of the patent. Any equivalent structural or procedural transformations made based on the description and drawings of the present invention, or direct or indirect applications in other related technical fields, are similarly included within the scope of patent protection of the present invention.

Claims

1. A hardware-in-the-loop simulation verification method for autonomous driving, characterized in that, include: The vehicle dynamics simulation terminal updates the vehicle dynamics model based on the control commands output in the previous control cycle, and outputs the vehicle state parameters and environmental state parameters for the current control cycle. The interface coordination end performs parameter packaging and framing on the vehicle status parameters and environmental status parameters according to the preset field sorting rules, generates input data frames, and sends them to the real-time control hardware. The real-time control hardware performs frame de-framing and parameter restoration processing on the received input data frames, and performs kinematic extrapolation calculations on the vehicle state parameters based on a preset compensation duration to obtain the compensation state quantity; The real-time control hardware uses the compensation state variables to run the control algorithm under test, outputs the control command for the current control cycle, and collects the execution time of each sub-stage of the control calculation as well as the total execution time of the entire process. Based on the execution duration of each sub-stage, the total execution duration, and the control cycle duration, the sub-stage load, system load, and execution deadline satisfaction status are calculated, and telemetry data is generated. The control command and the calculated telemetry data are encapsulated into a composite output data frame and sent back to the interface coordination end. The interface coordination end parses the control command from the composite output data frame and sends the control command to the vehicle dynamics simulation end. The vehicle dynamics simulation terminal generates vehicle response data in response to the control command, and the interface coordination terminal synchronously collects and records the vehicle response data and calculates telemetry data carrying synchronization timestamps. The interface coordination terminal performs time-series alignment processing on the vehicle response data carrying synchronization timestamps and the calculated telemetry data, calculates the control performance indicators and the results of real-time execution constraint satisfaction, and completes the hardware-in-the-loop simulation verification of autonomous driving.

2. The method according to claim 1, characterized in that, The vehicle state parameters output by the vehicle dynamics simulation terminal include: Vehicle longitudinal position, vehicle lateral position, vehicle heading angle, vehicle longitudinal velocity, steering wheel steering amount, vehicle lateral velocity, vehicle yaw rate, and vehicle lateral acceleration; The environmental condition parameters include the road surface adhesion coefficient; The vehicle state parameters are used by the real-time control hardware to perform kinematic extrapolation calculations.

3. The method according to claim 2, characterized in that, Before generating an input data frame from the vehicle state parameters, a random disturbance signal with a preset mean and a preset variance is superimposed on at least one of the vehicle state parameters. After completing the simulation verification, the control performance indicators obtained before and after the disturbance are compared with the results of real-time execution constraint satisfaction, and the quantitative evaluation results of the closed-loop response characteristics of the hardware-in-the-loop system are obtained.

4. The method according to claim 2, characterized in that, The kinematic extrapolation calculation includes: Based on the vehicle's longitudinal speed, the vehicle's lateral speed, the vehicle's heading angle, and a preset compensation time, extrapolation calculations are performed on the vehicle's longitudinal position and the vehicle's lateral position to obtain the compensated longitudinal position and lateral position. Based on the vehicle body yaw rate and the preset compensation duration, an extrapolation calculation is performed on the vehicle body heading angle to obtain the compensated vehicle body heading angle.

5. The method according to claim 1, characterized in that, Both the input data frame and the composite output data frame are encapsulated using single-precision floating-point data fields. The data sending end breaks down each single-precision floating-point field into multi-byte data and sends it according to a preset standard byte order; The data receiving end matches the same byte order rules, reassembles and restores the received multi-byte data, and obtains the original single-precision floating-point value.

6. The method according to claim 5, characterized in that, The encapsulation data of the composite output data frame also includes: The parameters include target longitudinal velocity, steering control command, lateral position error, heading angle error, intermediate state parameters of control algorithm, execution time of each control calculation sub-stage, control calculation time of non-target sub-stages, sub-stage load, calculation load of other modules, and system load.

7. The method according to claim 1, characterized in that, The acquisition and control calculation includes the execution time of each sub-stage and the total execution time, including: At the start and end times of each target control calculation sub-stage, the count value of the hardware decrement timing unit is read respectively; Based on the difference between the two count values ​​and the inherent clock frequency of the hardware, the execution time of the corresponding sub-stage is calculated. Using the same timing logic, the execution time of a single complete control calculation process is collected.

8. The method according to claim 6 or 7, characterized in that, The calculations for the sub-stage execution duration, the total process execution duration, the sub-stage load, the system load, and the execution deadline satisfaction status include: The ratio of the execution duration of the sub-stage to the duration of the current control cycle is used as the load of the sub-stage. The ratio of the total process execution time to the current control cycle duration is used as the system load. When the total execution time of the process is less than or equal to the current control cycle time, the execution deadline is deemed to be satisfied; otherwise, it is deemed not to be satisfied.

9. The method according to claim 1, characterized in that, It also includes configuring at least two different control cycle durations for simulation verification; By comparing the control performance indicators, total process execution time, system load, and execution deadline satisfaction status corresponding to different control cycle durations, real-time performance verification results under multiple operating conditions are obtained.

10. An autonomous driving hardware-in-the-loop simulation verification device, characterized in that, include: Vehicle dynamics simulation module, interface coordination module, and real-time control hardware module; The vehicle dynamics simulation module is used to update the vehicle dynamics model based on the control commands output in the previous control cycle, and output the vehicle state parameters and environmental state parameters in the current control cycle. The interface coordination module is used to perform parameter packaging and framing on the vehicle status parameters and environmental status parameters according to a preset field sorting rule, generate input data frames, and send them to the real-time control hardware module. The real-time control hardware module is used to perform frame de-framing and parameter restoration processing on the received input data frames, and to perform kinematic extrapolation calculation on the vehicle state parameters based on a preset compensation duration to obtain the compensation state quantity. The real-time control hardware module is also used to run the control algorithm under test using the compensation state quantity, output the control command of the current control cycle, and collect the execution time of each sub-stage of the control calculation and the execution time of the whole process. The real-time control hardware module is also used to calculate the sub-stage load, system load, and execution deadline satisfaction status based on the execution duration of each sub-stage, the total execution duration, and the control cycle duration, and generate telemetry data. The real-time control hardware module is also used to encapsulate the control command and the calculated telemetry data into a composite output data frame and send it back to the interface coordination module. The interface coordination module is also used to parse control commands from the composite output data frame and send the control commands to the vehicle dynamics simulation module; The vehicle dynamics simulation module is also used to generate vehicle response data in response to the control command; the interface coordination module is also used to synchronously collect and record vehicle response data carrying a synchronization timestamp and calculate telemetry data. The interface coordination module is also used to perform time-series alignment processing on vehicle response data carrying synchronization timestamps and calculated telemetry data, calculate control performance indicators and real-time execution constraint satisfaction results, and complete the hardware-in-the-loop simulation verification of autonomous driving.