Steering angle calculation method and device, vehicle and storage medium

By introducing historical steering angle state information and slope compensation mechanism into the Hall effect steering angle sensor, and combining it with Kalman filter for dual-channel angle estimation, the problems of steering angle jitter and burrs caused by gear mechanical errors are solved, thereby improving the accuracy and stability of steering angle measurement.

CN122144012APending Publication Date: 2026-06-05TIANJIN TRINOVA AUTOMOTIVE TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
TIANJIN TRINOVA AUTOMOTIVE TECH CO LTD
Filing Date
2026-05-07
Publication Date
2026-06-05

AI Technical Summary

Technical Problem

Existing absolute steering angle sensors suffer from initial slope value jitter and step spikes due to mechanical constraints, affecting vehicle handling stability and response continuity.

Method used

By introducing historical steering angle state information, combined with slope compensation and fault tolerance mechanisms, and using a Kalman filter to fuse dual-channel angle estimates, slope jitter and power-on jump caused by gear mechanical errors are suppressed.

Benefits of technology

Without increasing hardware costs, it effectively eliminates step spikes in the steering angle signal, improving the accuracy and stability of steering angle measurement.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122144012A_ABST
    Figure CN122144012A_ABST
Patent Text Reader

Abstract

The application relates to the technical field of vehicle control, and discloses a steering angle calculation method and device, a vehicle and a storage medium, the method is applied to a Hall type rotation angle sensor, the rotation angle sensor comprises a main gear and two first and second slave gears with prime number of teeth, and the method comprises the following steps: obtaining an initial slope value representing a rotation angle interval of the main gear according to a first phase angle of the first slave gear, a second phase angle of the second slave gear and the number of teeth of the first and second slave gears; obtaining a target slope value based on the initial slope value and historical steering angle state information, combining a slope compensation and a fault tolerance mechanism; obtaining a first angle estimation value and a second angle estimation value according to the target slope value, the first phase angle and the second phase angle; and fusing the first angle estimation value and the second angle estimation value to obtain a steering angle of the main gear. The application can improve the precision of steering angle measurement.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of vehicle control technology, and in particular to a method, device, vehicle, and storage medium for calculating steering angle. Background Technology

[0002] Steering wheel angle sensors are core input units for critical functions such as automotive electronic stability programs, electric power steering, and advanced driver assistance systems. Their accuracy and reliability directly affect vehicle handling safety. Currently, most mainstream absolute steering angle sensors employ the principle of a magnetoelectric vernier caliper, where a primary gear drives two secondary gears with coprime tooth counts, using their phase difference to uniquely determine the absolute angle of the primary gear. However, in engineering implementation, this structure faces significant mechanical constraints: the primary gear is typically a large-sized ring structure, making it difficult to guarantee high roundness and tooth pitch uniformity during injection molding; the different meshing points of the two secondary gears with the primary gear lead to nonlinear and inconsistent transmission characteristics of local deformation or tooth profile errors in the two transmission chains. The key problem arising from this is that the initial slope value exhibits non-monotonic jitter near the true integer target value; if directly rounded to the nearest integer, even a small jitter can trigger a slope jump, which, after being weighted and amplified by the gear ratio, forms a step glitch of hundreds to thousands of degrees in the final output angle, severely interfering with the stability and response continuity of the downstream control system. Summary of the Invention

[0003] In view of this, embodiments of this application provide a steering angle calculation method, device, vehicle, and storage medium, which can effectively suppress initial slope jitter and power-on jump caused by gear mechanical errors, eliminate step spikes in the output angle signal, and improve the accuracy of steering angle measurement without increasing hardware cost and complexity, by introducing slope fault-tolerant correction guided by historical steering angle state information, dual-channel independent calculation and fusion processing.

[0004] In a first aspect, embodiments of this application provide a method for calculating steering angle, applied to a Hall effect steering angle sensor. The steering angle sensor includes a main gear and two driven gears, a first driven gear and a second driven gear, with coprime tooth counts. The method includes: Based on the first phase angle of the first driven gear, the second phase angle of the second driven gear, and the number of teeth of the first driven gear and the second driven gear, the initial slope value characterizing the range of rotation angles of the main gear is calculated. Based on the initial slope value and historical steering angle state information, the target slope value is obtained by combining slope compensation and fault tolerance mechanisms. Based on the target slope value, the first phase angle, and the second phase angle, the first angle estimate and the second angle estimate are calculated respectively. The first angle estimate and the second angle estimate are fused together to obtain the steering angle of the main gear.

[0005] In an optional implementation, obtaining the target slope value based on the initial slope value and historical steering angle state information, combined with slope compensation and fault tolerance mechanisms, includes: During the sensor power-on initialization phase, the initial slope value is initialized with an offset calibration based on the decimal part of the initial slope value to obtain an intermediate slope value; wherein, the initial offset calibration is to apply a preset offset to the initial slope value when the decimal part of the initial slope value is within a preset fluctuation range; During the stable operation phase of the sensor, the intermediate slope value is processed to handle parity errors by combining the historical steering angle state information, so as to obtain the target slope value.

[0006] In an optional implementation, the parity tolerance processing includes: The range of the intermediate slope value is divided into multiple judgment intervals of equal width; wherein the width of the judgment interval is 2. When the historical turning angle state information indicates the first state, the intermediate slope values ​​falling into the same determination interval are mapped to the same integer with the first parity attribute to obtain the target slope value. When the historical turning angle state information indicates the second state, the intermediate slope values ​​falling into the same determination interval are mapped to the same integer with the second parity attribute to obtain the target slope value. The first parity attribute is the opposite of the second parity attribute.

[0007] In an optional implementation, the step of calculating the first angle estimate and the second angle estimate based on the target slope value, the first phase angle, and the second phase angle includes: Based on the target slope value, a first associated slope value and a second associated slope value are generated; The first angle estimate is calculated using the first phase angle, the first associated slope value, the first proportional coefficient, and the first offset. The second angle estimate is calculated using the second phase angle, the second associated slope value, the second proportional coefficient, and the second offset.

[0008] In an optional implementation, generating a first associated slope value and a second associated slope value based on the target slope value includes: A first bias and a second bias are applied to the target slope value to obtain the first associated slope value and the second associated slope value. The difference between the first bias and the second bias is a constant; the constant is determined by the ratio of the number of teeth of the first driven gear to the number of teeth of the second driven gear.

[0009] In an optional implementation, the process of outputting the steering angle of the main gear further includes: The steering angular velocity of the main gear is acquired in real time; When the steering angular velocity exceeds a preset dynamic response threshold, the dynamic delay compensation mechanism is activated; Based on the fused turning angles from multiple consecutive sampling periods, a time series model of the angle-time relationship is constructed. Based on the delay characteristics, the angle value at the corresponding delay time point is predicted forward along the time series model, and the predicted angle value is used as the compensated turning angle at the current time.

[0010] In an optional implementation, the step of fusing the first angle estimate and the second angle estimate to obtain the steering angle of the main gear includes: The first angle estimate and the second angle estimate are used as observations and input into a Kalman filter. The state vector of the Kalman filter includes the absolute angle and angular velocity of the main gear. The Kalman filter outputs the fused steering angle of the main gear based on a preset process noise covariance matrix and observation noise covariance matrix.

[0011] Secondly, this application provides a steering angle calculation device applied to a Hall effect steering angle sensor. The steering angle sensor includes a main gear and two coprime driven gears, a first driven gear and a second driven gear. The device includes: The initial slope value acquisition module is used to calculate and obtain the initial slope value characterizing the range of rotation angles of the main gear based on the first phase angle of the first driven gear, the second phase angle of the second driven gear, and the number of teeth of the first driven gear and the second driven gear. The target slope value acquisition module is used to obtain the target slope value based on the initial slope value and historical steering angle state information, combined with slope compensation and fault tolerance mechanisms. An angle estimation module is used to calculate and obtain a first angle estimation value and a second angle estimation value based on the target slope value, the first phase angle and the second phase angle, respectively. The steering angle acquisition module is used to fuse the first angle estimate and the second angle estimate to obtain the steering angle of the main gear.

[0012] Thirdly, according to an embodiment of this application, a vehicle includes a processor and a memory, the memory storing a computer program, and the processor executing the computer program to implement the above-described steering angle calculation method.

[0013] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program that, when executed on a processor, implements the aforementioned steering angle calculation method.

[0014] The embodiments of this application have the following beneficial effects: The method of this application no longer relies on hardware precision improvement or additional physical redundancy, but takes the initial slope value as input and combines historical steering angle state information to implement slope compensation and fault tolerance, fundamentally suppressing the slope jump caused by gear error; on this basis, the target slope value is used to calculate two independent angle estimates respectively, and the final steering angle is output through fusion processing, which not only retains the complementarity of dual-channel observation, but also achieves the synergistic suppression of noise and bias in each channel.

[0015] This application constructs an adaptive slope calculation and fusion architecture for Hall effect angle sensors at the software level, which can effectively overcome the signal distortion problem caused by mechanical deformation of the main gear, uneven tooth pitch, and meshing clearance. Attached Figure Description

[0016] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0017] Figure 1 This paper illustrates a first flowchart of the steering angle calculation method according to an embodiment of this application. Figure 2 ( Figure 2a and Figure 2b This diagram illustrates the second process flow of the steering angle calculation method according to an embodiment of this application. Figure 3 This paper illustrates a third flowchart of the steering angle calculation method according to an embodiment of this application. Figure 4 A schematic diagram of the fourth process of the steering angle calculation method according to an embodiment of this application is shown; Figure 5 A schematic diagram of a steering angle calculation device according to an embodiment of this application is shown. Detailed Implementation

[0018] The technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments.

[0019] The components of the embodiments of this application described and illustrated in the accompanying drawings can be arranged and designed in a variety of different configurations. Therefore, the following detailed description of the embodiments of this application provided in the drawings is not intended to limit the scope of the claimed application, but merely to illustrate selected embodiments of the application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without inventive effort are within the scope of protection of this application.

[0020] In the following text, the terms "comprising," "having," and their cognates, which may be used in various embodiments of this application, are intended only to indicate a particular feature, number, step, operation, element, component, or combination thereof, and should not be construed as primarily excluding the presence of one or more other features, numbers, steps, operations, elements, components, or combinations thereof, or adding the possibility of one or more combinations thereof. Furthermore, the terms "first," "second," "third," etc., are used only for distinguishing descriptions and should not be construed as indicating or implying relative importance.

[0021] Unless otherwise specified, all terms used herein (including technical and scientific terms) shall have the same meaning as commonly understood by one of ordinary skill in the art to which the various embodiments of this application pertain. Terms (such as those defined in commonly used dictionaries) shall be interpreted as having the same meaning as in their contextual meaning in the relevant technical field and shall not be construed as having an idealized or overly formal meaning, unless clearly defined in the various embodiments of this application.

[0022] The following detailed description of some embodiments of this application is provided in conjunction with the accompanying drawings. Unless otherwise specified, the following embodiments and features can be combined with each other.

[0023] The following describes the steering angle calculation method with reference to some specific embodiments. This steering angle calculation method is applied to a Hall effect steering angle sensor, which includes a main gear and two driven gears with coprime tooth numbers, namely a first driven gear and a second driven gear.

[0024] Figure 1 A schematic flowchart of a steering angle calculation method according to an embodiment of this application is shown. Exemplarily, the steering angle calculation method includes steps S100-S400: Step S100: Calculate the initial slope value representing the range of rotation angles of the master gear based on the first phase angle of the first driven gear, the second phase angle of the second driven gear, and the number of teeth of the first and second driven gears.

[0025] The following is a schematic diagram of the overall process (Figure 2). Figure 2a This step will be explained.

[0026] S1, power on.

[0027] S2 reads the first phase angle and the second phase angle of the first driven gear and the second driven gear, which have coprime tooth numbers.

[0028] S3 performs filtering on the first phase angle and the second phase angle.

[0029] S4 calculates the initial slope value based on the first and second phase angles after filtering.

[0030] Specifically, step S100 begins execution after the sensor completes power-on initialization and enters normal operating mode. The system first synchronously reads the first phase angle signal of the first driven gear and the second phase angle signal of the second driven gear through the signal acquisition unit. Both phase angle signals can be acquired by a Hall effect sensor, whose output is a continuous analog angle signal, which is then converted into a digital phase angle value after analog-to-digital conversion. The first and second phase angles correspond to the instantaneous rotation angles of the first and second driven gears relative to their respective zero-point positions, respectively.

[0031] Furthermore, in order to suppress the inherent noise of the sensor, the high-frequency jitter caused by mechanical vibration, and the transient jump caused by gear meshing clearance, this embodiment needs to perform Kalman filtering on the read first phase angle signal and second phase angle signal respectively, so as to obtain the filtered first phase angle and second phase angle.

[0032] Subsequently, based on the filtered first and second phase angles, and the number of teeth of the first and second driven gears, the initial slope value characterizing the range of rotation angles of the main gear is calculated.

[0033] Among them, the initial slope value The calculation formula can be: In the formula, This is the first phase angle; This is the second phase angle; and These are the number of teeth of the first driven gear and the number of teeth of the second driven gear, respectively.

[0034] For example, the primary gear has 90 teeth, the first driven gear has 30 teeth, and the second driven gear has 26 teeth. Therefore, the initial slope value can be determined as follows: .

[0035] It is understandable that the initial slope value does not change monotonically with continuous steering wheel rotation, but rather exhibits an oscillating characteristic with the ratio of the number of teeth of the first driven gear to the number of teeth of the second driven gear as its inherent periodic constraint. Its value fluctuates back and forth within a limited range, with the center of fluctuation corresponding to the equivalent number of revolutions of the main gear. The fluctuation amplitude mainly comes from the quantization error of the phase measurement of the two driven gears, mechanical backlash, and the tooth profile deviation of the main gear. It is this non-monotonic jitter around the integer value that makes it very easy to cause jumps when performing conventional rounding operations on the initial slope value, which in turn leads to step spikes in the final steering angle output.

[0036] Step S200: Based on the initial slope value and historical steering angle state information, the target slope value is obtained by combining slope compensation and fault tolerance mechanism.

[0037] In some implementations, such as Figure 3 As shown, step S200 includes steps S210-S220: Step S210: During the sensor power-on initialization phase, the initial slope value is initialized with an offset calibration based on the fractional part of the initial slope value to obtain an intermediate slope value.

[0038] The initial offset calibration involves applying a preset offset to the initial slope value if the fractional part of the initial slope value is within a preset fluctuation range.

[0039] As an example, after the sensor is powered on, this step, following the execution timing shown in Figure 2, also requires executing step S5 to read the value of the FEE module flag bit temp_flag in the non-volatile memory. The initial value of temp_flag is 0.

[0040] Further, after calculating and obtaining the initial slope value, step S6 is executed to determine whether the decimal part of the initial slope value is within the preset fluctuation range, and to determine whether temp_flag is equal to 0.

[0041] The preset fluctuation range can be set based on the statistical results of a large number of faulty components (e.g., it can be...). When the decimal part of the initial slope value continuously falls within this range, if a rounding operation is directly performed on it, the resulting integer value will jump between adjacent integers. This jump result, as a rough slope without fault tolerance processing, if directly used for subsequent steering angle calculation, will cause a large step change in the absolute angle output of the steering wheel. This embodiment, through initial offset calibration, can prevent the decimal part of the offset initial slope value from falling into this fluctuation range, thereby fundamentally avoiding the occurrence of this change.

[0042] If the decimal part of the initial slope value is within the preset fluctuation range and temp_flag is 0, it indicates that the sensor has a risk of power-on jump. Then, step S7 is executed to apply a preset offset to the initial slope value to obtain an intermediate slope value.

[0043] The magnitude of this preset offset can be determined based on the probability distribution characteristics of the decimal part of the initial slope value within the critical jump region. Its function is to directionally shift the decimal part along the direction of numerical increase, so that the shifted value is always on the stable convergence side of the rounding decision boundary. This mathematically eliminates the unexpected flip of the target slope value caused by measurement jitter crossing the decision threshold, thereby fundamentally suppressing the generation of step spikes. For example, if the preset offset is 0.2, this offset operation can shift the decimal part of the initial slope value to the right by 0.2. For example, if it was originally 0.49, it becomes 0.69 after the offset, thus ensuring that it is permanently removed from the critical region near 0.5, thereby fundamentally eliminating jumps caused by rounding.

[0044] It should be noted that regardless of whether the dual judgment result is true or not, step S8 is executed to update the value of temp_flag to 1 and write the updated temp_flag value to the FEE area. This write operation remains valid throughout the sensor's lifecycle and can be reset to 0 via a diagnostic command. Therefore, the initial offset calibration is only performed once during the first power-on of the sensor's lifecycle; during all subsequent power-ons, the offset operation is skipped when temp_flag is 1, and reset and re-execute SAS calibration when a UDS diagnostic command is received.

[0045] Furthermore, during the initialization phase, assuming temp_flag equals zero, the decimal part of the initial slope value is continuously monitored over multiple consecutive calculation cycles after power-on. If the decimal part falls within a preset fluctuation range a preset number of times during these consecutive calculation cycles, the sensor is deemed to have a power-on jump risk, and initialization offset calibration is performed. This preset number of times can be 3. This method ensures that calibration decisions are based on stable state observations, avoiding false triggering caused by single-point noise.

[0046] Step S220: During the stable operation phase of the sensor, the intermediate slope value is processed for parity tolerance by combining historical steering angle state information to obtain the target slope value.

[0047] Exemplary parity-tolerance processing includes: dividing the range of intermediate slope values ​​into multiple decision intervals of equal width; wherein the width of the decision interval is greater than 1; when the historical steering angle state information indicates a first state, mapping intermediate slope values ​​falling into the same decision interval to the same integer with a first parity attribute to obtain a target slope value; when the historical steering angle state information indicates a second state, mapping intermediate slope values ​​falling into the same decision interval to the same integer with a second parity attribute to obtain a target slope value.

[0048] Specifically, in conjunction with Figure 2 ( Figure 2b The processing sequence is as follows: after obtaining the intermediate slope value, step S9 is executed to determine whether the loop flag Flag_Slope is less than or equal to 1.

[0049] It is understandable that the value of the cycle flag Flag_Slope can be used to determine whether the sensor is in a stable operating phase. Flag_Slope is set to 0 after the system is powered on and initialized, and the Flag_Slope++ operation is executed after each complete calculation cycle from step S200 to step S400; when the value of Flag_Slope is greater than 1, that is, when Flag_Slope... If the value is 2, it is determined that the sensor has entered a stable operating phase, allowing the parity-tolerance processing logic based on historical steering angle state information to be enabled. This embodiment ensures that when the data has not yet converged and the angle estimation fluctuates significantly in the early stages of sensor startup, the fault-tolerance mechanism is skipped, avoiding misjudgments caused by unstable historical angles.

[0050] After determining that the value of Flag_Slope is greater than 1, step S11 is executed to determine the status of the historical steering angle.

[0051] The historical steering angle state information is determined by the final steering angle (angle_sas) output from the previous stable cycle. When the angle_sas output from the previous cycle... When the value is 0, it indicates that the historical steering angle status information indicates the first state; when the angle_sas output in the previous cycle is 0, it indicates the first state. When the value is 0, it indicates that the historical steering angle status information is in the second state.

[0052] When angle_sas≥0, step S12 is executed to map the intermediate slope values ​​falling into the same decision interval to the same integer with the first parity attribute, so as to obtain the target slope value.

[0053] When angle_sas<0, step S13 is executed to map the intermediate slope values ​​falling into the same decision interval to the same integer with the second parity attribute in order to obtain the target slope value.

[0054] For example, before performing step S12 or step S13, it is necessary to first divide the range of intermediate slope values ​​into multiple decision intervals of equal width, which are typically 2. During continuous unidirectional rotation of the steering wheel, the slope value does not change monotonically. Instead, it is determined by the vernier transmission relationship between the primary gear and two driven gears with coprime tooth counts, exhibiting a periodic discrete distribution. The interval between adjacent discrete points in this distribution is determined by inverting the least common multiple of the tooth counts of the two driven gears. Traditional rounding methods use an interval of 1 width for judgment, and their quantification decisions are easily affected by gear manufacturing errors, assembly clearances, and signal noise, leading to unexpected jumps. This embodiment introduces historical steering angle state information, dividing the range of intermediate slope values ​​into two mutually exclusive target slope value sets based on integer parity: when the historical steering angle state information indicates the first state, it is mapped to the odd-numbered target slope value set; when it indicates the second state, it is mapped to the even-numbered target slope value set. The numerical interval between adjacent target slope values ​​within each set is 2, and the corresponding judgment interval width is also 2. Therefore, the intermediate slope value must cross this judgment interval width to trigger a target slope value update. This method can reduce the sensitivity of the quantization results to measurement jitter, thereby effectively suppressing glitches in the output angle signal.

[0055] In this embodiment, the first parity attribute and the second parity attribute are opposites of each other; that is, when the first state corresponds to an odd number, the second state must correspond to an even number, and vice versa. It can be understood that existing rounding methods rely solely on a single numerical threshold, and their output is independent of the system's historical states. However, this embodiment constructs a bimodal response mechanism by binding historical states with parity attributes: the same intermediate slope value can be assigned different parity target slope values ​​under different historical states, thus forming an alternating parity distribution overall. However, this alternation is not a preset pattern but rather a result dynamically triggered by the real-time state.

[0056] It should be noted that the starting point of the determination interval and the mapping offset between the target slope value and the determination interval are all calibrable parameters. Their values ​​are jointly determined based on the continuity constraint of the main gear rotation direction, the periodic characteristics of the vernier structure, and the physical consistency requirements of the angle output. In one embodiment, in step S12, when the historical steering angle state information indicates the first state, the system maps the intermediate slope value to the set of odd target slope values, and the mapping relationship satisfies: all intermediate slope values ​​in the same determination interval correspond to a unique odd target slope value, and the target slope values ​​corresponding to adjacent determination intervals differ by 2 (e.g., when the intermediate slope value falls within the interval [-12, -10), it is mapped to the target slope value -11); when the indication is the second state, the system maps the intermediate slope value to the set of even target slope values, and the mapping relationship is the same (e.g., when the intermediate slope value falls within the interval [-13, -11), it is mapped to the target slope value -12). This design ensures that the target slope value set maintains a monotonic trend throughout the continuous forward or reverse rotation of the steering wheel, and achieves seamless connection at the positive-negative switching boundary through odd-even attribute conversion, thereby avoiding angle jumps caused by non-monotonic jumps in the target slope value.

[0057] It is understood that, through the above-mentioned parity tolerance processing, the fluctuation of the intermediate slope value within any judgment interval, regardless of its direction or amplitude, will not cause the target slope value to change as long as it does not cross the interval boundary. Since the judgment interval width is 2, its fault tolerance capability is twice that of the traditional rounding method, so that the glitch phenomenon in the absolute angle output signal of the steering wheel completely disappears in actual measurement.

[0058] Furthermore, if step S9 determines that the loop flag Flag_Slope is less than or equal to 1, then steps S11, S12, and S13 are skipped, and the subsequent step S300 is executed directly. If step S9 determines that Flag_Slope is greater than 1, and the target slope value is determined through steps S11, S12, or S13, the system continues to execute step S300. This ensures that the sensor can continuously output angle estimates regardless of whether it is in the initial startup phase or the stable operation phase, guaranteeing the real-time performance and integrity of the signal chain.

[0059] Step S300: Calculate the first angle estimate and the second angle estimate based on the target slope value, the first phase angle, and the second phase angle, respectively.

[0060] In some implementations, such as Figure 4 As shown, step S300 specifically includes steps S310-S330: Step S310: Based on the target slope value, generate a first associated slope value and a second associated slope value.

[0061] This step corresponds to S10 in Figure 2, which involves applying a first bias and a second bias to the target slope value to obtain a first associated slope value and a second associated slope value; wherein, the difference between the first bias and the second bias is a constant; the constant is determined by the tooth ratio between the first driven gear and the second driven gear.

[0062] The difference between the first and second bias values ​​can be uniquely determined by the vernier transmission ratio relationship formed by the number of teeth on the two driven gears and the number of teeth on the main gear. It characterizes the difference in the evolution rate of the phase difference between the two driven gears caused by a unit main gear rotation angle. This difference can be calibrated to maintain a constant difference between the first and second associated slope values ​​across the entire range, thereby ensuring the consistency of the dual-channel angle estimation model in terms of geometry and numerical response. For example, when the main gear has 90 teeth, the first driven gear has 30 teeth, and the second driven gear has 26 teeth, this constant can be set to 15. In this hardware configuration, the difference in their transmission ratios is... ≈3.4615 - 3 - 0.4615; where, The number of teeth on the main gear; the reciprocal of this difference is approximately 2.166, representing the cumulative rate of phase difference between the two driven gears caused by a unit number of rotations of the main gear in the vernier caliper structure.

[0063] When the first and second associated slope values ​​are specifically generated: when the target slope value belongs to an odd subset triggered by the first state of the historical turning angle state information, the first associated slope value is configured as the value obtained by performing an upward even operation on the target slope value, and the second associated slope value is configured as the value obtained by performing a downward even operation on the target slope value; when the target slope value belongs to an even subset triggered by the second state of the historical turning angle state information, the first associated slope value is configured as the value obtained by performing a downward even operation on the target slope value, and the second associated slope value is configured as the value obtained by performing an upward even operation on the target slope value; wherein, "upward even operation" refers to rounding the input value to the nearest integer in the direction of numerical increase. The even number, "downward even operation" refers to rounding the input value to the nearest even number in the direction of numerical decrease; this rule strictly corresponds to the odd-even subset partitioning logic guided by the historical steering angle state information in step S220: when the target slope value falls into the odd chain, the first associated slope value and the second associated slope value form a pair of adjacent even numbers with a difference of 2, in order to match the tooth ratio relationship between the first driven gear and the second driven gear; when the target slope value falls into the even chain, the first associated slope value and the second associated slope value are equal to ensure that the dual-channel solution maintains geometric alignment near the zero point; the first associated slope value and the second associated slope value generated thereby form a complementary even pair in numerical terms, together covering the complete phase space of the main gear rotation.

[0064] Step S320: Calculate the first angle estimate using the first phase angle, the first associated slope value, the first proportional coefficient, and the first offset.

[0065] Step S330: Calculate the second angle estimate using the second phase angle, the second associated slope value, the second proportional coefficient, and the second offset.

[0066] Exemplary, steps S320 and S330 correspond to S14 and S15 in Figure 2, where the first angle estimate is... Compared with the second angle estimate The calculation formulas can be expressed as follows: ; In the formula, and These are the first and second proportionality coefficients, respectively. and These are the first offset and the second offset, respectively. and These are the first and second correlation slope values, respectively.

[0067] The first and second proportional coefficients are calibrated based on the transmission ratios of the first and second driven gears relative to the main gear, respectively. Their function is to map the phase angle signal collected by the Hall sensor to a unified quantization unit of the absolute angle of the main gear according to the physical scaling relationship of their respective transmission paths. The first and second offsets are equal and are calibrated to make the numerical ranges of the first and second angle estimates symmetrical about the zero point. Together, they ensure that the dual-channel solution results are consistent in terms of dimensions, zero-point reference, and dynamic range, thereby providing the Kalman filter with physically comparable observations.

[0068] Through steps S310 to S330, two independent, physically separated, mathematically determined angle estimates—a first angle estimate and a second angle estimate—can be generated. Both originate from the same target slope value, but are calculated via paths with different gear ratios, biases, and proportional coefficients. Consequently, they exhibit differentiated sensitivities to sensor errors, local gear deformation, and signal chain drift in their respective channels, thus providing a basis for subsequent cross-validation and fault isolation.

[0069] After determining the first angle estimate and the second angle estimate, referring to Figure 2, the method further includes step S16, which determines whether the absolute value of the difference between the first angle estimate and the second angle estimate is within a preset difference threshold.

[0070] The preset difference threshold can be set comprehensively based on the actual accuracy requirements of the steering angle sensor, gear manufacturing tolerances, and signal noise levels. For example, in a hardware configuration with 90 teeth on the main gear, 30 teeth on the first driven gear, and 26 teeth on the second driven gear, it can be set to 5 degrees. The preset difference threshold setting only needs to ensure a high detection rate of real faults and avoid false alarms caused by normal vibrations.

[0071] If the difference is within the preset range, the dual-channel output is determined to be within the reliable range, satisfying the fusion prerequisite, and step S17 (corresponding to step S400) is executed; if the absolute value of the difference is greater than the preset difference threshold, a channel-level anomaly is determined to exist, and step S18 is executed, triggering an angle anomaly fault alarm.

[0072] Step S400: The first angle estimate and the second angle estimate are fused to obtain the steering angle of the main gear.

[0073] Specifically, this fusion process is achieved through a Kalman filter. This Kalman filter is based on the physical motion characteristics of the main gear, incorporating both the absolute angle and angular velocity of the main gear into the state estimation framework, thereby maintaining high accuracy and low latency output characteristics even when the steering wheel is turned rapidly.

[0074] Its state vector is defined as ,in, This represents the absolute angle of the main gear at the k-th sampling time; This represents the angular velocity of the main gear at that moment. This embodiment introduces angular velocity as a state variable, allowing the uniform motion model to describe the evolution of the angle over time, thus enabling the filter to have forward prediction capabilities.

[0075] The state transition equation adopts a linear uniform model, which can be... ,in This is the state transition matrix; w is the system sampling period; k The noise is a zero-mean Gaussian process noise, reflecting the quantitative characterization of the uncertainty of the model regarding the change in angular velocity. Its covariance matrix is ​​denoted as Q, which is used to represent the quantitative modeling of the uncertainty of the change in angular velocity.

[0076] The construction of Q is based on vehicle dynamics boundary condition calibration. Under emergency maneuvering conditions, the upper limit of the main gear angular acceleration amplitude is... Therefore, the maximum possible change in angular velocity within one sampling period can be obtained as follows: Furthermore, in this embodiment, the maximum change can be considered as a preset multiple of the standard deviation of the angular velocity process noise, thereby obtaining the standard deviation of the angular velocity process noise. Its expression is Further By performing a squaring operation, we obtain the variance q of the noise in the angular velocity process, i.e., q = Since the model assumes that the angle θ itself is not affected by the process, only There is uncertainty, therefore Q is a diagonal matrix Q= This matrix can be pre-calculated based on vehicle model parameters and embedded in the software during the system design phase. In practical applications, the value of q can be fine-tuned to adapt to the noise characteristics of different vehicle models or sensor batches, thereby optimizing the filter performance.

[0077] In this embodiment, the observation vector can be defined as... That is, the first and second angle estimates acquired synchronously at the k-th sampling time. The observation equation is z k =H·x k +v k Where H is the observation matrix, and its values ​​can be: This indicates that both observations directly reflect the absolute angle of the main gear. , and angular velocity Irrelevant; v k Let R be the zero-mean Gaussian observation noise, and let its covariance matrix be denoted as R.

[0078] R is obtained by calibration based on measured noise levels. Under stationary or low-speed steady-state conditions, the system continuously collects sets of first and second angle estimates for 20 sampling periods, and calculates their unbiased sample variances respectively. and Forming a diagonal matrix R= Since the two signal acquisition paths are independent of each other and their observation noise is uncorrelated, the off-diagonal elements of R are always zero. This matrix is ​​calculated during factory calibration or first power-on and stored in non-volatile memory, also known as preset parameters.

[0079] The Kalman filter initialization is performed during the zeroth sampling period, i.e., the initial estimation of the absolute angle of the main gear. Take the arithmetic mean of the first angle estimate and the second angle estimate; the initial angular velocity estimate can be set to 0; the initial covariance matrix is ​​set to... The value of 100 indicates that the error range for both the initial angle and the initial angular velocity is allowed to be no more than ±10 degrees per second. This setting takes into account both data volatility and engineering robustness during the initial startup phase.

[0080] Within each subsequent sampling period k, the filter performs a standard Kalman recursion. First, a prediction step is executed, utilizing the optimal state estimate from the previous period. Calculate the current state prediction value using the state transition matrix F ,Right now Simultaneously, the predicted covariance from the previous period is utilized. Calculate the current prediction covariance using F and the process noise covariance matrix Q. ,Right now Then, an update step is performed, utilizing the current observations. Predicted state And the observation matrix H calculates the new information. ,Right now Using predicted covariance Calculate the innovation covariance using H and the observation noise covariance matrix R. ,Right now ; and utilize H and Calculate Kalman gain ,Right now Then utilize , and Calculate the updated state estimate ,Right now Finally utilize H and Calculate the updated covariance ,Right now .

[0081] Finally, take the state estimate. The first component This serves as the steering angle of the fused main gear. This value integrates independent observation information from both channels, which, while suppressing noise in each channel, improves the accuracy and stability of angle estimation and provides a high-confidence input basis for subsequent dynamic delay compensation.

[0082] It is understandable that after outputting the fused main gear steering angle in step S400, step S19 needs to be executed to increment the value of the loop flag Flag_Slope by 1. Flag_Slope is an integer variable stored in the controller's random access memory, and its value is incremented by 1 at the end of each complete calculation cycle. This operation indicates that all processing steps from S200 to S400 in this cycle have been completed, and the system is about to enter the calculation of S100 in the next cycle.

[0083] In some implementations, the process of outputting the steering angle of the main gear also includes a dynamic delay compensation process, which specifically involves: acquiring the steering angular velocity of the main gear in real time; activating the dynamic delay compensation mechanism when the steering angular velocity exceeds a preset dynamic response threshold; constructing a time series model of the angle-time relationship based on the steering angle fused within multiple consecutive sampling periods; and then, based on the delay characteristics, predicting the angle value at the corresponding delay time point along the time series model, and using the predicted angle value as the compensated steering angle at the current moment.

[0084] This step is primarily to offset the impact of inherent signal chain delays on control performance during high-speed steering. These delays mainly originate from the response time of the Hall sensor signal conditioning circuit, the computation cycle required for algorithm processing, and the transmission delay of the controller communication link. When the steering wheel is turned rapidly, if the fused steering angle calculated at the current moment is directly output, this value actually reflects the true angle before the time delay. This could lead to a lag in the angle signal received by the ESP or ADAS controller, affecting the control accuracy in high-dynamic scenarios such as emergency avoidance.

[0085] The activation of the dynamic delay compensation mechanism is triggered by the steering angular velocity. Specifically, the system calculates the steering angular velocity of the main gear in real time. The calculation method involves performing a sliding window difference on the fused steering angle set, that is, taking the fused angle values ​​of the most recent N sampling periods. In this embodiment, the least squares method is used to fit its relationship with time, and the resulting slope is the current angular velocity estimate. When the preset dynamic response threshold is exceeded, it is determined that the system has entered a high-speed dynamic operating condition and the dynamic delay compensation mechanism is activated.

[0086] After activation, the fused turning angle values ​​corresponding to the current and the previous N consecutive sampling periods (N+1 times in total) are taken, and these angle values ​​and their respective times are used as input. The least squares method is used for linear fitting to obtain a straight line that best reflects the trend of angle change over time.

[0087] Based on the total signal delay time determined by the system's actual measurement, and combined with the straight line, the angle value corresponding to the total delay time after the current moment is calculated. The calculated angle value is then used as the output of the main gear's steering angle after compensation at the current moment, thereby replacing the uncompensated fusion angle.

[0088] This compensation mechanism is only activated when the dual-channel consistency is met. That is, the execution of dynamic delay compensation is contingent on the judgment result of step S16: the compensation module is only allowed to be invoked when the absolute value of the difference between the first angle estimate and the second angle estimate is less than a preset difference threshold, and the Kalman filter has output a stable and smooth fused angle. This ensures that the compensation target is a high-confidence signal, avoiding erroneous prediction and amplification of the original jitter or fault signal.

[0089] This embodiment effectively overcomes signal distortion caused by mechanical deformation of the main gear, uneven tooth pitch, and meshing backlash by constructing an adaptive slope calculation and fusion architecture for Hall effect steering angle sensors at the software level. This method no longer relies on hardware precision improvements or additional physical redundancy. Instead, it uses the initial slope value as input and combines historical steering angle state information to implement slope compensation and fault tolerance, fundamentally suppressing slope jumps caused by gear errors. Based on this, it uses the target slope value to calculate two independent angle estimates separately, and outputs the final steering angle through fusion processing. This preserves the complementarity of the dual-channel observations while achieving coordinated suppression of noise and bias in each channel. Practical applications show that this method can improve the smoothness and stability of the steering angle signal, eliminate step spikes in the output, and enhance the angle consistency and reliability of the system under static, low-speed, and transient conditions.

[0090] Figure 5 A schematic diagram of a steering angle calculation device according to an embodiment of this application is shown. Exemplarily, this steering angle calculation device is applied to a Hall-effect steering angle sensor, which includes a main gear and two driven gears (first and second driven gears) with coprime tooth numbers, comprising: The initial slope value acquisition module 100 is used to calculate and obtain the initial slope value characterizing the range of rotation angles of the main gear based on the first phase angle of the first driven gear, the second phase angle of the second driven gear, and the number of teeth of the first driven gear and the second driven gear.

[0091] The target slope value acquisition module 200 is used to obtain the target slope value based on the initial slope value and historical steering angle state information, combined with slope compensation and fault tolerance mechanism.

[0092] The angle estimation module 300 is used to calculate and obtain the first angle estimate and the second angle estimate based on the target slope value, the first phase angle and the second phase angle, respectively.

[0093] The steering angle acquisition module 400 is used to fuse the first angle estimate and the second angle estimate to obtain the steering angle of the main gear.

[0094] It is understood that the device in this embodiment corresponds to the steering angle calculation method in the above embodiment, and the options in the above embodiment are also applicable to this embodiment, so they will not be described again here.

[0095] This application also provides a terminal device, exemplary of which includes a processor and a memory, wherein the memory stores a computer program, and the processor executes the computer program to enable the terminal device to perform the functions of the above-described steering angle calculation method or the various modules in the above-described steering angle calculation device.

[0096] The processor can be an integrated circuit chip with signal processing capabilities. The processor can be a general-purpose processor, including at least one of a Central Processing Unit (CPU), Graphics Processing Unit (GPU), Network Processor (NP), Digital Signal Processor (DSP), Application-Specific Integrated Circuit (ASIC), Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. The general-purpose processor can be a microprocessor or any conventional processor, capable of implementing or executing the methods, steps, and logic block diagrams disclosed in the embodiments of this application.

[0097] The memory can be, but is not limited to, Random Access Memory (RAM), Read Only Memory (ROM), Programmable Read-Only Memory (PROM), Erasable Programmable Read-Only Memory (EPROM), Electrically Erasable Programmable Read-Only Memory (EEPROM), etc. The memory is used to store computer programs, and the processor can execute the computer programs accordingly after receiving execution instructions.

[0098] This application also provides a computer-readable storage medium for storing the computer program used in the aforementioned terminal device. For example, the computer-readable storage medium may include, but is not limited to, various media capable of storing program code, such as a USB flash drive, a portable hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.

[0099] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can also be implemented in other ways. The apparatus embodiments described above are merely illustrative. For example, the flowcharts and block diagrams in the accompanying drawings show the architecture, functionality, and operation of possible implementations of apparatus, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that, in alternative implementations, the functions marked in the blocks may occur in a different order than those marked in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagram and / or flowchart, and combinations of blocks in the block diagram and / or flowchart, can be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.

[0100] In addition, the functional modules or units in the various embodiments of this application can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part.

[0101] If the aforementioned functions are implemented as software functional modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a smartphone, personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application.

[0102] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application.

Claims

1. A method for calculating steering angle, characterized in that, The method, applied to a Hall-effect angle sensor, includes a main gear and two coprime-numbered driven gears, a first driven gear and a second driven gear, and comprises: Based on the first phase angle of the first driven gear, the second phase angle of the second driven gear, and the number of teeth of the first driven gear and the second driven gear, the initial slope value characterizing the range of rotation angles of the main gear is calculated. Based on the initial slope value and historical steering angle state information, the target slope value is obtained by combining slope compensation and fault tolerance mechanisms. Based on the target slope value, the first phase angle, and the second phase angle, the first angle estimate and the second angle estimate are calculated respectively. The first angle estimate and the second angle estimate are fused together to obtain the steering angle of the main gear.

2. The steering angle calculation method according to claim 1, characterized in that, The process of obtaining the target slope value based on the initial slope value and historical steering angle state information, combined with slope compensation and fault tolerance mechanisms, includes: During the sensor power-on initialization phase, the initial slope value is initialized with an offset calibration based on the decimal part of the initial slope value to obtain an intermediate slope value; wherein, the initial offset calibration is to apply a preset offset to the initial slope value when the decimal part of the initial slope value is within a preset fluctuation range; During the stable operation phase of the sensor, the intermediate slope value is processed to handle parity errors by combining the historical steering angle state information, so as to obtain the target slope value.

3. The steering angle calculation method according to claim 2, characterized in that, The parity tolerance processing includes: The range of the intermediate slope value is divided into multiple judgment intervals of equal width; wherein the width of the judgment interval is 2. When the historical turning angle state information indicates the first state, the intermediate slope values ​​falling into the same determination interval are mapped to the same integer with the first parity attribute to obtain the target slope value. When the historical turning angle state information indicates the second state, the intermediate slope values ​​falling into the same determination interval are mapped to the same integer with the second parity attribute to obtain the target slope value. The first parity attribute is the opposite of the second parity attribute.

4. The steering angle calculation method according to claim 1, characterized in that, The step of calculating the first angle estimate and the second angle estimate based on the target slope value, the first phase angle, and the second phase angle includes: Based on the target slope value, a first associated slope value and a second associated slope value are generated; The first angle estimate is calculated using the first phase angle, the first associated slope value, the first proportional coefficient, and the first offset. The second angle estimate is calculated using the second phase angle, the second associated slope value, the second proportional coefficient, and the second offset.

5. The steering angle calculation method according to claim 4, characterized in that, The step of generating a first associated slope value and a second associated slope value based on the target slope value includes: A first bias and a second bias are applied to the target slope value to obtain the first associated slope value and the second associated slope value. The difference between the first bias and the second bias is a constant; the constant is determined by the ratio of the number of teeth of the first driven gear to the number of teeth of the second driven gear.

6. The steering angle calculation method according to claim 1, characterized in that, The process of outputting the steering angle of the main gear also includes: The steering angular velocity of the main gear is acquired in real time; When the steering angular velocity exceeds a preset dynamic response threshold, the dynamic delay compensation mechanism is activated; Based on the fused turning angles from multiple consecutive sampling periods, a time series model of the angle-time relationship is constructed. Based on the delay characteristics, the angle value at the corresponding delay time point is predicted forward along the time series model, and the predicted angle value is used as the compensated turning angle at the current time.

7. The method for calculating the steering angle according to claim 1, characterized in that, The process of fusing the first angle estimate and the second angle estimate to obtain the steering angle of the main gear includes: The first angle estimate and the second angle estimate are used as observations and input into a Kalman filter. The state vector of the Kalman filter includes the absolute angle and angular velocity of the main gear. The Kalman filter outputs the fused steering angle of the main gear based on a preset process noise covariance matrix and observation noise covariance matrix.

8. A steering angle calculation device, characterized in that, An application is made to a Hall-effect angle sensor, the angle sensor comprising a main gear and two coprime-numbered first and second driven gears, the device comprising: The initial slope value acquisition module is used to calculate and obtain the initial slope value characterizing the range of rotation angles of the main gear based on the first phase angle of the first driven gear, the second phase angle of the second driven gear, and the number of teeth of the first driven gear and the second driven gear. The target slope value acquisition module is used to obtain the target slope value based on the initial slope value and historical steering angle state information, combined with slope compensation and fault tolerance mechanisms. An angle estimation module is used to calculate and obtain a first angle estimation value and a second angle estimation value based on the target slope value, the first phase angle and the second phase angle, respectively. The steering angle acquisition module is used to fuse the first angle estimate and the second angle estimate to obtain the steering angle of the main gear.

9. A vehicle, characterized in that, The vehicle includes a processor and a memory, the memory storing a computer program, and the processor executing the computer program to implement the steering angle calculation method according to any one of claims 1-7.

10. A computer-readable storage medium, characterized in that, It stores a computer program, which, when executed on a processor, implements the steering angle calculation method according to any one of claims 1-7.