A two-way positive and negative judgment method based on phase difference pulse signal

CN122945501APending Publication Date: 2026-10-20GUANGDONG TOPRO TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611235115.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-14
Publication Date
2026-10-20

AI Technical Summary

Technical Problem

[0003]为了弥补以上不足,本发明提供了一种基于相位差脉冲信号的双路正反判向方法,旨在改善现有技术中因缺乏对非理想信号的自适应处理与闭环校验机制,导致复杂工况下判向可靠性与适应性不足的技术问题

Benefits of technology

[0041]1、本发明中,通过提取两路脉冲信号的相位偏差量并结合多维度工况参数评估信号质量等级,实现了对非理想信号畸变程度的量化感知,克服了现有技术因过度依赖理想正交假设导致误判率高的缺陷。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure FT_1
    Figure FT_1
  • Figure FT_2
    Figure FT_2
  • Figure FT_3
    Figure FT_3
Patent Text Reader

Abstract

This invention relates to the field of industrial signal processing technology, and particularly to a dual-channel forward and reverse direction determination method based on phase difference pulse signals. The method includes: acquiring the timing characteristic parameters of two pulse signals after preprocessing; determining the phase deviation between the two signals based on the timing parameters, evaluating the current signal's operating characteristics, and generating an operating condition evaluation result; constructing a prediction model based on historical phase deviation trends, and incrementally updating the model by collecting actual phase deviations, calculating the direction determination parameter compensation based on the updated model; constructing a strategy adaptation space, selecting the optimal direction determination strategy through multi-objective performance evaluation, and performing direction determination in conjunction with the updated direction determination parameters to generate a direction determination result; performing a confidence evaluation on the direction determination result, and correcting it based on the evaluation result and preset motion law constraints, outputting a direction signal and a confidence status flag. This invention can achieve highly reliable direction determination of dual signals under non-ideal signal conditions.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of industrial signal processing technology, and in particular to a dual-path forward / reverse direction determination method based on phase difference pulse signals. Background Technology

[0002] In industrial control and rotating machinery monitoring, sensors that output two-channel phase difference pulse signals are widely used to detect the rotational speed and direction of moving parts, such as incremental encoders and dual-channel speed sensors. These sensors have two built-in magnetic elements arranged at a preset angle on the outer circumference of the speed measuring gear, outputting two pulse signals with a 90° phase difference. Their direction determination principle is based on determining the leading or lagging relationship between the two signals. Existing technologies for direction determination using dual-channel phase difference pulse signals mainly include hardware phase detection circuits, software state machines, software interrupts, and error compensation schemes focusing on offline calibration or general compensation. However, all of these methods rely on the assumption of ideal orthogonality and lack online compensation and direction verification for signal distortion, making it difficult to meet the reliability requirements under complex operating conditions. Specifically, the problems are as follows: First, there is an over-reliance on the ideal orthogonality assumption. Under the influence of factors such as sensor installation errors, temperature drift, and cable transmission delays, the phase difference between the two signals is prone to deviate from 90°, causing the direction determination logic based on a fixed orthogonality relationship to fail. Second, error compensation schemes mostly focus on offline calibration, and the compensation results are not fed back to the direction determination decision in real time. There is a lack of closed-loop linkage between measurement, compensation, and direction determination, making it unable to cope with dynamic signal distortion. Third, the direction determination logic is fixed and singular, unable to adaptively switch according to changes in signal quality and rotation speed, making it difficult to balance accuracy and response speed under transient and high-noise conditions. Fourth, there is a lack of verification and correction mechanisms for the direction determination results. Single misjudgments caused by low-speed jitter and edge distortion are directly counted and form cumulative errors, making it difficult to ensure the long-term reliability of direction determination under complex operating conditions. Summary of the Invention

[0003] To overcome the above deficiencies, this invention provides a dual-path forward and reverse direction determination method based on phase difference pulse signals, aiming to improve the technical problem in the prior art where the lack of adaptive processing and closed-loop verification mechanism for non-ideal signals leads to insufficient reliability and adaptability of direction determination under complex working conditions.

[0004] To achieve the above objectives, the present invention provides the following technical solution:

[0005] In a first aspect, the present invention provides the following technical solution: a dual-path forward / reverse direction determination method based on phase difference pulse signals, comprising:

[0006] After preprocessing, the timing characteristic parameters of the two pulse signals generated by the magnetic sensing element sensing the moving part under test are obtained. The timing characteristic parameters include at least the time interval between adjacent edges and the signal period.

[0007] The phase deviation between the two signals is determined based on the timing characteristic parameters, and the operating characteristics of the current signal are evaluated to generate an operating condition evaluation result that includes the signal frequency and signal quality level.

[0008] A deviation evolution prediction model is constructed based on the historical phase deviation change trend, and the actual phase deviation is collected to incrementally update the deviation evolution prediction model online. The compensation amount of the orientation parameter is calculated based on the updated model to generate the updated orientation parameter.

[0009] A strategy adaptation space is constructed based on the working condition evaluation results, and the adaptation score of each candidate direction determination strategy is calculated through a preset multi-objective performance evaluation function. The corresponding direction determination strategy is selected based on the adaptation score, and the direction determination is performed in combination with the updated direction determination parameters to generate the direction determination result.

[0010] The direction determination result is evaluated for confidence level, and the result is corrected based on the evaluation result and the preset motion constraints based on the laws of physical motion. The direction signal and the corresponding confidence status flag are then output.

[0011] Furthermore, determining the phase deviation between the two signals based on the timing characteristic parameters specifically includes:

[0012] The time difference between the two signals is calculated by extracting the occurrence times of the corresponding edges of the two signals, and then converted into a phase angle with 360° as the reference, in combination with the current signal period, to obtain the actual phase difference value.

[0013] The actual phase difference is compared with the standard theoretical phase value, and the phase deviation is extracted.

[0014] Furthermore, the step of evaluating the operating characteristics of the current signal includes:

[0015] The system detects the amplitude consistency, duty cycle deviation, and edge jitter of the two signals, and combines this with the signal frequency fluctuation range and signal-to-noise ratio level to comprehensively determine the current operating condition category and corresponding signal quality level of the signal.

[0016] Furthermore, the deviation evolution prediction model is a prediction model constructed based on the Kalman filter algorithm, and its state variables include at least the phase deviation amount and the rate of change of the phase deviation.

[0017] Furthermore, the incremental online update specifically includes:

[0018] After each signal cycle ends, the model parameters are updated based on the actual phase deviation collected in the current cycle, and the model parameters of the deviation evolution prediction model are recursively corrected.

[0019] Furthermore, the compensation amount for calculating the orientation parameters based on the updated model specifically includes:

[0020] The orientation parameters include at least one of the following: orientation threshold, sampling time offset, and filter time constant;

[0021] The deviation evolution prediction model is used to lock the expected occurrence window of the signal edge in the next cycle, and dynamic masking intervals are set on both sides of the expected occurrence window according to the signal quality level.

[0022] By adjusting the sampling time offset, the sampling points can avoid the oscillation interference zone within the dynamic masking interval.

[0023] Furthermore, the calculation of the fitness score of each candidate orientation strategy using a preset multi-objective performance evaluation function specifically includes:

[0024] In the multi-objective performance evaluation function, the weight coefficients of orientation accuracy, response speed, and resource consumption are dynamically distributed according to the working condition evaluation results.

[0025] In transient conditions where the signal frequency fluctuation rate exceeds a preset threshold, the weighting coefficient for response speed is increased.

[0026] In high-noise conditions where the detected signal quality level is below a preset threshold, the weighting coefficient of the direction determination accuracy is increased and a nonlinear penalty term is introduced to limit the jump rate of the direction determination result.

[0027] Furthermore, the step of correcting the orientation determination result based on the evaluation results and preset motion constraints based on the laws of physical motion includes:

[0028] Construct a physical motion constraint model for the target under test, wherein the physical motion constraint model includes a preset maximum angular acceleration threshold;

[0029] The instantaneous angular acceleration is calculated based on the directional change corresponding to the current orientation result, and the instantaneous angular acceleration is compared with the maximum angular acceleration threshold.

[0030] When the instantaneous angular acceleration exceeds the maximum angular acceleration threshold and the confidence level is lower than the preset threshold, the current orientation result is determined to be an abnormal change result and is removed, while maintaining the orientation state of the previous cycle. Otherwise, the current orientation result is backtracked and corrected.

[0031] Furthermore, the state backtracking correction specifically includes:

[0032] Obtain a valid state transition sequence of two signal level combinations. When the detected state transition deviates from the valid state transition sequence, it is determined to be an abnormal state transition.

[0033] Predict missing intermediate states based on the valid state transition sequence and fill in the corresponding counts.

[0034] Secondly, the present invention provides the following technical solution: a dual-path forward / reverse direction determination system based on a phase difference pulse signal, used to implement the above-mentioned dual-path forward / reverse direction determination method, the system comprising:

[0035] The signal acquisition module is used to acquire, after preprocessing, the timing characteristic parameters of two pulse signals generated by the magnetic sensing element sensing the moving part under test. The timing characteristic parameters include at least the time interval between adjacent edges and the signal period.

[0036] The signal analysis module is used to determine the phase deviation between the two signals based on the timing characteristic parameters, evaluate the operating characteristics of the current signal, and generate an operating condition evaluation result that includes the signal frequency and signal quality level.

[0037] The adaptive prediction compensation module is used to construct a deviation evolution prediction model based on the historical phase deviation change trend, collect the actual phase deviation to incrementally update the deviation evolution prediction model online, calculate the compensation amount of the direction judgment parameter based on the updated model, generate the updated direction judgment parameter, and feed the prediction deviation value back to the signal analysis module to form a closed-loop correction mechanism based on deviation feedback.

[0038] The multi-objective strategy decision module is used to construct a strategy adaptation space based on the working condition evaluation results, calculate the adaptation score of each candidate direction decision strategy through a preset multi-objective performance evaluation function, select the corresponding direction decision strategy based on the adaptation score, and perform direction determination in combination with the updated direction decision parameters to generate the direction decision result.

[0039] The confidence assessment and correction module is used to perform confidence assessment on the orientation result, and correct the orientation result according to the assessment result and the preset motion constraints based on the laws of physical motion, and output the direction signal and the corresponding confidence status flag.

[0040] The present invention has the following beneficial effects:

[0041] 1. In this invention, by extracting the phase deviation of two pulse signals and combining it with multi-dimensional operating parameters to evaluate the signal quality level, the quantitative perception of the degree of distortion of non-ideal signals is realized, overcoming the defect of high misjudgment rate caused by excessive reliance on the ideal orthogonal assumption in the existing technology.

[0042] 2. In this invention, by constructing a deviation evolution prediction model and introducing an incremental online update mechanism, the system can detect signal drift in advance based on historical trends and recursively correct the model based on the measured deviation. At the same time, the updated model is used to lock the edge expectation window and set a dynamic masking interval to avoid the oscillation interference area, which solves the technical problem that the existing error compensation scheme lacks real-time closed-loop linkage and cannot cope with dynamic signal distortion.

[0043] 3. In this invention, the working condition adaptive switching of the orientation strategy is realized through multi-objective performance evaluation. By combining confidence evaluation and physical motion constraints for dual verification, and by combining active prediction of legal state transition sequences and missing complement mechanism, the problem of error accumulation caused by the single orientation strategy and lack of verification and correction in the prior art is solved, thereby improving the long-term operational stability and fault tolerance under complex working conditions. Attached Figure Description

[0044] Figure 1 The flowchart is a method for determining the direction of a dual-path orientation based on a phase difference pulse signal proposed in this invention.

[0045] Figure 2 This is a flowchart of the construction and orientation parameter compensation of the deviation evolution prediction model proposed in this invention;

[0046] Figure 3 This is a flowchart of the multi-objective strategy decision-making and direction determination proposed in this invention;

[0047] Figure 4 This is a flowchart of the physical constraint verification and confidence correction process proposed in this invention;

[0048] Figure 5 This is a diagram of a dual-path forward / reverse direction determination system based on phase difference pulse signals proposed in this invention. Detailed Implementation

[0049] The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0050] Example 1

[0051] In a first embodiment of the present invention, the present invention provides a dual-path forward / reverse direction determination method based on phase difference pulse signals, such as... Figure 1 As shown, it includes the following steps:

[0052] S100: After preprocessing, the timing characteristic parameters of the two pulse signals generated by the magnetic sensing element sensing the moving part under test are obtained. The timing characteristic parameters include at least the time interval between adjacent edges and the signal period.

[0053] Specifically, in this embodiment, the magnetic sensing element employs two Hall sensors, which are mounted on the outer periphery of the speed-measuring gear at a preset mechanical angle. When the measured moving part, i.e., the speed-measuring gear, rotates with the shaft, the tooth tips and tooth grooves alternately pass through the sensing area of ​​the magnetic sensing element, causing a change in magnetic flux. The magnetic sensing element then outputs two quasi-sine wave signals with a certain phase difference. The two Hall sensors are spatially positioned at a preset electrical angle (e.g., ...). The electrical angles are staggered so that when the speed measuring gear rotates at a constant speed, the theoretical phase difference between the two output signals is [value missing]. Those skilled in the art will understand that the magnetic sensing element is not limited to Hall sensors; anisotropic magnetoresistive sensors or giant magnetoresistive sensors can also be used, as long as they can sense the moving part being measured and generate two pulse signals with a phase difference.

[0054] The raw analog signal output from the magnetic sensor first passes through a hardware preprocessing circuit. This circuit includes a low-pass filter and a Schmitt trigger. The low-pass filter is used to filter out high-frequency electromagnetic interference, and its cutoff frequency is... The speed is determined based on the maximum rotational speed and the number of teeth of the moving part being measured. In this embodiment, when the speed measuring gear has 60 teeth, the maximum rotational speed is 6000 RPM. The signal frequency is 6kHz, and the cutoff frequency of the low-pass filter is... Set it to between 50kHz and 200kHz, for example, 100kHz, to retain effective fundamental and low-order harmonic components while filtering out high-frequency noise.

[0055] The filtered signal enters a Schmitt trigger for shaping, converting the quasi-sine wave into a square wave pulse signal with steep edges. The hysteresis voltage of the Schmitt trigger is set between 0.2V and 0.5V to suppress false triggering caused by small noise fluctuations near the zero-crossing point of the signal.

[0056] The two shaped pulse signals, denoted as signal A and signal B, are input to the microprocessor's capture unit. The high-speed timer clock frequency inside the microprocessor is set to 100MHz, corresponding to a time measurement resolution of 10ns, which meets the requirements for nanosecond-level time measurement accuracy.

[0057] The capture unit records the timer count value at each edge transition moment of signal A and signal B in real time. Let the first edge transition of signal A be... The rising edge time is Signal B is adjacent to the first The rising edge time is The time interval between adjacent edges of the two signals is... The calculation formula is ,in This represents the absolute shift of the two signals in the time domain.

[0058] signal period It is obtained by measuring the time difference between two consecutive edges with the same properties in the same channel. Taking signal A as an example, its period... The calculation formula is:

[0059] ;

[0060] in, The period is the time taken for the tachometer to rotate one tooth pitch. It is inversely proportional to the instantaneous rotational speed of the moving part being measured; and The difference between the occurrence times of two consecutive rising edges of signal A is a complete signal cycle.

[0061] In this embodiment, the magnetic sensing element operates at 5V. After being shaped by a Schmitt trigger, the output pulse signal has a high level of 3.8V to 5V and a low level of 0V to 0.8V. The microprocessor's internal high-speed timer clock frequency is set to 100MHz, corresponding to a time measurement resolution of 10ns. The speed measuring gear has 60 teeth and a rotational speed range of 100... Up to 6000 In typical application scenarios, the signal period varies within a range of 166.67. Up to 1.67ms. When the spatial distribution of the two magnetic sensing elements corresponds At electrical angle, the theoretical time interval between adjacent edges of the two signals is _____. In the preprocessing circuit, the cutoff frequency of the low-pass filter is set to 100kHz, the hysteresis voltage of the Schmitt trigger is set to 0.2V to 0.5V, and the filter capacitor is a surface-mount capacitor ranging from 1nF to 10nF, with the specific value determined based on the actual noise level and cutoff frequency. The above data can be adaptively adjusted according to the number of teeth on the tachometer gear, the speed range, and the electromagnetic environment.

[0062] By using a magnetic sensing element in conjunction with a speed measuring gear to generate dual-channel phase difference pulse signals, and combining hardware preprocessing and high-precision timing parameter extraction, the physical magnetic field changes can be transformed into precise timing characteristic parameters.

[0063] S200: Determine the phase deviation between the two signals based on the timing characteristic parameters, evaluate the operating characteristics of the current signal, and generate an operating condition evaluation result that includes the signal frequency and signal quality level.

[0064] Furthermore, determining the phase deviation between the two signals based on the timing characteristic parameters specifically includes:

[0065] The time difference between the two signals is calculated by extracting the occurrence times of the corresponding edges of the two signals, and then converted into a phase angle with 360° as the reference, in combination with the current signal period, to obtain the actual phase difference value.

[0066] The actual phase difference is compared with the standard theoretical phase value, and the phase deviation is extracted.

[0067] Specifically, the microprocessor calculates the time difference using the corresponding edge times of the two captured signals. Taking the rising edges of signals A and B as an example, the actual time difference is calculated. Subsequently, combined with the current signal period Calculate the actual phase difference value The formula is:

[0068] ;

[0069] in, The phase difference angle of the electrical signals generated by the two magnetic sensing elements at the current rotation speed; The time interval between the corresponding edges of the two pulse signals; This represents the complete period of the current signal.

[0070] The physical meaning of this formula is: by converting the time offset in the time domain into the phase difference in the angular domain based on 360° by the proportion of the edge timing difference to the complete signal period, the true phase angle of the two signals under actual working conditions can be obtained.

[0071] After obtaining the actual phase difference value, compare it with the standard theoretical phase value. A comparison is performed. The standard theoretical phase value is determined by the physical mounting position of the magnetic sensing element inside the sensor, and in this embodiment, it is set to 90° electrical angle. Phase deviation amount. The calculation formula is:

[0072] ;

[0073] This deviation reflects the degree of signal offset caused by installation mechanical errors, magnetic field non-uniformity, or environmental electromagnetic interference.

[0074] Its physical meaning lies in: using the standard theoretical phase value as a reference, quantifying the direction and magnitude of the deviation of the actual phase difference from the ideal orthogonal state. In this embodiment, The normal fluctuation range is within to between.

[0075] Furthermore, the step of evaluating the operating characteristics of the current signal includes:

[0076] The system detects the amplitude consistency, duty cycle deviation, and edge jitter of the two signals, and combines this with the signal frequency fluctuation range and signal-to-noise ratio level to comprehensively determine the current operating condition category and corresponding signal quality level of the signal.

[0077] Specifically, the current signal condition is comprehensively evaluated through multi-dimensional parameter detection. The microprocessor samples the high-level amplitude of the two pulse signals using its built-in analog-to-digital converter. Calculate the amplitude difference between the two signals. In this embodiment, if If the voltage exceeds 0.5V, it is determined that the sensing intensity of the magnetic sensing element is inconsistent.

[0078] At the same time, by measuring the duration of the high level of the signal Calculate the duty cycle The standard duty cycle is theoretically 50%. In this embodiment, if the duty cycle deviates from the range by more than ±10%, that is... or If so, it is considered an abnormal duty cycle.

[0079] For continuous The time interval of each cycle Variance calculation is performed, where Values ​​typically range from 8 to 16 to assess the degree of edge jitter. :

[0080] ;

[0081] in, For the first The time interval measurement of each cycle; for The average value of each periodic time interval. The physical meaning of this is to measure the instantaneous phase jump caused by noise interference at the signal edge.

[0082] The frequency fluctuation range is calculated by measuring the rate of change between adjacent periods. Obtain, among which For signal frequency .

[0083] Signal quality levels are divided into four levels, with level one being the standard for level one. Duty cycle deviation And signal frequency fluctuation The corresponding sensor is in a stable operating condition; the secondary standard is... Duty cycle deviation And the degree of edge jitter The level is larger than Level 1 but not more than twice its original size, corresponding to slight interference from external magnetic fields on the sensor; Level 3 standard is... Poor amplitude consistency and frequency fluctuation between 5% and 10% correspond to starting, braking, or high-vibration operating conditions; Level IV standard is... The signal may be missing, or the corresponding sensor may have experienced a severe physical shift or be subjected to extremely strong electromagnetic pulse interference.

[0084] A comprehensive operating condition assessment is performed every four signal cycles to ensure the real-time performance and smoothness of the assessment results. In this embodiment, the standard theoretical phase value... for The phase deviation warning threshold can be set to 18°, and the transient condition judgment threshold can be set to a frequency change rate exceeding 15%.

[0085] By converting the edge time interval and signal period of time-domain measurement into the phase difference value in the angle domain and comparing it with the standard theoretical phase value to extract the deviation, a quantitative assessment of the degree of signal distortion is achieved. At the same time, by combining multi-dimensional parameters such as amplitude consistency, duty cycle deviation, edge jitter degree and frequency fluctuation range, operating condition characteristics are detected, and an evaluation result including signal frequency and quality level is generated.

[0086] S300: Construct a deviation evolution prediction model based on the historical phase deviation change trend, and collect actual phase deviations to incrementally update the deviation evolution prediction model online. Calculate the compensation amount of the orientation parameters based on the updated model to generate updated orientation parameters.

[0087] Furthermore, such as Figure 2 As shown, the deviation evolution prediction model is a prediction model constructed based on the Kalman filter algorithm, and its state variables include at least the phase deviation amount and the rate of change of the phase deviation.

[0088] Specifically, an adaptive prediction mechanism is established using historical data to compensate for the dynamic errors of the magnetically sensitive element under complex operating conditions. This embodiment preferably employs a linear Kalman filter algorithm to construct the deviation evolution prediction model. The system state variables of the model are defined as follows: ,in For the first The phase deviation of the period. Let be the rate of change of the phase deviation. The model's prediction equation is:

[0089] ;

[0090] in, This is the predicted value of the current cycle state based on historical state predictions; This is the state transition matrix, which describes the linear evolution logic of the deviation over time. This refers to system process noise.

[0091] This model can detect the phase drift trend caused by sudden changes in the rotational speed of the measured moving part or mechanical vibration of the sensor by inputting the rate of change of the phase deviation.

[0092] Furthermore, the incremental online update specifically includes:

[0093] After each signal cycle ends, the model parameters are updated based on the actual phase deviation collected in the current cycle, and the model parameters of the deviation evolution prediction model are recursively corrected.

[0094] Specifically, at the end of each signal cycle, the system acquires the actual phase deviation calculated from the output signal of the magnetic sensor for the current cycle. And the model is revised:

[0095] ;

[0096] ;

[0097] in, Kalman gain is used to measure the trust weight between the predicted value and the actual collected value. In this embodiment, the noise covariance is measured as a one-dimensional scalar. This is the observation matrix.

[0098] In this embodiment, the observation matrix That is, the first dimension of the directly observed state variables. Through this recursive correction, the model parameters can be incrementally updated within each tooth pitch cycle, allowing the predicted deviation value to approximate the actual physical deviation of the magnetic sensitive element in real time.

[0099] Furthermore, the compensation amount for calculating the orientation parameters based on the updated model specifically includes:

[0100] The orientation parameters include at least one of the following: orientation threshold, sampling time offset, and filter time constant;

[0101] The deviation evolution prediction model is used to lock the expected occurrence window of the signal edge in the next cycle, and dynamic masking intervals are set on both sides of the expected occurrence window according to the signal quality level.

[0102] By adjusting the sampling time offset, the sampling points can avoid the oscillation interference zone within the dynamic masking interval.

[0103] Specifically, based on the updated model predictions The system dynamically adjusts the core parameters for orientation determination. If the standard orientation threshold is... When the model predicts the existence When there is a systematic phase deviation, the system will automatically compensate the orientation threshold. This is to counteract the effects of misalignment in the installation of the magnetic sensing element.

[0104] Based on the predictive model, the expected occurrence window of the next cycle signal edge is determined. Based on the signal quality level, dynamic masking zones are set on both sides of the expected occurrence window. :

[0105] ;

[0106] in, This is a coefficient that is positively correlated with the signal quality level. Under Level 1 operating conditions, The value is 0.02; under level three operating conditions, Increased to 0.08.

[0107] The microprocessor adjusts the effective sampling time of the capture unit based on the dynamic occlusion interval. If the predicted edge oscillation interference zone is located within 50 microseconds before and after the expected edge, the sampling time offset is adjusted so that the control unit skips this interval to perform logic level readings, thereby avoiding the oscillation interference zone caused by transient changes in the magnetic field. The sampling time offset adjustment is performed in conjunction with the orientation threshold compensation. The orientation threshold compensation is used to offset systematic phase deviations, and the sampling time offset adjustment is used to avoid local edge distortions. Together, they constitute a complete compensation for the orientation parameter.

[0108] In this embodiment, the state transition matrix Set as ,in The sampling interval is periodic; the noise covariance is measured. The value is between 0.01 and 0.05 and can be dynamically fine-tuned according to the sensor signal-to-noise ratio; the process noise covariance matrix Q is calibrated experimentally based on the sensor noise level and system dynamic characteristics, and its value is on the same order of magnitude as or slightly lower than the measurement noise covariance R; the filter time constant is set to 5ms to 20ms to smooth the phase deviation change curve; the adaptive compensation range of the direction determination threshold is ±25% of the base value.

[0109] By constructing a deviation evolution prediction model and introducing an incremental online update mechanism, the system can detect the signal drift direction in advance based on the historical phase deviation change trend, and recursively correct the model parameters based on the measured deviation in each cycle, thus achieving dynamic approximation between the predicted value and the actual value. On this basis, the updated model is used to lock the expected edge occurrence window and set a dynamic masking interval, while adjusting the sampling time offset to avoid the oscillation interference area, thereby converting the dynamic error of the magnetic sensitive element under complex working conditions into a quantifiable compensation quantity.

[0110] S400: Construct a strategy adaptation space based on the working condition evaluation results, calculate the adaptation score of each candidate direction determination strategy through a preset multi-objective performance evaluation function, select the corresponding direction determination strategy based on the adaptation score, and perform direction determination in combination with the updated direction determination parameters to generate a direction determination result.

[0111] Furthermore, such as Figure 3 As shown, the calculation of the fitness score of each candidate orientation strategy using a preset multi-objective performance evaluation function specifically includes:

[0112] In the multi-objective performance evaluation function, the weight coefficients of orientation accuracy, response speed, and resource consumption are dynamically distributed according to the working condition evaluation results.

[0113] In transient conditions where the signal frequency fluctuation rate exceeds a preset threshold, the weighting coefficient for response speed is increased.

[0114] In high-noise conditions where the detected signal quality level is below a preset threshold, the weighting coefficient of the direction determination accuracy is increased and a nonlinear penalty term is introduced to limit the jump rate of the direction determination result.

[0115] Specifically, the optimal direction determination control logic is switched in real time based on the current signal conditions to balance the sensor's performance in complex dynamic environments. The system pre-sets a set of candidate direction determination strategies, stored in the processor's Flash memory. These candidate strategies include a fast direction determination strategy based on single-edge triggering, a noise-resistant direction determination strategy based on multi-sampling-point voting, and a robust direction determination strategy based on state machine hysteresis logic. These strategies constitute the strategy adaptation space.

[0116] The microprocessor uses a multi-objective performance evaluation function to comprehensively consider three objectives: direction-determination accuracy, response speed, and resource consumption, calculating the suitability score of each candidate strategy under the current operating conditions. The direction-determination accuracy index is derived based on historical accuracy statistics, and its value ranges from [value missing]. The response speed metric corresponds to the number of instruction cycles from edge capture to direction output in the algorithm, and its value range is [value range missing]. Resource consumption indicators reflect the utilization rate of microprocessor computing resources and RAM; the weighting coefficients of accuracy, response speed and resource consumption are dynamically distributed according to the current operating conditions, and the sum of the three is 1.

[0117] When the sensor detects that the signal frequency fluctuation rate of the moving part being measured exceeds a preset threshold, the system determines it to be a transient acceleration or deceleration condition. At this time, in order to prevent directional lag from causing control failure, the system increases the weight of response speed from the baseline value while decreasing the weight of resource consumption.

[0118] When the signal quality level reaches level three or above, the system is identified as operating under high noise conditions. In this case, the system increases the weight of direction determination accuracy and introduces a non-linear penalty term to limit the rate of frequent flips in the direction determination result under high noise conditions.

[0119] The system selects the candidate strategy with the highest fit score as the current execution strategy. Combining the updated direction-determination parameters, such as the compensated direction-determination threshold and sampling offset, logical operations are performed on the two magnetic pulse signals. For example, when selecting a robust direction-determination strategy, the system not only requires the phase difference to exceed the compensated threshold, but also requires the level combination within two consecutive signal cycles to conform to a preset direction logic sequence. The final direction-determination result is stored in the direction status register as a binary state (e.g., 0 represents forward, 1 represents reverse).

[0120] In this embodiment, the baseline values ​​of the weighting coefficients for accuracy, response speed, and resource consumption can be set to 0.4, 0.4, and 0.2, respectively; the frequency fluctuation threshold can be set to a periodic change rate of 20%; a nonlinear penalty term is activated when the signal quality level reaches level three or above; the response time of the fast direction determination strategy is controlled within 10 microseconds, and the response time of the robust direction determination strategy is controlled within 0.5 signal cycles.

[0121] By constructing a strategy adaptation space containing multiple differentiated direction-determination logics and employing a multi-objective performance evaluation function to comprehensively score each strategy, the system can automatically select the optimal direction-determination logic under different operating conditions. Simultaneously, through a multi-objective adjustment mechanism—where weight coefficients are dynamically distributed according to the operating condition evaluation results, transient operating conditions emphasize response speed, and high-noise operating conditions introduce nonlinear penalty terms to suppress jump rates—an adaptive balance between direction-determination accuracy and response speed is achieved. Combined with the updated direction-determination parameters for execution direction determination, parameter consistency between the decision-making and execution layers is ensured, thereby improving the real-time performance and reliability of the system's direction-determination under all operating conditions.

[0122] S500: Perform a confidence assessment on the orientation determination result, and correct the orientation determination result according to the assessment result and the preset motion constraints based on the laws of physical motion, and output the direction signal and the corresponding confidence status flag.

[0123] Furthermore, such as Figure 4 As shown, the step of correcting the orientation result based on the evaluation results and preset motion constraints based on the laws of physical motion includes:

[0124] Construct a physical motion constraint model for the target under test, wherein the physical motion constraint model includes a preset maximum angular acceleration threshold;

[0125] The instantaneous angular acceleration is calculated based on the directional change corresponding to the current orientation result, and the instantaneous angular acceleration is compared with the maximum angular acceleration threshold.

[0126] When the instantaneous angular acceleration exceeds the maximum angular acceleration threshold and the confidence level is lower than the preset threshold, the current orientation result is determined to be an abnormal change result and is removed, while maintaining the orientation state of the previous cycle. Otherwise, the current orientation result is backtracked and corrected.

[0127] Specifically, a physical constraint mechanism is introduced to perform a final verification of the logical direction determination result, ensuring the physical rationality of the output signal. A physical motion constraint model is constructed based on the mechanical inertial characteristics of the measured moving part. The core of this model lies in defining the physical critical conditions during direction switching. The angular acceleration of the measured target is set as... The calculation formula is as follows:

[0128] ;

[0129] in, The angular velocity at the current moment; The angular velocity at the previous moment; The time interval for speed updates.

[0130] Based on the laws of physical motion, the target being measured has a maximum angular acceleration limit. Calculate the instantaneous angular acceleration based on the directional change corresponding to the current orientation result. ,when Exceed The system determines that the current orientation result violates physical constraints. If the orientation result that violates physical constraints also has a confidence level below a preset threshold, it is determined to be an abnormal mutation result and is removed, maintaining the orientation state of the previous cycle; if the confidence level reaches the preset threshold, the orientation is allowed to be reversed, and the state backtracking correction continues.

[0131] A quality factor is determined based on the signal quality level; the higher the signal quality level, the larger the quality factor value. A consistency factor is determined based on the consistency between the current direction determination result and the historical motion trend; the consistency factor increases when the direction remains consistent and decreases when there are frequent jumps. A confidence score is calculated by combining the quality factor and the consistency factor. In this embodiment, the confidence score can be calculated using a weighted summation method, with a quality factor weight of 0.6 and a consistency factor weight of 0.4. When the confidence score is lower than a preset threshold and the physical motion constraint model determines that the current jump is not physically possible, the system identifies the result as an abnormal mutation and removes it, maintaining the direction state of the previous cycle.

[0132] Furthermore, the state backtracking correction specifically includes:

[0133] Obtain a valid state transition sequence of two signal level combinations. When the detected state transition deviates from the valid state transition sequence, it is determined to be an abnormal state transition.

[0134] Predict missing intermediate states based on the valid state transition sequence and fill in the corresponding counts.

[0135] Specifically, for the two pulse signals, signal A and signal B, generated by the magnetic sensing element, the system defines a valid sequence of level combinations. The four state combinations for the two signals are as follows: , , , A valid sequence of forward rotations is defined as follows: A valid sequence of reverse rotations is defined as follows: The microprocessor performs corrections by monitoring the state machine's transition path in real time. When a deviation from a valid transition sequence is detected, the system performs state backtracking based on historical motion inertia to determine the lost intermediate states. After identifying the missing states, the system automatically fills in the missing count in the internal position counter, thereby correcting displacement or rotational speed calculation errors caused by lost signal edges.

[0136] In this embodiment, the maximum angular acceleration threshold It can be set to 1200 rad / s² for example; the confidence output flag is represented by 2 bits, for example 00 represents low confidence (result has been corrected), 01 represents medium confidence, 10 represents high confidence, and 11 represents reserved confidence; the status monitoring window is set to 3 to 5 consecutive level transition states; if more than 4 illegal transitions occur consecutively, the system will invalidate the confidence status flag and request recalibration.

[0137] By constructing a physical motion constraint model based on mechanical inertia characteristics, the angular acceleration constraint is compared with the upper limit of the system's braking capacity to provide a physical-level rationality verification benchmark for the orientation determination results. At the same time, the confidence score is calculated by comprehensively considering the consistency between the signal quality level and the historical motion trend, eliminating abnormal results that are below the threshold and violate physical constraints, and maintaining the previous state. By defining a legal state transition sequence and monitoring the state transition path in real time, state backtracking is performed when an illegal jump is detected, actively predicting and filling in the missing count, thereby maintaining the continuity and accuracy of the count under the condition of signal distortion or loss.

[0138] Example 2

[0139] In industrial applications such as engineering machinery, hydraulic systems, and rail transportation, it is necessary to detect the motion direction and speed of rotating components in real time and accurately. Currently, a widely used method is a tachometer gear-based sensing scheme based on dual magnetic sensing elements. This involves using two magnetic sensing elements arranged at specific angles to sense changes in the magnetic field generated by the rotation of the gear, outputting two pulse signals with a phase difference. The direction is determined by judging the phase lead or lag relationship between the two signals. However, in actual working conditions, due to factors such as gear machining errors, installation eccentricity, mechanical vibration, temperature drift, and electromagnetic interference, the two signals often deviate from the ideal orthogonal state, exhibiting non-ideal characteristics such as phase deviation, duty cycle distortion, and edge jitter. This leads to frequent misjudgments and count jumps in traditional fixed direction-determining logic, seriously affecting the accuracy of direction detection and the reliability of system operation. To solve the above problems, this invention provides a dual-channel forward and reverse direction-determining system based on phase difference pulse signals, the structure of which is as follows: Figure 5 As shown. The system includes a signal acquisition module, a signal analysis module, an adaptive prediction and compensation module, a multi-objective strategy decision-making module, and a confidence assessment and correction module. Its specific implementation process is as follows:

[0140] Signal acquisition module

[0141] This module performs low-pass filtering and Schmitt shaping on the two original analog signals output by the magnetic sensing element to generate a square wave pulse signal with steep edges. The high-speed capture unit of the microprocessor records the occurrence time of each edge of the two signals in real time and calculates the time interval between adjacent edges and the signal period.

[0142] Signal Analysis Module

[0143] This module calculates the time difference based on the occurrence times of the corresponding edges of the two signals, and calculates the actual phase difference value in combination with the current signal period. It then compares the actual phase difference value with the standard theoretical phase value to extract the phase deviation. At the same time, it detects the amplitude consistency, duty cycle deviation, edge jitter degree and frequency fluctuation range of the two signals, and comprehensively maps them to generate a signal quality level. The output is a condition evaluation result that includes the signal frequency and quality level.

[0144] Adaptive Prediction Compensation Module

[0145] This module constructs a Kalman filter prediction model using the phase deviation and its rate of change as state variables, and predicts the current deviation evolution direction based on historical phase deviation trends. After each signal cycle, the actual phase deviation is collected to recursively correct the model. Based on the updated model, the expected occurrence window of the signal edge in the next cycle is locked, the direction determination threshold and the compensation value of the sampling time offset are calculated, the updated direction determination parameters are generated, and the predicted deviation value is fed back to the signal analysis module, forming a closed-loop correction mechanism that verifies the prediction and the actual measurement.

[0146] Multi-objective strategy decision-making module

[0147] This module uses a multi-objective performance evaluation function to comprehensively evaluate the suitability scores of each strategy in three dimensions: accuracy of direction determination, response speed, and resource consumption, based on a preset set of candidate direction determination strategies. It dynamically adjusts the weight coefficients of each dimension according to the working condition evaluation results, selects the strategy with the highest suitability score, and performs direction determination in combination with the updated direction determination parameters, outputting the direction determination result.

[0148] Confidence assessment and correction module

[0149] This module determines the quality factor based on the signal quality level and the consistency factor based on the consistency between the direction judgment result and the historical motion trend, and calculates the confidence score comprehensively. Abnormal results with confidence scores below the threshold and violating physical motion constraints are eliminated and the previous state is maintained. At the same time, it monitors the legal state transition sequence of the two signal level combinations, predicts and fills in the missing count when an illegal transition is detected, and outputs the direction signal and confidence status flag.

[0150] Finally, it should be noted that the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing embodiments or make equivalent substitutions for some of the technical features. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A dual-path forward / reverse direction determination method based on phase difference pulse signals, characterized in that, include: After preprocessing, the timing characteristic parameters of the two pulse signals generated by the magnetic sensing element sensing the moving part under test are obtained. The timing characteristic parameters include at least the time interval between adjacent edges and the signal period. The phase deviation between the two signals is determined based on the timing characteristic parameters, and the operating characteristics of the current signal are evaluated to generate an operating condition evaluation result that includes the signal frequency and signal quality level. A deviation evolution prediction model is constructed based on the historical phase deviation change trend, and the actual phase deviation is collected to incrementally update the deviation evolution prediction model online. The compensation amount of the orientation parameter is calculated based on the updated model to generate the updated orientation parameter. A strategy adaptation space is constructed based on the working condition evaluation results, and the adaptation score of each candidate direction determination strategy is calculated through a preset multi-objective performance evaluation function. The corresponding direction determination strategy is selected based on the adaptation score, and the direction determination is performed in combination with the updated direction determination parameters to generate the direction determination result. The direction determination result is evaluated for confidence level, and the result is corrected based on the evaluation result and the preset motion constraints based on the laws of physical motion. The direction signal and the corresponding confidence status flag are then output.

2. The dual-path forward / reverse direction determination method based on phase difference pulse signals according to claim 1, characterized in that, Determining the phase deviation between the two signals based on the aforementioned timing characteristic parameters specifically includes: The time difference between the two signals is calculated by extracting the occurrence times of the corresponding edges of the two signals, and then converted into a phase angle with 360° as the reference, in combination with the current signal period, to obtain the actual phase difference value. The actual phase difference is compared with the standard theoretical phase value, and the phase deviation is extracted.

3. The dual-path forward / reverse direction determination method based on phase difference pulse signals according to claim 1, characterized in that, The steps for evaluating the operating characteristics of the current signal include: The system detects the amplitude consistency, duty cycle deviation, and edge jitter of the two signals, and combines this with the signal frequency fluctuation range and signal-to-noise ratio level to comprehensively determine the current operating condition category and corresponding signal quality level of the signal.

4. The dual-path forward / reverse direction determination method based on phase difference pulse signals according to claim 1, characterized in that, The deviation evolution prediction model is a prediction model built based on the Kalman filter algorithm, and its state variables include at least the phase deviation amount and the rate of change of the phase deviation.

5. The dual-path forward / reverse direction determination method based on phase difference pulse signals according to claim 1, characterized in that, The incremental online update specifically includes: After each signal cycle ends, the model parameters are updated based on the actual phase deviation collected in the current cycle, and the model parameters of the deviation evolution prediction model are recursively corrected.

6. The dual-path forward / reverse direction determination method based on phase difference pulse signals according to claim 1, characterized in that, The compensation amount calculated based on the updated model for the orientation parameters specifically includes: The orientation parameters include at least one of the following: orientation threshold, sampling time offset, and filter time constant; The deviation evolution prediction model is used to lock the expected occurrence window of the signal edge in the next cycle, and dynamic masking intervals are set on both sides of the expected occurrence window according to the signal quality level. By adjusting the sampling time offset, the sampling points can avoid the oscillation interference zone within the dynamic masking interval.

7. The dual-path forward / reverse direction determination method based on phase difference pulse signals according to claim 1, characterized in that, The calculation of the fitness score of each candidate orientation strategy using a preset multi-objective performance evaluation function specifically includes: In the multi-objective performance evaluation function, the weight coefficients of orientation accuracy, response speed, and resource consumption are dynamically distributed according to the working condition evaluation results. In transient conditions where the signal frequency fluctuation rate exceeds a preset threshold, the weighting coefficient for response speed is increased. In high-noise conditions where the detected signal quality level is below a preset threshold, the weighting coefficient of the direction determination accuracy is increased and a nonlinear penalty term is introduced to limit the jump rate of the direction determination result.

8. The dual-path forward / reverse direction determination method based on phase difference pulse signals according to claim 1, characterized in that, The step of correcting the orientation result based on the evaluation results and the preset motion constraints based on the laws of physical motion includes: Construct a physical motion constraint model for the target under test, wherein the physical motion constraint model includes a preset maximum angular acceleration threshold; The instantaneous angular acceleration is calculated based on the directional change corresponding to the current orientation result, and the instantaneous angular acceleration is compared with the maximum angular acceleration threshold. When the instantaneous angular acceleration exceeds the maximum angular acceleration threshold and the confidence level is lower than the preset threshold, the current orientation result is determined to be an abnormal change result and is removed, while maintaining the orientation state of the previous cycle. Otherwise, the current orientation result is backtracked and corrected.

9. A dual-path forward / reverse direction determination method based on phase difference pulse signals according to claim 8, characterized in that, The state backtracking correction specifically includes: Obtain a valid state transition sequence of two signal level combinations. When the detected state transition deviates from the valid state transition sequence, it is determined to be an abnormal state transition. Predict missing intermediate states based on the valid state transition sequence and fill in the corresponding counts.

10. A dual-channel forward / reverse direction determination system based on phase difference pulse signals, characterized in that, The system for the dual-path forward / reverse orientation determination method according to any one of claims 1-9 comprises: The signal acquisition module is used to acquire, after preprocessing, the timing characteristic parameters of two pulse signals generated by the magnetic sensing element sensing the moving part under test. The timing characteristic parameters include at least the time interval between adjacent edges and the signal period. The signal analysis module is used to determine the phase deviation between the two signals based on the timing characteristic parameters, evaluate the operating characteristics of the current signal, and generate an operating condition evaluation result that includes the signal frequency and signal quality level. The adaptive prediction compensation module is used to construct a deviation evolution prediction model based on the historical phase deviation change trend, collect the actual phase deviation to incrementally update the deviation evolution prediction model online, calculate the compensation amount of the direction judgment parameter based on the updated model, generate the updated direction judgment parameter, and feed the prediction deviation value back to the signal analysis module to form a closed-loop correction mechanism based on deviation feedback. The multi-objective strategy decision module is used to construct a strategy adaptation space based on the working condition evaluation results, calculate the adaptation score of each candidate direction decision strategy through a preset multi-objective performance evaluation function, select the corresponding direction decision strategy based on the adaptation score, and perform direction determination in combination with the updated direction decision parameters to generate the direction decision result. The confidence assessment and correction module is used to perform confidence assessment on the orientation result, and correct the orientation result according to the assessment result and the preset motion constraints based on the laws of physical motion, and output the direction signal and the corresponding confidence status flag.