A kind of eddy current displacement measurement device and method based on loongson microcontroller
The fully digital eddy current displacement measurement device based on Loongson microcontroller solves the problem of large size of existing eddy current displacement measurement equipment, and realizes miniaturized and digital eddy current displacement measurement.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- HOHAI UNIV
- Filing Date
- 2023-08-15
- Publication Date
- 2026-07-21
AI Technical Summary
Existing eddy current displacement measurement technology requires complex analog circuit processing, resulting in large sensor size and difficulty in miniaturization.
Employing a fully digital approach based on a Loongson microcontroller, an eddy current displacement measurement device is constructed using a direct digital frequency synthesizer, a digital phase comparator, a low-pass filter, resistors, a planar eddy current displacement measurement coil, and capacitors to achieve fully digital impedance measurement.
It realizes the digitization and miniaturization of eddy current displacement measurement, simplifies the measurement circuit, and reduces the size of the equipment.
Smart Images

Figure CN116793201B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of displacement measurement technology, specifically relating to an eddy current displacement measurement device and method based on a Loongson microcontroller. Background Technology
[0002] A coil driven by an alternating current generates an alternating magnetic field. When the coil approaches a conductor metal, an alternating current is induced in the metal. The alternating magnetic field generated by the induced alternating current opposes the coil's magnetic field, thus causing a change in the coil's impedance. The magnitude of this impedance change depends on the resistivity and permeability of the conductor metal, the frequency of the alternating current, and the distance between them (also known as the lift-off distance). When factors other than distance remain constant, the lift-off distance can be obtained from the impedance change, thus enabling distance measurement. Traditional eddy current displacement measurement coils are typically made of tightly wound wire. In recent years, planar eddy current coils on printed circuit boards (PCBs) have also been widely used. Regardless of whether the coil is wound or planar, its impedance value needs to be obtained by a subsequent processing unit after fabrication. Impedance measurement methods include the bridge method and the resonance method. Commercial eddy current sensors typically consist of an eddy current coil probe and a preamplifier. The preamplifier uses the bridge measurement principle to measure the impedance of the eddy current coil probe, and these sensors are generally quite large. Texas Instruments (TI) has implemented impedance processing in its dedicated inductance measurement chips, such as the LDC1001 and LDC1614. The principle involves using a capacitor and eddy current coil to form an oscillator to generate an oscillation signal, and then calculating the inductance by measuring the frequency of the oscillation signal. These methods all require relatively complex analog circuitry. Summary of the Invention
[0003] The purpose of this invention is to provide an eddy current displacement measurement device and method based on a Loongson microcontroller, which realizes eddy current impedance measurement in a fully digital manner, thereby achieving displacement measurement.
[0004] To achieve the above objectives, the technical solution adopted by the present invention is as follows:
[0005] This invention provides an eddy current displacement measurement device based on a Loongson microcontroller, comprising a microcontroller, a direct digital frequency synthesizer, a digital phase comparator, a low-pass filter, a resistor, a planar eddy current displacement measurement coil, a capacitor, and a clock unit;
[0006] The planar eddy current displacement measuring coil is connected in parallel with a capacitor, with one end grounded and the other end connected in series with the resistor.
[0007] The input terminal of the direct digital frequency synthesizer is connected to the microcontroller, and the output terminal of the direct digital frequency synthesizer is connected to the input terminal of the low-pass filter.
[0008] The output terminal of the low-pass filter is connected to one end of the resistor, and the output terminal of the low-pass filter is also connected to the first input terminal of the digital phase comparator;
[0009] The other end of the resistor is connected to the second input terminal of the digital phase comparator;
[0010] The output of the digital phase comparator is connected to the microcontroller;
[0011] The clock unit is connected to the direct digital frequency synthesizer and the microcontroller;
[0012] The microcontroller is used to control the input of the direct digital frequency synthesizer and acquire the output of the digital phase comparator, and to estimate the resonant frequency of the planar eddy current displacement measurement coil and the capacitor based on the input and output; and to calculate the displacement of the target conductor based on the resonant frequency.
[0013] Furthermore, the direct digital frequency synthesizer outputs a square wave signal with an adjustable frequency, and the low-pass filter is used to filter the square wave signal to obtain a sine wave.
[0014] Furthermore, the clock unit has two branches: one branch provides the operating clock for the direct digital frequency synthesizer, and the other branch provides the operating clock for the control.
[0015] Furthermore, the digital phase comparator is composed of a phase frequency detector and an RS flip-flop; both ends of the resistor are connected to the phase frequency detector to generate UP and DOWN signals; the UP signal is connected to the reset terminal R of the RS flip-flop, and the DOWN signal is connected to the S terminal of the RS flip-flop.
[0016] Furthermore, the direct digital frequency synthesizer consists of a phase accumulator and a sine table.
[0017] Furthermore, the clock unit is composed of a crystal oscillator and a frequency divider;
[0018] The frequency divider consists of a set of triggers. The frequency divider is used to divide the clock signal generated by the crystal oscillator and supply it to the direct digital frequency synthesizer and the Loongson microcontroller respectively.
[0019] Furthermore, the microcontroller is a Loongson microcontroller.
[0020] This invention also provides a displacement measurement method for an eddy current displacement measuring device based on a Loongson microcontroller, comprising:
[0021] S1: Estimate the resonant frequency f0 based on the inductor design value L and the nominal capacitor C;
[0022] S2: Set initial frequencies f1, f2 and error threshold Δf, where f1 is a value less than f0 and f2 is a value greater than f0;
[0023] S3: Place the target conductor at a distance d from the planar eddy current displacement measuring coil;
[0024] S4: Set the output frequency of the direct digital frequency synthesizer to f1, and calculate the input control word of the direct digital frequency synthesizer according to the following formula, denoted as X. f1 And input to a direct digital frequency synthesizer;
[0025] f = X f *f clk / 2 M ;
[0026] Where f represents the output frequency of the direct digital frequency synthesizer, and X f This represents the input control word for the direct digital frequency synthesizer, f. clk Here, M represents the frequency of the direct digital frequency synthesizer, and M represents the number of bits in the phase accumulator inside the direct digital frequency synthesizer.
[0027] Read the result P1 from the digital phase comparator. P1 should satisfy P1 = 1.
[0028] Initially, f1 takes the value f1;
[0029] S5: Set the direct digital frequency synthesizer output frequency to f2, and calculate the input control word X. f2 The result P2 from the digital phase comparator is read and input to the direct digital frequency synthesizer; P2 should satisfy P2 = 0.
[0030] Initially, f2 takes the value f2;
[0031] S6: Set the output frequency of the direct digital frequency synthesizer to f3, where f3 = 0.5(f1 + f2), and calculate the input control word X. f3 And input it to the direct digital frequency synthesizer; read the result P3 of the digital phase comparator;
[0032] If P3 = 1, then let f1 = f3 and proceed to S7; if P3 = 0, then let f2 = f3 and proceed to S7.
[0033] S7: If f2-f1>Δf, then go to S6; if f2-f1<Δf, the resonant frequency fx=f2 is obtained;
[0034] S8: Obtain the current displacement d based on the pre-calibrated relationship curve between the resonant frequency fx and the displacement d;
[0035] The calibration method for the relationship curve between the resonant frequency fx and the displacement d is as follows:
[0036] Impedance-displacement curves are obtained by measuring the impedance at different displacements.
[0037] The impedance-displacement curve is converted based on the relationship between resonant frequency and impedance to obtain the resonant frequency-displacement curve.
[0038] Furthermore, f1 = 0.95f0 and f2 = 1.5f0.
[0039] The beneficial effects of this invention are:
[0040] This invention provides an eddy current displacement measurement device based on a Loongson microcontroller. It realizes eddy current impedance measurement in a fully digital manner, thereby achieving displacement measurement. The measurement circuit and microcontroller can be integrated on a general-purpose programmable logic device, realizing miniaturized or even micronized eddy current displacement measurement. Attached Figure Description
[0041] Figure 1 A schematic diagram of the coil structure and measurement principle for planar eddy current displacement measurement;
[0042] Figure 2 The structural diagram of the eddy current displacement measuring device provided by the present invention;
[0043] Figure 3 The present invention provides a structure for an eddy current displacement measurement device based on a Loongson microcontroller in one embodiment of the present invention. Detailed Implementation
[0044] The present invention will now be further described. The following embodiments are only used to more clearly illustrate the technical solution of the present invention, and should not be used to limit the scope of protection of the present invention.
[0045] The structure and measurement principle of the planar eddy current displacement measuring coil are as follows: Figure 1 As shown, there are N concentric spirals on a plane, each with a radius of r. i Line width W i A current of the same magnitude flows through it, in either clockwise or counterclockwise direction. Its free-space impedance Z0 is expressed as:
[0046]
[0047] Among them, D k =s k r k J1(ar k ), s k The direction of the current in the k-th segment of the spiral is represented by s, clockwise. k =1, counterclockwise is s k=-1, J1(·) is a first-order Bessel function of the first kind, j is the imaginary unit, ω is the operating angular frequency, and μ is the permeability. Theoretically, Z0 is a purely imaginary number with only a reactance component, i.e., Z0 = jX0 = jωL0.
[0048] When a planar conductor with conductivity σ and permeability μ approaches a coil, an eddy current effect is generated, causing a change in the coil's impedance. When the displacement between the coil and the conductor is d, the change in the coil's impedance is ΔZ. The impedance of the coil under the influence of eddy currents becomes Z = Z0 + ΔZ, where ΔZ is expressed as:
[0049]
[0050] in,
[0051]
[0052] The displacement d of the target conductor and coil can be obtained by measuring either the real part R or the imaginary part X of the impedance Z. The key to eddy current displacement measurement is impedance measurement. Generally, the rate of change of the imaginary part X of the impedance is greater than the rate of change of the real part R, and the displacement d can be obtained by measuring X.
[0053] Based on the aforementioned planar eddy current displacement measuring coil, this invention provides an eddy current displacement measuring device, see [link to relevant documentation]. Figure 2 It includes a microcontroller, a direct digital frequency synthesizer, a digital phase comparator, a low-pass filter, a resistor R, a planar eddy current displacement measurement coil L, a capacitor C, and a clock unit.
[0054] Specifically, the planar eddy current displacement measuring coil L is connected in parallel with the capacitor C, with one end grounded and the other end connected in series with the resistor R.
[0055] The input of the direct digital frequency synthesizer is connected to a microcontroller, and the input value is controlled by the microcontroller. The output of the direct digital frequency synthesizer is connected to the input of a low-pass filter. The direct digital frequency synthesizer outputs a square wave signal with an adjustable frequency, which is filtered out by the low-pass filter to obtain a sine wave.
[0056] The output of the low-pass filter is connected to one end of the resistor R, and the output of the low-pass filter is also connected to the first input of the digital phase comparator.
[0057] The other end of resistor R is connected to the second input of the digital phase comparator. The digital phase comparator output logic '0' indicates that the phase of its second input lags behind its first input, and output logic '1' indicates that the phase of its second input leads its first input.
[0058] The output of the digital phase comparator is connected to the microcontroller and is sensed by the microcontroller.
[0059] The direct digital frequency synthesizer's operating clock is provided by one branch of the clock unit at a frequency of fclk. The microcontroller's operating clock is provided by another branch of the clock unit, and can be different from the frequency fclk.
[0060] The direct digital frequency synthesizer has an internal phase accumulator with M bits, an input value of X, and an output square wave signal frequency of f = X. f *fclk / 2 M .
[0061] Specifically, the microcontroller is used to measure the actual resonant frequency of the LC using the bisection method, and then calculate the displacement of the target conductor.
[0062] The measurement principle is as follows:
[0063] The square wave signal of the direct digital frequency synthesizer gradually increases from a frequency f1 (e.g., f1 = 0.95f0) below f0 to f0. At this point, the parallel LC circuit exhibits inductive behavior, and the signal phase at the second input of the digital phase comparator initially leads the first input, with the phase difference gradually decreasing until it reaches zero at a certain frequency (the actual resonant frequency of the LC circuit). Continuing to increase the frequency to f2 (e.g., f2 = 1.05f0) above f0, the parallel LC circuit exhibits capacitive behavior, and the signal phase at the second input of the digital phase comparator lags the first input, with the phase difference gradually increasing. The resonant frequency is then measured using this phase relationship.
[0064] Based on the above-mentioned eddy current displacement measuring device, the present invention provides an eddy current displacement measuring method based on a Loongson microcontroller, as follows:
[0065] Step 1: Estimate the resonant frequency f0 based on the design inductor value L and the nominal capacitor C.
[0066]
[0067] Step 2: Set the initial frequencies f1, f2 and error threshold Δf; where f1 is a value less than f0 and f2 is a value greater than f0; it should be noted that Δf is a preset value, which is the allowable error limit;
[0068] Step 3: Place the target conductor at a distance d from the planar eddy current displacement measuring coil;
[0069] Step 4: Set the output frequency of the direct digital frequency synthesizer to f1, and calculate the input control word of the direct digital frequency synthesizer according to the following formula, denoted as X. f1 And input to a direct digital frequency synthesizer;
[0070] f = X f *f clk / 2 M ;
[0071] Where f represents the output frequency of the direct digital frequency synthesizer, and X f This represents the input control word for the direct digital frequency synthesizer, f. clk Here, M represents the frequency of the direct digital frequency synthesizer, and M represents the number of bits in the phase accumulator inside the direct digital frequency synthesizer.
[0072] Read the result P1 from the digital phase comparator;
[0073] It should be noted that initially, f1 takes the value f1, and initially P1 should satisfy P1 = 1;
[0074] Step 5: Set the output frequency of the direct digital frequency synthesizer to f2, and calculate its input control word X as described above. f2 And input to a direct digital frequency synthesizer;
[0075] Read the result P2 from the digital phase comparator;
[0076] It should be noted that initially, f2 takes the value f2, and initially P2 should satisfy P2 = 0;
[0077] Step 6: Set the output frequency of the direct digital frequency synthesizer to f3 = 0.5(f1 + f2), and calculate its input control word X as described above. f3 And input to a direct digital frequency synthesizer;
[0078] Read the result P3 from the digital phase comparator.
[0079] If P3 = 1, then let f1 = f3 and proceed to step 7; if P3 = 0, then let f2 = f3 and proceed to step 7.
[0080] Step 7: If f2-f1>Δf, then go to step 6; if f2-f1<Δf, stop the bisection method measurement and obtain the actual resonant frequency fx=f2.
[0081] Step 8: Obtain the current displacement d based on the pre-obtained relationship curve between fx and displacement d.
[0082] It should be noted that the resonant frequency-displacement curve is obtained beforehand, and the calibration process is as follows:
[0083] Impedance-displacement curves are obtained by measuring the impedance at different displacements.
[0084] Based on the relationship between resonant frequency and impedance The impedance-displacement curve is converted to obtain the resonant frequency-displacement curve.
[0085] Preferably, f1 = 0.95f0 and f2 = 1.5f0.
[0086] In one embodiment of the present invention, an eddy current displacement measurement device based on a Loongson microcontroller is provided, comprising a microcontroller, a direct digital frequency synthesizer, a digital phase comparator, a low-pass filter, a resistor R, a planar eddy current displacement measurement coil L, a capacitor C, and a clock unit, wherein the connection relationship of each component is as follows: Figure 2 The same eddy current displacement measuring device is used.
[0087] See Figure 3 In this embodiment, the direct digital frequency synthesizer consists of a phase accumulator and a sine table.
[0088] A digital phase comparator consists of a phase-frequency detector (PFD) and an RS flip-flop.
[0089] The microcontroller uses Loongson 1C103.
[0090] The clock unit consists of a crystal oscillator and a frequency divider.
[0091] The frequency divider consists of a set of flip-flops that divide the clock signal generated by the crystal oscillator and supply it to the direct digital frequency synthesizer and Loongson microcontroller.
[0092] In this embodiment, the frequency divider, Loongson microcontroller, direct digital frequency synthesizer, and digital phase comparator are all integrated into a single logic device.
[0093] Preferably, the crystal oscillator frequency is 80MHz, and the frequency divider provides 40MHz and 8MHz, which are respectively supplied to the direct digital frequency synthesizer and the Loongson microcontroller.
[0094] In this embodiment, the Loongson microcontroller writes a frequency controller to the phase accumulator, stores the digitized sine waveform in the sine table, takes the highest bit and outputs it, and obtains a sine wave of the same frequency through a low-pass filter.
[0095] The signal across the resistor is sent to the phase frequency detector, generating UP / DOWN signals. The UP signal is connected to the reset terminal R of the RS flip-flop, and the DOWN signal is connected to the S terminal of the RS flip-flop. When the first input terminal of the phase frequency detector leads the second input terminal, the RS flip-flop outputs 0; when the first input terminal of the phase frequency detector lags the second input terminal, the RS flip-flop outputs 1.
[0096] The Loongson microcontroller senses the output of the digital phase comparator and measures the actual resonant frequency of the LC according to the above-mentioned binary division method, thereby realizing the measurement of displacement d.
[0097] The above description is only a preferred embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.
Claims
1. An eddy current displacement measuring device based on a Loongson microcontroller, characterized in that, Includes a microcontroller, a direct digital frequency synthesizer, a digital phase comparator, a low-pass filter, resistors, a planar eddy current displacement measurement coil, capacitors, and a clock unit; The planar eddy current displacement measuring coil is connected in parallel with a capacitor, with one end grounded and the other end connected in series with the resistor. The input terminal of the direct digital frequency synthesizer is connected to the microcontroller, and the output terminal of the direct digital frequency synthesizer is connected to the input terminal of the low-pass filter. The output terminal of the low-pass filter is connected to one end of the resistor, and the output terminal of the low-pass filter is also connected to the first input terminal of the digital phase comparator; The other end of the resistor is connected to the second input terminal of the digital phase comparator; The output of the digital phase comparator is connected to the microcontroller; The clock unit is connected to the direct digital frequency synthesizer and the microcontroller; The microcontroller is used to control the input of the direct digital frequency synthesizer and acquire the output of the digital phase comparator, and to estimate the resonant frequency of the planar eddy current displacement measurement coil and the capacitor based on the input and output; and to calculate the displacement of the target conductor based on the resonant frequency.
2. The eddy current displacement measuring device based on a Loongson microcontroller according to claim 1, characterized in that, The direct digital frequency synthesizer outputs a square wave signal with an adjustable frequency, and the low-pass filter is used to filter the square wave signal to obtain a sine wave.
3. The eddy current displacement measuring device based on a Loongson microcontroller according to claim 1, characterized in that, The clock unit has two branches: one branch provides the operating clock for the direct digital frequency synthesizer, and the other branch provides the operating clock for the control.
4. The eddy current displacement measuring device based on a Loongson microcontroller according to claim 1, characterized in that, The digital phase comparator consists of a phase frequency detector and an RS flip-flop; both ends of the resistor are connected to the phase frequency detector to generate UP and DOWN signals; the UP signal is connected to the reset terminal R of the RS flip-flop, and the DOWN signal is connected to the S terminal of the RS flip-flop.
5. The eddy current displacement measuring device based on a Loongson microcontroller according to claim 1, characterized in that, The direct digital frequency synthesizer consists of a phase accumulator and a sine table.
6. The eddy current displacement measuring device based on a Loongson microcontroller according to claim 1, characterized in that, The clock unit is composed of a crystal oscillator and a frequency divider; The frequency divider consists of a set of triggers. The frequency divider is used to divide the clock signal generated by the crystal oscillator and supply it to the direct digital frequency synthesizer and the Loongson microcontroller respectively.
7. An eddy current displacement measuring device based on a Loongson microcontroller according to any one of claims 1 to 6, characterized in that, The microcontroller used is a Loongson microcontroller.
8. A displacement measurement method based on the eddy current displacement measuring device based on a Loongson microcontroller as described in any one of claims 1 to 7, characterized in that: include: S1: Estimate the resonant frequency f0 based on the inductor design value L and the nominal capacitor C; S2: Set initial frequencies f1, f2 and error threshold Δf, where f1 is a value less than f0 and f2 is a value greater than f0; S3: Place the target conductor at a distance d from the planar eddy current displacement measuring coil; S4: Set the output frequency of the direct digital frequency synthesizer to f1, and calculate the input control word of the direct digital frequency synthesizer according to the following formula, denoted as X. f1 And input to a direct digital frequency synthesizer; f=X f *f clk / 2 M ; Where f represents the output frequency of the direct digital frequency synthesizer, and X f This represents the input control word for the direct digital frequency synthesizer, f. clk Here, M represents the frequency of the direct digital frequency synthesizer, and M represents the number of bits in the phase accumulator inside the direct digital frequency synthesizer. Read the result P1 from the digital phase comparator. P1 should satisfy P1 = 1. Initially, f1 takes the value f1; S5: Set the direct digital frequency synthesizer output frequency to f2, and calculate the input control word X. f2 The result P2 from the digital phase comparator is read and input to the direct digital frequency synthesizer; P2 should satisfy P2 = 0. Initially, f2 takes the value f2; S6: Set the output frequency of the direct digital frequency synthesizer to f3, where f3 = 0.5(f1 + f2), and calculate the input control word X. f3 And input it to the direct digital frequency synthesizer; read the result P3 of the digital phase comparator; If P3 = 1, then let f1 = f3 and proceed to S7; if P3 = 0, then let f2 = f3 and proceed to S7. S7: If f2-f1>Δf, then go to S6; if f2-f1<Δf, the resonant frequency fx=f2 is obtained; S8: Obtain the current displacement d based on the pre-calibrated relationship curve between the resonant frequency fx and the displacement d; The calibration method for the relationship curve between the resonant frequency fx and the displacement d is as follows: Impedance-displacement curves are obtained by measuring the impedance at different displacements. The impedance-displacement curve is converted based on the relationship between resonant frequency and impedance to obtain the resonant frequency-displacement curve.
9. The displacement measurement method according to claim 8, characterized in that, The values are f1 = 0.95f0 and f2 = 1.5f0.