Steering wheel angle sensor algorithm based on difference calculation
Through the steering wheel angle sensor algorithm based on the difference calculation, the traditional steering wheel control method is solved in the absence of steering angle in emergencies and precisely controlling the steering angle, achieving more refined direction control and vehicle stability improvement, which is suitable for the intelligent driving needs of modern cars.
Patent Information
- Application Number
- CN202412000246.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-05-06
AI Technical Summary
Traditional steering wheel control methods can cause the vehicle to overturn in emergencies or incorrectly operated, and there are difficulties in precise control of steering angles, which are especially challenging for novice drivers.
The steering wheel angle sensor algorithm based on the difference calculation is adopted, and the angle conversion of the main gear and the secondary gear, the angle difference calculation and the MATLAB algorithm model model are used to accurately calculate the steering wheel angle, angle direction and angular velocity.
It realizes more refined customized direction control, can accurately measure the angle range of -1080° to 1080°, improves the stability of the vehicle, and supports intelligent control, suitable for the safer and smarter driving experience of modern cars.
Smart Images

Figure CN119935054A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of control algorithms, and more specifically, to a steering wheel angle sensor algorithm based on difference calculation. Background Art
[0002] The automotive steering wheel angle sensor (SAS) is a key component of the vehicle stability control system and is usually installed in the steering column below the steering wheel. As an independent CAN bus node, it is responsible for measuring the rotation angle of the steering wheel when the car is turning, and outputs it in the form of multiple absolute angles to ensure that its absolute angle can be accurately captured even if the steering wheel rotates multiple times. The traditional steering wheel control method directly controls the rotation of the front wheels, but this "1:1" rotation relationship lacks the necessary amplification and buffering mechanism, which may cause the vehicle to roll over in an emergency or improper operation. In addition, the traditional method has difficulties in accurately controlling the steering angle, and requires high experience and skills from the driver, which is especially challenging for novice drivers. In order to overcome these shortcomings, this patent proposes a steering wheel angle sensor algorithm based on difference calculation.
[0003] SUMMARY OF THE INVENTION
[0004] The object of the present invention is to provide a steering wheel angle sensor algorithm based on difference calculation to solve the problems raised in the above background technology.
[0005] To achieve the above-mentioned purpose, the present invention provides the following technical solutions: a steering wheel angle sensor algorithm based on difference calculation includes angle conversion between main gear and auxiliary gear, angle reading and calculation of auxiliary gear, angle difference calculation and MATLAB algorithm model building, which can finally calculate the current angle value, angle direction and angular velocity.
[0006] Preferably, the angle conversion between the main gear and the secondary gear is as shown in the following formula (7):
[0007]
[0008] In the above formula (12), m C ,n A and m B The number of teeth of the main gear and the measuring gear, n A , n B and n C They are the rotation speeds of the main gear and the measuring gear respectively.
[0009] Preferably, the angle and reading calculation of the constructed secondary gear are as shown in the following formula (13):
[0010]
[0011] Among them, βA and β B is the value of the current sensor read, θ A With θ B are the angles of the secondary gear respectively.
[0012] Preferably, the angle difference is calculated as shown in the following formula (10):
[0013] Δθ AB =θ A -θ B =β A -β B -(n A -n B )×360° (11)
[0014] Preferably, the MATLAB algorithm model is modeled as follows:
[0015] Step 1: Construct the angle relationship between the main gear and the secondary gear. Specifically, it is divided into three steps: ① Construct the angle conversion relationship between the main gear and the secondary gear; ② Construct the angle reading and calculation of the secondary gear; ③ Construct the final angle difference.
[0016] Step 2: Build the gear zero point calibration and read the current position of the gear. First, read the actual value β of the angle sensor at the zero point position. A0 With β B0 And store the data. In this step, variables such as gu16Zero_SensorAngleC, gu16Zero_SensorAngleB, f32_Zero_SmallAngled, and f32_Zero_MiddAngled are used.
[0017] Step 3: Build the corresponding MABLAB code. In this step, an angle algorithm based on graphical steps is used. This algorithm is modeled in MATLAB and can automatically generate code.
[0018] Compared with the prior art, the present invention provides a steering wheel angle sensor algorithm based on difference calculation, which has the following beneficial effects:
[0019] 1. This angle algorithm implements a more refined customized direction compared to traditional strategies, and can accurately measure the angle range of -1080° to 1080°; angle resolution: 0.1°; 3. Angle error: ±1.5°; the zero point can be calibrated at any angle; in the case of power failure, the steering wheel angle sensor (SAS) changes angle within -1080° to 1080°, and can accurately read the current angle position after power-on.
[0020] 2. The car steering wheel angle sensor (SAS) has no mechanical 0 position. The algorithm is used to calibrate the 0 position at any position through the CAN communication network through the car configuration tool. The power supply of the car steering wheel angle sensor (SAS) will be disconnected after the car is turned off. After the power is off, even if the steering wheel rotates within its effective range, the current angle position of the steering wheel must be accurately calculated and output when the power is turned on again.
[0021] 3. This algorithm not only improves the stability of the vehicle, but also realizes precise control of the steering angle and supports intelligent control. It can be widely used in multiple fields, bringing safer and smarter driving experience to modern cars. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] Figure 1 A system structure diagram according to an embodiment of the present application is shown;
[0023] Figure 2 A system principle block diagram according to an embodiment of the present application is shown;
[0024] Figure 3 A simulation diagram of the angle difference algorithm according to an embodiment of the present application is shown. By calculating the difference between the auxiliary gears and the relationship between the number of teeth of the main and auxiliary gears and making corresponding error compensation, the current angle value, angle direction and angular velocity can be calculated;
[0025] Figure 4 A diagram showing the gear and angle parameter settings of the MATLAB algorithm model according to an embodiment of the present application is shown, and the parameters involved in the SAS algorithm are adjusted by setting the base value and the number of teeth;
[0026] Figure 5 The variables involved in the "gear zero point calibration" and the variables involved in the "gear current position" of the MATLAB algorithm model according to the embodiment of the present application are shown, which are used to read the angle value of the current sensor A and B;
[0027] Figure 6 The MATLAB algorithm flow according to the embodiment of the present application and the related codes involved in the flow are shown;
[0028] Figure 7 A sensor output characteristic curve diagram according to an embodiment of the present application is shown. DETAILED DESCRIPTION
[0029] The technical solutions in the embodiments of the present application will be described clearly and completely below in conjunction with the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, not all embodiments. Based on the embodiments of the present application, all other embodiments obtained by ordinary technicians in this field without creative work also fall within the scope of protection of the present application.
[0030] As shown in this application and claims, unless the context clearly indicates an exception, the words "a", "an", "an" and / or "the" do not refer to the singular and may also include the plural. Generally speaking, the terms "include" and "comprise" only indicate the inclusion of the steps and elements that have been clearly identified, and these steps and elements do not constitute an exclusive list. The method or device may also include other steps or elements.
[0031] Various exemplary embodiments, features and aspects of the present application will be described in detail below with reference to the accompanying drawings. The same reference numerals in the accompanying drawings represent elements with the same or similar functions. Although various aspects of the embodiments are shown in the accompanying drawings, the drawings are not necessarily drawn to scale unless otherwise specified.
[0032] In addition, in order to better illustrate the present application, numerous specific details are given in the following specific embodiments. It should be understood by those skilled in the art that the present application can also be implemented without certain specific details. In some examples, methods, means, components and circuits well known to those skilled in the art are not described in detail in order to highlight the subject matter of the present application.
[0033] according to Figure 1 As shown, the mechanical configuration mainly consists of an upper and lower housing, a main gear, two sub-gears with embedded magnets, and a PCBA; the main gear and sub-gear have different radii and numbers of teeth; the PCBA includes an MCU, a sensor CAN interface chip, etc.
[0034] according to Figure 2 As shown in the figure, the system principle block diagram mainly consists of three parts: CAN bus, sensor module and mechanical equipment.
[0035] ①Use a three-gear mechanical structure to measure the angle value;
[0036] ②The sensor chip collects current angle data;
[0037] ③MCU reads the angle data and calculates the steering wheel position and angular velocity through the algorithm, and sends the angle position and angular velocity to the CAN network.
[0038] according to Figure 3 As shown in the figure, the simulation diagram of the angle difference algorithm, its generation process and its mathematical principle are as follows:
[0039] First convert the angle between the main gear and the secondary gear:
[0040]
[0041] In the above formula (12), m C ,m A and m BThe number of teeth of the main gear and the measuring gear, n A , n B and n C They are the rotation speeds of the main gear and the measuring gear respectively.
[0042] Furthermore, to construct the angle and reading of the secondary gear, the calculation is shown in the following formula (13).
[0043]
[0044] Among them, β A and β B is the value of the current sensor read, θ A With θ B are the angles of the secondary gear respectively.
[0045] The final angle difference Δθ AB The calculation process is shown in the formula.
[0046] Δθ AB =θ A -θ B =β A -β B -(n A -n B )×361° (14)
[0047] according to Figure 4 , Figure 5 , Figure 6 The MATLAB algorithm model shown in the figure has the following implementation steps:
[0048] Step 1: Construct the angle relationship between the main gear and the secondary gear. Specifically, it is divided into three steps: ① Construct the angle conversion relationship between the main gear and the secondary gear; ② Construct the angle reading and calculation of the secondary gear; ③ Construct the final angle difference.
[0049] Step 2: Build the gear zero point calibration and read the current position of the gear. First, read the actual value β of the angle sensor at the zero point position. A0 With β B0 And store the data. In this step, variables such as gu16Zero_SensorAngleC, gu16Zero_SensorAngleB, f32_Zero_SmallAngled, and f32_Zero_MiddAngled are used.
[0050] Step 3: Build the corresponding MABLAB code. In this step, an angle algorithm based on graphical steps is used. This algorithm is modeled in MATLAB and can automatically generate code.
[0051] according to Figure 7 As shown in the figure, the overall execution steps related to the SAS algorithm are as follows: ① With the help of the main gear rotation angle θ and the rotation angles α and β of the two measuring gears, a corresponding output diagram of the steering wheel rotation angle and the output measurement element is constructed; ② The corresponding angle output is customized within the measurement range, and its mapping function is output as θ=f(α, β) according to the MATLAB simulation results; ③ The corresponding diagram of the final steering wheel rotation angle and the sensor output angle is constructed, where a positive steering wheel rotation angle represents a counterclockwise direction, and a negative angle represents a clockwise direction.
Claims
1. A steering wheel angle sensor algorithm based on difference calculation includes angle conversion between main gear and auxiliary gear, angle reading and calculation of auxiliary gear, angle difference calculation and MATLAB algorithm model building.
2. The steering wheel angle sensor algorithm based on difference calculation according to claim 1, characterized in that: The angle conversion between the main gear and the secondary gear is shown in the following formula (2): In the above formula (12), m C , m A and m B The number of teeth of the main gear and the measuring gear, n A , n B and n C They are the rotation speeds of the main gear and the measuring gear respectively.
3. The steering wheel angle sensor algorithm based on difference calculation according to claim 1, characterized in that: The angle and reading calculation of the constructed secondary gear are shown in the following formula (13): Among them, β A and β B is the value of the current sensor read, θ A With θ B are the angles of the secondary gear respectively.
4. The steering wheel angle sensor algorithm based on difference calculation according to claim 1, characterized in that: The angle difference is calculated as shown in the following formula (5): Dth AB =θ A -θ B =b A -b B -(n A -n B )×360° (6).
5. The steering wheel angle sensor algorithm based on difference calculation according to claim 1, characterized in that: Preferably, the MATLAB algorithm model is modeled as follows: Step 1: Construct the angle relationship between the main gear and the secondary gear. Specifically, it is divided into three steps: ① Construct the angle conversion relationship between the main gear and the secondary gear; ② Construct the angle reading and calculation of the secondary gear; ③ Construct the final angle difference. Step 2: Build the gear zero point calibration and read the current position of the gear. First, read the actual value β of the angle sensor at the zero point position. A0 With β B0 And store the data. In this step, variables such as gu16Zero_SensorAngleC, gu16Zero_SensorAngleB, f32_Zero_SmallAngled, and f32_Zero_MiddAngled are used. Step 3: Build the corresponding MABLAB code. In this step, an angle algorithm based on graphical steps is used. This algorithm is modeled in MATLAB and can automatically generate code.