Automatic driving vehicle dynamics modeling method based on time-varying parameter neural network
By introducing a vehicle dynamics modeling method based on time-varying parameter neural networks, physical constraints and time-varying parameters are introduced, which solves the problem of insufficient accuracy of existing models in complex environments, realizes adaptive and consistent prediction in variable environments, and improves the performance of autonomous vehicle dynamics modeling.
Patent Information
- Application Number
- CN202511693253.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-18
- Publication Date
- 2026-02-17
AI Technical Summary
Existing vehicle dynamics modeling methods struggle to maintain accuracy in complex road conditions and variable environments, and purely data-driven models lack physical constraints, leading to inconsistent prediction results and insufficient generalization ability.
A modeling method based on time-varying parameter neural networks is adopted. By acquiring vehicle operating data under different working conditions, a neural network model is constructed after preprocessing. Physical constraints and time-varying parameters are introduced, and time-series features are extracted using GRU networks. Bounded mapping is performed through a physical constraint layer, and state prediction is performed in combination with dynamic equations.
It significantly improves the model's generalization and robustness under unseen or rare conditions, ensures the consistency and physical rationality of prediction results, reduces the dependence on large-scale labeled data, adapts to changes in road surface or load, and improves the performance and practicality of dynamic modeling for autonomous vehicles.
Smart Images

Figure CN121543653A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of vehicle dynamics, specifically relating to a dynamic modeling method for autonomous vehicles based on time-varying parameter neural networks. Background Technology
[0002] Vehicle dynamics is the science that studies the motion of vehicles under the influence of the external environment and the force relationships they experience. It typically involves the coupling relationship between the vehicle's longitudinal, lateral, and yaw motions and factors such as tires, road surface, steering, and braking. Vehicle dynamics modeling, on the other hand, uses mathematical or computational models to characterize these motions, describing the vehicle's dynamic behavior under different driving tasks and road conditions. In the field of autonomous driving, vehicle dynamics modeling is a core component of control and simulation systems. Its accuracy and robustness directly determine the autonomous driving system's ability to predict vehicle states and its control effectiveness, thus affecting the vehicle's safety, comfort, and stability in complex traffic environments.
[0003] Existing vehicle dynamics modeling methods are mainly divided into two categories: one is analytical modeling methods based on traditional dynamic equations, such as two-degree-of-freedom or seven-degree-of-freedom vehicle models. These methods have strong physical interpretability, but often rely on simplification assumptions and are difficult to maintain accuracy in complex road conditions and variable environments. The other category is data-driven modeling methods that rely on technologies such as neural networks and deep learning to predict vehicle states. These methods can fit nonlinear relationships, but lack physical constraints and are prone to overfitting or uninterpretable prediction results.
[0004] For example, Chinese patent application CN113386781A (application number 202110563037.5) discloses an intelligent vehicle trajectory tracking control method based on a data-driven vehicle dynamics model. Its main contents are: obtaining a vehicle dynamics dataset containing information such as vehicle state and control input through high-fidelity vehicle experiments (e.g., simulations) or actual unmanned vehicle experiments; designing a neural network vehicle dynamics model (NNVM) based on the idea of time-delay feedback and the principle of neural network nonlinear modeling, which uses multi-time-step control inputs, delayed states, and their derivatives as input information; training the designed neural network model using the dataset, with its loss function mainly based on the error between the predicted state and the actual state (data error term) to minimize model prediction bias; and finally applying the trained model to the design of a trajectory tracking controller.
[0005] For example, patent document CN118194442A (application number 202410467920.8) proposes a data-driven modeling method based on a non-autoregressive decoder. It directly outputs the corresponding longitudinal velocity, center of gravity sideslip angle, and lateral acceleration data by inputting the current longitudinal force, lateral force, and yaw moment data, which are used to control the working state of the vehicle.
[0006] Although the two closest technical solutions mentioned above differ in network structure and specific applications, they are essentially both purely data-driven methods, sharing the following common characteristics and key technical shortcomings: 1) Pure data-driven structure: Model training relies solely on minimizing the error of the observed data, lacking the technical feature of incorporating vehicle dynamics equations as constraints into the loss function.
[0007] 2) Static parameter assumptions: The model usually treats key parameters of vehicle dynamics (such as tire lateral stiffness and vehicle mass distribution) as fixed constants, and cannot achieve online dynamic estimation of these parameters to adapt to changes in road surface or load.
[0008] These shortcomings directly lead to purely data-driven models being prone to producing physically inconsistent or uninterpretable predictions during training, and limit the model's generalization ability and robustness under variable and complex conditions. Summary of the Invention
[0009] In view of the shortcomings of the prior art, the purpose of this invention is to provide a dynamic modeling method for autonomous vehicles based on time-varying parameter neural networks, which solves the problems in the prior art.
[0010] The objective of this invention can be achieved through the following technical solutions: The method for dynamic modeling of autonomous vehicles based on time-varying parameter neural networks includes the following steps: Acquire vehicle operating data under different working conditions and label time-varying parameters; Vehicle operation data is preprocessed and a sample set is constructed by slicing it according to time series. A neural network model is constructed based on physical constraints and time-varying parameters; The neural network model is trained and validated using a sample set to obtain a parameter-optimized neural network model for state prediction. The neural network model includes an input layer, a GRU network, a physical constraint layer, and an output layer. Input data enters the neural network model through the input layer and undergoes dimensionality transformation and temporal packaging via a linear embedding layer. Temporal features are then extracted through the GRU network, and the output vector of the GRU network is bounded through a physical constraint layer to obtain time-varying parameter estimates. Substituting the time-varying parameter estimates into the vehicle dynamics equations Calculations are performed to obtain the physical prediction state. And output by the output layer.
[0011] Furthermore, vehicle operation data includes: Vehicle driving status information: used to describe the dynamic performance of the vehicle under different operating conditions, including: longitudinal speed, lateral speed, yaw rate, longitudinal and lateral acceleration, steering wheel angle, braking force and driving force; Environmental parameter information: used to describe the driving environment of the vehicle, including: road surface adhesion coefficient, road slope, road curvature and weather conditions; Vehicle structural parameter information: used to describe the characteristics of the vehicle body and tires, including: vehicle mass, center of gravity position, tire lateral stiffness and suspension stiffness.
[0012] Furthermore, the data preprocessing steps include: The moving average filtering method is used to denoise the vehicle operation data, and then the linear interpolation method is used to synchronize the vehicle operation data. The data after denoising and synchronization is normalized, and key features are extracted based on vehicle dynamics equations to construct a sample set.
[0013] Furthermore, the formula for performing a bounded mapping on the output vector of the GRU network is: in, This is the output vector of the GRU network. For the Sigmoid function, , These are the upper and lower bounds of the parameter.
[0014] Furthermore, the vehicle dynamics equations are expressed as follows: in, For the physical prediction state, For state vectors, For the input vector, A set of known or measurable constant coefficients. These are time-varying parameters; For longitudinal velocity, For lateral velocity, This refers to the yaw rate; As the driving force, This refers to the steering angle of the front wheels.
[0015] Furthermore, the input to the neural network model is a historical segment with a length of [missing information]. The state-control sequence is denoted as: .
[0016] Furthermore, the loss function during the training process of the neural network model for: in, This is the total loss function; For data loss, measure the first... The error between the measured next state of a sample and the physical state prediction obtained from the vehicle dynamics equations; The weighting coefficient for the physical loss term; This is the physical loss item; These are the weighting coefficients for the smoothing loss term; To smooth out the loss term; These are the weighting coefficients for the regularization loss term, balancing model complexity and fitting performance; This is the regularization loss term; The batch size; For the first One sample in The state vector at any given time; For the first A sample at time... The input vector; These are fixed parameters for vehicle dynamics; For the first One sample in The estimated time-varying parameters at time t; For the first One sample in The estimated time-varying parameters at time t; This is the nominal value of the coefficient.
[0017] An autonomous vehicle dynamics modeling system based on time-varying parameter neural networks includes: Data acquisition module: Acquires vehicle operating data under different working conditions and labels time-varying parameters; Data processing module: preprocesses vehicle operation data and constructs a sample set by slicing it according to time series. Model building module: Constructs neural network models based on physical constraints and time-varying parameters; Model training module: Uses a sample set to train and validate the neural network model, resulting in a parameter-optimized neural network model for state prediction; The neural network model includes an input layer, a GRU network, a physical constraint layer, and an output layer. Input data enters the neural network model through the input layer and undergoes dimensionality transformation and temporal packaging via a linear embedding layer. Temporal features are then extracted through the GRU network, and the output vector of the GRU network is bounded through a physical constraint layer to obtain time-varying parameter estimates. Substituting the time-varying parameter estimates into the vehicle dynamics equations Calculations are performed to obtain the physical prediction state. And output by the output layer.
[0018] A computer storage medium storing a readable program that, when executed, instructs a computing device to perform the above-described method for modeling the dynamics of autonomous vehicles based on a time-varying parameter neural network.
[0019] An electronic device includes: a processor, a memory, a communication interface, and a communication bus, wherein the processor, the memory, and the communication interface communicate with each other through the communication bus; The memory is used to store at least one executable instruction, which causes the processor to perform operations corresponding to the above-described method for modeling the dynamics of autonomous vehicles based on time-varying parameter neural networks.
[0020] The beneficial effects of this invention are: 1. The invention focuses on time-varying parameter modeling: It treats dynamic parameters such as tire lateral stiffness, road surface adhesion coefficient, and load distribution as quantities that dynamically change with time and operating conditions. By temporally encoding historical state-control sequences, these parameters are estimated in real time and injected into the dynamic equations, fundamentally solving the problem of "model mismatch caused by parameter changes with operating conditions." Therefore, it can be deduced that when road surface, load, or tire conditions undergo abrupt changes, time-varying parameters can instantly reflect these physical changes, enabling predictions to adapt in short timescales and maintain consistency in long timescales. This significantly improves the model's generalization and robustness under unseen or rarely seen operating conditions. 2. This invention, by setting physical constraints (dynamic equations + PhysicsGuard + smoothing regularization), enables the network to learn complex nonlinearities in the data while simultaneously satisfying the physical boundaries of mechanical relationships and parameters. Therefore, it can be deduced that: physical priors suppress the non-physical understanding and overfitting tendency of black-box networks; smoothing terms avoid high-frequency fluctuations in parameter estimation; and PhysicsGuard ensures that parameters remain within a reasonable range. In summary, physical constraints, as structural priors, reduce the network's degrees of freedom, thereby significantly reducing reliance on large-scale, high-cost labeled data. Especially under extreme or dangerous conditions, reliable modeling can be achieved with fewer simulations / a small number of real-vehicle samples, meeting the dual requirements of safety and engineering feasibility.
[0021] 3. This invention effectively improves data quality and eliminates noise interference in time-varying parameter estimation through preprocessing steps such as moving average filtering for noise reduction, linear interpolation synchronization, normalization, and extraction of key features based on dynamic equations. This ensures the consistency of data time series and the effectiveness of features. The high-quality sample set enables the subsequent GRU network to encode historical state-control sequences more accurately and to estimate time-varying parameters more reliably. This allows the time-varying parameters injected into the dynamic equations to reflect changes in physical properties in real time, significantly improving the model's adaptability in short time scales and its consistency in long time scales.
[0022] 4. The multi-objective loss function employed in this invention constrains and optimizes the model from four dimensions: data fitting accuracy, physical constraint satisfaction, time-varying parameter smoothness, and model generalization ability. Data loss ensures the model's accuracy in fitting the measured data; physical loss ensures the model follows dynamic laws; smoothing loss avoids high-frequency fluctuations in parameter estimation; and regularization loss improves the model's generalization ability. This comprehensive constraint enables the trained model to accurately fit the data, maintain physical rationality, and possess good stability, allowing reliable operation even under extreme conditions. This comprehensively improves the performance and practicality of dynamic modeling for autonomous vehicles. Attached Figure Description
[0023] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0024] Figure 1 This is a flowchart of the autonomous vehicle dynamics modeling method of the present invention; Figure 2 This is a schematic diagram of a bicycle model; Figure 3 This is a diagram of the neural network architecture of the present invention; Figure 4 This is the actual control effect of the model constructed in the path tracking task. Detailed Implementation
[0025] 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 some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0026] Example 1 The method for dynamic modeling of autonomous vehicles based on time-varying parameter neural networks includes the following steps: S1, acquire vehicle operating data under different working conditions and label time-varying parameters; First, it is necessary to acquire the vehicle's operating data under different working conditions, and to declare the vehicle's dynamic state under specific environmental and control input conditions. Vehicle operating data includes: vehicle driving status information, environmental parameter information, and vehicle structural parameter information.
[0027] Among them, driving status information is a description of the dynamic performance of the vehicle under different operating conditions. The driving status information includes: longitudinal speed, lateral speed, yaw rate, longitudinal and lateral acceleration, steering wheel angle, braking force and driving force, etc.
[0028] Environmental parameter information describes the driving environment of a vehicle, including factors such as road surface adhesion coefficient, road slope, road curvature, and weather conditions.
[0029] Vehicle structural parameter information describes the characteristics of the vehicle body and tires. The structural parameter information includes: vehicle mass, center of gravity position, tire lateral stiffness, suspension stiffness, etc.
[0030] For parameters that change over time or under operating conditions (such as tire lateral stiffness, load coefficient, road adhesion coefficient, etc.), they need to be labeled and recorded during data collection to serve as inputs for time-varying parameters in subsequent modeling processes.
[0031] S2, preprocess the vehicle operation data and construct a sample set by time series slicing; Data preprocessing steps include: S21, Denoising and synchronizing the original vehicle operation data to ensure sample consistency; details are as follows: Vehicle operation data is collected from multiple sources, including speed sensors, inertial measurement units, and wheel speed sensors. Due to noise interference during sensor measurements, a moving average filter is used to smooth the raw data. Let the raw signal be... Window length is The filtered signal for: The formula calculates the signal at the current moment. and the preceding consecutive The simple average of the original signal values at each moment. By averaging the sampled values within a certain window, random noise with large instantaneous changes (high frequency) can be effectively reduced.
[0032] Because multiple sensors on a vehicle may acquire data asynchronously or at different frequencies, their measurement data may deviate along the timeline. Data synchronization aims to ensure that data from different sensors correspond at the same moment, thereby guaranteeing the temporal consistency of data samples and enabling accurate fusion analysis of multi-source data. For data synchronization, a uniform sampling interval is set, and all signals are resampled to a discrete-time series according to timestamps. For missing sampling points, linear interpolation is used: in, To represent the signal in continuous time The value at that point is the signal value obtained after linear interpolation; Represents the signal at discrete time points The original sampled value at the location; Represents the signal at discrete time points The original sampled value at the next discrete time point; This represents a continuous-time variable, with values ranging from 1 to 2. That is, any time between two discrete time points; Indicates the first The timestamps of discrete-time sampling points. Linear interpolation assumes that between two adjacent known sampling points... and Between these points, the signal changes uniformly and linearly. Using this formula, the target time can be determined. With known sampling time The distance is used to calculate the estimated value of the missing points proportionally, thereby smoothly and accurately filling in the data and ultimately ensuring that the data collected by different sensors are consistent at the same time.
[0033] S22, normalize the denoised and synchronized data, and extract key features based on vehicle dynamics equations to construct a sample set, and then divide the sample set into training set, validation set and test set; After denoising and synchronization, the physical quantities are standardized. Let the original value of a certain feature be... Its mean and standard deviation are respectively , Centering is achieved by subtracting the mean, and scaling is achieved by dividing by the standard deviation. Normalized features It follows a standard normal distribution (mean 0, standard deviation 1). Then the normalized characteristics are: While normalizing, key features are extracted based on vehicle dynamics equations; vehicle dynamics equations have different forms depending on the dynamics model, such as... Figure 2 The image shows a widely used two-degree-of-freedom model (bicycle model).
[0034] In this invention, a bicycle model is used as the dynamic model assumption. In the bicycle model, the front and rear wheel slip angles are... , The calculation is as follows: in, For the front wheel steering angle, , These are the longitudinal velocity and the lateral velocity, respectively. The yaw rate is angular velocity. , This represents the distance from the front and rear axles to the center of gravity. Then, based on the linear tire model, calculate the lateral forces on the front and rear wheels: in, Front tire lateral stiffness (reflects the proportional relationship between the front wheel slip angle and the lateral force, and is a key parameter in vehicle dynamics; the larger the value, the greater the lateral force generated by the front wheel under a unit slip angle). This refers to the rear tire lateral stiffness (similarly reflecting the proportional relationship between the rear wheel slip angle and the lateral force). The slip angle of the front wheel (the angle between the actual direction of movement of the front wheel and the plane of the wheel). The rear wheel slip angle (the angle between the actual direction of the rear wheel's movement and the wheel plane). The lateral force on the front wheels (the force exerted on the front wheels of the vehicle in the lateral direction). This represents the lateral force on the rear wheel (the force exerted on the rear wheel in the lateral direction of the vehicle). To reflect the variation of parameters with operating conditions, the recursive least squares method is used to estimate the tire lateral stiffness online. Let the observation model be (the measured lateral force). (Predicted by tire model + noise): The recursive formula is: Parameter update means adding a correction to the old stiffness estimate: Error covariance update indicates that the estimation error is getting smaller and smaller: in, For the first The lateral force of the vehicle is measured at all times; For the first The lateral stiffness estimated at each moment; The side slip angle is an input term in the parameter estimation process; For system observation error, The Kalman gain determines the magnitude of the impact of the current observation on the parameter correction. For the first The time-varying parameter estimation error covariance; λ is the forgetting factor. This method can update tire lateral stiffness in real time, thereby obtaining estimates of time-varying parameters.
[0035] The process of constructing a sample set is as follows: After completing the above preprocessing, training samples are constructed according to the time series slicing method. Let the historical window length be... The predicted step size is The input sample is: The output sample is: in, These are the key features extracted after normalization. The predicted targets for vehicle status (such as lateral acceleration, yaw rate, etc.).
[0036] Finally, the constructed samples are divided into training set (70%), validation set (15%) and test set (15%) in chronological order and stored in a standard data file format for use by the neural network model.
[0037] S3, based on physical constraints and time-varying parameters, constructs a neural network model; By introducing vehicle dynamics equations as physical constraints into the neural network structure and modeling key dynamic parameters as time-varying variables that change with time and operating conditions, high-precision modeling of vehicle dynamics and stronger adaptability to operating conditions can be achieved.
[0038] like Figure 3As shown, the neural network model includes an input layer, a hidden layer (GRU network), a physical constraint layer (PhysicsGuard layer), and an output layer. Input data enters the neural network model through the input layer, undergoes dimensionality transformation and temporal packaging through the linear embedding layer, then extracts temporal features through the GRU network, and finally performs bounded mapping on the output vector (temporal features) of the GRU network through the physical constraint layer to obtain time-varying parameter estimates. Substituting the time-varying parameter estimates into the vehicle dynamics equations Calculations are performed to obtain the physical prediction state. And output by the output layer The specific content of model construction includes: 1) Formalization of vehicle dynamics equations To facilitate incorporating physical constraints into the loss, a discrete-time monorail model is first used as the constrained dynamic equation.
[0039] Assume the vehicle dynamics system at time 10:00 state vector for: in, For longitudinal velocity, For lateral velocity, ω represents the yaw rate.
[0040] Control input Defined as: in, As the driving force, This refers to the steering angle of the front wheels.
[0041] The set of known or measurable constant coefficients (measurable terms) is: (For example, mass, wheelbase parameters, etc.), the set of unknown parameters that need to be estimated is time-varying parameters. (e.g., the set of lateral stiffness coefficients) Discretized single-step state equations (in addition to example forms; more precise formulations may be used depending on the vehicle being implemented): Specifically, this can be expanded as follows (another example must be consistent with the vehicle model being implemented): Furthermore, the lateral force of the tire is given by (linear example or Pacejka), for example, in linearized form: Side slip angle as follows: By incorporating the aforementioned physical equations into the neural network modeling process, it can be ensured that the model's prediction results are consistent with physical laws, thus avoiding physical inconsistencies.
[0042] 2) Neural network model structure and time-varying parameter modeling The sample set includes state vectors and control input A state-control sequence of historical length is used as network input, denoted as: The input data undergoes dimensionality transformation and temporal packaging through a linear embedding layer to form the network input tensor.
[0043] A GRU network composed of gated recurrent units (GRUs) is used to extract the dynamic evolution of the input sequence.
[0044] The neural network model outputs a prediction of the next physical state, along with estimates of the time-varying parameters at that moment. To ensure that the output physical parameters are within a reasonable physical range and to prevent the network from predicting non-physical values (such as negative stiffness or abnormal friction coefficients), a bounded mapping mechanism is introduced. The "PhysicsGuard" layer is used to perform bounded mapping on the output of the GRU network. in, This is the output vector of the GRU network. For the Sigmoid function, , These are the upper and lower bounds of the parameter.
[0045] Final utilization and Calculate the physical prediction state: At the same time, the network can also directly output a purely data-driven prediction.
[0046] Time-varying parameter estimates of network output It is not directly used as a prediction result, but rather as a dynamic input term to the physical equations, participating in the physical propagation prediction of the vehicle state. At the time step... The neural network calculates based on the historical input sequence. Then, the physical state prediction of the next moment is obtained through the dynamic function.
[0047] Through the above-mentioned embedding mechanism, the model can automatically adjust its parameter response under unsteady conditions such as road surface adhesion and load changes, thereby achieving adaptive modeling for multiple working conditions.
[0048] 3) Loss function and physical constraint embedding To ensure both fitting accuracy and physical consistency, and to introduce reasonable time smoothing constraints on time-varying parameters, a weighted composite loss is used during training. : in, This is the total loss function, used to comprehensively measure the model's performance in terms of data fitting, physical constraints, parameter smoothness, and regularization. For data loss, measure the first... The error between the measured next state of a sample and the physical state prediction obtained from the vehicle dynamics equations; This is the weighting coefficient for the physical loss term, used to adjust the degree of influence of physical constraints on the total loss; This is a physical loss term to ensure that the model predictions satisfy the laws of vehicle dynamics. The weighting coefficients are used to smooth the loss term, controlling the strength of the smoothness constraint on the time-varying parameters in the time dimension; To smooth out the loss term and make the time-varying parameter estimates change more smoothly over time; These are the weighting coefficients for the regularization loss term, balancing model complexity and fitting performance; This is a regularization loss term used to improve the model's generalization ability.
[0049] The following are the explicit definitions for each item (all items can be summed using mini-batch): 1. Data error term (observation matching) in, The batch size, It is the first The next step state of each sample was measured. It is derived from the vehicle dynamics equations (use The predictions are calculated.
[0050] 2. Physical residuals (explicit physical equation constraints) To encourage stronger consistency within the physical equations in the network output parameters, physical residuals are defined. For generality, the L2 norm of the residuals directly calculated from the model equations and the actual measurements is used. in, To estimate the next state (or the true state) using higher precision measurement or numerical integration; this essentially overlaps and reinforces However, in some implementations, it can be used to constrain internal physical quantities (such as force / torque) rather than direct states.
[0051] 3. Time-varying parameter smoothing term (controls the smoothness of parameter changes over time) To ensure that the estimated time-varying parameters can both follow changes in operating conditions and avoid unnecessary fluctuations, a time smoothing penalty term is introduced: Among them, weight Controlling the response rate of the estimated parameters: smaller values allow for rapid changes (suitable for volatile operating conditions), while larger values promote smoothing (suitable for slowly changing parameters).
[0052] 4. Parameter regularization term (avoids extreme values of coefficients and promotes generalization) Although the Physics Guard layer forces the coefficients to be within a known boundary, L2 regularization is added to avoid boundary squeezing or boundary oscillation: in, The nominal value of the coefficient (can be taken as the midpoint of the boundary or a priori estimate).
[0053] S4 uses a sample set to train the neural network model and a validation set to validate the model, resulting in a parameter-optimized neural network model for state prediction.
[0054] After constructing the neural network model based on physical constraints and time-varying parameters, the model needs to be trained to obtain parameters that can accurately predict the vehicle's dynamic state. The training process of this invention includes the following sub-steps: S41, Forward Propagation Historical Window Data is input into a neural network to obtain an output vector. By restricting it to a physically reasonable range through nonlinear mapping, time-varying parameter estimates are obtained: Then, the estimated parameters Substitute the equations of vehicle dynamics to calculate the predicted state at the next moment: S42, Loss Function Calculation To ensure that the prediction results conform to both the observed data and physical laws, a composite loss function is constructed: in: Data error terms: Physical residuals: Parameter smoothing term: Parameter regularization terms: S43, Parameter Update and Convergence Based on loss function Perform backpropagation and update the neural network parameters using an optimizer (such as Adam). When the validation set loss stabilizes over several training epochs, the model is considered converged and the final parameters are saved.
[0055] To verify the effectiveness and applicability of the constructed vehicle dynamics modeling method based on time-varying parameter neural networks, the effectiveness can be tested through both open-loop prediction verification and closed-loop control verification based on the test set.
[0056] 1) Open-loop verification The model was validated through open-loop prediction on a vehicle dynamics simulation platform and a real-world road test set. Test conditions included typical scenarios such as straight-line acceleration, emergency braking, slippery road surfaces, and high-speed curves. The model's predicted states were compared with those of the test models. Compared with the measured state Calculate the root mean square error : 2) Closed-loop verification The model is embedded within a Model Predictive Control (MPC) framework for path tracing validation. Let a reference path be defined. for: The optimization objective of MPC is to minimize the path tracking error and the change in control input. Among them, matrix This is the tracking error weight matrix (symmetric positive definite, used to set the importance of tracking errors in different states / outputs); matrix It is a weight matrix for controlling the changes in the control input (symmetric positive definite, used to set the cost weights for different changes in the control input). Optimize the control sequence to find the control input sequence that minimizes the objective function, where For prediction in the time domain (the number of future steps considered during optimization). It is the first The control input for each step; the summation before and after is the summation of the "tracking error in the prediction time domain" and the "change in control input" within the corresponding number of steps, respectively, to summarize the cost of each step; , It is the first The actual state (or output) of the step. , This is the reference state (or output) of the first step (i.e., the target value to be achieved); It is the first Step control input The change in (such as torque, thrust, etc.); It is the first Step control input Changes in parameters such as steering angle and valve opening.
[0057] Based on a similar inventive concept, embodiments of the present invention also provide a computer storage medium storing a readable program that, when run by a processor, can execute the above-described method for modeling the dynamics of autonomous vehicles based on time-varying parameter neural networks.
[0058] Based on a similar inventive concept, this invention provides an electronic device, including: a processor, a memory, a communication interface, and a communication bus, wherein the processor, the memory, and the communication interface communicate with each other through the communication bus; The memory is used to store at least one executable instruction, which causes the processor to perform the operation corresponding to the above-described method for modeling the dynamics of autonomous vehicles based on time-varying parameter neural networks.
[0059] Based on a similar inventive concept, embodiments of the present invention also provide a computer program product, including computer instructions, which instruct a computing device to perform the operations corresponding to the above-described method for modeling the dynamics of autonomous vehicles based on time-varying parameter neural networks.
[0060] Example 2 In this embodiment, a specific example is used to verify the superiority of the modeling method of the present invention.
[0061] Step 1, Dataset Construction 1. Simulation Dataset In the CARLA customized simulation environment, two differentiated tracks were built (Track 1: multiple low-speed curves, Track 2: long straightaways + high-speed curves). A pure tracking algorithm was used to control a 1:1 scale racing car model to drive along a reference trajectory, and ground-based vehicle states and model coefficients were collected.
[0062] Data content: State variables (longitudinal velocity, lateral velocity, yaw rate, throttle opening, steering wheel angle), control inputs (throttle change, steering angle change), environmental parameters including road adhesion coefficient (0.3~1.0, simulating wet to dry road surface); time-varying parameter annotations include tire lateral stiffness (dynamically changing with tire wear rate from 0% to 30%) and transmission system damping coefficient (adjusted with temperature from -10℃ to 40℃).
[0063] Data partitioning: Track 1 collects 100 samples as the dataset, and Track 2 collects 1000 samples as the experimental dataset. The sampling frequency is 50Hz, and the time span is 20s for both tracks.
[0064] 2. Real vehicle dataset An open-source dataset based on a full-size Indy autonomous vehicle race car, used for real-world testing at the Putnam Park circuit (multiple consecutive corners) and the Las Vegas Motor Speedway (high-speed elliptical circuit).
[0065] Data content: Status data is acquired via GNSS (positioning accuracy ±2cm), IMU (sampling rate 100Hz) and vehicle CAN bus, including longitudinal velocity (0~80m / s), lateral acceleration (-4~4m / s²), yaw rate (-0.5~0.5rad / s), etc.; environmental parameters are recorded by vehicle meteorological sensors (rainfall 0~50mm / h, road surface temperature -5℃~35℃); time-varying parameter annotation is achieved through offline analysis tools, such as estimating tire lateral stiffness based on tire pressure and wear, and correcting the vehicle's center of gravity position based on fuel consumption.
[0066] Data split: 13,418 samples were collected from the PutnamPark track as the dataset, and 10,606 samples were collected from the LasVegas track as the dataset. The sampling frequency was 25Hz, and the time spans were 536s and 424s, respectively.
[0067] Data preprocessing: 1. Noise Reduction: For sensor noise (such as IMU high-frequency vibration noise and GNSS positioning jumps), a combination of moving average filtering and Kalman filtering is used. The formula for the moving average window length filtering of a one-dimensional signal is: The formula calculates the signal at the current moment. and the preceding consecutive The simple average of the raw signal values at each time point.
[0068] 2. Data Synchronization: Due to differences in sampling frequencies among multiple sensors (GNSS 25Hz, IMU 100Hz, CAN bus 50Hz), all signals are resampled to a discrete time series of 25Hz, using timestamps as a reference. For missing sampling points (such as brief loss of GNSS signals), linear interpolation is used to complete the data, with the following formula: According to the target time With known sampling time The distance is used to calculate the estimated value of the missing points proportionally, thereby smoothly and accurately filling in the data.
[0069] 3. Normalization and Feature Extraction Z-score normalization is applied to all physical quantities to eliminate the influence of dimensions. The formula is as follows: in , Features Mean and standard deviation on the training set. For example, longitudinal velocity. of , After normalization, the value range is mapped to [-1.5, 3.5]; steering wheel angle of , , mapped to [-2.5, 2.5].
[0070] Key feature extraction: First, an observation model is established based on the physical characteristics of each parameter: tire lateral stiffness is modeled through the linear relationship between the lateral force of the front and rear wheels and the lateral angle, i.e. , ( , For lateral force observations, , The sideslip angle, ( , (For observing noise); the transmission system coefficients are modeled by the relationship between longitudinal driving force, throttle opening, and longitudinal speed, and then summarized as follows: ( For longitudinal driving force, For throttle opening, , Given the drag coefficient, (for noise); the road surface adhesion coefficient is modeled based on the relationship between lateral acceleration and gravitational acceleration, i.e. ( For lateral acceleration, Indicates the road surface adhesion coefficient. It is the acceleration due to gravity. (For noise), all models take into account the Gaussian distribution characteristics of the observed noise, which fits the characteristics of actual sensor data.
[0071] Key parameters and recursive process of the RLS algorithm to ensure estimation accuracy: Forgetting factor To balance the timeliness and stability of parameters and avoid excessive interference from historical data on the current estimate; initial covariance matrix ( (As an identity matrix), ensuring sufficient degrees of freedom for parameter estimation in the initial state; initial values of each parameter refer to the vehicle design manual and the nominal range of model coefficients, such as in the simulation scenario. , Below, real vehicle scenario , The recursive process consists of three steps: first, calculating the gain matrix. ( For the observation vector, such as correspond ); secondly, update the parameter estimates. ( For observed values, such as correspond Third, update the covariance matrix. At the same time, physical boundary constraints (such as simulation scenarios, etc.) are imposed on the estimation results. Real vehicle scene And filtered by moving average (window length) Noise is suppressed by a first-order low-pass filter, ultimately generating a continuous time-varying parameter sequence. This provides dynamic parameter support for the subsequent construction of input features and the solution of dynamic equations in neural network models.
[0072] 4. Training Sample Construction Input-output samples are constructed using time series slicing, with the historical window length set. (Covering 0.4s time series information), prediction step size (Single-step state prediction), then: Input sample: The dimension is 10×(5+2+13)=200 (5 state variables, 2 control inputs, and 13 time-varying parameters). Output sample: , that is, the state vector at the next moment; Sample partitioning: The training set, validation set, and test set are partitioned in a ratio of 70%:15%:15%. The simulation and real vehicle datasets generate 700 / 150 / 150 and 9393 / 2013 / 2012 samples respectively, which are stored in HDF5 format to improve reading efficiency.
[0073] Step 2: Building a Neural Network Model Based on Physical Constraints and Time-Varying Parameters Construct a network architecture consisting of "GRU + Physical Constraint Layer + PhysicsGuard Layer": Input layer: Receives time-series input samples with a dimension of 200, including historical states, control inputs and time-varying parameter estimates, and maps them to a 128-dimensional feature space through a fully connected layer. The activation function is Mish.
[0074] Hidden layers: A 7-layer GRU network (simulation dataset) or a 5-layer GRU network (real vehicle dataset) is used, with the number of hidden units in each layer being 108, 128, 256, 256, 128, 108, 64 (simulation) and 254, 256, 512, 256, 254 (real vehicle), respectively. The weights of the forget gate, update gate, and reset gate of the GRU are initialized using a Xavier normal distribution, and the recurrent dropout rate is set to 0.1 to prevent overfitting.
[0075] Physical constraint layer: Embeds discrete-time monorail vehicle dynamics equations, decoding the feature vectors output by the GRU into model coefficients. (Including Pacejka tire coefficient) Transmission system coefficient Moment of inertia (13 time-varying parameters, etc.) are substituted into the dynamic equations to calculate the physical predicted state. The core equations include: Vertical speed update: Horizontal speed update: Yaw rate update: in (25Hz sampling interval) (Simulated racing car quality).
[0076] The Physics Guard layer (i.e., the physical constraint layer) applies physical boundary constraints to the GRU output vector, using the Sigmoid function to map the parameters to a preset reasonable range. The formula is as follows: in, This is the output vector of the GRU network. For the Sigmoid function, , These are the upper and lower bounds of the parameters. (e.g., in a real vehicle) of , In the simulation , .
[0077] Output layer: Output (Physical Predicted State) and (Estimated time-varying parameters for the next time step), with dimensions of 5 and 13 respectively.
[0078] Table 1 Time-varying parameters physical boundary range Step 3: Loss Function Calculation and Optimization Strategy Formulation Composite loss function construction: A weighted summation composite loss is used to balance data fitting accuracy, physical consistency, and time-varying parameter smoothness. The formula is as follows: 1. Data error term (observation matching) in, The batch size, It is the first The next step state of each sample was measured. It is derived from the vehicle dynamics equations (use The predictions are calculated.
[0079] 2. Physical residuals (explicit physical equation constraints) To encourage stronger internal consistency of the physical equations in the network output parameters, a physical residual is defined to achieve generality. This is achieved by directly calculating the L2 norm of the residuals from the model equations and comparing them with actual measurements. in, To estimate the next state (or the true state) using higher precision measurement or numerical integration; this essentially overlaps and reinforces However, in some implementations, it can be used to constrain internal physical quantities (such as force / torque) rather than direct states.
[0080] 3. Time-varying parameter smoothing term (controls the smoothness of parameter changes over time) To ensure that the estimated time-varying parameters can both follow changes in operating conditions and avoid unnecessary fluctuations, a time smoothing penalty term is introduced: Among them, weight Controlling the response rate of the estimated parameters: smaller values allow for rapid changes (suitable for volatile operating conditions), while larger values promote smoothing (suitable for slowly changing parameters).
[0081] 4. Parameter regularization term (avoids extreme values of coefficients and promotes generalization) Although the Physics Guard layer forces the coefficients to be within a known boundary, L2 regularization is added to avoid boundary squeezing or boundary oscillation: in, The nominal value of the coefficient (can be taken as the midpoint of the boundary or a priori estimate).
[0082] Optimization strategy: The Adam optimizer is used, with an initial learning rate of (1.4e-4) (simulation) and (4.4e-4) (real vehicle). The learning rate decays with each training epoch (decaying to 0.9 times the previous epoch every 10 epochs). The training epochs are set to 50 epochs, and an early stopping strategy is adopted (training stops if the validation set loss does not decrease for 5 consecutive epochs). To improve training stability, gradient clipping (maximum gradient norm is set to 5.0) is used to suppress gradient explosion.
[0083] Step 4: Model Training Training rounds and early stopping strategy: The total number of training rounds is set to 50 rounds. After each round of training, the loss value is calculated on the validation set. If the loss on the validation set does not decrease for 5 consecutive rounds (fluctuation less than 1e-6), the early stopping mechanism is triggered to stop training, and the model parameters of the current round are saved as the optimal model to avoid overfitting.
[0084] Training logs and visualization: Training loss and validation loss are recorded every 200 training steps, along with key model coefficients. , The estimated value sequence is monitored to see if the parameters are stable within the physical range. If the parameters exceed the boundary, the parameter range of the PhysicsGuard layer or the learner learning rate is adjusted backtracking.
[0085] Model saving and version control: After each training round, save the model weight file (.pth format). The file name includes the training round, validation loss value and training time, such as "model_epoch30_valLoss0.0025_20240510.pth". Establish a model version management mechanism to record the hyperparameter configuration and training results of each version of the model, which will facilitate subsequent comparative analysis and iterative optimization.
[0086] Model Validation and Application 1. Open-loop verification Open-loop validation evaluates the accuracy of the model's single-step state prediction and multi-step trajectory prediction based on experimental datasets, using root mean square error (RMSE) and maximum error. The average displacement error (ADE) and final displacement error (FDE) were used as evaluation indicators, and the traditional data-driven model (NN) was used as the comparison object. The results are shown in Table 2.
[0087] Table 2 Comparison of Open-Loop Validation Performance Single-step prediction performance: On the simulation dataset, the model of this invention shows good prediction performance for longitudinal velocity. The RMSE is only 1.506e-5 m / s², which is about four orders of magnitude lower than NN (using the actual moment of inertia); for lateral velocity The RMSE is 1.839e-4m / s, a 99.85% reduction compared to NN (GT). On a real-world vehicle dataset, [the following is a separate, unrelated sentence:] The RMSE values were 0.0312 m / s, 0.0730 m / s, and 0.0187 rad / s, respectively, which were 24.1%, 45.5%, and 60.3% lower than the optimal NN (-20% moment of inertia). Time-varying parameter modeling effectively improved the prediction accuracy under complex working conditions.
[0088] Multi-step trajectory prediction performance: In the simulation, the horizontal prediction was performed at 300ms, with ADE and FDE being 3.77e-5m and 1.15e-4m respectively, which are 53.88% and 52.15% lower than NN (GT). In the real vehicle simulation, the horizontal prediction was performed at 600ms, with ADE and FDE being 0.1827m and 0.3840m respectively, which are 23.0% and 31.9% lower than the best NN, verifying the model's ability to capture long-term dynamics.
[0089] 2. Closed-loop verification The model of this invention is embedded into a Model Predictive Control (MPC) framework, and its actual control effect in path tracking tasks is verified based on experimental datasets. The results are shown in the figure below. Figure 4 , raceline is the actual route map when collecting data, and purepursuit is the actual effect of the model.
[0090] MPC Configuration: Predictions The controlled horizon matches the predicted horizon; the optimization objective is to minimize the path tracking error and the smoothness of the control input, and the cost function is: The weight matrix (Emphasizing position tracking accuracy) (Suppressing frequent steering changes); constraints include throttle opening. Steering wheel angle Longitudinal acceleration .
[0091] In the simulation, the lap time was 5.38s, a 12.7% improvement over the NN's 6.16s, with an average speed of 2.01m / s and no boundary violations. In the real car, the lap time of the present invention was 128.5s, a 9.7% improvement over the optimal NN's 142.3s, with an average speed of 45.2m / s (162.7km / h) and 0 violations, while the NN (GT) had 2 violations, verifying the advantages of the present invention model in control stability and racing performance.
[0092] 3. Validation of the effectiveness of time-varying parameter modeling To verify the advantages of time-varying parameter modeling, a control experiment was designed: "with time-varying parameters" and "fixed parameters (Fix-Param)" were trained separately, and their performance was compared under dynamic parameter change conditions (tire wear, sudden change in road adhesion coefficient).
[0093] Table 3. Validation results of time-varying parameter modeling. Scenario 1: Tire wear rate increases from 0% to 30%; Scenario 2: The road surface adhesion coefficient drops sharply from 1.0 to 0.3.
[0094] In scenario 1, the Fix-Param model... The RMSE of the original model increased from 0.052 m / s to 0.187 m / s, an increase of 178.8%, while that of the present invention only increased from 0.0018 m / s to 0.0045 m / s, an increase of 150.0%, a decrease of 16.1 percentage points. In scenario 2, the maximum error of the yaw rate of the Fix-Param model reached 0.32 rad / s, while that of the present invention was only 0.089 rad / s, a reduction of 72.2%, which fully verified the adaptability of time-varying parameter modeling to dynamic working conditions.
[0095] Example 3 In this embodiment, an autonomous vehicle dynamics modeling system based on a time-varying parameter neural network is proposed, including: Data acquisition module: Acquires vehicle operating data under different working conditions and labels time-varying parameters; Data processing module: preprocesses vehicle operation data and constructs a sample set by slicing it according to time series. Model building module: Constructs neural network models based on physical constraints and time-varying parameters; Model training module: The neural network model is trained and validated using a sample set to obtain a parameter-optimized neural network model for state prediction.
[0096] The neural network model includes an input layer, a GRU network, a physical constraint layer, and an output layer. Input data enters the neural network model through the input layer and undergoes dimensionality transformation and temporal packaging via a linear embedding layer. Temporal features are then extracted through the GRU network, and the output vector of the GRU network is bounded through a physical constraint layer to obtain time-varying parameter estimates. Substituting the time-varying parameter estimates into the vehicle dynamics equations Calculations are performed to obtain the physical prediction state. And output by the output layer.
[0097] The methods of the present invention can be implemented in hardware, firmware, or as software or computer code that can be stored in a recording medium (such as a CD-ROM, RAM, floppy disk, hard disk, or magneto-optical disk), or as computer code originally stored on a remote recording medium or a non-transitory machine-readable medium and subsequently stored on a local recording medium, downloaded via a network. Thus, the methods described herein can be processed by software stored on a recording medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware (such as an ASIC or FPGA). It is understood that the computer, processor, microprocessor controller, or programmable hardware includes storage components (e.g., RAM, ROM, flash memory, etc.) capable of storing or receiving software or computer code that, when accessed and executed by the computer, processor, or hardware, implements the methods described herein. Furthermore, when a general-purpose computer accesses the code used to implement the methods shown herein, the execution of the code transforms the general-purpose computer into a dedicated computer for performing the methods shown herein.
[0098] The foregoing has shown and described the basic principles, main features, and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited to the above embodiments. The embodiments and descriptions in the specification are merely illustrative of the principles of the invention. Various changes and modifications can be made to the invention without departing from its spirit and scope, and all such changes and modifications fall within the scope of the claimed invention.
Claims
1. A method for modeling the dynamics of autonomous vehicles based on time-varying parameter neural networks, characterized in that, Includes the following steps: Acquire vehicle operating data under different working conditions and label time-varying parameters; Vehicle operation data is preprocessed and a sample set is constructed by slicing it according to time series. A neural network model is constructed based on physical constraints and time-varying parameters; The neural network model is trained and validated using a sample set to obtain a parameter-optimized neural network model for state prediction. The neural network model includes an input layer, a GRU network, a physical constraint layer, and an output layer. Input data enters the neural network model through the input layer and undergoes dimensionality transformation and temporal packaging via a linear embedding layer. Temporal features are then extracted through the GRU network, and the output vector of the GRU network is bounded through a physical constraint layer to obtain time-varying parameter estimates. Substituting the time-varying parameter estimates into the vehicle dynamics equations Calculations are performed to obtain the physical prediction state. And output by the output layer.
2. The method for dynamic modeling of autonomous vehicles based on time-varying parameter neural networks according to claim 1, characterized in that, Vehicle operation data includes: Vehicle driving status information: used to describe the dynamic performance of the vehicle under different operating conditions, including: longitudinal speed, lateral speed, yaw rate, longitudinal and lateral acceleration, steering wheel angle, braking force and driving force; Environmental parameter information: used to describe the driving environment of the vehicle, including: road surface adhesion coefficient, road slope, road curvature and weather conditions; Vehicle structural parameter information: used to describe the characteristics of the vehicle body and tires, including: vehicle mass, center of gravity position, tire lateral stiffness and suspension stiffness.
3. The method for dynamic modeling of autonomous vehicles based on time-varying parameter neural networks according to claim 1, characterized in that, Data preprocessing steps include: The moving average filtering method is used to denoise the vehicle operation data, and then the linear interpolation method is used to synchronize the vehicle operation data. The data after denoising and synchronization is normalized, and key features are extracted based on vehicle dynamics equations to construct a sample set.
4. The method for dynamic modeling of autonomous vehicles based on time-varying parameter neural networks according to claim 1, characterized in that, The formula for applying a bounded mapping to the output vector of a GRU network is: in, This is the output vector of the GRU network. For the Sigmoid function, , These are the upper and lower bounds of the parameter.
5. The method for modeling the dynamics of autonomous vehicles based on time-varying parameter neural networks according to claim 1, characterized in that, The vehicle dynamics equations are expressed as follows: in, For the physical prediction state, For state vectors, For the input vector, A set of known or measurable constant coefficients. These are time-varying parameters; For longitudinal velocity, For lateral velocity, This refers to the yaw rate; As the driving force, This refers to the steering angle of the front wheels.
6. The method for modeling the dynamics of autonomous vehicles based on time-varying parameter neural networks according to claim 5, characterized in that, The input to the neural network model is a historical segment with a length of The state-control sequence is denoted as: 。 7. The method for dynamic modeling of autonomous vehicles based on time-varying parameter neural networks according to claim 5, characterized in that, The loss function during the training process of the neural network model for: in, This is the total loss function; For data loss, measure the first... The error between the measured next state of a sample and the physical state prediction obtained from the vehicle dynamics equations; The weighting coefficient for the physical loss term; This is the physical loss item; These are the weighting coefficients for the smoothing loss term; To smooth out the loss term; These are the weighting coefficients for the regularization loss term, balancing model complexity and fitting performance; This is the regularization loss term; The batch size; For the first One sample in The state vector at any given time; For the first Each sample at time... The input vector; These are fixed parameters for vehicle dynamics; For the first One sample in The estimated time-varying parameters at time t; For the first One sample in The estimated time-varying parameters at time t; This is the nominal value of the coefficient.
8. An autonomous vehicle dynamics modeling system based on time-varying parameter neural networks, characterized in that, include: Data acquisition module: Acquires vehicle operating data under different working conditions and labels time-varying parameters; Data processing module: preprocesses vehicle operation data and constructs a sample set by slicing it according to time series. Model building module: Constructs neural network models based on physical constraints and time-varying parameters; Model training module: Uses a sample set to train and validate the neural network model, resulting in a parameter-optimized neural network model for state prediction; The neural network model includes an input layer, a GRU network, a physical constraint layer, and an output layer. Input data enters the neural network model through the input layer and undergoes dimensionality transformation and temporal packaging via a linear embedding layer. Temporal features are then extracted through the GRU network, and the output vector of the GRU network is bounded through a physical constraint layer to obtain time-varying parameter estimates. Substituting the time-varying parameter estimates into the vehicle dynamics equations Calculations are performed to obtain the physical prediction state. And output by the output layer.
9. A computer storage medium storing a readable program, characterized in that, When the program runs, it can instruct the computing device to execute the autonomous vehicle dynamics modeling method based on time-varying parameter neural networks as described in any one of claims 1-7.
10. An electronic device, characterized in that, include: The processor, memory, communication interface, and communication bus are provided, wherein the processor, memory, and communication interface communicate with each other via the communication bus. The memory is used to store at least one executable instruction, which causes the processor to perform the operation corresponding to the autonomous vehicle dynamics modeling method based on time-varying parameter neural networks as described in any one of claims 1-7.
Citation Information
Patent Citations
Intelligent vehicle trajectory tracking control method based on data-driven vehicle dynamics model
CN113386781A
Data-driven vehicle dynamics modeling method based on autoregression decoder
CN118194442A
Cited By
Unmanned excavator operation track planning method and device
CN122130097A