Method and device for measuring displacement of ferromagnetic material based on PWM (Pulse Width Modulation) wave and phase method
By combining high-frequency PWM wave generation by a microcontroller with phase method and digital logic processing, the problems of insufficient measurement accuracy and dynamic response performance in displacement measurement of ferromagnetic materials are solved, realizing high-precision and low-cost displacement measurement in complex electromagnetic environments.
Patent Information
- Application Number
- CN202511531593.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-24
- Publication Date
- 2026-01-30
AI Technical Summary
Existing displacement measurement technologies for ferromagnetic materials suffer from problems such as decreased measurement accuracy, high system complexity, high cost, and insufficient dynamic response performance when facing complex electromagnetic environments.
A microcontroller is used to generate a high-frequency PWM wave combined with the phase method. The induced signal is obtained by the relative displacement between the electromagnetic induction probe and the ferromagnetic material. Digital logic processing and filtering technology are used to convert it into a digital pulse width change that is easy to measure accurately. Combined with an adaptive frequency tuning method, high precision and high dynamic response are achieved.
Achieving stable, reliable, and high-precision displacement measurement in complex electromagnetic environments reduces system complexity and cost, improves dynamic response performance, and is adaptable to high-speed motion and ferromagnetic materials with varying magnetic properties.
Smart Images

Figure CN121430431A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of displacement measurement technology, and in particular to a method and apparatus for measuring displacement of ferromagnetic materials based on PWM wave and phase method. Background Technology
[0002] Currently, non-contact displacement sensor technologies based on the principle of electromagnetic induction, such as inductive, Hall effect, and magnetostrictive displacement sensors, have been widely used in industrial automation, new energy vehicles, and aerospace due to their advantages such as high precision and long lifespan. In recent years, the introduction of new materials and processes has further improved sensor performance; for example, the application of magnetostrictive displacement sensors in high-temperature and high-pressure environments has increased significantly. Technological development shows a trend towards higher precision, intelligence, and integration. Specifically, MEMS technology and nanomaterials are driving the miniaturization of sensors, artificial intelligence algorithms are being introduced to achieve self-calibration and adaptive functions, and wireless communication technology and multifunctional integrated designs are meeting the complex needs of the Industrial Internet of Things (IIoT).
[0003] However, existing technologies still face a series of key technical challenges in displacement measurement scenarios involving ferromagnetic materials. On the one hand, variations in the permeability of ferromagnetic materials, hysteresis effects, and complex external electromagnetic environments can easily cause distortion of the measurement magnetic field and signal drift, leading to a decrease in the measurement accuracy of traditional electromagnetic sensors. On the other hand, although phase-based displacement measurement schemes can achieve high accuracy, they typically rely on complex signal processing algorithms and high-performance hardware, such as FPGAs. This not only increases system complexity and cost but also limits their dynamic response performance in high-speed displacement scenarios. Furthermore, while existing high-precision solutions such as laser displacement sensors can avoid magnetic field interference, they are expensive and susceptible to contamination in harsh industrial environments, while low-cost solutions such as potentiometer sensors are insufficient in accuracy and lifespan to meet industrial-grade measurement requirements.
[0004] In summary, existing displacement measurement technologies still have significant shortcomings in terms of environmental adaptability, dynamic response performance, system complexity, and cost-effectiveness when dealing with ferromagnetic materials. Summary of the Invention
[0005] The purpose of this invention is to provide a method and device for measuring the displacement of ferromagnetic materials based on PWM waves and phase methods. By using a microcontroller to generate high-frequency PWM waves and combining phase methods with digital logic processing, magnetic field interference and signal drift in the measurement of ferromagnetic materials are effectively suppressed. While ensuring high accuracy and high dynamic response, the system complexity and cost are significantly reduced.
[0006] To address the aforementioned technical problems, a first aspect of this invention provides a method for measuring the displacement of ferromagnetic materials based on PWM waves and the phase method, comprising the following steps: Two PWM square wave signals with the same frequency are generated, where the first PWM square wave signal is used as the excitation signal and the second PWM square wave signal is used as the reference signal. The excitation signal is applied to the electromagnetic induction probe, and based on the relative displacement between the electromagnetic induction probe and the ferromagnetic material, the phase of the electromagnetic induction probe output by the electromagnetic induction probe changes with the relative displacement. The sensed signal is converted into a third PWM square wave signal, the phase of which is related to the phase of the sensed signal; The third PWM square wave signal is ANDed with the reference signal to generate a pulse signal, and the duty cycle of the pulse signal changes with the relative displacement. The pulse signal is filtered to obtain a displacement measurement result that is proportional to the relative displacement.
[0007] Further, the conversion of the sensed signal into a third PWM square wave signal includes: The sensed signal is connected to the first input terminal of a comparator, and a reference voltage is connected to the second input terminal of the comparator. The comparator is used to compare the instantaneous voltage value of the sensed signal with the voltage value of the reference voltage in real time. When the instantaneous voltage value is higher than the reference voltage value, the comparator outputs a high level; when the instantaneous voltage value is lower than the reference voltage value, the comparator outputs a low level, thus obtaining a third PWM square wave signal with the same frequency and phase as the induced signal.
[0008] Further, the step of filtering the pulse signal to obtain a displacement measurement result proportional to the relative displacement includes: The pulse signal is input to a voltage follower of a signal conditioning circuit, and the signal after impedance conversion by the voltage follower is transmitted to a passive bandpass filter. The passive bandpass filter performs frequency domain processing on the received signal to filter out high-frequency harmonic components and low-frequency environmental noise components, and outputs a DC voltage signal. The voltage value of the DC voltage signal and the relative displacement show a linear proportional relationship. The DC voltage signal is connected to an analog-to-digital converter, which converts the DC voltage signal into a digital quantity, and the digital quantity is used as the displacement measurement result.
[0009] Further, the step of connecting the DC voltage signal to an analog-to-digital converter (ADC), converting the DC voltage signal into a digital quantity, and using the digital quantity as the displacement measurement result includes: Based on the displacement-digital calibration relationship, the real-time relative displacement value between the electromagnetic induction probe and the ferromagnetic material corresponding to the digital quantity is obtained, and the real-time relative displacement value is used as the displacement measurement result.
[0010] Furthermore, the output voltage ripple value of the DC voltage signal is no greater than ten millivolts.
[0011] Furthermore, the two PWM square wave signals with the same frequency are generated by a microcontroller; The frequency range of the PWM square wave signal is 700kHz~1MHz.
[0012] Furthermore, the displacement measurement method for ferromagnetic materials based on PWM wave and phase method further includes: During the system initialization phase, the microcontroller is controlled to output the excitation signal sequentially at multiple preset frequency points; At each preset frequency point, the signal stability index of the displacement measurement result is obtained; By comparing the signal stability indicators at all the preset frequency points, the operating frequency of the microcontroller is locked at the frequency point with the optimal signal stability indicator.
[0013] Furthermore, the signal stability index for obtaining the displacement measurement result includes: At each preset frequency point, the electromagnetic induction probe is controlled to remain relatively stationary with respect to the ferromagnetic material; The DC voltage signal is sampled multiple times continuously by the analog-to-digital converter of the microcontroller to obtain a voltage sampling sequence; Calculate the statistical variance of the voltage sampling sequence and use the statistical variance as the signal stability index at the current preset frequency point; The smaller the statistical variance value, the better the signal stability index.
[0014] Furthermore, the multiple preset frequency points are distributed in equal steps within the frequency range of 700kHz to 1MHz; The frequency difference between two adjacent preset frequency points is a fixed step value.
[0015] Accordingly, a second aspect of the present invention provides a displacement measurement device for ferromagnetic materials based on PWM wave and phase method, which measures the relative displacement between an electromagnetic induction probe and a ferromagnetic material based on the above-described displacement measurement method for ferromagnetic materials based on PWM wave and phase method, including: The square wave signal generation module is used to generate two PWM square wave signals with the same frequency, wherein the first PWM square wave signal is used as the excitation signal and the second PWM square wave signal is used as the reference signal. The induction signal acquisition module is used to apply the excitation signal to the electromagnetic induction probe and, based on the relative displacement between the electromagnetic induction probe and the ferromagnetic material, acquire the induction signal output by the electromagnetic induction probe whose phase changes with the relative displacement. The sensing signal conversion module is used to convert the sensing signal into a third PWM square wave signal, wherein the phase of the third PWM square wave signal is related to the phase of the sensing signal; The square wave signal processing module is used to perform a logical AND operation between the third PWM square wave signal and the reference signal to generate a pulse signal, wherein the duty cycle of the pulse signal changes with the relative displacement. The displacement result calculation module is used to filter the pulse signal to obtain a displacement measurement result that is proportional to the relative displacement.
[0016] Accordingly, a third aspect of the present invention provides an electronic device, comprising: at least one processor; and a memory connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to cause the at least one processor to perform the above-described method for measuring displacement of ferromagnetic materials based on PWM wave and phase method.
[0017] Accordingly, a fourth aspect of the present invention provides a computer-readable storage medium having computer instructions stored thereon, which, when executed by a processor, implement the above-described method for measuring displacement of ferromagnetic materials based on PWM wave and phase method.
[0018] The above-described technical solutions of the embodiments of the present invention have the following beneficial technical effects: 1. By using a microcontroller to directly generate high-frequency PWM waves as excitation and reference signals, and combining them with subsequent digital logic circuits for processing, a highly integrated hardware solution was constructed. Replacing traditional analog oscillation circuits or dedicated DDS chips with a digital signal source not only ensures the purity and stability of the excitation signal from the source, but also significantly simplifies the system architecture. This effectively overcomes the problem of decreased measurement accuracy caused by temperature drift and noise in traditional sensors, thus enabling stable and reliable displacement measurement results even in complex electromagnetic environments. 2. Based on the phase-duty cycle conversion mechanism of "logical AND operation" and combined with the adaptive frequency tuning method, high-precision tracking of hysteresis effect and dynamic displacement of ferromagnetic materials is achieved; the analog phase change, which is difficult to measure directly, is converted into the digital pulse width change, which is easy to measure accurately; and by selecting the optimal operating frequency in real time, the material characteristic noise and the real displacement signal are effectively distinguished; the sensor can respond quickly and maintain extremely high linear measurement accuracy when facing ferromagnetic materials with high-speed movement or variable magnetic properties. 3. By optimizing the hardware structure, adopting a non-contact eddy current probe and a highly integrated signal processing circuit, and introducing system self-calibration and adaptive functions, the system significantly reduces manufacturing and maintenance costs while improving performance. It also reduces reliance on precision optical components, complex shielding structures, or high-cost processing chips. Its "calibration-free" design also reduces the difficulty and frequency of on-site installation and debugging. Based on achieving excellent measurement performance, it achieves a comprehensive technical effect of high reliability, long life and low total cost of ownership, laying the foundation for large-scale industrial applications. Attached Figure Description
[0019] Figure 1 This is a flowchart of the displacement measurement method for ferromagnetic materials based on PWM wave and phase method provided in the embodiments of the present invention; Figure 2 This is a schematic diagram illustrating the principle of electromagnetic induction probe and ferromagnetic material displacement measurement provided in an embodiment of the present invention; Figure 3 This is a schematic diagram of PWM square wave signal generation provided in an embodiment of the present invention; Figure 4 This is a block diagram of a ferromagnetic material displacement measurement device based on PWM wave and phase method provided in an embodiment of the present invention.
[0020] Figure label: 1. Square wave signal generation module; 2. Induction signal acquisition module; 3. Induction signal conversion module; 4. Square wave signal calculation module; 5. Displacement result calculation module. Detailed Implementation
[0021] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to specific embodiments and the accompanying drawings. It should be understood that these descriptions are merely exemplary and not intended to limit the scope of the invention. Furthermore, descriptions of well-known structures and techniques are omitted in the following description to avoid unnecessarily obscuring the concept of the invention.
[0022] Please refer to Figure 1 and Figure 2 The first aspect of this invention provides a method for measuring the displacement of ferromagnetic materials based on PWM wave and phase method, comprising the following steps: Step S100: Generate two PWM square wave signals with the same frequency, wherein the first PWM square wave signal is used as the excitation signal and the second PWM square wave signal is used as the reference signal.
[0023] The process is executed by a microcontroller within the embedded system. The microcontroller, configured in PWM generation mode via its internal timer unit, utilizes its precise clock source and capture / compare register to generate two strictly synchronized PWM square waves. One PWM wave is defined as the excitation signal, with its designed frequency typically set in the range of hundreds of kilohertz to one megahertz. This frequency selection aims to balance the sensor's response speed and penetration depth. The other PWM wave serves as a reference signal, with the exact same frequency as the excitation signal and a fixed phase relationship between them. This reference signal provides a precise comparison benchmark for subsequent phase detection. This method of generating two critical signals from a single digital chip fundamentally ensures the homogeneity and stability of the signal sources, effectively avoiding the phase jitter and frequency drift problems that may be introduced by using multiple independent signal sources in traditional solutions.
[0024] In step S200, an excitation signal is applied to the electromagnetic induction probe, and based on the relative displacement between the electromagnetic induction probe and the ferromagnetic material, the phase of the output signal of the electromagnetic induction probe changes with the relative displacement is obtained.
[0025] An excitation signal is applied to an electromagnetic induction probe, typically an eddy current probe. Driven by the excitation signal, a coil inside the probe generates a high-frequency alternating magnetic field in the space at its front end. When this magnetic field approaches a ferromagnetic material, eddy currents are induced on the surface of the material according to the law of electromagnetic induction. These eddy currents generate a secondary magnetic field in the opposite direction, which reacts on the original magnetic field of the probe, thereby changing the equivalent impedance of the probe coil. When the probe and the ferromagnetic material undergo relative displacement, the coupling distance between them changes, leading to a change in the intensity of the eddy current effect, which in turn causes a change in the inductive reactance component of the probe coil's equivalent impedance. This change in inductive reactance directly modulates the phase relationship between the current flowing through the coil and the voltage across it, resulting in a monotonically changing phase value corresponding to the relative displacement in the probe's final output induced signal, while the signal amplitude serves as a secondary reference.
[0026] In step S300, the induced signal is converted into a third PWM square wave signal, the phase of which is related to the phase of the induced signal.
[0027] The conversion from analog to digital signals, while preserving crucial phase information, is achieved through a voltage comparator circuit. The induced signal emitted by the probe, typically a sine wave or near-sine wave, is input to one input of the comparator, while a carefully configured reference DC voltage is input to the other. The comparator circuit monitors the instantaneous voltage value of the induced signal in real time and rapidly compares it to the reference voltage. When the induced signal voltage is higher than the reference voltage, the comparator output circuit is logic high; when the induced signal voltage is lower than the reference voltage, the output circuit is logic low. Through this process, the input continuous analog waveform is shaped into a steeply edged digital square wave, which is the third PWM square wave signal. Its frequency matches the original induced signal, and the timing of its rising and falling edges (i.e., phase) faithfully reflects the zero-crossing points of the original induced signal, thus ensuring lossless conversion of phase information.
[0028] In step S400, the third PWM square wave signal and the reference signal are logically ANDed to generate a pulse signal, and the duty cycle of the pulse signal changes with the relative displacement.
[0029] The third PWM square wave signal obtained in step S300 and the reference signal generated in step S100 are simultaneously input to a digital AND gate circuit. The characteristic of the AND gate is that the output is high only when both input signals are simultaneously high; under any other input combination, the output is low. When these two PWM square wave signals of the same frequency but with a phase difference are input to the AND gate, the output signal is a new PWM wave with a constant frequency but varying pulse width (i.e., high-level duration). Its pulse width is directly determined by the phase overlap region of the two input signals: the smaller the phase difference, the larger the overlap region, the wider the output pulse, and the larger the duty cycle; the larger the phase difference, the smaller the overlap region, the narrower the output pulse, and the smaller the duty cycle. Therefore, the phase change of the induced signal caused by the probe displacement is linearly mapped to a change in the duty cycle of the output pulse signal in this step.
[0030] Step S500: The pulse signal is filtered to obtain a displacement measurement result that is proportional to the relative displacement.
[0031] The duty cycle-changing pulse signal obtained after logical operations is essentially a digital square wave, which needs to be converted into a smooth analog signal for easy reading and subsequent processing. This signal is first fed into a voltage follower composed of operational amplifiers. Its main function is impedance transformation, providing high input impedance to reduce the load on the preceding digital circuitry, while providing low output impedance to drive the subsequent filter circuitry. Subsequently, the signal enters a passive bandpass filter, which removes unwanted high-frequency switching noise and its harmonics, while suppressing low-frequency environmental interference. The filter output is a DC voltage signal whose average voltage is proportional to the input pulse duty cycle. This DC voltage signal can be directly used as the analog displacement measurement result, or, more typically, it is fed into an analog-to-digital converter to be converted into a digital signal, and the processor calculates the precise relative displacement value according to a preset displacement-voltage calibration curve.
[0032] Further, the conversion of the sensed signal into a third PWM square wave signal in step S300 includes: Step S310: Connect the induced signal to the first input terminal of a comparator and connect a reference voltage to the second input terminal of the comparator.
[0033] The induced signal from the electromagnetic induction probe is typically an analog sine wave whose amplitude varies continuously over time. This signal is directly connected to the non-inverting input (first input) of the voltage comparator via a shielded wire to minimize external interference introduced during transmission. Simultaneously, a stable DC voltage generated by a precision voltage divider circuit or a reference voltage source chip is connected to the inverting input (second input) of the comparator. The typical value of this reference voltage is usually set near the midpoint of the AC amplitude of the induced signal; for example, when the induced signal amplitude is between 0 and 3.3 volts, the reference voltage can be set to 1.65 volts.
[0034] This connection method constitutes a variant of a zero-crossing detector, the core purpose of which is to establish a stable reference criterion for subsequent voltage comparisons. The accuracy and stability of the reference voltage are crucial; any drift will directly cause a phase shift in the comparator's output square wave, thus introducing displacement measurement errors. Therefore, in practical circuit design, low-temperature drift precision resistors or dedicated voltage reference sources are often used to ensure the constant value of this voltage, thereby providing a reliable threshold reference for the entire conversion process.
[0035] Step S320: The instantaneous voltage value of the sensed signal is compared with the voltage value of the reference voltage in real time based on the comparator.
[0036] As a high-speed differential amplifier, the voltage comparator employs an open-collector or push-pull structure in its output stage, enabling it to respond quickly to minute voltage differences between its two input terminals. During operation, the comparator continuously and in real-time samples the instantaneous voltage of the induced signal and performs subtraction and amplification operations with a fixed reference voltage. When the induced signal voltage is slightly higher than the reference voltage, the output of the internal differential amplifier tends towards a saturation positive voltage; conversely, when the induced signal voltage is slightly lower than the reference voltage, its output tends towards a saturation negative voltage or ground level.
[0037] The comparator's response speed, i.e., the time required for it to switch from one output state to another, is a critical parameter. For high-frequency induced signals of hundreds of kilohertz, high-speed comparators must be selected, with response times typically on the order of nanoseconds, to ensure accurate capture of the rapid zero-crossing of the input signal and avoid additional phase errors caused by device delays. The entire comparison process is a strongly nonlinear operation that ignores the amplitude information of the input signal, only judging the relative high-low relationship between its instantaneous voltage and the reference voltage, thus preparing for the generation of a digital square wave.
[0038] In step S330, when the instantaneous voltage value is higher than the reference voltage value, the comparator outputs a high level; when the instantaneous voltage value is lower than the reference voltage value, the comparator outputs a low level, thus obtaining a third PWM square wave signal with the same frequency and phase as the induced signal.
[0039] Based on the real-time comparison result in step S320, the comparator output switches between two discrete logic levels. Specifically, when the instantaneous voltage of the sensed signal is determined to be higher than the reference voltage, the comparator output is driven to a logic high level, with a voltage value corresponding to the positive voltage of the power supply, such as 3.3 volts or 5 volts. Conversely, when the instantaneous voltage is determined to be lower than the reference voltage, the output is driven to a logic low level, i.e., zero volts or near-zero volts ground potential.
[0040] Through the above process, the input continuous analog sine wave is shaped into a steeply edged digital square wave, which is the third PWM square wave signal. The frequency of this square wave is exactly the same as the original induced signal; each rising edge corresponds to the moment when the induced signal voltage crosses the reference voltage during its rising phase, and each falling edge corresponds to the moment when the induced signal voltage crosses the reference voltage during its falling phase. Therefore, the third PWM square wave accurately reproduces the phase information of the original induced signal, while adverse factors such as amplitude fluctuations and nonlinear distortion are effectively suppressed and eliminated.
[0041] Through the coordinated operation of the above three sub-steps, the analog phase signal containing displacement information is converted into a PWM square wave signal with stronger anti-interference ability and easier processing by subsequent digital circuits. This conversion process not only achieves the standardization of signal form, but also significantly improves robustness due to its insensitivity to amplitude fluctuations, laying a solid and reliable signal foundation for subsequent high-precision phase difference detection and displacement calculation.
[0042] Further, the filtering of the pulse signal in step S500 to obtain a displacement measurement result proportional to the relative displacement includes: In step S510, the pulse signal is input to the voltage follower of a signal conditioning circuit, and the signal after impedance conversion by the voltage follower is transmitted to the passive bandpass filter.
[0043] This step is the initial stage of signal conditioning, primarily addressing the impedance matching issue between the preceding and following circuit stages. The pulse signal from the logic AND operation output has a high source impedance and limited driving capability; directly connecting it to a filter network would result in significant signal attenuation and waveform distortion. The voltage follower circuit uses an operational amplifier, with its non-inverting input receiving the pulse signal and its output directly feeding back to the inverting input, forming 100% negative feedback. This deep negative feedback configuration gives the operational amplifier extremely high input impedance and extremely low output impedance characteristics; its input impedance can typically reach megaohms, while its output impedance can drop to a few ohms or even lower.
[0044] High input impedance ensures that the voltage follower draws minimal current from the preceding digital circuitry, thus avoiding signal level errors and phase distortions caused by load effects. Low output impedance provides strong load-driving capability, enabling it to provide a stable voltage signal to subsequent passive filtering networks, unaffected by changes in filter impedance. The signal processed by the voltage follower maintains the same voltage waveform as the input pulse signal, but its driving characteristics are fundamentally improved, creating the necessary conditions for subsequent high-quality filtering. In practical circuit layouts, the voltage follower is typically placed as close as possible to the preceding signal source to minimize interference introduced along the transmission path.
[0045] Step S520: The received signal is processed in the frequency domain based on a passive bandpass filter to filter out high-frequency harmonic components and low-frequency environmental noise components in the signal, and a DC voltage signal is output. The voltage value of the DC voltage signal and the relative displacement show a linear proportional relationship.
[0046] Passive bandpass filters are typically constructed from a combination of resistors and capacitors, such as using a multi-stage RC filter network. Their frequency response characteristics are designed to allow the fundamental frequency component of the pulse signal and its nearby effective sidebands to pass through, while strongly attenuating noise components outside the frequency range. The filter's high-frequency cutoff frequency is set at a level much lower than the pulse signal switching frequency in order to filter out high-order harmonics and high-frequency electromagnetic interference generated by the switching action of digital circuits.
[0047] The low-frequency cutoff frequency of the filter is set at a frequency sufficient to suppress power supply frequency interference and its harmonics, as well as extremely low-frequency noise caused by the slow drift of ambient temperature. After this bandpass filtering, the AC component in the pulse signal is effectively removed, and the output signal is essentially a smooth DC voltage whose average voltage value is proportional to the duty cycle of the input pulse signal. Since this duty cycle strictly corresponds to the phase change of the electromagnetic induction probe, and the phase change is monotonically related to the relative displacement, a stable and linear proportional relationship is established between the final output DC voltage signal and the relative displacement. The slope and offset of this linear relationship are determined by the calibration program at the sensor factory and stored in the system for use during measurement.
[0048] Step S530: The DC voltage signal is connected to an analog-to-digital converter, which converts the DC voltage signal into a digital quantity, and uses the digital quantity as the displacement measurement result.
[0049] The filtered DC voltage signal is fed into the analog input channel of the analog-to-digital converter (ADC). The ADC uses the system clock as a reference and periodically samples and quantizes the input DC voltage according to a set sampling rate. During the conversion process, the continuous value of the analog voltage is discretized into a series of digital quantities represented by binary codes.
[0050] The resolution of the analog-to-digital converter (ADC) is a key parameter; typically, a 12-bit or higher precision converter is chosen to ensure the ability to distinguish voltage changes caused by minute displacements. For example, a 12-bit ADC theoretically achieves a resolution of 0.8 millivolts within a reference voltage range of 0 to 3.3 volts, which is sufficient for high-precision displacement measurement. The converted digital quantity directly represents the amplitude of the current DC voltage signal. Based on the displacement-voltage linear relationship established in step S520, this digital quantity is the final displacement measurement result. This digital result can be directly read by the microprocessor and converted into an actual displacement value with engineering units using pre-stored calibration parameters, completing the full conversion chain from physical quantity to digital information.
[0051] Further, step S530, which involves connecting the DC voltage signal to an analog-to-digital converter (ADC) to convert the DC voltage signal into a digital quantity, and using the digital quantity as the displacement measurement result, includes: Step S531: Based on the displacement-digital calibration relationship, obtain the real-time relative displacement value between the electromagnetic induction probe and the ferromagnetic material corresponding to the digital quantity, and use the real-time relative displacement value as the displacement measurement result.
[0052] The displacement-digital calibration relationship is a set of mapping parameters pre-established and stored in non-volatile memory through a precise calibration procedure before shipment. During calibration, the electromagnetic induction probe is fixed on a high-precision displacement platform. The platform drives the probe to generate a series of known and precisely measured displacements relative to a standard ferromagnetic material sample, covering the entire design range of the sensor. At each standard displacement point, after the system stabilizes, the digital quantity output by the analog-to-digital converter is recorded, thus obtaining a set of corresponding displacement-digital data pairs. These discrete data points are processed using curve fitting algorithms such as the least squares method to establish a complete calibration curve. The mathematical expression of this curve (such as the parameters of a linear equation or a lookup table) constitutes the final displacement-digital calibration relationship.
[0053] During the actual measurement process, the microprocessor reads the digital value output by the analog-to-digital converter in real time and calls the calibration relationship parameters stored in memory. Depending on the specific form of the calibration relationship, the processor performs corresponding mathematical operations. If the calibration relationship is a linear equation, the digital value is substituted into the equation to directly calculate the real-time displacement value; if the calibration relationship exists in the form of a lookup table, the corresponding displacement value is obtained through table lookup and interpolation algorithms. This calculation process compensates for the effects of inherent nonlinear errors of the sensor, temperature drift, and circuit gain deviations, ultimately outputting a real-time relative displacement value with clear physical meaning and engineering units, as the final result of this measurement.
[0054] Specifically, the output voltage ripple value of the DC voltage signal is no greater than ten millivolts.
[0055] Output voltage ripple mainly originates from residual harmonic components of the high-frequency PWM signal, power supply noise, and external electromagnetic interference. These stray signals are not completely attenuated after passing through a non-ideal filter. To control the ripple amplitude within ten millivolts, precise calculations and simulations of the passive bandpass filter are required during the circuit design phase. Multi-order RC filter networks are typically used to obtain a steeper attenuation slope. The selection of filter component parameters is crucial, requiring comprehensive consideration of cutoff frequency, phase response, and the tolerance and temperature characteristics of the actual components. For example, thin-film resistors with tolerances of one percent or even lower and COG capacitors are selected to ensure consistent and stable filtering performance. Furthermore, strict power supply decoupling and signal isolation measures are implemented during printed circuit board layout to minimize external noise coupling paths, laying a solid hardware foundation for achieving low-ripple output.
[0056] In practical implementation, low ripple output is ensured through a combination of meticulous circuit tuning and compensation measures. Even with theoretically optimized design, parasitic parameters may still cause resonant points or ground interference in the actual circuit. Therefore, during the prototype testing phase, a high-resolution oscilloscope is needed to observe the output voltage waveform, and frequency domain analysis is used to locate the source of the main ripple components. For residual noise at specific frequencies, targeted compensation strategies can be adopted, such as connecting small-capacity ceramic capacitors in parallel at specific nodes of the filter to absorb specific high-frequency noise, or introducing active filtering technology for secondary suppression. Simultaneously, a stable, low-noise linear regulated power supply powers the entire analog circuit, which is a prerequisite for suppressing power supply ripple at its source. Through this systematic design and iterative tuning, it is ensured that the peak value of the final output DC voltage signal ripple is always suppressed below the threshold of ten millivolts throughout the entire operating temperature range and measurement range of the sensor.
[0057] In one specific embodiment of the present invention, two PWM square wave signals with the same frequency are generated by a microcontroller. The frequency range of the PWM square wave signals is 700kHz to 1MHz.
[0058] In this embodiment, the microcontroller acts as the core of signal generation, generating PWM waveforms through its internal high-precision timer unit. Specifically, the timer is configured in PWM output mode, and the frequency and duty cycle of the output waveform are precisely controlled through the coordinated settings of the prescaler and the automatic reload register. To ensure strict synchronization between the two signals, the microcontroller utilizes a master-slave timer architecture or the multi-channel output function of an advanced timer, enabling the two PWM signals to share the same clock reference and counting period. This hardware-level synchronization mechanism fundamentally eliminates phase deviations that may be caused by software delays or interrupt response uncertainties, providing a stable and reliable signal foundation for subsequent phase detection. Simultaneously, the selection of this frequency range fully considers the operating characteristics of the eddy current effect, ensuring both sufficient penetration depth and good displacement response sensitivity.
[0059] In actual configuration, developers set the specific parameters of the PWM by configuring the relevant registers of the microcontroller. Taking the generation of an 800kHz PWM as an example, assuming the microcontroller's main frequency is 72MHz, the target frequency can be accurately calculated by setting the prescaler coefficient and the auto-reload value. The two PWM signals are usually set to the same frequency and initial duty cycle, but their initial phase relationship can be adjusted independently according to actual needs. This purely digital generation method not only ensures signal consistency and stability but also makes online frequency adjustment possible, providing flexibility for the system to adapt to different measurement scenarios. Furthermore, it eliminates the need for external dedicated signal generators, significantly simplifying the system architecture and reducing hardware costs and power consumption.
[0060] like Figure 3As shown, this PWM output mode is implemented based on the specific counting logic of the microcontroller's timer. When the timer is configured in up-counting mode, its counter value increments from zero and is compared in real time with a preset capture / compare register value. During the counting process, if the current counter value is less than the capture / compare register value, the PWM output pin is driven to an active level; once the counter value reaches or exceeds the capture / compare register value, the output immediately switches to an inactive level until the end of the current counting cycle. This counting logic ensures that the active level pulse width of the output signal is precisely proportional to the capture / compare register value within each PWM cycle.
[0061] When the timer operates in down-counting mode, its counter decrements from a preset auto-reload value. In this mode, the output logic complements the up-counting mode: when the counter value is greater than the capture / compare register value, the PWM output remains in an inactive state; when the counter value decrements to be equal to or less than the capture / compare register value, the output switches to an active state. This bidirectional counting mechanism ensures that the active duration of the PWM signal is strictly controlled within the set value of the capture / compare register, regardless of the counting direction, thus generating a square wave signal with a precisely adjustable duty cycle. This stable output characteristic provides the displacement measurement system with a phase-consistent and timing-accurate excitation source and reference signal.
[0062] In addition, displacement measurement methods for ferromagnetic materials based on PWM waves and phase methods also include: Step S101: During the initialization phase, the microcontroller is controlled to output excitation signals sequentially at multiple preset frequency points.
[0063] During sensor power-on initialization, the embedded program controls the microcontroller to sequentially switch the frequency of the output excitation signal within a set operating frequency band of 700kHz to 1MHz, according to a pre-stored frequency parameter table, using fixed step values. The dwell time at each frequency point needs to be carefully set to ensure that subsequent signal acquisition stages can obtain a sufficient number of samples for reliable analysis, while avoiding excessive delays that could affect system startup speed. Frequency switching is achieved by rewriting the values of the microcontroller's timer prescaler register and auto-reload register through software. This purely digital adjustment method ensures the accuracy and repeatability of frequency switching.
[0064] The selection of preset frequency points covers the effective operating frequency band of the sensor, and their distribution density needs to strike a balance between scanning efficiency and frequency search accuracy. For example, in one specific implementation, thirteen discrete test frequency points are generated in 25kHz increments within the range of 700kHz to 1MHz. At each frequency point, the microcontroller, while outputting the excitation signal, ensures that subsequent circuits reach a stable state through internal flags or delay programs, and then triggers the acquisition process of signal stability indicators. This systematic frequency scanning mechanism provides a sufficient data foundation for automatically finding the optimal operating point.
[0065] Step S102: At each preset frequency point, obtain the signal stability index of the displacement measurement results.
[0066] At the current frequency, the electromagnetic induction probe and the ferromagnetic material sample are first kept in a strictly static relative state to eliminate interference from mechanical displacement on signal stability. Then, its analog-to-digital converter is activated to continuously sample the DC voltage signal representing the displacement measurement result at high speed, acquiring a voltage data sequence of a certain time length, containing hundreds to thousands of discrete voltage sampling points. The sampling process must be carried out under the precise control of the microcontroller's timer to ensure the uniformity of the sampling interval, which is crucial for subsequent signal processing.
[0067] After acquiring the voltage sampling sequence, the built-in algorithm immediately calculates the statistical variance of the sequence. The variance is calculated by averaging the squares of the differences between each sample value and the sequence mean. This mathematical quantity effectively characterizes the degree of fluctuation of the DC voltage signal around its mean. The smaller the variance, the more stable the system's output signal is at that specific excitation frequency, and the less affected it is by random noise and interference. This calculated variance value is defined as the signal stability index at the current test frequency point and is temporarily stored in memory, providing a quantitative basis for subsequent frequency decisions.
[0068] Step S103: Compare the signal stability indicators at all preset frequency points, and lock the microcontroller's operating frequency at the frequency point with the optimal signal stability indicators.
[0069] After all preset frequency points have been scanned and stability indexes calculated, the decision-making phase begins. The microprocessor iterates through all frequency points and their corresponding signal stability indices (variance values) stored in memory, executing a comparison algorithm to find the minimum value. The frequency point corresponding to this minimum value is determined as the "optimal frequency point" with the highest signal quality and strongest anti-interference capability under the current environment. The comparison process is based on numerical values to ensure the objectivity and accuracy of the decision.
[0070] After determining the optimal frequency, a new set of parameters is written to the microcontroller's timer control register. This set of parameters uniquely corresponds to the optimal frequency. Once written, the microcontroller will stably output a PWM wave of this specific frequency as a fixed excitation and reference signal in subsequent measurements until the next restart or triggering of a new self-calibration process. This frequency-locking mechanism allows the sensor to automatically adapt to different ferromagnetic material properties, probe installation differences, and changing electromagnetic environments, always maintaining optimal operating conditions. This achieves intelligent performance optimization without manual intervention after the sensor leaves the factory.
[0071] Furthermore, the signal stability index for obtaining the displacement measurement results in step S102 includes: Step S1021: At each preset frequency point, control the electromagnetic induction probe to remain relatively stationary with respect to the ferromagnetic material.
[0072] During frequency scanning, any interference from mechanical displacement on the measurement signal must be eliminated, so that variations in the output signal can be attributed purely to the electromagnetic characteristics and environmental noise at different frequency points. To achieve this, the sensor must be rigidly fixed to the test platform, and the relative position between the probe and the ferromagnetic material sample is locked by a mechanical structure to ensure a constant air gap distance throughout the frequency scan. This mechanical fixation not only eliminates signal fluctuations introduced by displacement changes but also provides a benchmark for assessing the background noise level at each frequency point.
[0073] In addition to mechanical fixation, the testing environment must also be kept stable. Drastic changes in ambient temperature, strong airflow disturbances, and the influence of external vibration sources should be avoided during testing, as these factors may alter the probe's actual position through thermal expansion and contraction or mechanical vibration. In practice, the entire testing system can be placed on a vibration-isolated platform and conducted in a constant-temperature environment. Only under such strictly controlled static conditions can the acquired signal changes truly reflect the system's electromagnetic compatibility characteristics and anti-interference capabilities at different excitation frequencies, providing a reliable basis for subsequent frequency optimization.
[0074] Step S1022: The DC voltage signal is sampled multiple times continuously using the analog-to-digital converter of the microcontroller to obtain a voltage sampling sequence.
[0075] When the system stabilizes at a certain test frequency and the probe is stationary, the microcontroller activates its integrated analog-to-digital converter (ADC). The ADC continuously samples the DC voltage signal output from the signal conditioning circuit according to a preset sampling rate. The sampling rate setting must follow the Nyquist sampling theorem while taking into account the actual bandwidth of the signal; the number of sampling points must be sufficient to ensure the representativeness of the statistical results, typically hundreds to thousands of points are collected to form a complete voltage sampling sequence.
[0076] During sampling, the microcontroller's direct memory access controller (DMI) can be used to achieve efficient data transfer between the ADC and memory without frequent CPU intervention. This ensures the accuracy and consistency of the sampling time interval and avoids sampling jitter caused by software delays. The entire sampling sequence should be captured within a short time to ensure that all data points reflect the system's performance under the same transient conditions. The obtained voltage sampling sequence is sequentially stored in the microcontroller's memory buffer, preparing the raw dataset for subsequent variance calculation. The accuracy of this sequence directly depends on the ADC's resolution and the stability of the reference voltage.
[0077] Step S1023: Calculate the statistical variance of the voltage sampling sequence and use the statistical variance as the signal stability index at the current preset frequency point. The smaller the statistical variance, the better the signal stability index.
[0078] The system program reads the voltage sampling sequence stored in the buffer. First, it calculates the arithmetic mean of the sequence, which represents the DC bias level of the output signal at that frequency. Then, the program iterates through each sample value in the sequence, calculates the square of the difference between it and the mean, sums all these squared values, and takes the average to finally obtain the statistical variance of the voltage sequence.
[0079] Variance, in probability theory, is a measure of how much a random variable deviates from its mathematical expectation. In this application, it precisely quantifies the intensity of fluctuations in a DC voltage signal around its average level. A small variance value indicates that the output voltage is highly concentrated around the mean, with minimal signal ripple and random noise, resulting in high stability. Conversely, a large variance value indicates severe signal fluctuations and poor stability. Therefore, variance is used as an objective and quantifiable stability indicator to evaluate signal quality at each frequency point, and subsequent frequency decisions are made following the principle that "the smaller the variance, the better the stability." This statistically based evaluation method provides a rigorous scientific basis for adaptive frequency selection.
[0080] Accordingly, please refer to Figure 4 A second aspect of the present invention provides a displacement measurement device for ferromagnetic materials based on PWM wave and phase method. The device measures the relative displacement between an electromagnetic induction probe and the ferromagnetic material using the aforementioned displacement measurement method based on PWM wave and phase method, including: Square wave signal generation module 1 is used to generate two PWM square wave signals with the same frequency, wherein the first PWM square wave signal is used as the excitation signal and the second PWM square wave signal is used as the reference signal. The induction signal acquisition module 2 is used to apply an excitation signal to the electromagnetic induction probe and, based on the relative displacement between the electromagnetic induction probe and the ferromagnetic material, acquire the induction signal output by the electromagnetic induction probe whose phase changes with the relative displacement. The induction signal conversion module 3 is used to convert the induction signal into a third PWM square wave signal, the phase of which is related to the phase of the induction signal. Square wave signal processing module 4 is used to perform a logical AND operation between the third PWM square wave signal and the reference signal to generate a pulse signal. The duty cycle of the pulse signal changes with the relative displacement. The displacement result calculation module 5 is used to filter the pulse signal to obtain displacement measurement results that are proportional to the relative displacement.
[0081] Accordingly, a third aspect of the present invention provides an electronic device, comprising: at least one processor; and a memory connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to cause the at least one processor to perform the above-described method for measuring displacement of ferromagnetic materials based on PWM wave and phase method.
[0082] Accordingly, a fourth aspect of the present invention provides a computer-readable storage medium having computer instructions stored thereon, which, when executed by a processor, implement the above-described method for measuring displacement of ferromagnetic materials based on PWM wave and phase method.
[0083] The embodiments of the present invention aim to protect a method and apparatus for measuring the displacement of ferromagnetic materials based on PWM wave and phase method, which has the following effects: 1. By using a microcontroller to directly generate high-frequency PWM waves as excitation and reference signals, and combining them with subsequent digital logic circuits for processing, a highly integrated hardware solution was constructed. Replacing traditional analog oscillation circuits or dedicated DDS chips with a digital signal source not only ensures the purity and stability of the excitation signal from the source, but also significantly simplifies the system architecture. This effectively overcomes the problem of decreased measurement accuracy caused by temperature drift and noise in traditional sensors, thus enabling stable and reliable displacement measurement results even in complex electromagnetic environments. 2. Based on the phase-duty cycle conversion mechanism of "logical AND operation" and combined with the adaptive frequency tuning method, high-precision tracking of hysteresis effect and dynamic displacement of ferromagnetic materials is achieved; the analog phase change, which is difficult to measure directly, is converted into the digital pulse width change, which is easy to measure accurately; and by selecting the optimal operating frequency in real time, the material characteristic noise and the real displacement signal are effectively distinguished; the sensor can respond quickly and maintain extremely high linear measurement accuracy when facing ferromagnetic materials with high-speed movement or variable magnetic properties. 3. By optimizing the hardware structure, adopting a non-contact eddy current probe and a highly integrated signal processing circuit, and introducing system self-calibration and adaptive functions, the system significantly reduces manufacturing and maintenance costs while improving performance. It also reduces reliance on precision optical components, complex shielding structures, or high-cost processing chips. Its "calibration-free" design also reduces the difficulty and frequency of on-site installation and debugging. Based on achieving excellent measurement performance, it achieves a comprehensive technical effect of high reliability, long life and low total cost of ownership, laying the foundation for large-scale industrial applications.
[0084] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0085] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0086] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0087] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1The steps of the function specified in one or more boxes.
[0088] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit it. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that modifications or equivalent substitutions can still be made to the specific implementation of the present invention. Any modifications or equivalent substitutions that do not depart from the spirit and scope of the present invention should be covered within the scope of protection of the claims of the present invention.
Claims
1. A method for measuring displacement of ferromagnetic material based on PWM wave and phase method, characterized in that, The method comprises the following steps: generating two same-frequency PWM square wave signals, wherein the first PWM square wave signal is used as an excitation signal, and the second PWM square wave signal is used as a reference signal; applying the excitation signal to an electromagnetic induction probe, and obtaining an induction signal in which the phase of an output signal of the electromagnetic induction probe changes with the relative displacement between the electromagnetic induction probe and the ferromagnetic material based on the relative displacement between the electromagnetic induction probe and the ferromagnetic material; converting the induction signal into a third PWM square wave signal, wherein the phase of the third PWM square wave signal is related to the phase of the induction signal; performing logical AND operation on the third PWM square wave signal and the reference signal to generate a pulse signal, wherein the duty cycle of the pulse signal changes with the relative displacement; filtering the pulse signal to obtain a displacement measurement result proportional to the relative displacement.
2. The method of claim 1, wherein the method is a method of measuring displacement of a ferromagnetic material based on a PWM wave and a phase method. The method further comprises the following steps: connecting the induction signal to a first input end of a comparator, and connecting a reference voltage to a second input end of the comparator; comparing the instantaneous voltage value of the induction signal with the voltage value of the reference voltage in real time based on the comparator; outputting a high level when the instantaneous voltage value is higher than the voltage value of the reference voltage, and outputting a low level when the instantaneous voltage value is lower than the voltage value of the reference voltage, thereby obtaining a third PWM square wave signal with the same frequency and phase as the induction signal.
3. The method of claim 1, wherein the method is based on a PWM wave and a phase method. The method further comprises the following steps: inputting the pulse signal into a voltage follower of a signal conditioning circuit, and transmitting the signal after impedance conversion of the voltage follower to a passive band-pass filter; performing frequency domain processing on the received signal based on the passive band-pass filter, filtering out high-frequency harmonic components and low-frequency environmental noise components in the signal, and outputting a direct current voltage signal, wherein the voltage value of the direct current voltage signal is linearly proportional to the relative displacement; connecting the direct current voltage signal to an analog-to-digital converter, converting the direct current voltage signal into a digital quantity by the analog-to-digital converter, and taking the digital quantity as the displacement measurement result.
4. The method of claim 3, wherein the PWM wave and phase method-based ferromagnetic material displacement measurement method is characterized by, The method further comprises the following steps: obtaining the real-time relative displacement value between the electromagnetic induction probe and the ferromagnetic material corresponding to the digital quantity according to the displacement-digital quantity calibration relationship, and taking the real-time relative displacement value as the displacement measurement result.
5. The ferromagnetic material displacement measurement method based on PWM wave and phase method according to claim 3, wherein the output voltage ripple value of the direct current voltage signal is not greater than 10 mV.
6. The ferromagnetic material displacement measurement method based on PWM wave and phase method according to any one of claims 1-5, wherein the two same-frequency PWM square wave signals are generated by a single-chip microcomputer; the frequency range of the PWM square wave signal is 700 kHz-1 MHz.
7. The method of claim 6, wherein the method is based on a PWM wave and a phase method. The method further comprises the following steps: During a system initialization phase, the single-chip microcomputer is controlled to output the excitation signal at a plurality of preset frequency points in turn; At each preset frequency point, a signal stability index of the displacement measurement result is obtained; The signal stability indexes at all preset frequency points are compared, and the working frequency of the single-chip microcomputer is locked at the frequency point with the optimal signal stability index.
8. The method of claim 7, wherein the method is based on a PWM wave and a phase method. The signal stability index of the displacement measurement result is obtained by: At each preset frequency point, the electromagnetic induction probe and the ferromagnetic material are controlled to be relatively stationary; The direct-current voltage signal is continuously sampled multiple times by an analog-to-digital converter of the single-chip microcomputer to obtain a voltage sampling sequence; The statistical variance value of the voltage sampling sequence is calculated, and the statistical variance value is taken as the signal stability index at the current preset frequency point; The smaller the statistical variance value is, the better the signal stability index is.
9. The ferromagnetic material displacement measurement method based on a PWM wave and a phase method according to claim 8, characterized in that: The plurality of preset frequency points are distributed in an equal step manner in a frequency range of 700 kHz to 1 MHz; The frequency difference between two adjacent preset frequency points is a fixed step value.
10. A ferromagnetic material displacement measuring device based on PWM wave and phase method, characterized in that, The ferromagnetic material displacement measurement method based on a PWM wave and a phase method according to any one of claims 1 to 9 is used to measure the relative displacement between an electromagnetic induction probe and a ferromagnetic material, and includes: A square wave signal generation module for generating two PWM square wave signals with the same frequency, wherein the first PWM square wave signal is used as an excitation signal, and the second PWM square wave signal is used as a reference signal; An induction signal acquisition module for applying the excitation signal to an electromagnetic induction probe, and acquiring an induction signal output by the electromagnetic induction probe based on the relative displacement between the electromagnetic induction probe and a ferromagnetic material, wherein the phase of the induction signal changes with the relative displacement; An induction signal conversion module for converting the induction signal into a third PWM square wave signal, wherein the phase of the third PWM square wave signal is related to the phase of the induction signal; A square wave signal operation module for performing a logic AND operation on the third PWM square wave signal and the reference signal to generate a pulse signal, wherein the duty cycle of the pulse signal changes with the relative displacement; A displacement result calculation module for performing filtering processing on the pulse signal to obtain a displacement measurement result proportional to the relative displacement.
