Method and system for calculating slope where vehicle is located, terminal and storage medium
Through the six-degree-of-freedom sensor and Kalman filter processing technology, the problem of distinguishing gravity acceleration and dynamic acceleration in vehicle slope measurement is solved, the accuracy and stability of slope measurement are improved, and the deviation and vibration interference problems in the existing technology are overcome.
Patent Information
- Application Number
- CN202411128189.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-16
- Publication Date
- 2024-10-15
AI Technical Summary
In the existing vehicle slope measurement technology, it is difficult for the three-axis acceleration sensor to accurately distinguish between the acceleration of gravity and the dynamic acceleration of the vehicle, resulting in deviations in the slope measurement results, especially when the vehicle is disturbed by vibration during driving.
A six-degree-of-freedom sensor is used to detect the acceleration and angular velocity of the vehicle, and the data is transmitted to the microcontroller through the SPI communication module. The Z-axis acceleration value and Y-axis angular velocity value are calculated based on the spatial coordinate axis, and complementary filter fusion and Kalman filtering are performed. Get a more accurate slope angle.
It effectively overcomes the problem of distinguishing gravity acceleration and dynamic acceleration, improves the accuracy and stability of slope measurement, reduces vibration interference, and provides more accurate slope information support.
Smart Images

Figure CN118770232A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of vehicle monitoring, and in particular relates to a method, system, terminal and storage medium for calculating the slope of a vehicle. Background Art
[0002] Among the existing vehicle slope measurement technologies, the triaxial accelerometer is widely used. This sensor measures the gravity acceleration components of the vehicle in three directions and constructs slope angle calculation based on the physical model. However, this method faces many challenges in practical applications, which significantly affects the accuracy of slope measurement.
[0003] First, when measuring slope, the three-axis acceleration sensor mainly relies on the components of gravity acceleration in different directions. However, when the vehicle is driving, especially in the forward direction, the acceleration sensor is not only affected by the gravity acceleration component, but also by the acceleration generated by the acceleration and deceleration of the vehicle itself. This composite acceleration makes it difficult for the sensor to accurately distinguish between the gravity acceleration component and the vehicle's dynamic acceleration, resulting in deviations in the slope measurement results.
[0004] Secondly, when the vehicle is driving, especially when it encounters acceleration and deceleration, bumpy roads, or suddenly driving over potholes, the vehicle body will produce obvious vibrations. These vibrations will directly affect the measurement value of the acceleration sensor, causing it to change suddenly. Such sudden measurement values will seriously interfere with the accuracy of the slope calculation, making the final slope angle differ greatly from the actual situation. Summary of the invention
[0005] In view of the above-mentioned deficiencies in the prior art, the present invention provides a method, system, terminal and storage medium for calculating the slope on which a vehicle is located, so as to solve the above-mentioned technical problems.
[0006] In a first aspect, the present invention provides a method for calculating a slope of a vehicle, comprising:
[0007] Use a six-degree-of-freedom sensor to detect whether the vehicle slope changes;
[0008] If yes, the acceleration and angular velocity output by the six-degree-of-freedom sensor are transmitted to the microcontroller via the SPI communication module;
[0009] The microcontroller receives and solves the Z-axis acceleration value and the Y-axis angular velocity value in combination with the pre-established spatial coordinate axes;
[0010] The slope measurement θ is calculated by the Z-axis acceleration value, and the slope change ρ within a certain period of time is obtained by integrating the angular velocity;
[0011] The calculated slope measurement θ and the slope change ρ within a certain period of time are complementary filtered and fused to obtain a fused slope angle α;
[0012] The fused slope angle α is subjected to Kalman filtering to obtain the predicted slope value.
[0013] A further improvement of the technical solution is that the relationship between the Z-axis acceleration value and the slope measurement value θ is:
[0014] G Z =g*cosθ;
[0015] Among them, G Z is the gravitational acceleration on the Z axis; g is the gravitational acceleration of the area where the vehicle is located.
[0016] A further improvement of the technical solution is that the calculation formula for the slope change ρ within a certain time period obtained by integrating the angular velocity is:
[0017]
[0018] in, is the average angular velocity, and dt is the time required for the slope to change to that angle.
[0019] A further improvement of the technical solution is that, since the angular velocity is constantly changing, the calculation formula for the slope change ρ within a certain time period obtained by integrating the angular velocity with the sampling period as the minimum time of its change can also be recorded as:
[0020] ρ=∑V gryoy *Δt;
[0021] Among them, V gryoy is the real-time angular velocity output by the sensor, V gryoy The six-degree-of-freedom sensor transmits the data to the microcontroller through the SPI communication module, and Δt is the sampling time.
[0022] A further improvement of the technical solution is to perform complementary filtering fusion on the calculated slope measurement θ and the slope change ρ within a certain period of time to obtain a fused slope angle α, the specific calculation formula of which is:
[0023] α=(1-s)*(α -1 +ρ single )+s*θ;
[0024] Among them, α is the fusion slope angle, that is, the slope angle obtained by complementary filter fusion, α -1 is the slope angle value corresponding to the previous state, ρ single is the integral of the angular velocity in a single sampling period, and s is the weight of the slope measurement θ calculated from the acceleration.
[0025] A further improvement of the technical solution is that Kalman filtering is performed on the fused slope angle α to obtain a predicted slope value, wherein the relationship between the fused slope angle α and the angular velocity V is:
[0026] α k =α k-1 +Δt*V k-1 ;
[0027] Among them, α k is the slope angle value at time k, α k-1 is the slope angle value at time k-1, V k-1 is the angular velocity value at time k-1; the relationship between the fusion slope angle α and the angular velocity V is expressed in a matrix as follows:
[0028]
[0029] That is, the state equation of the fusion slope angle α and angular velocity V is:
[0030]
[0031] in, is the state equation at time k-1, F K is the matrix transformed from the previous state to the next state, that is, the prediction matrix;
[0032] Equation of state The covariance P k for:
[0033]
[0034] Among them, P k-1 is the state equation at time k-1 The covariance of F K The transpose of Q k is the variance of external disturbance;
[0035] When the predicted slope value follows the Gaussian distribution N(x, μ0, σ0), the mean μ0 and variance Σ0 of the predicted slope value are:
[0036]
[0037]
[0038] Among them, H k Represents the transition matrix from state variables to predicted quantities at time k; H k The transpose of
[0039] Similarly, the slope measurement θ also follows the Gaussian distribution N(x, μ1, σ1), and the mean μ1 and variance Σ1 of the slope measurement θ are:
[0040]
[0041] Σ1=R k ;
[0042] in, is the mean value of the slope measurement θ, R k is the variance of the slope measurement θ;
[0043] In order to correct the predicted slope value by the slope measurement θ, N(x, μ0, σ0) is multiplied by N(x, μ1, σ1) to obtain N(x, μ′, σ′), and its corresponding mean μ′ and variance Σ′ are:
[0044]
[0045]
[0046] Optimal predicted slope value The calculation formula is:
[0047]
[0048] Where K′ is the Kalman gain.
[0049] A further improvement of the technical solution is that the expression of the Kalman gain K′ is:
[0050]
[0051] In a second aspect, the present invention provides a system for calculating a slope of a vehicle, comprising:
[0052] Six-degree-of-freedom sensor, which includes a three-axis acceleration sensor and a three-axis gyroscope;
[0053] A microcontroller is used to receive the acceleration and angular velocity measured by the six-degree-of-freedom sensor and calculate the predicted slope value based on the received data;
[0054] SPI communication module, used to connect the six-degree-of-freedom sensor and the microcontroller;
[0055] External communication module, used to connect the microcontroller and the external host computer;
[0056] The microprocessor includes:
[0057] A calculation module is used to calculate the Z-axis acceleration value and the Y-axis angular velocity value according to the received acceleration value and angular velocity value and in combination with the pre-established spatial coordinate axis; calculate the slope measurement θ through the Z-axis acceleration value, and integrate the angular velocity to obtain the slope change ρ within a certain time period;
[0058] The complementary filtering fusion calculation module is used to perform complementary filtering fusion on the calculated slope measurement θ and the slope change ρ within a certain time period to obtain a fused slope angle α;
[0059] The Kalman filter calculation module is used to perform Kalman filtering on the fused slope angle α to obtain a predicted slope value.
[0060] In a third aspect, the present invention provides a terminal, comprising:
[0061] processor, memory, wherein:
[0062] The memory is used to store computer programs.
[0063] The processor is used to call and run the computer program from the memory, so that the terminal executes the above-mentioned terminal method.
[0064] In a fourth aspect, the present invention provides a computer storage medium, wherein the computer-readable storage medium stores instructions, which, when executed on a computer, enable the computer to execute the methods described in the above aspects.
[0065] The beneficial effect of the present invention is that the present invention not only detects the acceleration of the vehicle in three directions, but also detects the angular velocity at the same time by introducing a six-degree-of-freedom sensor, thereby more comprehensively capturing the motion state of the vehicle. This improvement effectively overcomes the limitation of the prior art that only relies on the gravity acceleration component for slope measurement, especially during vehicle driving, it can accurately distinguish the gravity acceleration component from the vehicle's dynamic acceleration, and avoids the deviation of the slope measurement result caused by the composite acceleration.
[0066] Secondly, the present invention uses an SPI communication module to transmit the data of the six-degree-of-freedom sensor to the microcontroller in real time for processing, and combines the pre-established spatial coordinate axis model to calculate the Z-axis acceleration value and the Y-axis angular velocity value. This data processing method improves the accuracy and real-time performance of the slope calculation, making the measurement results more reliable.
[0067] In addition, the present invention also fuses the slope measurement and the slope change value through complementary filtering fusion technology to obtain a more accurate fused slope angle. This fusion algorithm effectively reduces the influence of interference factors such as vehicle vibration on the slope calculation and improves the stability and robustness of the slope measurement.
[0068] Finally, the present invention performs Kalman filtering on the fused slope angle to obtain the predicted slope value, further improving the accuracy and reliability of slope measurement. This prediction algorithm can predict the changing trend of the vehicle slope to a certain extent, providing more accurate information support for the slope control during vehicle driving.
[0069] In addition, the invention has a reliable design principle, a simple structure and a very broad application prospect. BRIEF DESCRIPTION OF THE DRAWINGS
[0070] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0071] Figure 1 is a schematic flow chart of a method according to an embodiment of the present invention.
[0072] Figure 2 is a schematic block diagram of a system according to an embodiment of the present invention.
[0073] Figure 3 A schematic diagram of the structure of a terminal provided by an embodiment of the present invention.
[0074] 210 is a six-degree-of-freedom sensor, 220 is a microcontroller, 221 is a solution module, 222 is a complementary filter fusion calculation module, 223 is a Kalman filter calculation module, 230 is an SPI communication module, 240 is an external communication module, and 250 is an external host computer. DETAILED DESCRIPTION
[0075] In order to enable those skilled in the art to better understand the technical solutions in the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0076] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art of the present invention. The terms used in the specification of the present invention herein are only for the purpose of describing specific embodiments and are not intended to limit the present invention.
[0077] Figure 1 FIG. 1 is a schematic flow chart of a method for calculating the slope of a vehicle according to an embodiment of the present invention. Figure 1 The execution subject may be a system for calculating the slope that the vehicle is in. According to different requirements, the order of the steps in the flow chart may be changed, and some may be omitted.
[0078] like Figure 1 As shown, the method includes:
[0079] Step 110, detecting whether the vehicle slope changes by a six-degree-of-freedom sensor; if so, proceeding to step 120;
[0080] Step 120, the acceleration and angular velocity output by the six-degree-of-freedom sensor are transmitted to the microcontroller via the SPI communication module;
[0081] Step 130, the microcontroller receives and calculates the Z-axis acceleration value and the Y-axis angular velocity value in combination with the pre-established spatial coordinate axes;
[0082] Step 140, calculating the slope measurement θ through the Z-axis acceleration value, and integrating the angular velocity to obtain the slope change ρ within a certain time period;
[0083] Step 150, the calculated slope measurement θ and the slope change ρ within a certain time period are subjected to complementary filtering fusion to obtain a fused slope angle α;
[0084] Step 160: Perform Kalman filtering on the fused slope angle α to obtain a predicted slope value.
[0085] To facilitate understanding of the present invention, the following further describes the method for calculating the slope on which the vehicle is located provided by the present invention based on the principle of the method for calculating the slope on which the vehicle is located and the process of calculating the slope on which the vehicle is located in the embodiment.
[0086] Specifically, the relationship between the Z-axis acceleration value and the slope measurement θ is:
[0087] G Z =g*cosθ;
[0088] Among them, G Z is the gravitational acceleration on the Z axis; g is the gravitational acceleration of the area where the vehicle is located.
[0089] The calculation formula for the slope change ρ within a certain period of time by integrating the angular velocity is:
[0090]
[0091] in, is the average angular velocity, and dt is the time required for the slope to change to that angle.
[0092] Since the angular velocity is constantly changing, the sampling period is taken as the minimum time of its change. The calculation formula for the slope change ρ within a certain period of time by integrating the angular velocity can also be written as:
[0093] ρ=∑V gryoy *Δt;
[0094] Among them, V gryoy is the real-time angular velocity output by the sensor, V gryoy The six-degree-of-freedom sensor transmits the data to the microcontroller through the SPI communication module, and Δt is the sampling time.
[0095] Furthermore, the calculated slope measurement θ and the slope change ρ within a certain period of time are complementary filtered and fused to obtain the fused slope angle α, and the specific calculation formula is:
[0096] α=(1-s)*(α -1 +ρ single )+s*θ;
[0097] Among them, α is the fusion slope angle, that is, the slope angle obtained by complementary filter fusion, α -1 is the slope angle value corresponding to the previous state, ρ single is the integral of the angular velocity in a single sampling period, and s is the weight of the slope measurement θ calculated from the acceleration.
[0098] The fused slope angle α is subjected to Kalman filtering to obtain the predicted slope value, where the relationship between the fused slope angle α and the angular velocity V is:
[0099] α k =α k-1 +Δt*V k-1 ;
[0100] Among them, α k is the slope angle value at time k, α k-1 is the slope angle value at time k-1, V k-1 is the angular velocity value at time k-1; the relationship between the fusion slope angle α and the angular velocity V is expressed in a matrix as follows:
[0101]
[0102] That is, the state equation of the fusion slope angle α and angular velocity V is:
[0103]
[0104] in, is the state equation at time k-1, F K is the matrix transformed from the previous state to the next state, that is, the prediction matrix;
[0105] Equation of state The covariance P k for:
[0106]
[0107] Among them, P k-1 is the state equation at time k-1 The covariance of F K The transpose of Q k is the variance of external disturbance;
[0108] When the predicted slope value follows the Gaussian distribution N(x, μ0, σ0), the mean μ0 and variance Σ0 of the predicted slope value are:
[0109]
[0110]
[0111] Among them, H k Represents the transition matrix from state variables to predicted quantities at time k; H k The transpose of
[0112] Similarly, the slope measurement θ also follows the Gaussian distribution N(x, μ1, σ1), and the mean μ1 and variance Σ1 of the slope measurement θ are:
[0113]
[0114] Σ1=R k ;
[0115] in, is the mean value of the slope measurement θ, R k is the variance of the slope measurement θ;
[0116] In order to correct the predicted slope value by the slope measurement θ, N(x, μ0, σ0) is multiplied by N(x, μ1, σ1) to obtain N(x, μ′, σ′), and its corresponding mean μ′ and variance Σ′ are:
[0117]
[0118]
[0119] Optimal predicted slope value The calculation formula is:
[0120]
[0121] Where K′ is the Kalman gain.
[0122] Among them, the expression of Kalman gain K′ is:
[0123]
[0124] like Figure 2 As shown, the present invention provides a system for calculating the slope of a vehicle, comprising: a six-degree-of-freedom sensor, a microcontroller, an SPI communication module and an external host computer; specifically, the six-degree-of-freedom sensor comprises a three-axis acceleration sensor and a three-axis gyroscope; the microcontroller is used to receive the acceleration and angular velocity measured by the six-degree-of-freedom sensor, and calculate the predicted slope value according to the received data; the SPI communication module is used to connect the six-degree-of-freedom sensor and the microcontroller; the external communication module is used to connect the microcontroller and the external host computer, including at least one of USB, Ethernet, UART and CAN.
[0125] Among them, the microprocessor includes: a solution module, a complementary filter fusion calculation module and a Kalman filter calculation module; specifically, the solution module is used to solve the Z-axis acceleration value and the Y-axis angular velocity value according to the received acceleration value and angular velocity value and in combination with the pre-established spatial coordinate axis; the slope measurement value θ is calculated by the Z-axis acceleration value, and the angular velocity is integrated to obtain the slope change ρ within a certain time period; the complementary filter fusion calculation module is used to perform complementary filtering fusion on the calculated slope measurement value θ and the slope change ρ within a certain time period to obtain a fused slope angle α; the Kalman filter calculation module is used to perform Kalman filtering on the fused slope angle α to obtain a predicted slope value.
[0126] Figure 3 A schematic diagram of the structure of a terminal 300 provided in an embodiment of the present invention. The terminal 300 can be used to execute the method for calculating the slope of a vehicle provided in an embodiment of the present invention.
[0127] The terminal 300 may include: a processor 310, a memory 320 and a communication module 330. These components communicate via one or more buses. Those skilled in the art will appreciate that the server structure shown in the figure does not limit the present invention, and it may be a bus structure or a star structure, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.
[0128] The memory 320 can be used to store the execution instructions of the processor 310, and the memory 320 can be implemented by any type of volatile or non-volatile storage terminal or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk. When the execution instructions in the memory 320 are executed by the processor 310, the terminal 300 can perform some or all of the steps in the following method embodiments.
[0129] The processor 310 is the control center of the storage terminal, and uses various interfaces and lines to connect various parts of the entire electronic terminal. It runs or executes software programs and / or modules stored in the memory 320, and calls data stored in the memory to perform various functions of the electronic terminal and / or process data. The processor can be composed of an integrated circuit (IC), for example, it can be composed of a single packaged IC, or it can be composed of a plurality of packaged ICs with the same or different functions. For example, the processor 310 can include only a central processing unit (CPU). In the embodiment of the present invention, the CPU can be a single computing core or multiple computing cores.
[0130] The communication module 330 is used to establish a communication channel so that the storage terminal can communicate with other terminals, receive user data sent by other terminals or send user data to other terminals.
[0131] The present invention also provides a computer storage medium, wherein the computer storage medium may store a program, and when the program is executed, the program may include some or all of the steps in each embodiment provided by the present invention. The storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM).
[0132] Those skilled in the art can clearly understand that the technology in the embodiments of the present invention can be implemented by means of software plus a necessary general hardware platform. Based on this understanding, the technical solution in the embodiments of the present invention, in essence or in other words, the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, and other media that can store program codes, including several instructions for enabling a computer terminal (which can be a personal computer, a server, or a second terminal, a network terminal, etc.) to perform all or part of the steps of the methods described in each embodiment of the present invention.
[0133] In this specification, the same or similar parts between the various embodiments can be referred to each other. In particular, for the terminal embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the description in the method embodiment.
[0134] In the several embodiments provided by the present invention, it should be understood that the disclosed systems and methods can be implemented in other ways. For example, the system embodiments described above are only schematic. For example, the division of the modules is only a logical function division. There may be other division methods in actual implementation, such as multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of systems or modules, which can be electrical, mechanical or other forms.
[0135] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical modules, that is, they may be located in one place or distributed on multiple network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0136] In addition, each functional module in each embodiment of the present invention may be integrated into one processing module, or each module may exist physically separately, or two or more modules may be integrated into one module.
[0137] Although the present invention has been described in detail with reference to the accompanying drawings and in combination with the preferred embodiments, the present invention is not limited thereto. Without departing from the spirit and essence of the present invention, a person of ordinary skill in the art may make various equivalent modifications or substitutions to the embodiments of the present invention, and these modifications or substitutions shall be within the scope of the present invention. Any person of ordinary skill in the art may easily think of changes or substitutions within the technical scope disclosed by the present invention, and these shall be within the scope of protection of the present invention.
Claims
1. A method for calculating the slope of a vehicle, characterized in that: include: Use a six-degree-of-freedom sensor to detect whether the vehicle slope changes; If yes, the acceleration and angular velocity output by the six-degree-of-freedom sensor are transmitted to the microcontroller via the SPI communication module; The microcontroller receives and solves the Z-axis acceleration value and the Y-axis angular velocity value in combination with the pre-established spatial coordinate axes; The slope measurement θ is calculated by the Z-axis acceleration value, and the slope change ρ within a certain period of time is obtained by integrating the angular velocity; The calculated slope measurement θ and the slope change ρ within a certain period of time are complementary filtered and fused to obtain a fused slope angle α; The fused slope angle α is subjected to Kalman filtering to obtain the predicted slope value.
2. The method for calculating the slope of a vehicle according to claim 1, characterized in that: The relationship between the Z-axis acceleration value and the slope measurement θ is: G Z =g*cosθ; Among them, G Z is the gravitational acceleration on the Z axis; g is the gravitational acceleration of the area where the vehicle is located.
3. The method for calculating the slope of a vehicle according to claim 1, characterized in that: The calculation formula for the slope change ρ within a certain period of time by integrating the angular velocity is: in, is the average angular velocity, and dt is the time required for the slope to change to that angle.
4. The method for calculating the slope of a vehicle according to claim 3, characterized in that: Since the angular velocity is constantly changing, the sampling period is taken as the minimum time of its change. The calculation formula for the slope change ρ within a certain period of time by integrating the angular velocity can also be written as: ρ=∑V gryoy *Δt; Among them, V gryoy is the real-time angular velocity output by the sensor, V gryoy The six-degree-of-freedom sensor transmits the data to the microcontroller through the SPI communication module, and Δt is the sampling time.
5. The method for calculating the slope of a vehicle according to claim 4, characterized in that: The calculated slope measurement θ and the slope change ρ within a certain period of time are complementary filtered and fused to obtain the fused slope angle α, the specific calculation formula of which is: α=(1-s)*(α -1 +r single )+s*θ; Among them, α is the fusion slope angle, that is, the slope angle obtained by complementary filter fusion, α -1 is the slope angle value corresponding to the previous state, ρ single is the integral of the angular velocity in a single sampling period, and s is the weight of the slope measurement θ calculated from the acceleration.
6. The method for calculating the slope of a vehicle according to claim 5, characterized in that: The fused slope angle α is subjected to Kalman filtering to obtain the predicted slope value, where the relationship between the fused slope angle α and the angular velocity V is: a k =a k-1 +Δt*V k-1 ; Among them, α k is the slope angle value at time k, α k-1 is the slope angle value at time k-1, V k-1 is the angular velocity value at time k-1; the relationship between the fusion slope angle α and the angular velocity V is expressed in a matrix as follows: That is, the state equation of the fusion slope angle α and angular velocity V is: in, is the state equation at time k-1, F K is the matrix transformed from the previous state to the next state, that is, the prediction matrix; Equation of state The covariance P k for: Among them, P k-1 is the state equation at time k-1 The covariance of F K The transpose of Q k is the variance of external disturbance; When the predicted slope value follows the Gaussian distribution N(x, μ0, σ0), the mean μ0 and variance Σ0 of the predicted slope value are: Among them, H k Represents the transition matrix from state variables to predicted quantities at time k; H k The transpose of Similarly, the slope measurement θ also follows the Gaussian distribution N(x, μ1, σ1), and the mean μ1 and variance Σ1 of the slope measurement θ are: Σ1=R k ; in, is the mean value of the slope measurement θ, R k is the variance of the slope measurement θ; In order to correct the predicted slope value by the slope measurement θ, N(x, μ0, σ0) is multiplied by N(x, μ1, σ1) to obtain N(x, μ′, σ′), and its corresponding mean μ′ and variance Σ′ are: Optimal predicted slope value The calculation formula is: Where K′ is the Kalman gain.
7. The method for calculating the slope of a vehicle according to claim 6, characterized in that: The expression of Kalman gain K′ is:
8. A system for calculating the slope of a vehicle, characterized in that: include: Six-degree-of-freedom sensor, which includes a three-axis acceleration sensor and a three-axis gyroscope; A microcontroller is used to receive the acceleration and angular velocity measured by the six-degree-of-freedom sensor and calculate the predicted slope value based on the received data; SPI communication module, used to connect the six-degree-of-freedom sensor and the microcontroller; External communication module, used to connect the microcontroller and the external host computer; The microprocessor includes: A calculation module is used to calculate the Z-axis acceleration value and the Y-axis angular velocity value according to the received acceleration value and angular velocity value and in combination with the pre-established spatial coordinate axis; calculate the slope measurement θ through the Z-axis acceleration value, and integrate the angular velocity to obtain the slope change ρ within a certain time period; The complementary filtering fusion calculation module is used to perform complementary filtering fusion on the calculated slope measurement θ and the slope change ρ within a certain time period to obtain a fused slope angle α; The Kalman filter calculation module is used to perform Kalman filtering on the fused slope angle α to obtain a predicted slope value.
9. A terminal, characterized in that: include: processor; A memory for storing execution instructions of the processor; The processor is configured to execute the method according to any one of claims 1 to 7.
10. A computer-readable storage medium storing a computer program, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Measurement device and calculation method for vehicle acceleration and slope where vehicle is located
CN107132377A
Road slope testing method and system based on inertial sensor
CN117516472A
Kalman filter based road grade estimation method using accelerometer, gyroscope, and vehicle velocity
US20210300383A1
Grade angle and acceleration sensor
US5351540A
Cited By
Gradient determination method and vehicle
CN119568167A
