A method and system for state estimation of a distributed drive electric vehicle
By constructing a vehicle kinematics model and explicitly calculating the vehicle speed using a Transformer encoder model, and then combining it with the unscented Kalman filter method, the problem of low accuracy in state estimation of distributed drive electric vehicles is solved, and accurate vehicle state estimation under complex conditions is achieved.
Patent Information
- Application Number
- CN202311235092.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-24
- Publication Date
- 2026-11-27
- Estimated Expiration
- 2043-09-24
AI Technical Summary
In the existing technology, the accuracy of vehicle state estimation results for distributed drive electric vehicles is low, especially when it is difficult to obtain an accurate dynamic model and the wheel slip ratio is high, the estimation of longitudinal and lateral vehicle speeds is not accurate enough.
By constructing a vehicle kinematic model, the explicit vehicle speed is calculated using a Transformer encoder model, and longitudinal and lateral velocities are estimated using an unscented Kalman filter method. The yaw rate is used as the observation vector, and vehicle state information is fused for accurate estimation.
Even when it is difficult to obtain an accurate dynamic model and the wheel slip ratio is high, it can still achieve a relatively accurate estimate of the vehicle state, thus improving the accuracy of vehicle state estimation.
Smart Images

Figure CN117022299B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of vehicle state analysis technology, specifically relating to a method and system for estimating the state of a distributed drive electric vehicle. Background Technology
[0002] Pure electric vehicles are automobiles powered entirely by electric motors. Due to their advantages of zero emissions, simple structure, high efficiency, and relatively mature technology, they have become an important form of new energy vehicles. If electric vehicles adopt a four-wheel independent drive system, not only can the mechanical transmission devices required in traditional vehicles be eliminated, making the drive system and overall vehicle structure simpler and more compact, improving transmission efficiency and reducing energy consumption, but also, with each wheel driven independently by a motor, rapid control of driving and braking forces can be achieved, enhancing driving stability and passability. For these reasons, distributed drive electric vehicles are one of the hot topics in the field of electric vehicle research.
[0003] Distributed drive electric vehicles include hub-driven electric vehicles (EVs) with the motor mounted in the wheel hub, and wheel-side motor-driven electric vehicles (EVs) with the motor mounted in the vehicle body and connected to the wheel hub via a drive shaft. Compared to traditional centralized drive vehicles, the biggest advantage of distributed drive electric vehicles is their ability to flexibly distribute torque to all four wheels, expanding the application scope of vehicle dynamics control and improving control accuracy and response speed. Vehicle dynamics control is a key technology for active vehicle safety control, and accurately acquiring vehicle state signals is a necessary prerequisite for achieving vehicle dynamics control. Since some vehicle state signals are often impossible to measure directly, or the cost of direct measurement is too high to be widely applied in the automotive industry, vehicle state estimation has become a research hotspot in the field of vehicle dynamics control.
[0004] Vehicle state estimation algorithms aim to minimize the residual between the measured and estimated values of easily measurable states, thereby achieving optimal estimation of the state to be estimated. Among vehicle state signals, longitudinal speed and sideslip angle are the most commonly used input signals in vehicle dynamics control systems and are also frequently required to be estimated. Existing technologies typically rely on vehicle dynamics models and Kalman filtering algorithms for vehicle state estimation. However, in traditional dynamic models, model parameters are often difficult to identify in practical applications, and the tire forces Fx and Fy, which are inputs to the dynamic model, are actually difficult to estimate accurately, ultimately leading to low accuracy in state estimation results. Summary of the Invention
[0005] This invention provides a method and system for state estimation of distributed drive electric vehicles to solve the problem of low accuracy in vehicle state estimation results.
[0006] In a first aspect, the present invention provides a distributed drive electric vehicle state estimation method, the method comprising the following steps:
[0007] Vehicle status information is acquired through sensors inside the target vehicle, including yaw rate, lateral acceleration, and longitudinal acceleration.
[0008] A vehicle kinematic model is constructed based on the vehicle state information;
[0009] The explicit speed of the target vehicle is calculated explicitly based on the vehicle status information and using the Transformer encoder model.
[0010] The estimated speed of the target vehicle is calculated by combining the explicit vehicle speed and the vehicle kinematic model and using the unscented Kalman filter method.
[0011] Optionally, the vehicle status information is time-series data, and the vehicle status information also includes the wheel speeds of all wheels of the target vehicle, the wheel torques of all wheels, and the front wheel steering angles.
[0012] Optionally, the method further includes the following steps:
[0013] The vehicle state information is segmented based on a preset sliding time window and sample number to obtain multiple training sample feature data.
[0014] After randomly shuffling the feature data of multiple training samples, they are classified into training datasets and validation datasets.
[0015] The Transformer encoder model is trained and optimized by combining the training dataset and the validation dataset.
[0016] Optionally, constructing the vehicle kinematic model based on the vehicle state information includes the following steps:
[0017] Based on the vehicle state information and the motion state of the target vehicle, a vehicle kinematic equation is constructed, which is as follows:
[0018]
[0019]
[0020] In the formula: v represents the longitudinal velocity of the target vehicle in the inertial coordinate system. y The lateral velocity of the target vehicle in the vehicle coordinate system is represented by r, and the yaw rate is represented by a. x This indicates the longitudinal acceleration. v represents the lateral velocity of the target vehicle in the inertial coordinate system. x a represents the longitudinal velocity of the target vehicle in the vehicle coordinate system.y This indicates the lateral acceleration;
[0021] The vehicle kinematic equations are converted into a vehicle kinematic model in state-space form.
[0022] Optionally, the Transformer encoder model includes an input embedding layer, a position encoding layer, an encoder block stacking layer, a global average pooling layer, and a linear output layer.
[0023] Optionally, the step of explicitly calculating the explicit vehicle speed of the target vehicle based on the vehicle state information and using the Transformer encoder model includes the following steps:
[0024] The vehicle status information is input into the input embedding layer, and the vehicle status information is then up-dimensioned through the input embedding layer to obtain sequence data;
[0025] The sine and cosine position codes in the position coding layer are used to add relative position information to the sequence data;
[0026] The sequence data is input into the encoder block stack layer to extract the data feature vector of the sequence data;
[0027] After the data feature vector is reduced in dimensionality by the global average pooling layer, the explicit vehicle speed of the target vehicle with the same dimension as the vehicle state information is output by the linear output layer.
[0028] Optionally, the encoder block stack layer comprises multiple encoder blocks connected end-to-end, and the step of inputting the sequence data into the encoder block stack layer to extract the data feature vector of the sequence data includes the following steps:
[0029] The query matrix, key matrix, and value matrix are calculated based on the sequence data and preset matrix weights.
[0030] The query matrix, the key matrix, and the value matrix are input into the multi-head attention mechanism layer in the encoder block to obtain the basic feature vector;
[0031] The basic feature vector is input into the feedforward network layer in the encoder block to update the state information in the basic feature vector, thereby obtaining the data feature vector of the sequence data. The multi-head attention mechanism layer and the feedforward network layer are connected through the residual network and normalization layer in the encoder block.
[0032] Optionally, the step of combining the explicit vehicle speed and the vehicle kinematic model and calculating the estimated speed of the target vehicle using an unscented Kalman filter includes the following steps:
[0033] The observation vector in the unscented Kalman filter method is generated based on the explicit vehicle speed.
[0034] The vehicle system state is constructed based on the vehicle kinematics model and using the unscented Kalman filtering method.
[0035] Initialize the vehicle system state and the covariance matrix of the vehicle system state;
[0036] Substituting the observation vector into the vehicle system state calculation yields 2n+1 Sigma points;
[0037] A one-step prediction of all the Sigma points is calculated to obtain a prediction point set, and a one-step prediction of the vehicle system state is obtained by calculating the weighted mean of the prediction point set.
[0038] By performing an unscented transformation on the predicted value in the first step, the predicted mean and gain matrix of the observed vector are calculated.
[0039] The vehicle system state and the covariance matrix are updated by combining the predicted mean and the gain matrix;
[0040] Repeat the above steps until the preset number of times is reached, and finally output the estimated speed of the target vehicle.
[0041] Optionally, the state equation of the vehicle system state is as follows:
[0042]
[0043]
[0044] In the formula: Let t represent the longitudinal velocity of the target vehicle at time t. Let t represent the lateral velocity of the target vehicle at time t. This represents the longitudinal velocity of the target vehicle at time t-1. Let r represent the lateral velocity of the target vehicle at time t-1, and let a represent the yaw rate. x a represents the longitudinal acceleration. y The lateral acceleration is represented by T, the sampling interval is represented by ω, and the process noise is represented by ω.
[0045] In a second aspect, the present invention also provides a distributed drive electric vehicle state estimation system, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor performs the method described in the first aspect.
[0046] The beneficial effects of this invention are:
[0047] The vehicle kinematic model constructed in this invention considers the yaw motion of the target vehicle. Since the yaw rate is measurable, it can be used as the observation vector. First, utilizing the fitting capability of the Transformer encoder model, the explicit vehicle speed is calculated explicitly using the Transformer encoder model as the observation vector. Then, an unscented Kalman filter is used to fuse this speed with the kinematic model to estimate the longitudinal and lateral velocities of the target vehicle. Compared to existing technologies that explicitly calculate the longitudinal speed based on wheel speed information and use it as the observation vector, where wheel speed only reflects vehicle speed under low wheel slip ratios, resulting in accurate state estimation, the method employed in this invention can still provide relatively accurate vehicle state estimations even when a precise dynamic model is difficult to obtain and the wheel slip ratio is high. Attached Figure Description
[0048] Figure 1 This is a flowchart illustrating the distributed drive electric vehicle state estimation method of the present invention.
[0049] Figure 2 This is a schematic diagram illustrating the construction of the vehicle kinematics equations in this invention.
[0050] Figure 3 This is a schematic diagram illustrating the model training of the Transformer encoder model in this invention.
[0051] Figure 4 This is a schematic diagram illustrating the principle of the unscented Kalman filtering method in this invention.
[0052] Figure 5 This is a sampling diagram of the training samples segmented based on a preset time window in this invention.
[0053] Figure 6 This is a schematic diagram illustrating the process of randomly shuffling the training samples in this invention.
[0054] Figure 7 This is a schematic diagram of the encoder block stack layer in this invention.
[0055] Figure 8 This is a schematic diagram of the structure of the multi-head self-attention layer in this invention.
[0056] Figure 9 This is a schematic diagram of the scaling dot product attention structure in this invention. Detailed Implementation
[0057] This invention discloses a method for state estimation of distributed drive electric vehicles.
[0058] Reference Figure 1The distributed drive electric vehicle state estimation method specifically includes the following steps:
[0059] S101. Obtain vehicle status information through sensors inside the target vehicle.
[0060] The internal sensors include an inertial measurement unit, wheel-side motor sensors, steering wheel angle sensors, wheel speed sensors, yaw rate sensors, longitudinal acceleration sensors, lateral acceleration sensors, and current sensors. All internal sensors are connected to the target vehicle's vehicle status control system via a CAN bus, and vehicle status information is acquired through this system. This vehicle status information is time-series data and includes yaw rate, lateral acceleration, longitudinal acceleration, wheel speeds of all wheels, wheel torques of all wheels, and front wheel steering angle.
[0061] S102. Construct a vehicle kinematic model based on vehicle state information.
[0062] Among them, reference Figure 2 Considering the longitudinal and lateral motions of the target vehicle, the vehicle kinematic equations can be established, as follows:
[0063]
[0064]
[0065] In the formula: v represents the longitudinal velocity of the target vehicle in the inertial coordinate system. y Let r represent the lateral velocity of the target vehicle in the vehicle coordinate system, and a represent the yaw rate. x Indicates longitudinal acceleration. v represents the lateral velocity of the target vehicle in the inertial coordinate system. x Let a represent the longitudinal velocity of the target vehicle in the vehicle coordinate system. y This indicates lateral acceleration.
[0066] The vehicle kinematics model in state-space form can be represented as:
[0067]
[0068]
[0069] In the formula: r z This represents the yaw rate.
[0070] S103. Calculate the explicit speed of the target vehicle explicitly based on the vehicle status information and using the Transformer encoder model.
[0071] Before the Transformer was proposed, the mainstream method for handling sequence modeling tasks was to use Recurrent Neural Networks (RNNs) and their variants, Long Short-Term Memory Networks (LSTM) and Gated Recurrent Units (GRUs). However, these RNN-based models lack efficient parallel computing capabilities, which to some extent limited their upper limit compared to other non-RNN-based models, making their performance and computational efficiency uncompetitive. Against this backdrop, researchers proposed the Transformer architecture, which encodes input and computes output entirely based on an attention mechanism. The Transformer directly abandons the architectures of RNNs and CNNs, achieving greater feature extraction capabilities, long-range feature capture capabilities, task-integrated feature extraction capabilities, parallel computing capabilities, and operational efficiency by fully utilizing the attention mechanism. Figure 3 The Transformer encoder model includes an input embedding layer, a positional encoding layer, an encoder block stacking layer, a global average pooling layer, and a linear output layer. Figure 3 This demonstrates the entire process of training a Transformer encoder model.
[0072] S104. The estimated speed of the target vehicle is calculated by combining the explicit vehicle speed and the vehicle kinematic model and using the unscented Kalman filter method.
[0073] One limitation of the Kalman filter is that it is used to handle linear systems. Any slightly nonlinear model can be approximated by linearization in the extended Kalman filter. Another limitation comes from the assumption that the variance is inherently Gaussian, but this is not always the case. This is relevant because these assumptions may not apply to velocity measurements from Transformer encoder models, which are derived from nonlinear models with nonlinear error distributions. Therefore, the filter may not produce optimal results. (See reference...) Figure 4 In this embodiment, the unscented Kalman filter (UKF) is used to explicitly calculate the longitudinal and lateral vehicle speeds of the Transformer encoder model as observation vectors of the UKF, and then combined with the vehicle kinematics model to accurately estimate the longitudinal and lateral vehicle speeds.
[0074] The implementation principle of this method is as follows:
[0075] The vehicle kinematic model constructed in this embodiment considers the yaw motion of the target vehicle. Since the yaw rate is measurable, it can be used as the observation vector. First, utilizing the fitting capability of the Transformer encoder model, the explicit vehicle speed of the target vehicle is calculated explicitly using the Transformer encoder model as the observation vector. Then, an unscented Kalman filter is used to fuse this speed with the kinematic model to estimate the longitudinal and lateral velocities of the target vehicle. Compared to the prior art, which explicitly calculates the longitudinal speed based on wheel speed information and uses it as the observation vector, the existing technology only provides accurate state estimation results when the wheel speed reflects the vehicle speed under low wheel slip ratio conditions. Therefore, the method adopted in this invention can still provide relatively accurate estimation results of the vehicle state even when it is difficult to obtain an accurate dynamic model and the wheel slip ratio is high.
[0076] In existing technologies, for non-distributed drive vehicles, the average wheel speed of the two driven wheels is commonly used as the longitudinal vehicle speed, which is then used as the observation vector to estimate the longitudinal and lateral vehicle speeds using Kalman filtering. However, in distributed drive vehicles, all four wheels are driving wheels, and the wheel speed averaging method has too large an error in observing the longitudinal vehicle speed. Therefore, it is necessary to consider the wheel slip ratio to perform a preliminary estimate of the longitudinal vehicle speed to obtain the observation vector for Kalman filtering. Refer to the following formula for details:
[0077]
[0078] The observation matrix is shown in the following formula:
[0079]
[0080] It is known that the existing Kalman filter model fails to observe lateral vehicle speed only when the yaw rate is zero. The observability of longitudinal vehicle speed is 1, and the observability of lateral vehicle speed is r. z It can be seen that for v y The lack of observational data and the need for complex calibration of SR (Side Response) results in inaccurate estimations. Because existing technologies rely on wheel speed information for preliminary estimation of longitudinal vehicle speed and have low observability for lateral vehicle speed, this invention utilizes the fitting capability of the Transformer encoder model to perform regression training on longitudinal and lateral velocities. These are then used as observation vectors, and combined with unscented Kalman filtering for estimation, yielding more accurate results.
[0081] In one implementation, the vehicle state information is time-series data, and the distributed drive electric vehicle state estimation method further includes the following steps:
[0082] Vehicle state information is segmented based on a preset sliding time window and sample number to obtain multiple training sample feature data.
[0083] After randomly shuffling the feature data of multiple training samples, they are classified into training dataset and validation dataset.
[0084] The Transformer encoder model is trained and optimized by combining the training dataset and the validation dataset.
[0085] In this embodiment, vehicle state information from the current and past 10 time points, totaling 25ms, is selected as the input to the Transformer encoder model. (Refer to...) Figure 5 The time-series data of vehicle state information is segmented using a preset sliding time window and sample size to obtain several training sample feature data. Before using these training samples for training, they are randomly shuffled and then classified into training datasets and validation datasets. Figure 6 Without random shuffling, the network learns the time series of the data, rather than the dynamic behavior of the vehicles.
[0086] In one embodiment, step S102 specifically includes the following steps:
[0087] Based on vehicle state information and according to the motion state of the target vehicle, construct vehicle kinematic equations;
[0088] The vehicle kinematic equations are transformed into a vehicle kinematic model in state-space form.
[0089] In this embodiment, the vehicle kinematic equations are as follows:
[0090]
[0091]
[0092] In the formula: v represents the longitudinal velocity of the target vehicle in the inertial coordinate system. y Let r represent the lateral velocity of the target vehicle in the vehicle coordinate system, and a represent the yaw rate. x Indicates longitudinal acceleration. v represents the lateral velocity of the target vehicle in the inertial coordinate system. x Let a represent the longitudinal velocity of the target vehicle in the vehicle coordinate system. y This indicates lateral acceleration.
[0093] The vehicle kinematic model can be represented as:
[0094]
[0095]
[0096] In the formula: r z This represents the yaw rate.
[0097] In one embodiment, step S103 specifically includes the following steps:
[0098] Vehicle status information is input into the input embedding layer, and the vehicle status information is then up-dimensioned through the input embedding layer to obtain sequence data;
[0099] The sine and cosine position codes in the position coding layer are used to add relative position information to the sequence data;
[0100] The sequence data is input into the encoder block stack layer to extract the data feature vector of the sequence data;
[0101] After reducing the dimensionality of the data feature vector through a global average pooling layer, the explicit vehicle speed of the target vehicle with the same dimension as the vehicle state information is output using a linear output layer.
[0102] In this embodiment, since the encoder block stack layer contains residual structures, its input and output dimensions remain consistent. Therefore, before data input, it first undergoes a dimensionality upscaling operation through an input embedding layer. In this embodiment, a fully connected layer is used for data dimensionality upscaling, and the activation function is ReLU. On the other hand, since the self-attention mechanism in the encoder block stack layer cannot directly capture the sequential relationship of the input data, a positional encoding layer is used to add relative positional information to the data before it enters the stack layer, enabling the model to capture temporal features. Specifically, sine positional encoding and cosine positional encoding in the positional encoding layer are used to add relative positional information to the sequence data. The calculation formula for sine positional encoding is as follows:
[0103]
[0104] In the formula: t represents the time point; d represents the sensor dimension; 2i represents an even number of sensors, encoded using a sine function (sin).
[0105] The formula for calculating cosine position coding is as follows:
[0106]
[0107] In the formula: 2i+1 represents an odd-numbered sensor, which is encoded using a cosine function (cos).
[0108] In one embodiment, the encoder block stack layer comprises multiple encoder blocks connected end-to-end. The step of inputting sequence data into the encoder block stack layer to extract the data feature vector of the sequence data specifically includes the following steps:
[0109] The query matrix, key matrix, and value matrix are calculated based on the sequence data and preset matrix weights.
[0110] The query matrix, key matrix, and value matrix are input into the multi-head attention mechanism layer in the encoder block to obtain the basic feature vector;
[0111] The basic feature vector is input into the feedforward network layer in the encoder block to update the state information in the basic feature vector, thus obtaining the data feature vector of the sequence data. The multi-head attention mechanism layer and the feedforward network layer are connected through the residual network and normalization layer in the encoder block.
[0112] In this embodiment, refer to Figure 7 The encoder block includes a multi-head attention mechanism layer, a feedforward network layer, a residual network, and a normalization layer. Based on the sequence data and preset matrix weights, the query matrix Q, key matrix K, and value matrix V are calculated. These matrixes are then input into the multi-head attention mechanism layer within the encoder block to obtain the basic feature vector. Figure 8 , Figure 8 This is a schematic diagram of the multi-head attention mechanism layer. The multi-head attention mechanism layer is the core mechanism for modeling sequence data in the Transformer encoder model. The input query matrix Q, key matrix K, and value matrix V of the multi-head attention layer represent the hidden state matrix of the same input sequence. N is the sequence length, and d is the dimension of the hidden state. Self-attention mechanisms extract temporal features of a sequence by calculating the attention distribution of the sequence at each position. The most commonly used attention mechanisms are additive attention and dot-product attention. In the Transformer encoder model, an improvement to the dot-product attention mechanism is called scaled dot-product attention, such as... Figure 9 As shown. The formula for calculating the scaling dot product attention is as follows:
[0113]
[0114] In the formula, This is the scaling factor.
[0115] Residual networks are used to sum the input x and output f(x) of a multi-head attention mechanism layer to obtain the final output x+f(x). When the model has many layers, residual connections can pass information from lower layers to higher layers with minimal decay. For example, in the Transformer encoder model, positional encoding is used to model the positional information of the sequence; the residual connection structure allows this positional information to be retained after multiple encodings. Furthermore, during backpropagation, the error signal can be directly propagated from the module's output to its input through the identity mapping constructed by residual connections, thus mitigating the vanishing gradient problem.
[0116] The normalization layer aims to normalize the input vector layer by layer. The formula for the normalization operation is as follows:
[0117]
[0118] Suppose there is an input vector x = [x1, x2, ..., xd] of dimension d. d ] Calculate the mean u and variance σ of the input vector. 2 The mean and variance of the input vector are normalized to constants through a normalization operation. In the equation, g and b are learnable weight vectors. This represents the element-wise multiplication of the corresponding vectors. When the input is a matrix... In this case, H can be viewed as consisting of N column vectors, and the normalization layer performs a normalization operation on each column vector in turn. Using the normalization operation method can keep the variance of the features within a certain range in each module, thus making the gradient more stable when training deep models.
[0119] After passing through the multi-head attention mechanism layer, the signal is transmitted to a feedforward network layer with two fully connected feedforward layers. The computation process of the feedforward network layer is shown below:
[0120] FFN(x) = W2Relu(W i x+b1)+b2
[0121] In the formula: W1 and W2 are learnable weight matrices, and b1 and b2 are learnable weight vectors.
[0122] Before finally obtaining the data feature vector of the sequence data, the maximum-minimum normalization method can be used to normalize the sequence data. The calculation process is as follows:
[0123]
[0124] In the formula: x i Sequence data representing the current point in time; and These represent the maximum and minimum values of the sensor at all time points, respectively; x′ i This represents the data obtained after normalization calculation.
[0125] In one embodiment, step S104 specifically includes the following steps:
[0126] The observation vector in the unscented Kalman filter method is generated based on the explicit vehicle speed;
[0127] The vehicle system state is constructed based on the vehicle kinematics model and using the unscented Kalman filter method;
[0128] Initialize the vehicle system state and the covariance matrix of the vehicle system state;
[0129] Substituting the observation vector into the vehicle system state calculation yields 2n+1 Sigma points;
[0130] Calculate the one-step prediction of all Sigma points to obtain the prediction point set, and obtain the one-step prediction value of the vehicle system state by calculating the weighted mean of the prediction point set.
[0131] By performing an unscented transformation on the one-step predicted value, the predicted mean and gain matrix of the observed vector are calculated.
[0132] The vehicle system state and covariance matrix are updated by combining the predicted mean and gain matrix;
[0133] Repeat the above steps until the preset number of times is reached, and finally output the estimated speed of the target vehicle.
[0134] In this embodiment, the algorithm structure of the unscented Kalman filter is as follows:
[0135] Step 1: Initialize the system state and its covariance matrix. The relevant formulas are as follows:
[0136]
[0137]
[0138] Step 2: Calculate 2n+1 sampling points (Sigma points), the relevant formula is as follows:
[0139]
[0140] In the formula: n is the state dimension, and λ is the scaling parameter.
[0141] Step 3: Calculate the one-step prediction for 2n+1 sampling points. After obtaining the predicted point set, substitute them into the equation to obtain the transformed point set. The relevant formulas are as follows:
[0142]
[0143] Step 4: The one-step prediction of the system state variables and its covariance matrix are obtained by weighting the predicted values from the sampled point set. Unlike traditional Kalman filtering, which only requires substituting the state variables from the previous time step into the state equation and performing a single calculation to obtain the state prediction, UKF utilizes the point predictions and calculates their weighted average to obtain the one-step prediction of the system state. The relevant formula is as follows:
[0144]
[0145]
[0146] Step 5: Apply an unscented transform to the one-step prediction values to calculate the predicted mean and gain matrix of the observation vector. The relevant formulas are as follows:
[0147]
[0148]
[0149]
[0150]
[0151] Step 6: State update and its covariance matrix update, the relevant formulas are as follows:
[0152]
[0153]
[0154] Step 7: Repeat the above steps until the set number of steps is reached.
[0155] In this embodiment, the state equation of the vehicle system is as follows:
[0156]
[0157]
[0158] In the formula: Let represent the longitudinal velocity of the target vehicle at time t. Let represent the lateral velocity of the target vehicle at time t. This represents the longitudinal velocity of the target vehicle at time t-1. Let r represent the lateral velocity of the target vehicle at time t-1, and let a represent the yaw rate. x a represents longitudinal acceleration. y ω represents lateral acceleration, T represents the sampling interval, and ω represents process noise.
[0159] The system's measurement equations are as follows:
[0160]
[0161]
[0162] In the formula: and That is, the observation vector, where v represents the measurement noise.
[0163] The present invention also discloses a distributed drive electric vehicle state estimation system, including a memory, a processor, and a computer program stored in the memory and executable on the processor. The processor executes the distributed drive electric vehicle state estimation method shown in any of the above embodiments.
[0164] The implementation principle of this method is as follows:
[0165] The following steps are executed by retrieving the program: acquiring vehicle state information through sensors inside the target vehicle, including yaw rate, lateral acceleration, and longitudinal acceleration; constructing a vehicle kinematic model based on the vehicle state information; explicitly calculating the target vehicle's speed based on the vehicle state information and using a Transformer encoder model; and calculating the estimated speed of the target vehicle by combining the explicit speed and the vehicle kinematic model and using an unscented Kalman filter method.
[0166] Through the execution of the above steps, since the constructed vehicle kinematic model considers the yaw motion of the target vehicle, and because the yaw rate is measurable, it can be used as the observation vector. First, utilizing the fitting capability of the Transformer encoder model, the explicit vehicle speed of the target vehicle is explicitly calculated using the Transformer encoder model as the observation vector. Then, an unscented Kalman filter is used to fuse this speed with the kinematic model to estimate the longitudinal and lateral velocities of the target vehicle. Compared to existing technologies that explicitly calculate the longitudinal speed based on wheel speed information and use it as the observation vector, where wheel speed only reflects vehicle speed under low wheel slip ratios, the method adopted in this invention can still provide relatively accurate estimation results of the vehicle state even when a precise dynamic model is difficult to obtain and the wheel slip ratio is high.
[0167] Those skilled in the art should understand that the discussion of any of the above embodiments is merely exemplary and is not intended to imply that the scope of protection of this application is limited to these examples; under the concept of this application, the technical features of the above embodiments or different embodiments can also be combined, the steps can be implemented in any order, and there are many other variations of different aspects of one or more embodiments of this application as described above, which are not provided in detail for the sake of brevity.
[0168] One or more embodiments in this application are intended to cover all such substitutions, modifications, and variations that fall within the broad scope of this application. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of one or more embodiments in this application should be included within the protection scope of this application.
Claims
1. A method for state estimation of a distributed-drive electric vehicle, characterized in that, Includes the following steps: Vehicle status information is acquired through sensors inside the target vehicle, including yaw rate, lateral acceleration, and longitudinal acceleration. A vehicle kinematic model is constructed based on the vehicle state information; The explicit speed of the target vehicle is calculated explicitly based on the vehicle status information and using the Transformer encoder model. The estimated speed of the target vehicle is calculated by combining the explicit vehicle speed and the vehicle kinematic model and using the unscented Kalman filter method. The Transformer encoder model includes an input embedding layer, a position encoding layer, an encoder block stacking layer, a global average pooling layer, and a linear output layer. The step of explicitly calculating the explicit vehicle speed based on the vehicle state information and using the Transformer encoder model includes the following steps: The vehicle status information is input into the input embedding layer, and the vehicle status information is then up-dimensioned through the input embedding layer to obtain sequence data; The sine and cosine position codes in the position coding layer are used to add relative position information to the sequence data; The sequence data is input into the encoder block stack layer to extract the data feature vector of the sequence data; After the data feature vector is reduced in dimensionality by the global average pooling layer, the explicit vehicle speed of the target vehicle with the same dimension as the vehicle state information is output by the linear output layer.
2. The distributed drive electric vehicle state estimation method according to claim 1, characterized in that: The vehicle status information is time-series data, and it also includes the wheel speeds, wheel torques, and front wheel steering angles of all wheels of the target vehicle.
3. The distributed drive electric vehicle state estimation method according to claim 2, characterized in that, The method further includes the following steps: The vehicle state information is segmented based on a preset sliding time window and sample number to obtain multiple training sample feature data. After randomly shuffling the feature data of multiple training samples, they are classified into training datasets and validation datasets respectively. The Transformer encoder model is trained and optimized by combining the training dataset and the validation dataset.
4. The distributed drive electric vehicle state estimation method according to claim 1, characterized in that, The process of constructing a vehicle kinematic model based on the vehicle state information includes the following steps: Based on the vehicle state information and the motion state of the target vehicle, a vehicle kinematic equation is constructed, which is as follows: In the formula: This represents the longitudinal velocity of the target vehicle in the inertial coordinate system. This represents the lateral velocity of the target vehicle in the vehicle coordinate system. This indicates the yaw rate. This indicates the longitudinal acceleration. This represents the lateral velocity of the target vehicle in the inertial coordinate system. This represents the longitudinal velocity of the target vehicle in the vehicle coordinate system. This indicates the lateral acceleration; The vehicle kinematic equations are converted into a vehicle kinematic model in state-space form.
5. The distributed drive electric vehicle state estimation method according to claim 1, characterized in that, The encoder block stack layer comprises multiple encoder blocks connected end-to-end. The step of inputting the sequence data into the encoder block stack layer to extract the data feature vector of the sequence data includes the following steps: The query matrix, key matrix, and value matrix are calculated based on the sequence data and preset matrix weights. The query matrix, the key matrix, and the value matrix are input into the multi-head attention mechanism layer in the encoder block to obtain the basic feature vector; The basic feature vector is input into the feedforward network layer in the encoder block to update the state information in the basic feature vector, thereby obtaining the data feature vector of the sequence data. The multi-head attention mechanism layer and the feedforward network layer are connected through the residual network and normalization layer in the encoder block.
6. The distributed drive electric vehicle state estimation method according to claim 1, characterized in that, The process of combining the explicit vehicle speed and the vehicle kinematic model and calculating the estimated speed of the target vehicle using the unscented Kalman filter method includes the following steps: The observation vector in the unscented Kalman filter method is generated based on the explicit vehicle speed. The vehicle system state is constructed based on the vehicle kinematics model and using the unscented Kalman filtering method. Initialize the vehicle system state and the covariance matrix of the vehicle system state; Substituting the observation vector into the vehicle system state calculation yields 2n+1 Sigma points; A one-step prediction of all the Sigma points is calculated to obtain a prediction point set, and a one-step prediction of the vehicle system state is obtained by calculating the weighted mean of the prediction point set. By performing an unscented transformation on the predicted value in the first step, the predicted mean and gain matrix of the observed vector are calculated. The vehicle system state and the covariance matrix are updated by combining the predicted mean and the gain matrix; Repeat the above steps until the preset number of times is reached, and finally output the estimated speed of the target vehicle.
7. The distributed drive electric vehicle state estimation method according to claim 6, characterized in that, The state equation for the vehicle system state is as follows: In the formula: express The longitudinal speed of the target vehicle at time _____. express The lateral velocity of the target vehicle at that moment. express The longitudinal speed of the target vehicle at time _____. express The lateral velocity of the target vehicle at that moment. This indicates the yaw rate. This indicates the longitudinal acceleration. This indicates the lateral acceleration. Indicates the sampling interval. This indicates process noise.
8. A distributed drive electric vehicle state estimation system, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the method as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Vehicle state estimation method and system combining neural network and unscented Kalman filter
CN115556755A
Method and apparatus for estimating position
US20220058401A1
