Gradient calculation method and device, storage medium and electronic equipment
By collecting data under static and dynamic operating conditions to calculate the rotation matrix and angle of the vehicle controller, and correcting the six-axis gyroscope data, the slope estimation error problem caused by changes in the installation position of the vehicle controller is solved, and the accuracy and applicability of the slope calculation are achieved.
Patent Information
- Application Number
- CN202510764763.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-09
- Publication Date
- 2025-08-19
- Estimated Expiration
- 2045-06-09
AI Technical Summary
The existing slope estimation calculation method cannot accurately estimate slope parameters when the installation position deviation or change of the vehicle vehicle controller is installed. Especially the method based on the vehicle longitudinal dynamic equation and longitudinal kinematic equation requires high requirements for sensor installation position and measurement accuracy, and errors are prone to occur.
By collecting static data of the vehicle under static operating conditions, calculating the installation attitude rotation matrix and rotation angle of the vehicle controller, combining data under dynamic driving conditions, correcting the real-time acceleration and angular velocity data of the six-axis gyroscope, and using coordinate changes to achieve data correction to adapt to changes in the installation positions of different sensors.
It realizes accurate correction of gyroscope data when the installation position of the vehicle controller is uncertain or changed, ensuring the accuracy and applicability of slope calculation, and improving the accuracy and applicability of slope estimation.
Smart Images

Figure CN120503799A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of vehicles, and in particular to a slope calculation method, device, storage medium and electronic equipment. Background Art
[0002] Real-time slope is a crucial parameter for implementing functions such as gear shifting, mass estimation, and powertrain regulation. Vehicles often travel on uneven roads, such as those in mountainous areas. Obtaining real-time slope is crucial for adjusting system operating modes and improving vehicle control performance. Existing slope estimation algorithms are based on either the vehicle's longitudinal dynamics equation or the vehicle's longitudinal kinematics equation.
[0003] Slope estimation algorithms based on the vehicle's longitudinal dynamics equations are implemented based on the vehicle's equilibrium equations. This approach places high demands on the accuracy of the vehicle dynamics model, key model parameters, and data acquisition precision. Lack of sensor measurements, inaccurate sensor measurements, or unknown vehicle mass can lead to significant errors. Alternative approaches based on the vehicle's longitudinal kinematics equations estimate the longitudinal road slope by calculating the difference between the sensor-collected acceleration and the vehicle's acceleration in the direction of travel, using methods such as least squares with a forgetting factor or Kalman filtering. This approach places high demands on the installation position of the longitudinal acceleration sensor and the accuracy of the measurement values. High-frequency noise in the signal acquisition, the forgetting factor, and the choice of the Kalman filter coefficient matrix all significantly impact the accuracy of the results.
[0004] During the prototype vehicle verification phase or vehicle maintenance, it is inevitable that the vehicle controller installation position deviation or change will occur. In this case, the above-mentioned existing technology cannot accurately achieve slope parameter estimation. Summary of the Invention
[0005] In view of the above problems, the present invention provides a slope calculation method, device, storage medium and electronic device that overcome the above problems or at least partially solve the above problems.
[0006] In a first aspect, a slope calculation method includes:
[0007] Collect static data of the vehicle under static working conditions, and calculate the installation posture rotation matrix, first rotation angle, and second rotation angle of the vehicle controller based on the static data, wherein the first rotation angle is the rotation angle of the vehicle controller around the Y axis of its own coordinate system, and the second rotation angle is the rotation angle of the vehicle controller around the X axis of its own coordinate system;
[0008] Collecting dynamic data of the vehicle under dynamic driving conditions, and calculating a third rotation angle based on the dynamic data and the installation posture rotation matrix, wherein the third rotation angle is an angular change between the installation direction of the vehicle controller and the driving direction of the vehicle;
[0009] The real-time acceleration data and the real-time angular velocity data collected by the six-axis gyroscope are corrected according to the first rotation angle, the second rotation angle and the third rotation angle, and the corresponding slope value is calculated according to the corrected real-time acceleration data and the real-time angular velocity data.
[0010] Optionally, in certain optional embodiments, collecting static data of the vehicle under static working conditions and calculating the installation posture rotation matrix, the first rotation angle, and the second rotation angle of the vehicle controller based on the static data include:
[0011] Collecting static data of the vehicle under static operating conditions, wherein the static data is collected based on a six-axis gyroscope and includes: static X-axis acceleration, static Y-axis acceleration, and static Z-axis acceleration. The static operating condition is an operating condition with a slope of zero and within the first time range from system power-up to engine ignition.
[0012] Calculating the arithmetic mean of the static X-axis acceleration, the static Y-axis acceleration, and the static Z-axis acceleration respectively;
[0013] Calculating the local acceleration of gravity according to the arithmetic average of the static X-axis acceleration, the static Y-axis acceleration, and the static Z-axis acceleration;
[0014] Calculating a first rotation angle according to the arithmetic mean of the static X-axis acceleration and the gravitational acceleration;
[0015] An installation posture rotation matrix and a second rotation angle are calculated according to the first rotation angle and the gravitational acceleration.
[0016] Optionally, in certain optional implementations, calculating the installation posture rotation matrix and the second rotation angle according to the first rotation angle and the gravitational acceleration includes:
[0017] Calculating a first rotation matrix according to the first rotation angle;
[0018] Calculating a second rotation matrix based on the first rotation matrix;
[0019] Calculating an installation posture rotation matrix of the vehicle controller based on the first rotation matrix and the second rotation matrix;
[0020] A second rotation angle is calculated according to the installation posture rotation matrix and the gravitational acceleration.
[0021] Optionally, in certain optional embodiments, collecting dynamic data of the vehicle under dynamic driving conditions, and calculating a third rotation angle based on the dynamic data and the installation posture rotation matrix, includes:
[0022] Collecting dynamic data of the vehicle under dynamic driving conditions, wherein the dynamic data is collected based on a six-axis gyroscope and includes dynamic acceleration and dynamic angular velocity, and the dynamic conditions include acceleration, deceleration, turning, uphill and downhill;
[0023] Obtaining a third rotation matrix according to the installation posture rotation matrix;
[0024] Discretizing the third rotation matrix within a variation range of a third rotation angle to obtain a discretized third rotation matrix, wherein the variation range of the third rotation angle is 0 degrees to 360 degrees;
[0025] Correcting and calculating the dynamic data based on the discretized third rotation matrix to obtain two minimum values of the sum of the absolute values of the angular velocities;
[0026] Substituting the first minimum value into a discretized third rotation matrix to correct the dynamic X-axis acceleration in the dynamic acceleration, and calculating the sum of the absolute values of the difference between the corrected dynamic X-axis acceleration and the vehicle X-axis acceleration obtained by calculating the vehicle speed differential;
[0027] The minimum sum of the absolute values of the differences is used as the third rotation angle.
[0028] Optionally, in certain optional embodiments, the correcting the real-time acceleration data and the real-time angular velocity data collected by the six-axis gyroscope according to the first rotation angle, the second rotation angle, and the third rotation angle, and calculating the corresponding slope value according to the corrected real-time acceleration data and the real-time angular velocity data includes:
[0029] Preprocessing the real-time acceleration data and real-time angular velocity data collected by the six-axis gyroscope, wherein the preprocessing includes: outlier removal processing, five-point mean filtering processing and low-pass filtering processing;
[0030] Calculating a data rotation correction matrix according to the first rotation angle, the second rotation angle, and the third rotation angle;
[0031] Constructing a corresponding acceleration vector and angular velocity vector based on the preprocessed real-time acceleration data and real-time angular velocity data, wherein the real-time acceleration data corresponds to the acceleration vector, and the real-time angular velocity data corresponds to the angular velocity vector;
[0032] Calculating acceleration data in a vehicle coordinate system according to the acceleration vector and the data rotation correction matrix;
[0033] Calculating angular velocity data in the vehicle coordinate system according to the angular velocity vector and the data rotation correction matrix;
[0034] A corresponding slope value is calculated based on the acceleration data in the vehicle coordinate system and the angular velocity data in the vehicle coordinate system.
[0035] Optionally, in certain optional implementations, calculating the corresponding slope value based on the acceleration data in the vehicle coordinate system and the angular velocity data in the vehicle coordinate system includes:
[0036] Calculating a first slope estimation value based on the acceleration data in the vehicle coordinate system, and performing low-pass filtering on the first slope estimation value;
[0037] Performing high-pass filtering on the angular velocity data in the vehicle coordinate system to obtain high-frequency angular velocity data;
[0038] Calculating a second slope estimation value based on the high-frequency angular velocity data and the slope value calculated last time;
[0039] A corresponding slope value is calculated based on the first slope estimation value after low-pass filtering, the second slope value, and a preset complementary filtering weight coefficient.
[0040] In a second aspect, a slope calculation device includes: a static data processing unit, a dynamic data processing unit, and a slope value calculation unit;
[0041] The static data processing unit is used to collect static data of the vehicle under static working conditions, and calculate the installation posture rotation matrix, the first rotation angle and the second rotation angle of the vehicle controller based on the static data, wherein the first rotation angle is the rotation angle of the vehicle controller around the Y axis of its own coordinate system, and the second rotation angle is the rotation angle of the vehicle controller around the X axis of its own coordinate system;
[0042] The dynamic data processing unit is used to collect dynamic data of the vehicle under dynamic driving conditions, and calculate a third rotation angle based on the dynamic data and the installation posture rotation matrix, wherein the third rotation angle is an angular change between the installation direction of the vehicle controller and the driving direction of the vehicle;
[0043] The slope value calculation unit is used to correct the real-time acceleration data and real-time angular velocity data collected by the six-axis gyroscope according to the first rotation angle, the second rotation angle and the third rotation angle, and calculate the corresponding slope value based on the corrected real-time acceleration data and real-time angular velocity data.
[0044] Optionally, in certain optional embodiments, the static data processing unit includes: a static data acquisition subunit, an arithmetic mean calculation subunit, a gravity acceleration calculation subunit, a first rotation angle calculation subunit, and an angle matrix calculation subunit;
[0045] The static data acquisition subunit is used to collect static data of the vehicle under static working conditions, wherein the static data is acquired based on the six-axis gyroscope and includes: static X-axis acceleration, static Y-axis acceleration, and static Z-axis acceleration. The static working condition is a working condition with a slope of 0 and within the first time range from system power-on to engine ignition.
[0046] The arithmetic mean calculation subunit is used to calculate the arithmetic mean of the static X-axis acceleration, the static Y-axis acceleration and the static Z-axis acceleration respectively;
[0047] The gravity acceleration calculation subunit is used to calculate the local gravity acceleration according to the arithmetic average of the static X-axis acceleration, the static Y-axis acceleration and the static Z-axis acceleration;
[0048] The first rotation angle calculation subunit is configured to calculate a first rotation angle according to the arithmetic mean of the static X-axis acceleration and the gravitational acceleration;
[0049] The angle matrix calculation subunit is configured to calculate an installation posture rotation matrix and a second rotation angle according to the first rotation angle and the gravitational acceleration.
[0050] In a third aspect, a computer-readable storage medium stores a program, which, when executed by a processor, implements any of the above-mentioned slope calculation methods.
[0051] In a fourth aspect, an electronic device comprises at least one processor, and at least one memory and a bus connected to the processor; wherein the processor and the memory communicate with each other through the bus; and the processor is used to call program instructions in the memory to execute any of the above-mentioned slope calculation methods.
[0052] By means of the above technical scheme, the present invention provides a slope calculation method, device, storage medium and electronic device, which can collect static data of a vehicle under static conditions, and calculate the installation posture rotation matrix, the first rotation angle and the second rotation angle of the vehicle controller based on the static data, wherein the first rotation angle is the rotation angle of the vehicle controller around the Y axis of its own coordinate system, and the second rotation angle is the rotation angle of the vehicle controller around the X axis of its own coordinate system; collect dynamic data of the vehicle under dynamic driving conditions, and calculate the third rotation angle based on the dynamic data and the installation posture rotation matrix, wherein the third rotation angle is the angle change between the installation direction of the vehicle controller and the driving direction of the vehicle; according to the first rotation angle, the second rotation angle and the third rotation angle, the real-time acceleration data and real-time angular velocity data collected by the six-axis gyroscope are corrected, and the corresponding slope value is calculated based on the corrected real-time acceleration data and real-time angular velocity data. From this, it can be seen that the present invention can realize the correction of gyroscope data based on coordinate changes, can achieve compatibility with different sensor installation positions, and can realize the correction of gyroscope data based on static data and dynamic data, so that even if the installation position of the vehicle controller is not completely determined or the installation position of the vehicle controller changes after vehicle maintenance, the gyroscope data can still be accurately corrected to ensure the accuracy and applicability of slope calculation.
[0053] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are specifically listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] Various other advantages and benefits will become apparent to those skilled in the art upon reading the detailed description of the preferred embodiment below. The accompanying drawings are for illustration purposes only and are not to be considered as limiting the present invention. The same reference symbols are used throughout the drawings to represent the same components. In the drawings:
[0055] Figure 1 A flow chart showing a first slope calculation method provided by the present invention is shown;
[0056] Figure 2 A data correction flow chart of a six-axis gyroscope provided by the present invention is shown;
[0057] Figure 3 A schematic diagram of coordinate transformation of a six-axis gyroscope provided by the present invention is shown;
[0058] Figure 4A flow chart showing a second slope calculation method provided by the present invention is shown;
[0059] Figure 5 A schematic structural diagram of a slope calculation device provided by the present invention is shown;
[0060] Figure 6 A schematic structural diagram of an electronic device provided by the present invention is shown. DETAILED DESCRIPTION
[0061] Exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of the present invention are shown in the accompanying drawings, it should be understood that the present invention can be implemented in various forms and should not be limited by the embodiments set forth herein. Rather, these embodiments are provided to enable a more thorough understanding of the present invention and to fully convey the scope of the present invention to those skilled in the art.
[0062] like Figure 1 As shown, the present invention provides a slope calculation method, including: S100, S200 and S300;
[0063] S100, collecting static data of the vehicle under static working conditions, and calculating the installation posture rotation matrix, a first rotation angle, and a second rotation angle of the vehicle controller based on the static data, wherein the first rotation angle is the rotation angle of the vehicle controller around the Y axis of its own coordinate system, and the second rotation angle is the rotation angle of the vehicle controller around the X axis of its own coordinate system;
[0064] Alternatively, the static operating condition referred to in the present invention can be understood as the operating condition in which the vehicle is stationary on a standard test site with a slope of zero, and the vehicle system is operating for a period of time between power-up and engine ignition. Specifically, the present invention can collect six-axis gyroscope acceleration data from the vehicle system for a period of time between power-up and engine ignition as the static data referred to in the present invention, and the present invention is not limited to this.
[0065] For example, in some optional embodiments, the S100 includes: step 1.1, step 1.2, step 1.3, step 1.4 and step 1.5;
[0066] Step 1.1. Collect static data of the vehicle under static operating conditions, wherein the static data is collected based on a six-axis gyroscope and includes: static X-axis acceleration, static Y-axis acceleration, and static Z-axis acceleration. The static operating condition is the operating condition with a slope of zero and within the first time range from system power-up to engine ignition.
[0067] Optionally, the six-axis gyroscope referred to in the present invention can be a gyroscope already installed on the vehicle, used to collect changes in the vehicle's attitude along the X, Y, and Z axes (encoded roll, pitch, and yaw angles). The present invention can obtain static data by directly reading the data collected by the six-axis gyroscope. It should be noted that the X-axis data reflects changes in the vehicle's roll angle, the Y-axis data reflects changes in the vehicle's pitch angle, and the Z-axis data reflects changes in the vehicle's yaw angle, although this is not a limitation of the present invention.
[0068] Step 1.2, respectively calculating the arithmetic mean of the static X-axis acceleration, the static Y-axis acceleration, and the static Z-axis acceleration;
[0069] Optionally, the arithmetic mean referred to in the present invention is a well-known technical concept in the art. As previously mentioned, the present invention collects data over a period of time. For static X-axis acceleration, static Y-axis acceleration, and static Z-axis acceleration, each includes data at multiple moments. Therefore, the present invention can calculate the arithmetic mean based on the data at multiple moments, as shown in Formula 1 below.
[0070] Formula 1: , where i is the code at different times, is the number of moments, is the arithmetic mean of the static X-axis acceleration, is the arithmetic mean of the static Y-axis acceleration, is the arithmetic mean of the static Z-axis acceleration.
[0071] Step 1.3, calculating the local acceleration of gravity based on the arithmetic mean of the static X-axis acceleration, the static Y-axis acceleration, and the static Z-axis acceleration;
[0072] Optionally, the gravitational acceleration can be calculated using data of three-axis components, namely, the X-axis, the Y-axis, and the Z-axis, as shown in the following formula 2.
[0073] Formula 2: ,in, The acceleration is gravity, and the present invention does not impose any limitation on this.
[0074] Step 1.4: Calculate a first rotation angle based on the arithmetic mean of the static X-axis acceleration and the gravitational acceleration;
[0075] Alternatively, the coordinate system posture corresponding to the vehicle controller's installation posture can be obtained from the earth coordinate system through two rotational transformations around its own coordinate axis. Therefore, the present invention can calculate the first rotation angle, i.e., the rotation angle around its own coordinate system axis, based on the arithmetic mean of the previously calculated static X-axis acceleration and the acceleration of gravity. The specific calculation process is shown in Formula 3 below.
[0076] Formula 3: ,in, This is the first rotation angle, and the present invention does not impose any limitation on this.
[0077] Step 1.5: Calculate the installation posture rotation matrix and the second rotation angle according to the first rotation angle and the gravitational acceleration.
[0078] For example, in some optional embodiments, the step 1.5 includes: step 2.1, step 2.2, step 2.3 and step 2.4;
[0079] Step 2.1: Calculate a first rotation matrix based on the first rotation angle;
[0080] Optionally, based on the first rotation angle shown in Formula 3, the present invention can obtain the first rotation angle shown in Formula 4, which is not limited in the present invention.
[0081] Formula 4: ,in, is the first rotation matrix, which is not limited in the present invention.
[0082] Step 2.2: Calculate a second rotation matrix based on the first rotation matrix.
[0083] Optionally, based on the first rotation matrix shown in Formula 4, the present invention can transform to obtain a second rotation matrix as shown in Formula 5, and the present invention does not impose any limitation on this.
[0084] Formula 5: ,in, is the first rotation matrix, is the second rotation angle. It should be noted that: It is only used to represent the second rotation angle, and no specific value has been obtained, that is, It is an unknown quantity and its specific value needs to be calculated in subsequent steps. Please refer to the subsequent steps for details. The present invention does not limit this.
[0085] Step 2.3: Calculate the installation posture rotation matrix of the vehicle controller based on the first rotation matrix and the second rotation matrix;
[0086] Optionally, based on the expressions of Formula 4 and Formula 5, the present invention can obtain the expression shown in Formula 6, which is used to express the installation posture rotation matrix of the vehicle controller. The present invention does not impose any limitation on this.
[0087] Formula 6: ,in, The controller's installation posture rotation matrix is calculated from statically collected data, and the present invention does not impose any limitation on this.
[0088] Step 2.4: Calculate a second rotation angle according to the installation posture rotation matrix and the gravitational acceleration.
[0089] Optionally, after updating the matrix based on the installation posture rotation matrix shown in Formula 6, the present invention can use the component of gravity acceleration to calculate the specific value of θ2. That is, the present invention can calculate the specific value of θ2 based on the gravity vector in the rotated coordinate system. Axis and The second rotation angle is obtained by calculating the components of the axis, and the present invention does not impose any limitation on this.
[0090] S200, collecting dynamic data of the vehicle under dynamic driving conditions, and calculating a third rotation angle based on the dynamic data and the installation posture rotation matrix, wherein the third rotation angle is an angular change between the installation direction of the vehicle controller and the driving direction of the vehicle;
[0091] For example, in some optional embodiments, the S200 includes: step 3.1, step 3.2, step 3.3, step 3.4, step 3.5 and step 3.6;
[0092] Step 3.1, collecting dynamic data of the vehicle under dynamic driving conditions, wherein the dynamic data is collected based on a six-axis gyroscope and includes dynamic acceleration and dynamic angular velocity, and the dynamic conditions include acceleration, deceleration, turning, uphill and downhill;
[0093] Optionally, the present invention can collect and record the dynamic six-axis gyroscope acceleration data of the vehicle under specific driving conditions. The specific driving conditions include: acceleration, deceleration, turning, uphill and downhill scenarios. Of course, the present invention is not limited to these specific conditions. The present invention can also collect corresponding dynamic data for other feasible conditions, and the present invention does not limit this.
[0094] Step 3.2: Obtain a third rotation matrix according to the installation posture rotation matrix;
[0095] Optionally, under the premise that the installation posture of the vehicle controller is determined (that is, the installation posture rotation matrix is determined), the angle variation range between the installation direction and the vehicle driving direction is , then calculate the third rotation angle The third rotation matrix It can be expressed as shown in the following formula 7.
[0096] Formula 7:
[0097] Optionally, in order to further clarify the coordinate system transformation process of the present invention, the present invention provides the following Figure 2 It should be noted that coordinate transformation is a well-known technical process in the art. For the contents in the figure, please refer to the relevant descriptions in the art, and the present invention will not elaborate on it.
[0098] Optionally, the third rotation matrix is a rotation around the Z axis of the earth coordinate system. Assuming that the rotation angle is θ3, the third rotation matrix can be converted through a mathematical formula.
[0099] Step 3.3: discretize the third rotation matrix within a variation range of the third rotation angle to obtain a discretized third rotation matrix, wherein the variation range of the third rotation angle is 0 degrees to 360 degrees;
[0100] Optionally, by combining the first rotation matrix, the second rotation matrix and the third rotation matrix, the present invention can obtain the rotation matrix from the vehicle coordinate system to the vehicle controller coordinate system: , as shown in the following formula 8.
[0101] Formula 8:
[0102] Optionally, based on Formula 8, the present invention is within the third rotation angle variation range (ie, ) is discretized to obtain the rotation matrix from the vehicle coordinate system to the vehicle controller coordinate system after the discrete angle , that is, in , the present invention does not limit this.
[0103] Step 3.4: Based on the discretized third rotation matrix, the dynamic data is corrected and calculated to obtain two minimum values of the sum of the absolute values of the angular velocities;
[0104] Optionally, under dynamic driving conditions, the present invention can be based on the rotation matrix Correct the collected acceleration and angular velocity data of the six-axis gyroscope to obtain the corrected acceleration of the six-axis gyroscope and angular velocity , as shown in the following formula 9.
[0105] Formula 9:
[0106] Optionally, after the correction shown in Formula 9, the angular velocity data collected by the six-axis gyroscope about the X-axis, Y-axis, and Z-axis are consistent with the vehicle's roll, pitch, and yaw angular velocities. When the vehicle is going uphill or downhill, the pitch angular velocity changes more significantly; when the vehicle is turning, the yaw angular velocity changes more significantly. Therefore, under the specified vehicle dynamic driving conditions, the roll angular velocity changes the least. Based on this vehicle driving characteristic, when the rotation matrix is The collected six-axis gyroscope data is corrected and the sum of the absolute values of the vehicle's roll angular velocity under the entire dynamic driving condition is calculated, as shown in the following formula 10.
[0107] Formula 10:
[0108] Optionally, in the entire discrete interval, two minimum values of the sum of the absolute values of the angular velocities are obtained, and the corresponding third rotation angles are and , which respectively correspond to the two situations where the x-axis of the vehicle controller coordinate system and the vehicle coordinate system are in the same direction or in the opposite direction after the transformation, and the present invention does not impose any limitation on this.
[0109] Step 3.5: Substituting the first minimum value into the discretized third rotation matrix to correct the dynamic X-axis acceleration in the dynamic acceleration, and calculating the sum of the absolute values of the difference between the corrected dynamic X-axis acceleration and the vehicle X-axis acceleration obtained by the vehicle speed differential;
[0110] Step 3.6: The minimum sum of the absolute values of the differences is used as the third rotation angle.
[0111] Optionally, the present invention can calculate when the third rotation angle is and When the six-axis gyroscope is corrected The smaller value of the sum of the absolute values of the difference between the shaft acceleration and the vehicle acceleration obtained by differentiating the vehicle speed corresponds to the third rotation angle obtained, and the present invention does not impose any limitation on this.
[0112] Alternatively, the present invention can collect a set of data that includes data from multiple dynamic operating conditions to avoid inaccurate calculations due to a single operating condition. For example, if the vehicle is driving at a constant speed on a flat road, the longitudinal acceleration of the vehicle and the effect of the gravity component caused by the slope cannot be collected.
[0113] Optionally, a data set may have two minimum values. The range of the θ3 rotation angle is 0-360°. The calculation of the third rotation angle utilizes the vehicle's driving characteristics. Under the above operating conditions, the sum of the absolute values of the angular velocities about the vehicle coordinate system's x-axis is minimized. After calibration, if the controller's x-axis and the vehicle's x-axis are in the same or opposite directions, the condition of the minimum sum of absolute values is met, resulting in two minimum values. This is not a limitation of the present invention.
[0114] Optionally, in order to further clarify the data correction process of the present invention, the present invention provides the following Figure 3 The data correction flow chart shown in the figure, please refer to the above explanation for understanding the content, the present invention will not elaborate on this.
[0115] S300. Correct the real-time acceleration data and real-time angular velocity data collected by the six-axis gyroscope according to the first rotation angle, the second rotation angle, and the third rotation angle, and calculate a corresponding slope value according to the corrected real-time acceleration data and real-time angular velocity data.
[0116] For example, in some optional embodiments, the S300 includes: step 4.1, step 4.2, step 4.3, step 4.4, step 4.5 and step 4.6;
[0117] Step 4.1, preprocessing the real-time acceleration data and real-time angular velocity data collected by the six-axis gyroscope, wherein the preprocessing includes: outlier removal processing, five-point mean filtering processing and low-pass filtering processing;
[0118] Optionally, to improve the accuracy of the present invention, the present invention may perform certain preprocessing on the collected data. For example, preprocessing of the acceleration and angular velocity signals collected by the gyroscope may include outlier removal, five-point mean filtering, and low-pass filtering, etc., which are not limited by the present invention.
[0119] Step 4.2: Calculate a data rotation correction matrix based on the first rotation angle, the second rotation angle, and the third rotation angle;
[0120] Optionally, the present invention can use the first rotation angle calculated above , the second rotation angle and the third rotation angle , calculate and obtain the data rotation correction matrix of the data collected by the six-axis gyroscope, which is not limited in the present invention.
[0121] Step 4.3: constructing a corresponding acceleration vector and angular velocity vector based on the preprocessed real-time acceleration data and real-time angular velocity data, wherein the real-time acceleration data corresponds to the acceleration vector, and the real-time angular velocity data corresponds to the angular velocity vector;
[0122] Optionally, the present invention can construct the acceleration vector and angular velocity vector of the six-axis gyroscope based on the preprocessed real-time acceleration data and real-time angular velocity data, respectively, and then obtain the acceleration data and angular velocity data of the six-axis gyroscope in the vehicle coordinate system after operation with the aforementioned rotation correction matrix. The present invention does not impose any restrictions on this.
[0123] Step 4.4, calculating acceleration data in the vehicle coordinate system based on the acceleration vector and the data rotation correction matrix;
[0124] Step 4.5: Calculate the angular velocity data in the vehicle coordinate system based on the angular velocity vector and the data rotation correction matrix;
[0125] Step 4.6: Calculate the corresponding slope value based on the acceleration data and the angular velocity data in the vehicle coordinate system.
[0126] For example, in some optional embodiments, the step 4.6 includes: step 5.1, step 5.2, step 5.3 and step 5.4;
[0127] Step 5.1: Calculate a first slope estimate based on the acceleration data in the vehicle coordinate system, and perform low-pass filtering on the first slope estimate;
[0128] Optionally, when the vehicle is traveling on a slope, the longitudinal acceleration sensed and collected is the sum of the component of gravity acceleration along the slope and the vehicle's actual longitudinal acceleration. Based on the kinematic relationship, the road slope can be calculated as shown in the following formula 11.
[0129] Formula 11: ,in, Calculated by the first-order differential of the vehicle speed.
[0130] Optionally, after the road slope is calculated by formula 11, the calculated road slope is low-pass filtered to obtain a first slope estimation value.
[0131] Step 5.2: performing high-pass filtering on the angular velocity data in the vehicle coordinate system to obtain high-frequency angular velocity data;
[0132] It should be noted that due to the characteristics of data collected by the six-axis gyroscope, acceleration data is more accurate over long periods of time, while gyroscope data is more accurate over short periods of time. Due to road conditions and the installation location of the vehicle controller, the collected acceleration signal is contaminated with high-frequency interference signals. The initial slope estimate obtained using a low-pass filter often fails to meet the requirements. A small filter time constant cannot effectively reduce the interference caused by high-frequency signals. A large filter time constant introduces a delay in the estimation result, affecting the real-time performance of the calculation.
[0133] Therefore, the present invention can compensate the initial slope estimation value by extracting the high-frequency signal of the angular velocity data of the six-axis gyroscope, that is, performing high-pass filtering, thereby improving the accuracy of the final slope estimation result.
[0134] In addition, the angular velocity data of the six-axis gyroscope often has zero drift or temperature drift, and direct integration to calculate the slope will produce a large deviation. The axis angular velocity data, namely the pitch angular velocity data, is processed by a high-pass filter to obtain a high-frequency signal of the angular velocity data, which is not limited in the present invention.
[0135] Step 5.3: Calculate a second slope estimate based on the high-frequency angular velocity data and the slope value calculated last time;
[0136] Optionally, the present invention can be based on the final slope estimation result calculated at the last moment, the six-axis gyroscope around the vehicle coordinate system, The second slope estimation value is calculated based on the angular velocity data of the axis, as shown in the following formula 12.
[0137] Formula 12:
[0138] Step 5.4: Calculate a corresponding slope value based on the first slope estimation value after low-pass filtering, the second slope value, and a preset complementary filtering weight coefficient.
[0139] Optionally, further, the present invention is based on the complementary filter weight coefficient , the final slope estimation value is calculated as shown in the following formula 13.
[0140] Formula 13:
[0141] Optionally, in order to further clarify the slope estimation process of the present invention, the present invention provides the following Figure 4 The slope estimation algorithm flow chart shown in the figure, please refer to the above explanation for understanding the content in the figure, and the present invention will not elaborate on it.
[0142] The present invention can realize six-axis gyroscope data correction based on coordinate system transformation, and realize slope estimation by using complementary filtering. Compared with traditional slope estimation algorithms, the present invention can realize compatibility with different sensor installation positions, thereby improving the applicability of the algorithm. The present invention also realizes the calculation of key parameters for gyroscope data correction based on static and dynamic calibration, which is conducive to the correction of gyroscope data when the installation position of the whole vehicle controller is not completely determined during the prototype vehicle verification or the installation position of the whole vehicle controller changes after the vehicle maintenance. The present invention also realizes slope estimation based on complementary filtering, realizes the complementarity of acceleration and angular velocity data characteristics, improves the smoothness of the slope estimation result without generating time delay, and avoids the problem of key parameters being difficult to give compared with the implementation method of Kalman filtering.
[0143] Although the operations are depicted in a particular order, this should not be understood as requiring that the operations be performed in the particular order shown or in a sequential order.Multitasking and parallel processing may be advantageous under certain circumstances.
[0144] It should be understood that the various steps described in the method embodiments of the present invention may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present invention is not limited in this respect.
[0145] like Figure 5 As shown, the present invention provides a slope calculation device, comprising: a static data processing unit 100, a dynamic data processing unit 200 and a slope value calculation unit 300;
[0146] The static data processing unit 100 is used to collect static data of the vehicle under static working conditions, and calculate the installation posture rotation matrix, the first rotation angle and the second rotation angle of the vehicle controller based on the static data, wherein the first rotation angle is the rotation angle of the vehicle controller around the Y axis of its own coordinate system, and the second rotation angle is the rotation angle of the vehicle controller around the X axis of its own coordinate system;
[0147] The dynamic data processing unit 200 is used to collect dynamic data of the vehicle under dynamic driving conditions, and calculate a third rotation angle based on the dynamic data and the installation posture rotation matrix, wherein the third rotation angle is the angular change between the installation direction of the vehicle controller and the driving direction of the vehicle;
[0148] The slope value calculation unit 300 is used to correct the real-time acceleration data and real-time angular velocity data collected by the six-axis gyroscope according to the first rotation angle, the second rotation angle and the third rotation angle, and calculate the corresponding slope value based on the corrected real-time acceleration data and real-time angular velocity data.
[0149] Optionally, in some optional embodiments, the static data processing unit 100 includes: a static data acquisition subunit, an arithmetic mean calculation subunit, a gravity acceleration calculation subunit, a first rotation angle calculation subunit, and an angle matrix calculation subunit;
[0150] The static data acquisition subunit is used to collect static data of the vehicle under static working conditions, wherein the static data is acquired based on the six-axis gyroscope and includes: static X-axis acceleration, static Y-axis acceleration, and static Z-axis acceleration. The static working condition is a working condition with a slope of 0 and within the first time range from system power-on to engine ignition.
[0151] The arithmetic mean calculation subunit is used to calculate the arithmetic mean of the static X-axis acceleration, the static Y-axis acceleration and the static Z-axis acceleration respectively;
[0152] The gravity acceleration calculation subunit is used to calculate the local gravity acceleration according to the arithmetic average of the static X-axis acceleration, the static Y-axis acceleration and the static Z-axis acceleration;
[0153] The first rotation angle calculation subunit is configured to calculate a first rotation angle according to the arithmetic mean of the static X-axis acceleration and the gravitational acceleration;
[0154] The angle matrix calculation subunit is configured to calculate an installation posture rotation matrix and a second rotation angle according to the first rotation angle and the gravitational acceleration.
[0155] Optionally, in some optional embodiments, the angle matrix calculation subunit includes: a first matrix calculation subunit, a second matrix calculation subunit, a posture rotation matrix calculation subunit, and a second rotation angle calculation subunit;
[0156] The first matrix calculation subunit is configured to calculate a first rotation matrix according to the first rotation angle;
[0157] The second matrix calculation subunit is configured to calculate a second rotation matrix based on the first rotation matrix;
[0158] The posture rotation matrix calculation subunit is used to calculate the installation posture rotation matrix of the vehicle controller according to the first rotation matrix and the second rotation matrix;
[0159] The second rotation angle calculation subunit is configured to calculate a second rotation angle according to the installation posture rotation matrix and the gravitational acceleration.
[0160] Optionally, in some optional embodiments, the dynamic data processing unit 200 includes: a dynamic data acquisition subunit, a third matrix calculation subunit, a discretization subunit, a minimum value subunit, an absolute value summation subunit and a third rotation angle calculation subunit;
[0161] The dynamic data acquisition subunit is used to collect dynamic data of the vehicle under dynamic driving conditions, wherein the dynamic data is acquired based on a six-axis gyroscope and includes dynamic acceleration and dynamic angular velocity, and the dynamic conditions include acceleration, deceleration, turning, uphill and downhill;
[0162] The third matrix calculation subunit is used to obtain a third rotation matrix according to the installation posture rotation matrix;
[0163] The discretization subunit is configured to discretize the third rotation matrix within a variation range of a third rotation angle to obtain a discretized third rotation matrix, wherein the variation range of the third rotation angle is 0 degrees to 360 degrees;
[0164] The minimum value subunit is configured to correct and calculate the dynamic data based on the discretized third rotation matrix to obtain two minimum values of the sum of the absolute values of the angular velocities;
[0165] The absolute value summing subunit is configured to substitute the first minimum value into a discretized third rotation matrix to correct the dynamic X-axis acceleration in the dynamic acceleration, and calculate the sum of the absolute values of the difference between the corrected dynamic X-axis acceleration and the vehicle X-axis acceleration obtained by calculating the vehicle speed differential;
[0166] The third rotation angle calculation subunit is configured to take the minimum sum of the absolute values of the differences as the third rotation angle.
[0167] Optionally, in some optional embodiments, the slope value calculation unit 300 includes: a preprocessing subunit, a rotation correction matrix calculation subunit, a vector construction subunit, an acceleration data calculation subunit, an angular velocity data calculation subunit and a slope estimation subunit;
[0168] The preprocessing subunit is used to preprocess the real-time acceleration data and real-time angular velocity data collected by the six-axis gyroscope, wherein the preprocessing includes: outlier removal processing, five-point mean filtering processing and low-pass filtering processing;
[0169] The rotation correction matrix calculation subunit is used to calculate a data rotation correction matrix according to the first rotation angle, the second rotation angle and the third rotation angle;
[0170] The vector construction subunit is configured to construct a corresponding acceleration vector and angular velocity vector based on the preprocessed real-time acceleration data and real-time angular velocity data, wherein the real-time acceleration data corresponds to the acceleration vector, and the real-time angular velocity data corresponds to the angular velocity vector;
[0171] The acceleration data calculation subunit is used to calculate the acceleration data in the vehicle coordinate system according to the acceleration vector and the data rotation correction matrix;
[0172] The angular velocity data calculation subunit is configured to calculate the angular velocity data in the vehicle coordinate system according to the angular velocity vector and the data rotation correction matrix;
[0173] The slope estimation subunit is used to calculate a corresponding slope value based on the acceleration data in the vehicle coordinate system and the angular velocity data in the vehicle coordinate system.
[0174] Optionally, in certain optional implementations, the slope estimation subunit includes: a low-pass filtering subunit, a high-pass filtering subunit, an estimated value calculation subunit, and a slope value calculation subunit;
[0175] The low-pass filtering subunit is configured to calculate a first slope estimation value based on the acceleration data in the vehicle coordinate system, and perform low-pass filtering on the first slope estimation value;
[0176] The high-pass filter subunit is used to perform high-pass filtering on the angular velocity data in the vehicle coordinate system to obtain high-frequency angular velocity data;
[0177] The estimated value calculation subunit is configured to calculate a second slope estimated value based on the high-frequency angular velocity data and the slope value calculated last time;
[0178] The slope value calculation subunit is used to calculate a corresponding slope value according to the first slope estimation value after low-pass filtering, the second slope value and a preset complementary filtering weight coefficient.
[0179] Regarding the apparatus in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0180] The slope calculation device includes a processor and a memory. The static data processing unit 100, the dynamic data processing unit 200 and the slope value calculation unit 300 are all stored in the memory as program units, and the processor executes the program units stored in the memory to realize corresponding functions.
[0181] The processor includes a kernel, which retrieves the corresponding program unit from memory. One or more kernels can be configured, and gyroscope data can be corrected based on coordinate changes by adjusting kernel parameters. This allows for compatibility with different sensor installation locations and allows for gyroscope data correction based on both static and dynamic data. This ensures accurate gyroscope data correction even when the vehicle controller installation location is uncertain or changes after vehicle maintenance, ensuring the accuracy and applicability of slope calculations.
[0182] An embodiment of the present invention provides a computer-readable storage medium having a program stored thereon, which implements the slope calculation method when executed by a processor.
[0183] An embodiment of the present invention provides a processor, which is used to run a program, wherein the slope calculation method is executed when the program is run.
[0184] like Figure 6 As shown, an embodiment of the present invention provides an electronic device 700, which includes at least one processor 701, at least one memory 702 connected to the processor 701, and a bus 703. The processor 701 and the memory 702 communicate with each other via the bus 703. The processor 701 is configured to call program instructions stored in the memory 702 to execute the above-described slope calculation method. The electronic device herein may be a server, a PC, a PAD, a mobile phone, or the like.
[0185] The present invention also provides a computer program product, which, when executed on an electronic device, is adapted to execute a program for initializing the following method steps:
[0186] A slope calculation method, comprising:
[0187] Collect static data of the vehicle under static working conditions, and calculate the installation posture rotation matrix, first rotation angle, and second rotation angle of the vehicle controller based on the static data, wherein the first rotation angle is the rotation angle of the vehicle controller around the Y axis of its own coordinate system, and the second rotation angle is the rotation angle of the vehicle controller around the X axis of its own coordinate system;
[0188] Collecting dynamic data of the vehicle under dynamic driving conditions, and calculating a third rotation angle based on the dynamic data and the installation posture rotation matrix, wherein the third rotation angle is an angular change between the installation direction of the vehicle controller and the driving direction of the vehicle;
[0189] The real-time acceleration data and the real-time angular velocity data collected by the six-axis gyroscope are corrected according to the first rotation angle, the second rotation angle and the third rotation angle, and the corresponding slope value is calculated according to the corrected real-time acceleration data and the real-time angular velocity data.
[0190] Optionally, in certain optional embodiments, collecting static data of the vehicle under static working conditions and calculating the installation posture rotation matrix, the first rotation angle, and the second rotation angle of the vehicle controller based on the static data include:
[0191] Collecting static data of the vehicle under static operating conditions, wherein the static data is collected based on a six-axis gyroscope and includes: static X-axis acceleration, static Y-axis acceleration, and static Z-axis acceleration. The static operating condition is an operating condition with a slope of zero and within the first time range from system power-up to engine ignition.
[0192] Calculating the arithmetic mean of the static X-axis acceleration, the static Y-axis acceleration, and the static Z-axis acceleration respectively;
[0193] Calculating the local acceleration of gravity according to the arithmetic average of the static X-axis acceleration, the static Y-axis acceleration, and the static Z-axis acceleration;
[0194] Calculating a first rotation angle according to the arithmetic mean of the static X-axis acceleration and the gravitational acceleration;
[0195] An installation posture rotation matrix and a second rotation angle are calculated according to the first rotation angle and the gravitational acceleration.
[0196] Optionally, in certain optional implementations, calculating the installation posture rotation matrix and the second rotation angle according to the first rotation angle and the gravitational acceleration includes:
[0197] Calculating a first rotation matrix according to the first rotation angle;
[0198] Calculating a second rotation matrix based on the first rotation matrix;
[0199] Calculating an installation posture rotation matrix of the vehicle controller based on the first rotation matrix and the second rotation matrix;
[0200] A second rotation angle is calculated according to the installation posture rotation matrix and the gravitational acceleration.
[0201] Optionally, in certain optional embodiments, collecting dynamic data of the vehicle under dynamic driving conditions, and calculating a third rotation angle based on the dynamic data and the installation posture rotation matrix, includes:
[0202] Collecting dynamic data of the vehicle under dynamic driving conditions, wherein the dynamic data is collected based on a six-axis gyroscope and includes dynamic acceleration and dynamic angular velocity, and the dynamic conditions include acceleration, deceleration, turning, uphill and downhill;
[0203] Obtaining a third rotation matrix according to the installation posture rotation matrix;
[0204] Discretizing the third rotation matrix within a variation range of a third rotation angle to obtain a discretized third rotation matrix, wherein the variation range of the third rotation angle is 0 degrees to 360 degrees;
[0205] Correcting and calculating the dynamic data based on the discretized third rotation matrix to obtain two minimum values of the sum of the absolute values of the angular velocities;
[0206] Substituting the first minimum value into a discretized third rotation matrix to correct the dynamic X-axis acceleration in the dynamic acceleration, and calculating the sum of the absolute values of the difference between the corrected dynamic X-axis acceleration and the vehicle X-axis acceleration obtained by calculating the vehicle speed differential;
[0207] The minimum sum of the absolute values of the differences is used as the third rotation angle.
[0208] Optionally, in certain optional embodiments, the correcting the real-time acceleration data and the real-time angular velocity data collected by the six-axis gyroscope according to the first rotation angle, the second rotation angle, and the third rotation angle, and calculating the corresponding slope value according to the corrected real-time acceleration data and the real-time angular velocity data includes:
[0209] Preprocessing the real-time acceleration data and real-time angular velocity data collected by the six-axis gyroscope, wherein the preprocessing includes: outlier removal processing, five-point mean filtering processing and low-pass filtering processing;
[0210] Calculating a data rotation correction matrix according to the first rotation angle, the second rotation angle, and the third rotation angle;
[0211] Constructing a corresponding acceleration vector and angular velocity vector based on the preprocessed real-time acceleration data and real-time angular velocity data, wherein the real-time acceleration data corresponds to the acceleration vector, and the real-time angular velocity data corresponds to the angular velocity vector;
[0212] Calculating acceleration data in a vehicle coordinate system according to the acceleration vector and the data rotation correction matrix;
[0213] Calculating angular velocity data in the vehicle coordinate system according to the angular velocity vector and the data rotation correction matrix;
[0214] A corresponding slope value is calculated based on the acceleration data in the vehicle coordinate system and the angular velocity data in the vehicle coordinate system.
[0215] Optionally, in certain optional implementations, calculating the corresponding slope value based on the acceleration data in the vehicle coordinate system and the angular velocity data in the vehicle coordinate system includes:
[0216] Calculating a first slope estimation value based on the acceleration data in the vehicle coordinate system, and performing low-pass filtering on the first slope estimation value;
[0217] Performing high-pass filtering on the angular velocity data in the vehicle coordinate system to obtain high-frequency angular velocity data;
[0218] Calculating a second slope estimation value based on the high-frequency angular velocity data and the slope value calculated last time;
[0219] A corresponding slope value is calculated based on the first slope estimation value after low-pass filtering, the second slope value, and a preset complementary filtering weight coefficient.
[0220] The present invention is described with reference to flowcharts and / or block diagrams of methods, apparatuses, electronic devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowcharts and / or block diagrams, as well as combinations of processes and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable device to produce a machine, so that the instructions executed by the processor of the computer or other programmable device generate instructions for implementing the processes in the flowcharts and / or block diagrams. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0221] In a typical configuration, an electronic device includes one or more processors (CPUs), a memory, and a bus. The electronic device may also include an input / output interface, a network interface, and the like.
[0222] Memory may include non-permanent memory in a computer-readable medium, random access memory (RAM), and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory includes at least one memory chip. Memory is an example of a computer-readable medium.
[0223] Computer-readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. The information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include transitory media such as modulated data signals and carrier waves.
[0224] In the description of the present invention, it should be understood that if the terms "up", "down", "front", "back", "left" and "right" are used to indicate directions or positional relationships, they are based on the directions or positional relationships shown in the accompanying drawings. They are only used to facilitate the description of the present invention and simplify the description, and do not indicate or imply that the positions or elements referred to must have a specific direction, be constructed and operate in a specific direction. Therefore, they should not be understood as limitations of the present invention.
[0225] It should be noted that, in this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. It should also be noted that the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, commodity, or device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, commodity, or device comprising the element.
[0226] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Thus, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROMs, optical storage, etc.) containing computer-usable program code.
[0227] The above are merely embodiments of the present invention and are not intended to limit the present invention. It will be apparent to those skilled in the art that various modifications and variations of the present invention are possible. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention are intended to be included within the scope of the claims of the present invention.
Claims
1. A slope calculation method, characterized in that: include: Collect static data of the vehicle under static working conditions, and calculate the installation posture rotation matrix, first rotation angle, and second rotation angle of the vehicle controller based on the static data, wherein the first rotation angle is the rotation angle of the vehicle controller around the Y axis of its own coordinate system, and the second rotation angle is the rotation angle of the vehicle controller around the X axis of its own coordinate system; Collecting dynamic data of the vehicle under dynamic driving conditions, and calculating a third rotation angle based on the dynamic data and the installation posture rotation matrix, wherein the third rotation angle is an angular change between the installation direction of the vehicle controller and the driving direction of the vehicle; The real-time acceleration data and the real-time angular velocity data collected by the six-axis gyroscope are corrected according to the first rotation angle, the second rotation angle and the third rotation angle, and the corresponding slope value is calculated according to the corrected real-time acceleration data and the real-time angular velocity data.
2. The method according to claim 1, characterized in that The collecting of static data of the vehicle under static working conditions and calculating the installation posture rotation matrix, the first rotation angle and the second rotation angle of the vehicle controller according to the static data include: Collecting static data of the vehicle under static operating conditions, wherein the static data is collected based on a six-axis gyroscope and includes: static X-axis acceleration, static Y-axis acceleration, and static Z-axis acceleration. The static operating condition is an operating condition with a slope of zero and within the first time range from system power-up to engine ignition. Calculating the arithmetic mean of the static X-axis acceleration, the static Y-axis acceleration, and the static Z-axis acceleration respectively; Calculating the local acceleration of gravity according to the arithmetic average of the static X-axis acceleration, the static Y-axis acceleration, and the static Z-axis acceleration; Calculating a first rotation angle according to the arithmetic mean of the static X-axis acceleration and the gravitational acceleration; An installation posture rotation matrix and a second rotation angle are calculated according to the first rotation angle and the gravitational acceleration.
3. The method according to claim 2, characterized in that The step of calculating the installation posture rotation matrix and the second rotation angle according to the first rotation angle and the gravitational acceleration includes: Calculating a first rotation matrix according to the first rotation angle; Calculate a second rotation matrix based on the first rotation matrix; Calculating the installation posture rotation matrix of the vehicle controller according to the first rotation matrix and the second rotation matrix; A second rotation angle is calculated according to the installation posture rotation matrix and the gravitational acceleration.
4. The method according to claim 1, wherein The collecting dynamic data of the vehicle under a dynamic driving condition and calculating a third rotation angle according to the dynamic data and the installation posture rotation matrix includes: Collecting dynamic data of the vehicle under dynamic driving conditions, wherein the dynamic data is collected based on a six-axis gyroscope and includes dynamic acceleration and dynamic angular velocity, and the dynamic conditions include acceleration, deceleration, turning, uphill and downhill; Obtaining a third rotation matrix according to the installation posture rotation matrix; Discretizing the third rotation matrix within a variation range of a third rotation angle to obtain a discretized third rotation matrix, wherein the variation range of the third rotation angle is 0 degrees to 360 degrees; Correcting and calculating the dynamic data based on the discretized third rotation matrix to obtain two minimum values of the sum of the absolute values of the angular velocities; Substituting the first minimum value into a discretized third rotation matrix to correct the dynamic X-axis acceleration in the dynamic acceleration, and calculating the sum of the absolute values of the difference between the corrected dynamic X-axis acceleration and the vehicle X-axis acceleration obtained by the vehicle speed differential; The minimum sum of the absolute values of the differences is used as the third rotation angle.
5. The method according to claim 1, characterized in that The step of correcting the real-time acceleration data and the real-time angular velocity data collected by the six-axis gyroscope according to the first rotation angle, the second rotation angle, and the third rotation angle, and calculating the corresponding slope value according to the corrected real-time acceleration data and the real-time angular velocity data, includes: Preprocessing the real-time acceleration data and real-time angular velocity data collected by the six-axis gyroscope, wherein the preprocessing includes: outlier removal processing, five-point mean filtering processing and low-pass filtering processing; Calculating a data rotation correction matrix according to the first rotation angle, the second rotation angle, and the third rotation angle; Constructing a corresponding acceleration vector and angular velocity vector based on the preprocessed real-time acceleration data and real-time angular velocity data, wherein the real-time acceleration data corresponds to the acceleration vector, and the real-time angular velocity data corresponds to the angular velocity vector; Calculating acceleration data in a vehicle coordinate system according to the acceleration vector and the data rotation correction matrix; Calculating angular velocity data in the vehicle coordinate system according to the angular velocity vector and the data rotation correction matrix; A corresponding slope value is calculated based on the acceleration data in the vehicle coordinate system and the angular velocity data in the vehicle coordinate system.
6. The method according to claim 5, characterized in that The calculating the corresponding slope value according to the acceleration data in the vehicle coordinate system and the angular velocity data in the vehicle coordinate system includes: Calculating a first slope estimation value based on the acceleration data in the vehicle coordinate system, and performing low-pass filtering on the first slope estimation value; Performing high-pass filtering on the angular velocity data in the vehicle coordinate system to obtain high-frequency angular velocity data; Calculating a second slope estimation value based on the high-frequency angular velocity data and the slope value calculated last time; A corresponding slope value is calculated based on the first slope estimation value after low-pass filtering, the second slope value, and a preset complementary filtering weight coefficient.
7. A slope calculation device, characterized in that: include: Static data processing unit, dynamic data processing unit and slope value calculation unit; The static data processing unit is used to collect static data of the vehicle under static working conditions, and calculate the installation posture rotation matrix, the first rotation angle and the second rotation angle of the vehicle controller based on the static data, wherein the first rotation angle is the rotation angle of the vehicle controller around the Y axis of its own coordinate system, and the second rotation angle is the rotation angle of the vehicle controller around the X axis of its own coordinate system; The dynamic data processing unit is used to collect dynamic data of the vehicle under dynamic driving conditions, and calculate a third rotation angle based on the dynamic data and the installation posture rotation matrix, wherein the third rotation angle is an angular change between the installation direction of the vehicle controller and the driving direction of the vehicle; The slope value calculation unit is used to correct the real-time acceleration data and real-time angular velocity data collected by the six-axis gyroscope according to the first rotation angle, the second rotation angle and the third rotation angle, and calculate the corresponding slope value based on the corrected real-time acceleration data and real-time angular velocity data.
8. The device according to claim 7, characterized in that The static data processing unit includes: a static data acquisition subunit, an arithmetic mean calculation subunit, a gravity acceleration calculation subunit, a first rotation angle calculation subunit and an angle matrix calculation subunit; The static data acquisition subunit is used to collect static data of the vehicle under static working conditions, wherein the static data is acquired based on the six-axis gyroscope and includes: static X-axis acceleration, static Y-axis acceleration, and static Z-axis acceleration. The static working condition is a working condition with a slope of 0 and within the first time range from system power-on to engine ignition. The arithmetic mean calculation subunit is used to calculate the arithmetic mean of the static X-axis acceleration, the static Y-axis acceleration and the static Z-axis acceleration respectively; The gravity acceleration calculation subunit is used to calculate the local gravity acceleration according to the arithmetic average of the static X-axis acceleration, the static Y-axis acceleration and the static Z-axis acceleration; The first rotation angle calculation subunit is configured to calculate a first rotation angle according to the arithmetic mean of the static X-axis acceleration and the gravitational acceleration; The angle matrix calculation subunit is configured to calculate an installation posture rotation matrix and a second rotation angle according to the first rotation angle and the gravitational acceleration.
9. A computer-readable storage medium having a program stored thereon, characterized in that: When the program is executed by a processor, the slope calculation method according to any one of claims 1 to 6 is implemented.
10. An electronic device, characterized in that: The electronic device includes at least one processor, and at least one memory and bus connected to the processor; wherein the processor and the memory communicate with each other via the bus; the processor is used to call program instructions in the memory to execute the slope calculation method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Method and device for determining uphill and downhill running states of vehicle by utilizing acceleration sensor and gyroscope
CN103632062A
Implementation method of vehicle-mounted six-axis gyroscope
CN120063252A
determine an incline of a roadway
DE102017209747A1
An air directing arrangement for controlling airflow at an outlet
KR1020250060799A
Road grade measurement system for moving vehicles
US20200003557A1