An Adaptive Dynamic Hysteresis Closed-Loop Anti-Interference Method for Incremental Magnetic Encoders
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-11
- Publication Date
- 2026-08-14
AI Technical Summary
固定的滞环比较电压往往只能在某一窄带工况下达到最优抗干扰效果:若滞环过宽,在高速时容易造成信号翻转丢失;若滞环过窄,在强干扰下则容易产生误触发,这使现有电路的鲁棒性受到较大限制
本发明提出一种增量式磁编码器自适应动态滞环闭环抗干扰方法,通过将最终输出的正交差分输出信号反馈计算实时转速,并结合信号幅值、噪声水平及温度工况,动态闭环整定滞环比较电压,从而在全速域和宽温度范围内自动优化抗干扰裕度与响应速度:低速或强干扰时增宽滞环以有效抑制噪声毛刺,高速时减窄滞环以确保脉冲信号完整不丢失;同时Z相零位信号采用独立固定滞环阈值,避免动态调整引发零位误触发或丢失。该方法利用输出脉冲闭环反馈,融合噪声水平实时估计、温度补偿及转速调节,实现了多工况自感知与滞环阈值自调整,显著提升了编码器在复杂电磁环境、变转速及极端温度下的鲁棒性与可靠性,并保留了差分输出与故障自诊断功能,特别适用于对位置检测精度和抗扰能力要求严苛的伺服驱动与工业机器人系统。
Smart Images

Figure CN122566906A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of incremental magnetic encoder technology, and in particular to an adaptive dynamic hysteresis closed-loop anti-interference method for incremental magnetic encoders. Background Technology
[0002] Incremental magnetic encoders typically consist of a magnetic drum and a magnetic sensor. The magnetic drum, mounted on a rotating shaft, generates a periodically changing magnetic field as the shaft rotates. The magnetic sensor (such as a Hall effect sensor or magnetoresistive element) converts this magnetic field change into a corresponding voltage signal. This voltage signal is pre-amplified and shaped, then further decoded by a signal processing circuit, ultimately generating three pulse signals: phase A, phase B, and phase Z. Phases A and B are two pulses with a 90° phase difference, used to determine the direction of rotation and displacement. The Z-phase pulse outputs a high level per revolution, used for period counting and zero-point positioning. The A, B, and Z phase pulse signals together constitute the standard output format of an incremental encoder. However, these signals are highly susceptible to electromagnetic interference during transmission and processing, which can affect the accuracy of the edges and the reliability of the counting.
[0003] To improve anti-interference capabilities, existing incremental magnetic encoders commonly employ a fixed-threshold hysteresis comparison method in their circuit design. However, the hysteresis voltage in this method is entirely determined by the nominal signal amplitude and remains constant throughout the entire operation once set. While effective for ideal signals with constant amplitude, this approach cannot adapt to the dynamic changes in signal amplitude under actual operating conditions.
[0004] In actual operating conditions, the output signal amplitude of a magnetic encoder fluctuates significantly with factors such as temperature, rotational speed, and magnetic gap. Furthermore, the intensity of electromagnetic interference in the working environment is not constant, and the pulse period shortens at high speeds, drastically altering the requirements for hysteresis width compared to low-speed conditions. A fixed hysteresis comparison voltage often only achieves optimal anti-interference performance under specific narrow-band conditions: if the hysteresis is too wide, signal loss due to flipping is likely at high speeds; if the hysteresis is too narrow, false triggering is likely under strong interference, significantly limiting the robustness of existing circuits.
[0005] Furthermore, changes in ambient temperature alter the electrical characteristics of the magnetic sensor and comparator circuits, causing drift in the effective signal amplitude. Traditional fixed hysteresis designs do not consider temperature compensation. When encoders are used in applications with wide temperature ranges or drastic speed variations (such as electric vehicles and industrial servo systems), a fixed comparison threshold cannot simultaneously accommodate the different requirements of low-speed high-interference and high-speed low-interference, easily leading to signal distortion, phase shift, and even counting errors. Therefore, it is urgent to address the problem that existing hysteresis anti-interference circuits cannot dynamically adjust the threshold according to the input signal amplitude, noise level, speed, and temperature. Summary of the Invention
[0006] To address the problem of weak anti-interference capability of traditional incremental magnetic encoders in existing technologies, this invention proposes an adaptive dynamic hysteresis closed-loop anti-interference method for incremental magnetic encoders.
[0007] To solve the above-mentioned technical problems, the present invention provides the following technical solution: This invention provides an adaptive dynamic hysteresis closed-loop anti-interference method for incremental magnetic encoders, comprising the following steps: S1. The magnetic sensor converts the changing magnetic field generated by the rotating magnetic drum into a voltage signal. After amplification, shaping and decoding, it outputs three pulse signals: phase A, phase B and phase Z. S2. The real-time detection module collects the amplitude of phases A and B and the temperature information of the signal processing chip. At the same time, it calculates the real-time rotation speed based on the pulse period of the quadrature differential output signal and generates the dynamic hysteresis comparison voltage for phases A and B. Meanwhile, an independent fixed hysteresis comparison voltage is designed for phase Z. Phases S3, A, and B use dynamic hysteresis comparison voltage for hysteresis comparison, while phase Z uses an independent fixed hysteresis comparison voltage for hysteresis comparison, ultimately outputting six differential signals.
[0008] Optionally, in step S1, the magnetic sensor converts the changing magnetic field generated by the rotating magnetic drum into a voltage signal, which, after amplification, shaping, and decoding, outputs three pulse signals: phase A, phase B, and phase Z. The method also includes: The magnetic sensor detects the changing magnetic field generated by the magnetic drum mounted on the rotating shaft as the shaft rotates, and converts the change in magnetic field into a corresponding voltage signal. This voltage signal is then processed by pre-amplification, filtering and shaping, and decoding, and finally outputs three pulse signals: A-phase and B-phase pulse signals with a 90° phase difference, and Z-phase zero-position pulse signal for period counting.
[0009] Optionally, in step S2, the real-time detection module acquires the amplitude of phases A and B and the temperature information of the signal processing chip, and simultaneously calculates the real-time rotational speed based on the pulse period of the quadrature differential output signal, thereby generating dynamic hysteresis comparison voltages for phases A and B; furthermore, an independent fixed hysteresis comparison voltage is designed for phase Z, and the method also includes: S21. The real-time detection module collects the amplitude of phases A and B and the temperature information of the signal processing chip. At the same time, it calculates the real-time rotation speed based on the pulse period of the quadrature differential output signal, providing a basis for the generation of dynamic hysteresis comparison voltage.
[0010] The real-time detection module obtains the actual amplitude of the A-phase and B-phase signals through the built-in amplitude detection circuit, reads the temperature value of the signal processing chip through the integrated temperature sensor, and calculates the real-time rotational speed of the shaft using the pulse period of the quadrature differential output signal. The above amplitude, temperature and rotational speed information are used as input parameters for the dynamic hysteresis comparison voltage generation module.
[0011] S22. Based on the amplitudes of phase A and phase B signals, the noise level is estimated in real time.
[0012] When an incremental magnetic encoder is running, interference from motor drive, power supply ripple, and electromagnetic radiation can superimpose on the output signal, creating noise spikes. Higher noise levels require a wider hysteresis loop to prevent false flips; lower noise levels require a narrower hysteresis loop to ensure signal sensitivity. Therefore, it is necessary to estimate the noise level in real time and dynamically adjust the hysteresis loop width to achieve the optimal balance between interference immunity and signal fidelity.
[0013] In the stable signal range, that is, after more than [time period] since the last signal transition... After one pulse cycle, the A-phase pulse level signal is applied at a higher frequency. Sampling was performed, and the sampling time was... One pulse cycle. Estimate the noise level of phase A signal based on the sampled data: , in: This is the noise estimate for phase A signal. This represents the maximum amplitude of phase A signal within the sampling period. This represents the minimum amplitude of phase A signal within the sampling period.
[0014] Similarly, the noise level of phase B signal is estimated as follows: , in: This is the noise estimate for the B-phase signal. This represents the maximum amplitude of the B-phase signal within the sampling period. This represents the minimum amplitude of the B-phase signal within the sampling period.
[0015] S23. Calculate the speed compensation coefficient based on the real-time speed.
[0016] The frequency of the output pulses of an incremental magnetic encoder is proportional to the rotational speed. The higher the rotational speed, the shorter the signal period, requiring the circuit to detect level transitions in a shorter time. If the hysteresis width is too large, high-frequency signals may fail to flip correctly; if the hysteresis width is too small, the anti-interference capability decreases. Therefore, the hysteresis width should be appropriately reduced as the rotational speed increases to ensure responsiveness at high speeds.
[0017] The design speed compensation coefficient is: , in, This is the speed compensation coefficient. For real-time rotational speed, This is the maximum compensation coefficient at low speeds. Minimum compensation coefficient at high speeds Steepness coefficient, This is the half-decay point.
[0018] The application of the speed compensation coefficient is essentially based on closed-loop feedback control of the output pulse frequency: the signal processing chip detects the frequency of the A and B phase output pulses in real time and converts it into the current speed, thereby dynamically adjusting the speed compensation coefficient of the hysteresis comparator voltage; the adjusted hysteresis comparator directly affects the edge discrimination and output quality of subsequent pulse signals. This feedback loop enables the encoder's anti-interference characteristics to adaptively follow speed changes, realizing closed-loop adjustment of its own processing parameters by the output pulse, significantly improving signal integrity and system robustness under variable speed conditions.
[0019] S24. Calculate the temperature compensation coefficient based on the temperature information of the signal processing chip.
[0020] The sensitivity of the sensors in a magnetic encoder decreases with increasing temperature, leading to a reduction in the output signal amplitude. Simultaneously, the reference voltage of the comparator within the signal processing chip also experiences temperature drift. If the hysteresis width remains the same at high temperatures as at room temperature, the signal amplitude may attenuate and fail to cross the hysteresis threshold, resulting in pulse loss. Conversely, at low temperatures, the signal amplitude increases, making the original hysteresis width relatively small and insufficient for interference suppression. Therefore, a temperature compensation function is needed to dynamically adjust the hysteresis width: appropriately reducing the hysteresis at high temperatures to ensure reliable signal switching, and appropriately increasing the hysteresis at low temperatures to maintain interference immunity.
[0021] The design temperature compensation coefficient is: , in, This is the temperature compensation coefficient. It has a linear temperature coefficient. It is a second-order temperature coefficient. Real-time temperature of the signal processing chip. This is a reference temperature.
[0022] S25. Combining noise level, speed compensation coefficient, and temperature compensation coefficient, generate dynamic hysteresis comparison voltages for phases A and B.
[0023] Taking into account the noise level of phase A, the speed compensation coefficient, and the temperature compensation coefficient, the dynamic hysteresis width of phase A is designed as follows: , in, The dynamic hysteresis width of phase A. This is the noise weighting coefficient for phase A. The A-phase speed weighting coefficient, This is the temperature weighting coefficient for phase A.
[0024] The dynamic hysteresis comparator voltage of phase A is designed as follows: , in, The threshold comparison voltage for the dynamic hysteresis loop of phase A. The threshold comparison voltage under dynamic hysteresis in phase A. This represents the amplitude of a high-level signal.
[0025] Taking into account the noise level, speed compensation coefficient, and temperature compensation coefficient of phase B, the dynamic hysteresis width of phase B is designed as follows: , in, This refers to the dynamic hysteresis width of phase B. This is the B-phase noise weighting coefficient. The B-phase speed weighting coefficient. This is the temperature weighting coefficient for phase B.
[0026] The dynamic hysteresis comparator voltage of phase B can be designed as follows: , in, The threshold comparison voltage on the dynamic hysteresis loop of phase B. This is the threshold comparison voltage under dynamic hysteresis in phase B.
[0027] S26. Design a Z-phase independent fixed hysteresis comparison voltage.
[0028] The Z-phase signal outputs only one narrow pulse per revolution, with an extremely low frequency and a fixed duty cycle. If adaptive dynamic hysteresis is used for phases A and B, the hysteresis width will automatically decrease as the speed increases during high-speed operation. This can easily lead to the Z pulse failing to trigger reliably due to the excessively narrow hysteresis, resulting in the loss of the zero-position reference. Therefore, the Z-phase must use a fixed hysteresis threshold independent of phases A and B to ensure the zero-position pulse is stable and reliable under all operating conditions with a constant width.
[0029] The hysteresis comparator voltage of phase Z is designed as follows: , in, The threshold comparison voltage on the Z-phase dynamic hysteresis loop. This is the threshold comparison voltage under dynamic hysteresis in the Z-phase.
[0030] Optionally, in step S3, phases A and B use a dynamic hysteresis comparison voltage for hysteresis comparison, while phase Z uses an independent fixed hysteresis comparison voltage. The final output includes six differential signals, and further comprises: For phase A signal, the following hysteresis comparison method is designed: 1) When At that time, High level, It is a low level.
[0031] 2) When At that time, low level, It is a high level.
[0032] 3) If If so, a fault flag will be output.
[0033] In the above method, , The two differential signals are obtained after the A-phase pulse signal is processed by the hysteresis comparator circuit.
[0034] For phase B signals, the following hysteresis comparison method is designed: 1) When At that time, High level, It is a low level.
[0035] 2) When At that time, low level, It is a high level.
[0036] 3) If If so, a fault flag will be output.
[0037] In the above method, , The two differential signals are obtained after the B-phase pulse signal is processed by the hysteresis comparator circuit.
[0038] For the Z-phase signal, the following hysteresis comparison method is designed: 1) When At that time, High level, It is a low level.
[0039] 2) When At that time, low level, It is a high level.
[0040] 3) If If so, a fault flag will be output.
[0041] In the above method, , The two differential signals are obtained after the Z-phase pulse signal is processed by the hysteresis comparator circuit.
[0042] The above-described technical solutions of the embodiments of the present invention have at least the following beneficial effects: This invention proposes an adaptive dynamic hysteresis closed-loop anti-interference method for incremental magnetic encoders. By feeding back the final quadrature differential output signal to calculate the real-time rotational speed, and combining this with signal amplitude, noise level, and temperature conditions, the hysteresis comparison voltage is dynamically tuned in a closed loop. This automatically optimizes the anti-interference margin and response speed across the entire speed range and wide temperature range: widening the hysteresis at low speeds or with strong interference to effectively suppress noise glitches, and narrowing the hysteresis at high speeds to ensure the integrity of the pulse signal without loss; simultaneously, the Z-phase zero-position signal uses an independent fixed hysteresis threshold to avoid false triggering or loss of zero position caused by dynamic adjustment. This method utilizes output pulse closed-loop feedback, integrating real-time noise level estimation, temperature compensation, and speed regulation to achieve multi-condition self-sensing and hysteresis threshold self-adjustment. This significantly improves the encoder's robustness and reliability in complex electromagnetic environments, variable speeds, and extreme temperatures, while retaining differential output and fault self-diagnosis functions. It is particularly suitable for servo drive and industrial robot systems with stringent requirements for position detection accuracy and anti-interference capabilities. Attached Figure Description
[0043] Figure 1 This is a flowchart illustrating the design of an adaptive dynamic hysteresis closed-loop anti-interference method for an incremental magnetic encoder, provided in an embodiment of the present invention. Figure 2 This is a block diagram illustrating the principle of an incremental magnetic encoder adaptive dynamic hysteresis closed-loop anti-interference method provided in an embodiment of the present invention. Detailed Implementation
[0044] This invention provides an adaptive dynamic hysteresis closed-loop anti-interference method for incremental magnetic encoders. For example... Figure 1 The diagram shows a design flowchart for an adaptive dynamic hysteresis closed-loop anti-interference method for an incremental magnetic encoder. The processing flow of this method may include the following steps: S1. The magnetic sensor converts the changing magnetic field generated by the rotating magnetic drum into a voltage signal. After amplification, shaping and decoding, it outputs three pulse signals: phase A, phase B and phase Z.
[0045] In one feasible implementation, the magnetic sensor detects in real time the changing magnetic field generated by the magnetic drum mounted on the rotating shaft as the shaft rotates, and converts the change in magnetic field into a corresponding voltage signal. The voltage signal is then processed by pre-amplification, filtering and shaping and decoding, and finally outputs three pulse signals: A-phase and B-phase pulse signals with a 90° phase difference, and Z-phase zero-position pulse signal for period counting.
[0046] S2. The real-time detection module collects the amplitude of phases A and B and the temperature information of the signal processing chip. At the same time, it calculates the real-time rotation speed based on the pulse period of the quadrature differential output signal and generates the dynamic hysteresis comparison voltage for phases A and B. Meanwhile, an independent fixed hysteresis comparison voltage is designed for phase Z.
[0047] S21. The real-time detection module collects the amplitude of phases A and B and the temperature information of the signal processing chip. At the same time, it calculates the real-time rotation speed based on the pulse period of the quadrature differential output signal, providing a basis for the generation of dynamic hysteresis comparison voltage.
[0048] In one feasible implementation, the real-time detection module obtains the actual amplitude of the A-phase and B-phase signals through the built-in amplitude detection circuit, reads the temperature value of the signal processing chip through the integrated temperature sensor, and calculates the real-time rotational speed of the shaft using the pulse period of the quadrature differential output signal. The above amplitude, temperature and rotational speed information are used as input parameters for the dynamic hysteresis comparison voltage generation module.
[0049] S22. Based on the amplitudes of phase A and phase B signals, the noise level is estimated in real time.
[0050] In one feasible implementation, during the operation of an incremental magnetic encoder, interference from motor drive, power supply ripple, and electromagnetic radiation can superimpose onto the output signal, forming noise spikes. Higher noise levels require a wider hysteresis loop to prevent false flips; lower noise levels require a narrower hysteresis loop to ensure signal sensitivity. Therefore, it is necessary to estimate the noise level in real time and dynamically adjust the hysteresis loop width to achieve the optimal balance between interference immunity and signal fidelity.
[0051] In the stable signal range, that is, after more than [time period] since the last signal transition... After one pulse cycle, the A-phase pulse level signal is applied at a higher frequency. Sampling was performed, and the sampling time was... One pulse cycle. Estimate the noise level of phase A signal based on the sampled data: , in: This is the noise estimate for phase A signal. This represents the maximum amplitude of phase A signal within the sampling period. This represents the minimum amplitude of phase A signal within the sampling period.
[0052] Similarly, the noise level of phase B signal is estimated as follows: , in: This is the noise estimate for the B-phase signal. This represents the maximum amplitude of the B-phase signal within the sampling period. This represents the minimum amplitude of the B-phase signal within the sampling period.
[0053] S23. Calculate the speed compensation coefficient based on the real-time speed.
[0054] In one feasible implementation, the frequency of the incremental magnetic encoder's output pulses is proportional to the rotational speed. The higher the rotational speed, the shorter the signal period, requiring the circuit to complete level transition detection in a shorter time. If the hysteresis width is too large, the high-frequency signal may fail to flip properly; if the hysteresis width is too small, the anti-interference capability decreases. Therefore, the hysteresis width should be appropriately reduced as the rotational speed increases to ensure responsiveness at high speeds.
[0055] The design speed compensation coefficient is: , in, This is the speed compensation coefficient. For real-time rotational speed, This is the maximum compensation coefficient at low speeds. Minimum compensation coefficient at high speeds Steepness coefficient, This is the half-decay point.
[0056] The application of the speed compensation coefficient is essentially based on closed-loop feedback control of the output pulse frequency: the signal processing chip detects the frequency of the A and B phase output pulses in real time and converts it into the current speed, thereby dynamically adjusting the speed compensation coefficient of the hysteresis comparator voltage; the adjusted hysteresis comparator directly affects the edge discrimination and output quality of subsequent pulse signals. This feedback loop enables the encoder's anti-interference characteristics to adaptively follow speed changes, realizing closed-loop adjustment of its own processing parameters by the output pulse, significantly improving signal integrity and system robustness under variable speed conditions.
[0057] S24. Calculate the temperature compensation coefficient based on the temperature information of the signal processing chip.
[0058] In one feasible implementation, the sensitivity of the sensor in the magnetic encoder decreases as temperature rises, leading to a reduction in the output signal amplitude. Simultaneously, the reference voltage of the comparator inside the signal processing chip also experiences temperature drift. If the hysteresis width remains the same at high temperatures as at room temperature, the signal amplitude may attenuate and fail to cross the hysteresis threshold, resulting in pulse loss. Conversely, at low temperatures, the signal amplitude increases, and the original hysteresis width becomes relatively small, resulting in insufficient anti-interference capability. Therefore, it is necessary to dynamically adjust the hysteresis width using a temperature compensation function: appropriately reducing the hysteresis at high temperatures to ensure reliable signal switching, and appropriately increasing the hysteresis at low temperatures to maintain anti-interference margin.
[0059] The design temperature compensation coefficient is: , in, This is the temperature compensation coefficient. It has a linear temperature coefficient. It is a second-order temperature coefficient. Real-time temperature of the signal processing chip. This is a reference temperature.
[0060] S25. Combining noise level, speed compensation coefficient, and temperature compensation coefficient, generate dynamic hysteresis comparison voltages for phases A and B.
[0061] In one feasible implementation, the dynamic hysteresis width of phase A is designed as follows, taking into account the noise level of phase A, the speed compensation coefficient, and the temperature compensation coefficient: , in, The dynamic hysteresis width of phase A. This is the noise weighting coefficient for phase A. The A-phase speed weighting coefficient, This is the temperature weighting coefficient for phase A.
[0062] The dynamic hysteresis comparator voltage of phase A is designed as follows: , in, The threshold comparison voltage for the dynamic hysteresis loop of phase A. The threshold comparison voltage under dynamic hysteresis in phase A. This represents the amplitude of a high-level signal.
[0063] Taking into account the noise level, speed compensation coefficient, and temperature compensation coefficient of phase B, the dynamic hysteresis width of phase B is designed as follows: , in, This refers to the dynamic hysteresis width of phase B. This is the B-phase noise weighting coefficient. The B-phase speed weighting coefficient. This is the temperature weighting coefficient for phase B.
[0064] The dynamic hysteresis comparator voltage of phase B is designed as follows: , in, The threshold comparison voltage on the dynamic hysteresis loop of phase B. This is the threshold comparison voltage under dynamic hysteresis in phase B.
[0065] S26. Design an independent fixed hysteresis comparison voltage for the Z phase.
[0066] In one feasible implementation, the Z-phase signal outputs only a narrow pulse per revolution, with an extremely low frequency and a fixed duty cycle. If adaptive dynamic hysteresis is used for phases A and B, the hysteresis width will automatically decrease as the rotational speed increases during high-speed operation. This can easily lead to the Z pulse failing to trigger reliably due to the excessively narrow hysteresis, resulting in the loss of the zero-position reference. Therefore, the Z-phase must use a fixed hysteresis threshold independent of phases A and B to ensure the zero-position pulse is stable and reliable under all operating conditions with a constant width.
[0067] The hysteresis comparator voltage of phase Z is designed as follows: , in, The threshold comparison voltage on the Z-phase dynamic hysteresis loop. This is the threshold comparison voltage under dynamic hysteresis in the Z-phase.
[0068] Phases S3, A, and B use dynamic hysteresis comparison voltage for hysteresis comparison, while phase Z uses an independent fixed hysteresis comparison voltage for hysteresis comparison, ultimately outputting six differential signals.
[0069] In one feasible implementation, for the A-phase signal, the following hysteresis comparison method is designed: 1) When At that time, High level, It is a low level.
[0070] 2) When At that time, low level, It is a high level.
[0071] 3) If If so, a fault flag will be output.
[0072] In the above method, , The two differential signals are obtained after the A-phase pulse signal is processed by the hysteresis comparator circuit.
[0073] For phase B signals, the following hysteresis comparison method is designed: 1) When At that time, High level, It is a low level.
[0074] 2) When At that time, low level, It is a high level.
[0075] 3) If If so, a fault flag will be output.
[0076] In the above method, , The two differential signals are obtained after the B-phase pulse signal is processed by the hysteresis comparator circuit.
[0077] For the Z-phase signal, the following hysteresis comparison method is designed: 1) When At that time, High level, It is a low level.
[0078] 2) When At that time, low level, It is a high level.
[0079] 3) If If so, a fault flag will be output.
[0080] In the above method, , The two differential signals are obtained after the Z-phase pulse signal is processed by the hysteresis comparator circuit.
Claims
1. A method for adaptive dynamic hysteresis closed-loop anti-interference of incremental magnetic encoders, characterized in that, Includes the following steps: S1. The magnetic sensor converts the changing magnetic field generated by the rotating magnetic drum into a voltage signal. After amplification, shaping and decoding, it outputs three pulse signals: phase A, phase B and phase Z. S2. The real-time detection module collects the amplitude of phases A and B and the temperature information of the signal processing chip. At the same time, it calculates the real-time rotation speed based on the pulse period of the quadrature differential output signal and generates the dynamic hysteresis comparison voltage for phases A and B. Meanwhile, an independent fixed hysteresis comparison voltage is designed for phase Z. Phases S3, A, and B use dynamic hysteresis comparison voltage for hysteresis comparison, while phase Z uses an independent fixed hysteresis comparison voltage for hysteresis comparison, ultimately outputting six differential signals.
2. The incremental magnetic encoder adaptive dynamic hysteresis closed-loop anti-interference method according to claim 1, characterized in that, Step S1 further includes: The magnetic sensor detects the changing magnetic field generated by the magnetic drum mounted on the rotating shaft as the shaft rotates, and converts the change in magnetic field into a corresponding voltage signal. This voltage signal is then processed by pre-amplification, filtering and shaping, and decoding, and finally outputs three pulse signals: A-phase and B-phase pulse signals with a 90° phase difference, and Z-phase zero-position pulse signal for period counting.
3. The incremental magnetic encoder adaptive dynamic hysteresis closed-loop anti-interference method according to claim 1, characterized in that, Step S2 further includes: S21. The real-time detection module acquires the amplitude values of phases A and B and the temperature information of the signal processing chip. Simultaneously, it calculates the real-time rotational speed based on the pulse period of the quadrature differential output signal, providing a basis for generating the dynamic hysteresis comparison voltage. The real-time detection module obtains the actual amplitude of the A-phase and B-phase signals through the built-in amplitude detection circuit, reads the temperature value of the signal processing chip through the integrated temperature sensor, and calculates the real-time rotational speed of the shaft using the pulse period of the quadrature differential output signal. The above amplitude, temperature and rotational speed information are used as input parameters for the dynamic hysteresis comparison voltage generation module. S22. Based on the amplitudes of phase A and phase B signals, perform real-time estimation of the noise level: When an incremental magnetic encoder is running, the noise level needs to be estimated in real time and the hysteresis width needs to be dynamically adjusted to achieve the best balance between interference immunity and signal fidelity. In the stable signal range, that is, after more than [time period] since the last signal transition... After one pulse cycle, the A-phase pulse level signal is applied at a higher frequency. Sampling was performed, and the sampling time was... For each pulse cycle, the noise level of phase A signal is estimated based on the sampled data: ; in: This is the noise estimate for phase A signal. This represents the maximum amplitude of phase A signal within the sampling period. This represents the minimum amplitude of phase A signal within the sampling period; Similarly, the noise level of phase B signal is estimated as follows: ; in: This is the noise estimate for the B-phase signal. This represents the maximum amplitude of the B-phase signal within the sampling period. This represents the minimum amplitude of the B-phase signal within the sampling period. S23. Calculate the speed compensation coefficient based on the real-time speed: The frequency of the output pulses of the incremental magnetic encoder is proportional to the rotational speed. The designed speed compensation coefficient is: ; in, This is the speed compensation coefficient. For real-time rotational speed, This is the maximum compensation coefficient at low speeds. Minimum compensation coefficient at high speeds Steepness coefficient, It is the half-decay point; The speed compensation coefficient is based on closed-loop feedback control of the output pulse frequency: the signal processing chip detects the frequency of the A and B phase output pulses in real time and converts it into the current speed, and then dynamically adjusts the speed compensation coefficient of the hysteresis comparator voltage; the adjusted hysteresis comparator directly affects the edge discrimination and output quality of the subsequent pulse signal; this feedback loop enables the encoder's anti-interference characteristics to adaptively follow the speed change, realize the closed-loop adjustment of the output pulse to its own processing parameters, and improve the signal integrity and system robustness under variable speed conditions; S24. Calculate the temperature compensation coefficient based on the temperature information of the signal processing chip: The sensitivity of the sensors in a magnetic encoder decreases as temperature rises, leading to a reduction in the output signal amplitude. Simultaneously, the reference voltage of the comparator within the signal processing chip also experiences temperature drift. Therefore, a temperature compensation function is needed to dynamically adjust the hysteresis width: reducing the hysteresis at high temperatures to ensure reliable signal switching, and increasing the hysteresis at low temperatures to maintain anti-interference margins. The design temperature compensation coefficient is: ; in, This is the temperature compensation coefficient. It has a linear temperature coefficient. It is a second-order temperature coefficient. Real-time temperature of the signal processing chip. For reference temperature; S25. Combining noise level, speed compensation coefficient, and temperature compensation coefficient, generate dynamic hysteresis comparison voltages for phases A and B. Taking into account the noise level of phase A, the speed compensation coefficient, and the temperature compensation coefficient, the dynamic hysteresis width of phase A is designed as follows: ; in, The dynamic hysteresis width of phase A. This is the noise weighting coefficient for phase A. The A-phase speed weighting coefficient, The temperature weighting coefficient for phase A; The dynamic hysteresis comparator voltage of phase A is designed as follows: ; in, The threshold comparison voltage for the dynamic hysteresis loop of phase A. The threshold comparison voltage under dynamic hysteresis in phase A. The amplitude of the high-level signal; Taking into account the noise level, speed compensation coefficient, and temperature compensation coefficient of phase B, the dynamic hysteresis width of phase B is designed as follows: ; in, This refers to the dynamic hysteresis width of phase B. This is the B-phase noise weighting coefficient. The B-phase speed weighting coefficient. This refers to the temperature weighting coefficient for phase B. The dynamic hysteresis comparator voltage of phase B is designed as follows: ; in, The threshold comparison voltage on the dynamic hysteresis loop of phase B. This is the threshold comparison voltage under dynamic hysteresis in phase B; S26. Design an independent fixed hysteresis comparison voltage for the Z-phase: The Z-phase signal outputs only one narrow pulse per revolution, with an extremely low frequency and a fixed duty cycle. The Z-phase uses a fixed hysteresis threshold independent of the A and B phases to ensure stable and reliable zero-position pulses under all operating conditions with a constant width. The hysteresis comparator voltage of phase Z is designed as follows: ; in, The threshold comparison voltage on the Z-phase dynamic hysteresis loop. This is the threshold comparison voltage under dynamic hysteresis in the Z-phase.
4. The incremental magnetic encoder adaptive dynamic hysteresis closed-loop anti-interference method according to claim 1, characterized in that, Step S3 further includes: For phase A signal, the following hysteresis comparison method is designed: 1) When At that time, High level, Low level, 2) When At that time, low level, High level 3) If If so, then output a fault flag. In the above method, , The two differential signals are obtained after the A-phase pulse signal is processed by the hysteresis comparator circuit; For phase B signals, the following hysteresis comparison method is designed: 1) When At that time, High level, Low level, 2) When At that time, low level, High level 3) If If so, then output a fault flag. In the above method, , The two differential signals are obtained after the B-phase pulse signal is processed by the hysteresis comparator circuit; For the Z-phase signal, the following hysteresis comparison method is designed: 1) When At that time, High level, Low level, 2) When At that time, low level, High level 3) If If so, then output a fault flag. In the above method, , The two differential signals are obtained after the Z-phase pulse signal is processed by the hysteresis comparator circuit.