Vehicle uphill and downhill acceleration measurement and calibration method and device and vehicle
By measuring the acceleration value and attitude information of the car, and using coordinate transformation and rotation matrix to calibrate the acceleration value, the problem that the MPU6050 sensor cannot accurately measure the acceleration value when up and downhill is solved, improving the positioning accuracy of the car and the accuracy of driving trajectory control.
Patent Information
- Application Number
- CN202510146309.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-10
- Publication Date
- 2025-05-13
AI Technical Summary
During the automatic driving of the car, the MPU6050 sensor cannot accurately measure the acceleration value when going up and downhill, resulting in a decrease in positioning accuracy and the driving trajectory of the car cannot be correctly controlled.
By measuring the acceleration value and attitude information of the vehicle, the rotation matrix is obtained by using coordinate transformation, and the acceleration value is substituted into the rotation matrix to obtain the calibrated acceleration value.
It realizes accurate calibration of acceleration values in ups and downs, improving the positioning accuracy of the car and the accuracy of driving trajectory control.
Smart Images

Figure CN119986045A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of acceleration measurement, and more specifically, relates to a vehicle uphill and downhill acceleration measurement calibration method, device and vehicle. Background Art
[0002] At present, the development of sensors is showing a rapid and diversified trend. Its application areas include industrial automation, medical health, environmental protection, smart home, etc. Therefore, intelligent sensing technology is essential for future development and can bring us many conveniences. MPU6050 is a six-axis motion processing sensor that integrates a 3-axis MEMS gyroscope and a 3-axis MEMS accelerometer. This sensor can detect the attitude angle and motion state of an object in three-dimensional space in real time. By measuring the angular velocity of the object around each axis and the acceleration in the three axes, MPU6050 can calculate the attitude angle information of the object such as pitch angle, roll angle and yaw angle, so as to achieve accurate detection of the object's attitude. However, during the automatic driving of the car, there is a problem when using it to measure the acceleration value of the car's motion orientation: when the car is uphill or downhill, the car's motion direction does not coincide with any axis. The acceleration of a single axis obtained by using it is wrong data, and the positioning accuracy is reduced, so the attitude of the car cannot be measured correctly, and the driving trajectory of the car cannot be correctly controlled. Summary of the invention
[0003] The main purpose of the present invention is to provide a vehicle uphill and downhill acceleration measurement calibration method, device and vehicle, which can calibrate the acceleration value output by MPU6050 and correctly control the driving trajectory of the vehicle.
[0004] In order to achieve the above-mentioned object, in a first aspect, the present invention proposes a vehicle uphill and downhill acceleration measurement calibration method, comprising: Measure the acceleration value of the vehicle; Measuring vehicle posture information; Using coordinate transformation according to the posture information, a rotation matrix is obtained according to the rotation order of the ZYX Euler angles; Substituting the measured acceleration value into the rotation matrix, a calibrated acceleration value is obtained.
[0005] Furthermore, the rotation matrix includes: R = Where R is the rotation matrix, θ is the pitch angle, and ϕ is the roll angle.
[0006] Further, obtaining the calibrated acceleration value includes: aglobal=R·alocal Where aglobal is the calibrated acceleration value, alocal is the measured acceleration value, and R is the rotation matrix.
[0007] Furthermore, the vehicle's posture information includes the vehicle's pitch angle and roll angle.
[0008] In a second aspect, the present invention also provides a vehicle uphill and downhill acceleration measurement and calibration device, comprising a measurement module and a main control module. The measuring module is used to measure the acceleration value and posture information of the vehicle and send them to the main control module; The main control module is used to obtain a rotation matrix according to the rotation sequence of ZYX Euler angles by using coordinate transformation according to the posture information; and substitute the measured acceleration value into the rotation matrix to obtain a calibrated acceleration value.
[0009] Furthermore, the rotation matrix includes: R = Where R is the rotation matrix, θ is the pitch angle, and ϕ is the roll angle.
[0010] Further, obtaining the calibrated acceleration value includes: aglobal=R·alocal Where aglobal is the calibrated acceleration value, alocal is the measured acceleration value, and R is the rotation matrix.
[0011] Furthermore, the vehicle's posture information includes the vehicle's pitch angle and roll angle.
[0012] In a third aspect, the present invention further provides a vehicle, comprising the vehicle uphill and downhill acceleration measurement and calibration method as described in any one of the above, and also comprising a drive module, a sensor and a main control module. The sensor is used to measure the acceleration value and posture information of the vehicle and transmit them to the main control module; The main control module is used to obtain a rotation matrix according to the rotation order of ZYX Euler angles using coordinate transformation according to the posture information; and substitute the measured acceleration value into the rotation matrix to obtain a calibrated acceleration value; the main control module controls the output power of the drive module according to the calibrated acceleration value.
[0013] Furthermore, it also includes an encoding motor, which is connected to the driving module, and the driving module controls the rotation angle and speed of the encoding motor according to the signal of the main control module; the main control module is connected to the encoding motor to read the feedback signal of the encoder motor, and adjust the rotation angle and speed of the encoding motor through the driving module.
[0014] Compared with the prior art, the advantages of the present invention are as follows: the coordinate transformation principle is utilized, and after the measurement value of the accelerometer of MPU6050 in the local coordinate system of the device is transmitted to the main control, the internal algorithm of the main control is changed through the program to convert the coordinate system from the local coordinate system of the device to the earth reference system, thereby converting the measurement value of the MPU6050 accelerometer into an acceleration value relative to the earth reference system, and outputting this data to control the motor drive module, thereby realizing real-time and effective control of the automatically running car. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] Figure 1 A schematic diagram of a flow chart of a vehicle uphill and downhill acceleration measurement and calibration method provided by an embodiment of the present invention; Figure 2 A schematic diagram of a vehicle uphill and downhill acceleration measurement and calibration device provided by an embodiment of the present invention; Figure 3 A schematic diagram of the structure of a vehicle provided by an embodiment of the present invention; Figure 4 A wiring diagram of the STM32F103C8T6 single-chip microcomputer module provided in an embodiment of the present invention; Figure 5 A wiring diagram of an OLED provided by an embodiment of the present invention; Figure 6 A wiring diagram of the MPU6050 sensor provided in an embodiment of the present invention; Figure 7 A wiring diagram of the TB6612 motor drive module provided in an embodiment of the present invention; Figure 8 A wiring diagram of a power module provided in an embodiment of the present invention; Fig. 9 A comparison diagram of acceleration values displayed when a vehicle goes uphill provided by an embodiment of the present invention; Fig.10 A comparison diagram of acceleration values displayed when a vehicle is going downhill provided by an embodiment of the present invention; Fig.11 A comparison diagram of acceleration values displayed when a vehicle stops horizontally provided by an embodiment of the present invention; Fig.12 A comparison chart of acceleration values displayed when a vehicle is traveling normally horizontally provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0016] The embodiments of the present disclosure are described in detail below with reference to the accompanying drawings.
[0017] The following describes the embodiments of the present disclosure through specific examples, and those skilled in the art can easily understand other advantages and effects of the present disclosure from the contents disclosed in this specification. Obviously, the described embodiments are only a part of the embodiments of the present disclosure, rather than all of the embodiments. The present disclosure can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present disclosure. It should be noted that the following embodiments and features in the embodiments can be combined with each other without conflict. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present disclosure.
[0018] With the prosperity of the country and the rapid development of society, the gross national product has increased rapidly, and people's quality of life and conditions have also improved accordingly. The development of sensors has shown a rapid and diversified trend. Its application areas have expanded: industrial automation, medical health, environmental protection, smart home, etc. Therefore, intelligent sensing technology is essential for future development and can bring us many conveniences. MPU6050 is a six-axis motion processing sensor that integrates a 3-axis MEMS gyroscope and a 3-axis MEMS accelerometer. This sensor can detect the attitude angle and motion state of an object in three-dimensional space in real time. By measuring the angular velocity of the object around each axis and the acceleration in the three axes, MPU6050 can calculate the attitude angle information of the object such as pitch angle, roll angle and yaw angle, thereby realizing accurate detection of the object's attitude. However, when the car is driving automatically, there is a problem when using it to measure the acceleration value of the car's moving direction: when the car is going uphill or downhill, the car's moving direction does not coincide with any axis. The acceleration of a single axis obtained by using it is erroneous data, and the positioning accuracy is reduced, making it impossible to correctly measure the car's posture and control the car's driving trajectory.
[0019] Based on this, firstly, Figure 1 As shown, this embodiment provides a vehicle uphill and downhill acceleration measurement calibration method, including steps S1 to S4: S1. Measure the acceleration value of the vehicle.
[0020] Among them, the acceleration vector alocal is: alocal= S2. Measure the vehicle's posture information.
[0021] The vehicle's posture information includes at least the vehicle's pitch angle and roll angle.
[0022] S3. According to the posture information, coordinate transformation is used to obtain a rotation matrix in the rotation order of ZYX Euler angles.
[0023] The rotation matrix includes: R = Where R is the rotation matrix, θ is the pitch angle, and ϕ is the roll angle.
[0024] The rotation matrix R here only takes into account the pitch angle (pitch, θ) and roll angle (roll, ϕ), and assumes that the yaw angle (yaw, I) is 0 because the yaw angle (yaw) does not affect the measurement of the accelerometer.
[0025] S4. Substituting the measured acceleration value into the rotation matrix to obtain a calibrated acceleration value.
[0026] Among them, the calibrated acceleration value is obtained, including: aglobal=R·alocal Where aglobal is the calibrated acceleration value, alocal is the measured acceleration value, and R is the rotation matrix.
[0027] Second, as Figure 2 As shown, this embodiment also provides a vehicle uphill and downhill acceleration measurement and calibration device, including a measurement module and a main control module. A measuring module, used to measure the acceleration value and posture information of the vehicle and send them to the main control module; The main control module is used to obtain a rotation matrix according to the rotation sequence of ZYX Euler angles by using coordinate transformation according to the posture information; and substitute the measured acceleration value into the rotation matrix to obtain a calibrated acceleration value.
[0028] Furthermore, the rotation matrix includes: R = Where R is the rotation matrix, θ is the pitch angle, and ϕ is the roll angle.
[0029] Furthermore, the calibrated acceleration value is obtained, including: aglobal=R·alocal Where aglobal is the calibrated acceleration value, alocal is the measured acceleration value, and R is the rotation matrix.
[0030] Furthermore, the vehicle's posture information includes the vehicle's pitch angle and roll angle.
[0031] Thirdly, Figure 3As shown, this embodiment also provides a vehicle, including the vehicle uphill and downhill acceleration measurement and calibration method as described in any one of the above, and also includes a drive module, a sensor, a main control module, an encoding motor, a power module and a display module. The sensor is used to measure the acceleration value and posture information of the vehicle and transmit it to the main control module; The main control module is used to obtain the rotation matrix according to the rotation order of ZYX Euler angle by using coordinate transformation according to the posture information; and substitute the measured acceleration value into the rotation matrix to obtain the calibrated acceleration value; the main control module controls the output power of the drive module according to the calibrated acceleration value.
[0032] The encoder motor is connected to the drive module, and the drive module controls the rotation angle and speed of the encoder motor according to the signal of the main control module; the main control module is connected to the encoder motor to read the feedback signal of the encoder motor and adjust the rotation angle and speed of the encoder motor through the drive module.
[0033] The power module is used to provide 3.3V and 5V power to the main control module and the driver module respectively.
[0034] The display module is used to display system status and data information such as acceleration values and Euler angles, and provide intuitive visual feedback.
[0035] Among them, the main control module, sensor, encoder motor and drive module respectively use STM32F103C8T6 microcontroller module, mpu6050, GMR encoder motor, TB6612 motor drive module, OLED, and their specific connection structures are as follows: Figure 4-Figure 8 shown.
[0036] The MPU6050 sensor uses a 3-axis gyroscope and a 3-axis accelerometer to detect the attitude and motion state of the automatic driving car in real time, including pitch angle (Pitch), roll angle (Roll) and yaw angle (Yaw); by detecting the data of the three-axis accelerometer, it can track the motion state of the object, provide accurate motion data, and connect to the STM32F103C8T6 microcontroller module through the I2C interface to transmit the motion data to the STM32F103C8T6 microcontroller module for processing, during which the STM32F103C8T6 microcontroller serves as the main control chip. OLED is used to display system status and data information such as acceleration value and Euler angle, and provide intuitive visual feedback. OLED is connected to the STM32F103C8T6 microcontroller module through the I2C interface, receives the display data sent by the microcontroller, and updates the content from time to time. The GMR encoder motor has its own encoder, which can detect the rotation position, speed and direction of the motor shaft. It is used in situations where higher precision positioning or speed control is required. It is connected to the STM32F103C8T6 microcontroller module through PWM signals or other control signals. The microcontroller generates PWM signals through the timer module to control the rotation angle and speed of the GMR encoder motor. At the same time, the microcontroller can also realize closed-loop control by reading the feedback signal of the GMR encoder motor to improve the accuracy and stability of the system. The TB6612 motor driver module is used to drive a DC motor or a stepper motor, providing sufficient current and voltage to drive the motor to work. It is connected to the STM32F103C8T6 through the GPIO interface. The microcontroller controls the input signal of the TB6612 motor driver module to realize the forward and reverse rotation of the motor, speed adjustment and other functions; the TB6612 motor driver module also provides overcurrent, overheating and other protection functions to ensure the safe operation of the motor.
[0037] The vehicle using any of the above mentioned vehicle uphill and downhill acceleration measurement calibration methods is used as the test object. After experimental testing, it is found that the data obtained by the MPU6050 accelerometer when the attitude angle information is not used for adjustment and when the attitude angle information is used for adjustment is compared as follows: Figure 9-12 As shown, when comparing the data, it can be clearly found that the data on the horizontal plane is on a certain axis regardless of whether it is in motion or prohibited state, so the data obtained is correct. However, when the car is not on the horizontal plane (the car is in the up (down) slope stage), and the attitude information (pitch angle θ and roll angle ϕ) is not adjusted, the data obtained by the MPU6050 accelerometer is random or even wrong. However, after the attitude information (pitch angle θ and roll angle ϕ) is adjusted, the accelerometer data will make the accelerometer on the axis, which is correct. When the car is traveling in the horizontal direction, the measured results are also accurate.
[0038] The above is only for explaining the implementation mode of the present invention and is not intended to limit the present invention. For those skilled in the art, any modification, equivalent substitution, improvement, etc. made within the spirit and principle of the present invention without creative work should be included in the protection scope of the present invention.
Claims
1. A method for measuring and calibrating vehicle uphill and downhill acceleration, characterized in that: include: Measure the acceleration value of the vehicle; Measuring vehicle posture information; Using coordinate transformation according to the posture information, a rotation matrix is obtained according to the rotation order of the ZYX Euler angles; Substituting the measured acceleration value into the rotation matrix, a calibrated acceleration value is obtained.
2. The vehicle uphill and downhill acceleration measurement and calibration method according to claim 1, characterized in that: The rotation matrix includes: R = Where R is the rotation matrix, θ is the pitch angle, and ϕ is the roll angle.
3. The vehicle uphill and downhill acceleration measurement calibration method according to claim 1, characterized in that: The calibrated acceleration value includes: aglobal=R·alocal Where aglobal is the calibrated acceleration value, alocal is the measured acceleration value, and R is the rotation matrix.
4. The vehicle uphill and downhill acceleration measurement and calibration method according to claim 1, characterized in that: The vehicle's posture information includes the vehicle's pitch angle and roll angle.
5. A vehicle uphill and downhill acceleration measurement and calibration device, characterized in that: Including measurement module and main control module, The measuring module is used to measure the acceleration value and posture information of the vehicle and send them to the main control module; The main control module is used to obtain a rotation matrix according to the rotation sequence of ZYX Euler angles by using coordinate transformation according to the posture information; and substitute the measured acceleration value into the rotation matrix to obtain a calibrated acceleration value.
6. The vehicle uphill and downhill acceleration measurement and calibration device according to claim 5, characterized in that: The rotation matrix includes: R = Where R is the rotation matrix, θ is the pitch angle, and ϕ is the roll angle.
7. The vehicle uphill and downhill acceleration measurement and calibration device according to claim 6, characterized in that: The calibrated acceleration value includes: aglobal=R·alocal Where aglobal is the calibrated acceleration value, alocal is the measured acceleration value, and R is the rotation matrix.
8. The vehicle uphill and downhill acceleration measurement and calibration device according to claim 5, characterized in that: The vehicle's posture information includes the vehicle's pitch angle and roll angle.
9. A vehicle, characterized in that: The method comprises the vehicle uphill and downhill acceleration measurement and calibration method as claimed in any one of claims 1 to 4, and further comprises a drive module, a sensor and a main control module. The sensor is used to measure the acceleration value and posture information of the vehicle and transmit them to the main control module; The main control module is used to obtain a rotation matrix according to the rotation order of ZYX Euler angles using coordinate transformation according to the posture information; and substitute the measured acceleration value into the rotation matrix to obtain a calibrated acceleration value; the main control module controls the output power of the drive module according to the calibrated acceleration value.
10. The vehicle according to claim 9, characterized in that It also includes an encoding motor, which is connected to the driving module. The driving module controls the rotation angle and speed of the encoding motor according to the signal of the main control module; the main control module is connected to the encoding motor to read the feedback signal of the encoder motor and adjust the rotation angle and speed of the encoding motor through the driving module.