A phase feedback based electromagnetic flowmeter frequency tracking method
By detecting the phase angle change of the excitation current through phase feedback, the excitation frequency is adjusted to maintain the resonant state, thus solving the problem of resonant frequency drift in high-frequency electromagnetic flowmeters and achieving accuracy and stability in frequency tracking.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- HEFEI UNIV OF TECH
- Filing Date
- 2023-08-18
- Publication Date
- 2026-07-21
AI Technical Summary
Existing methods for tracking the excitation frequency of high-frequency electromagnetic flowmeters are affected by external factors such as temperature and humidity, which causes the resonant frequency to drift. Furthermore, existing methods are cumbersome and difficult to accurately lock the resonant frequency.
The frequency tracking method of high-frequency electromagnetic flowmeter with phase feedback is adopted. The state of excitation circuit is determined by detecting the phase angle change of excitation current, and resonance is maintained by adjusting the excitation frequency. Bandpass filtering and zero-crossing detection are used to simplify the frequency tracking process.
Automatic frequency tracking of the excitation circuit is achieved, which reduces excitation system losses, ensures that the excitation current is always at its maximum value, and improves the accuracy and stability of frequency tracking.
Smart Images

Figure CN117091676B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of flow detection technology, and more specifically, relates to an excitation frequency tracking method based on a high-frequency sinusoidal excitation electromagnetic flowmeter. Background Technology
[0002] An electromagnetic flowmeter is an instrument that measures the volumetric flow rate of conductive liquids based on Faraday's law of electromagnetic induction. It consists of two parts: a sensor (primary instrument) and a transmitter (secondary instrument). Its working principle is as follows: when an excitation coil is energized, a magnetic field is generated within the pipe. The conductive liquid flows through the pipe, cutting through the magnetic field lines; the pipe diameter is the length of the magnetic field lines cut by the conductor. A pair of parallel electrodes are installed in the pipe perpendicular to both the magnetic field direction and the direction of the liquid flow. The sensor's two electrodes then pick up the induced electromotive force, and combined with the instrument coefficient, the instantaneous and cumulative flow rates can be calculated. Due to its simple structure, corrosion resistance, and reliable performance, it is widely used in process control and flow measurement.
[0003] The excitation technology of an electromagnetic flowmeter determines the characteristics of the sensor's working magnetic field and its detection accuracy. Generally, electromagnetic flowmeters can be divided into two types based on the excitation current: rectangular wave and sinusoidal wave. For rectangular wave excitation, significant differential interference occurs when the magnetic field direction changes, thus requiring sampling and demodulation of the flow signal during the stable phase of the excitation current. However, since the excitation coil is an inductive load, the excitation current requires 3τ to 5τ to reach a stable phase during rise or fall. As the excitation frequency increases, the duration of each excitation current cycle decreases, making signal extraction during the stable phase more difficult. Therefore, the increase in excitation frequency for rectangular wave excitation is limited. Furthermore, electrode-type electromagnetic flowmeters generate random interference with a frequency domain 1 / f distribution, i.e., slurry noise, when measuring two-phase conductive fluids such as slurries. The frequency component of slurry noise decreases with increasing frequency. Therefore, high-frequency excitation can reduce the slurry noise component superimposed on the flow signal. Therefore, the excitation frequency of rectangular wave excitation can be increased in a limited way, which is not conducive to suppressing slurry noise interference; while sinusoidal wave excitation does not require the extraction of flow signals during the steady section. Therefore, when performing slurry measurement, the excitation frequency can be appropriately increased to improve the signal-to-noise ratio and suppress the influence of slurry interference.
[0004] In the existing literature "Excitation Control System for Electromagnetic Flowmeter Based on Series Resonance" (Liang Liping, Chinese Invention Patent, Publication No. CN111351536A), the excitation control system uses a DDS circuit to output a frequency-adjustable sinusoidal signal, which is then converted into a stable sinusoidal constant current source through an amplification and filtering circuit and a Howland voltage-to-current converter circuit. This source drives a resonant excitation circuit composed of an excitation coil and a resonant capacitor. However, this method suffers from frequency drift because the resonant capacitor in the excitation circuit is easily affected by external factors such as temperature and humidity, causing changes in capacitance. In the literature "A Frequency Locking Method for a High-Frequency Ultrasonic Transducer" (Liu Yufei, Chinese Invention Patent, Publication No. CN109365250B), the voltage and current signals of the load are sampled and mixed, then low-pass filtered to obtain a low-frequency DC signal. The low-frequency DC component is then converted to an AD converter and the phase difference is obtained using median averaging filtering. Finally, a large and small step search method is used to track and lock the frequency. The resonant frequency tracking method described above is quite cumbersome and requires sampling both load voltage and current signals. Since the sampling circuits for these two signals are different, it's difficult to ensure that the phase difference between the load voltage and current remains constant during sampling, leading to some error. In the literature "A Digital Ultrasonic Generator and Its Automatic Frequency Locking Method" (Chen Jianfeng, Chinese Invention Patent, Publication No. CN 106423808A), the driving circuit drives the transducer via a high-frequency inverter circuit. Then, the load voltage and current signals are fed into a multiplier. After low-pass filtering to remove high-frequency signals, the DC signal is processed with an inverse cosine to obtain the phase difference. Finally, the phase difference is used to determine whether the resonant frequency has been reached. This method requires voltage and current isolation circuits for sampling, which makes it difficult to ensure the waveform of the original signal remains unchanged and can interfere with subsequent sampling, making it difficult to accurately lock the resonant frequency.
[0005] Therefore, the present invention provides a method for tracking the resonant frequency of a high-frequency sinusoidal excitation electromagnetic flowmeter, which can effectively track the resonant frequency and is easy to implement. Summary of the Invention
[0006] The purpose of this invention is to overcome the shortcomings of current high-frequency electromagnetic flowmeters and to propose a frequency tracking method for high-frequency electromagnetic flowmeters based on phase feedback, so that the excitation frequency is always the resonant frequency of the excitation circuit.
[0007] The frequency tracking method for high-frequency sinusoidal excitation electromagnetic flowmeters proposed in this invention is implemented as follows:
[0008] Step 1: Sample the excitation current signal and perform bandpass filtering;
[0009] Step 2: Perform zero-crossing detection on the bandpass filtered excitation current signal to obtain the number of sampling points per half cycle;
[0010] Step 3: Compare the number of sampling points in each half-cycle with the theoretical calculation value to determine whether the excitation circuit is in a resonant state; if the actual number of sampling points differs from the theoretical calculation value, then the phase difference needs to be calculated. Make a judgment;
[0011] Step 4: Determine the absolute value of the phase difference Does it exceed the threshold θ? If it does, further judgment is required. If the value is greater than zero, the excitation circuit is in a capacitive state, and the excitation frequency needs to be increased; if If the value is less than zero, the excitation circuit is in an inductive state, and the excitation frequency needs to be reduced. Attached Figure Description
[0012] Figure 1 This is a block diagram of the excitation control system;
[0013] Figure 2 It is a frequency response curve of the load impedance of the excitation circuit;
[0014] Figure 3 It is a waveform diagram of excitation current and input voltage signal;
[0015] Figure 4 This is a schematic diagram showing the phase change of the excitation current during non-resonance.
[0016] Figure 5 This is a preprocessing flowchart;
[0017] Figure 6 This is the flowchart of the frequency tracking control program; Detailed Implementation
[0018] The present invention will now be described in further detail with reference to the accompanying drawings.
[0019] The block diagram of the excitation control system of the high-frequency sinusoidal excitation electromagnetic flowmeter of the present invention is as follows: Figure 1 The main components include a control signal generation circuit, a waveform generation circuit, an excitation coil drive circuit, a current sampling circuit, and a power supply circuit.
[0020] The resonant frequency tracking method proposed in this invention has two feedback modes: current amplitude feedback and current phase feedback. This invention chooses phase feedback, which has the following two advantages over current amplitude feedback: (1) Obviousness: In the excitation control system, when the capacitance value changes, the system is in a non-resonant state. At this time, the amplitude change of the excitation current is not obvious, but the phase angle change is obvious. Therefore, the change of the excitation current phase angle is easier to capture than the change of the amplitude. (2) Accuracy: In the excitation circuit, the change of the excitation current amplitude is not only caused by the change of the compensation capacitor value, but also by the change of other circuit components. Therefore, it is not accurate to judge whether the resonant frequency has drifted based solely on the change of the excitation current amplitude.
[0021] The phase feedback-based closed-loop frequency tracking method proposed in this invention aims to automatically detect and track the resonant frequency when changes in the capacitance of the excitation circuit cause resonant frequency drift. This ensures the excitation circuit remains in a resistive state, reducing unnecessary losses in the excitation system and maintaining the excitation current at its maximum value. Specifically, the phase angle of the excitation current is detected to determine whether the excitation system is in a resonant state. The reactance of the load circuit of the excitation control system is X(ω) = ωL - (1 / ωC).
[0022] When the capacitance changes, causing the resonant frequency of the excitation circuit to drift, but the excitation frequency remains constant, the load circuit exhibits either a capacitive or inductive load, meaning the reactance X(ω) ≠ 0. The excitation current will then generate a phase angle. Since X(ω) is a function of angular frequency ω, the reactance frequency characteristic curve of the excitation circuit is as follows: Figure 2 As shown. When ω < ω s When X(ω) < 0, The excitation circuit is a capacitive load; when ω > ω s When X(ω)>0, The excitation circuit is an inductive load; when ω = ω s When X(ω) = 0, The excitation circuit is a purely resistive load; therefore, based on the reactance of the load circuit, the excitation control system can be divided into resonant state, capacitive state, and inductive state. The input voltage and excitation current waveforms in different states are as follows: Figure 3 As shown in the figure, when the excitation circuit is in a resonant state, the excitation current i ab (t) and the output voltage u at the midpoint of the H-bridge ab When the phase difference is zero, and the excitation circuit is in a capacitive state, the excitation current i1(t) will lead the excitation voltage u. ab (t) A phase angle When the excitation circuit is in an inductive state, the excitation current i2(t) will lag behind the excitation voltage u. ab (t) A phase angle Therefore, we can determine the circuit state of the excitation circuit based on the phase angle and thus perform frequency tracking adjustment.
[0023] The specific steps are as follows:
[0024] Since the actual excitation current signal consists of the fundamental frequency, odd harmonics, power frequency interference, and white noise, it is necessary to filter out signals in frequency bands other than the fundamental frequency. This invention, considering the characteristics of the excitation current signal, selects an IIR bandpass filter to filter out all frequency signals except the fundamental frequency. Its transfer function is...
[0025]
[0026] In the formula, ω c The normalized center frequency is denoted by d, and d is the gain coefficient; the gain coefficient d is:
[0027]
[0028] In the formula, b ω Normalized bandwidth;
[0029] Therefore, as long as the filter is set appropriately, b will be fine. ω ω c By determining the values of and d, the ideal filtering effect can be achieved. From the expression for the gain coefficient, it can be seen that the bandwidth b... ω If the center frequency of the bandpass filter remains constant, then the gain coefficient d remains constant. Therefore, knowing the center frequency of the bandpass filter, we can calculate cos(ω). c The expression for the transfer function H(z) can then be obtained, greatly simplifying the computation. In this invention, the excitation frequency is 68.9Hz, and the ADC sampling rate f e If the frequency is 1.5kHz and the bandwidth is 1Hz, then ω c =2f out / f e =0.0919, b ω =2 / f e =0.0013, the filter attenuates to 0dB at the center frequency of 68.9Hz, attenuates to -3dB at the bandwidth boundary, and the attenuation increases continuously away from the bandwidth boundary, ensuring that the signal at the center frequency passes through completely.
[0030] The excitation current signal is acquired by an ADC and then sent to a digital processing filter for bandpass filtering and zero-crossing detection; the sampling rate f is known. e and excitation frequency f out Then the number of sampling points for the excitation current per cycle N = f e / f outTherefore, the number of sampling points N / 2 per half-cycle is also a known value; the number of sampling points of the excitation current per half-cycle is detected using a zero-crossing detection algorithm. Once the number of sampling points per half-cycle changes, it indicates that the excitation current i flowing through the load circuit of the excitation control system has changed. ab (t) generates phase angle The phase angle change of the excitation current is as follows Figure 4 As shown, i1(t) is the excitation current when the excitation circuit is in a capacitive state, and its phase leads i ab (t) A phase angle i2(t) is the excitation current when the excitation circuit is in an inductive state, and its phase lags i ab (t) A phase angle
[0031] In this invention, the excitation current i at resonance is acquired by an ADC. ab (n) can be represented as:
[0032] i ab (n)=I1sin(ω s n)
[0033] In the formula, I1 is the amplitude of the excitation current at resonance, the excitation circuit is in a resonant state, and the excitation current i ab (n) should pass through point B and zero, and the number of sampling points in half a cycle should be N / 2 = f e / 2f out If at a certain moment a parameter of the excitation circuit changes, causing the resonant frequency f to... s If drift occurs, and we assume that the excitation circuit becomes an inductive load at this time, then the excitation current i a ′ b (n) Lagging excitation current i ab (n) A phase angle At the same time i a ′ b (n) can be represented as:
[0034]
[0035] In the formula, I2 is the amplitude of the excitation current after the resonant frequency drifts. After the resonant frequency drifts, the excitation current i a ′ b (n) After passing through the zero point at C, by moving point C forward by half a cycle sampling point number N / 2 to point A, at this time the excitation current i at point A corresponds to the resonance. ab The amplitude of (n) is D. Let the number of sampling points at point C be n1, then we have:
[0036]
[0037]
[0038] Expanding the above two equations, we get:
[0039] sin(ω s n1)cos(ω s N / 2)-cos(ω s n1)sin(ω s N / 2)=D / I1
[0040]
[0041] The phase angle can be obtained by solving the two equations simultaneously. for:
[0042]
[0043] This invention can improve the phase angle. The excitation frequency is adjusted based on the judgment; the frequency tracking closed-loop control method based on phase feedback is implemented in the algorithm module of the DSP. The algorithm module is the core of the electromagnetic flowmeter software system, including the preprocessing part and the algorithm part. The main function of the preprocessing part is to convert the excitation current signal read from the data reception interrupt into a signal containing phase information, while the main function of the algorithm part is to process the phase information obtained from the preprocessing and convert it into the adjustment of the driving frequency.
[0044] The preprocessing section is mainly responsible for bandpass filtering and zero-crossing detection of the excitation current data. The flowchart of the preprocessing section is as follows: Figure 5 As shown, the specific workflow is as follows: First, the excitation current signal is received and its code is converted. It is then determined whether the excitation current signal exceeds a set threshold. If so, the bias adjustment flag is set to proceed to the next step; otherwise, the process proceeds directly to the next step. Next, the excitation current signal is bandpass filtered to remove all frequency signals except the fundamental frequency. Then, zero-crossing detection is performed to determine the number of sampling points per half-cycle of the excitation current. Finally, the preprocessing completion count is incremented by one, and it is determined whether the current count has reached 100. If it has, the algorithm flag is set, and the preprocessing count is cleared to zero, completing the preprocessing part; otherwise, the preprocessing ends directly.
[0045] After preprocessing is complete, the frequency tracking algorithm begins. The frequency tracking process is as follows: Figure 6 As shown, the specific flow of the frequency tracking closed-loop control program is as follows:
[0046] Step 1: Calculate the resonant frequency f s Phase angle generated by the excitation current signal after drift
[0047] Step 2: Determine the phase angle If the absolute value of f is less than the absolute value of the set phase threshold θ, then the excitation system is in a resonant state, and the driving frequency f is... out If it remains unchanged; otherwise, it indicates that the excitation system is in a non-resonant state, and further determination of the phase angle is needed.
[0048] Step 3: Determine the phase angle If the value is greater than zero, the excitation system is in a capacitive state, and the driving frequency f needs to be increased. out Adjust the step size to step; otherwise, the excitation system is in an inductive state, and the drive frequency f needs to be reduced. out Adjust the step size to step. Update the drive frequency f. out until the phase angle It is not greater than the phase threshold θ.
Claims
1. A frequency tracking method for an electromagnetic flowmeter based on phase feedback, characterized in that: First, the normal excitation current signal is acquired and bandpass filtered. The expression for the filtered excitation current is as follows: is ab (n)=I1 sin(ω s n) In the formula, i ab (n) represents the real-time sampled value of the excitation current signal at resonance, I1 is the amplitude of the excitation current, and ω s The resonant angular frequency can then be determined based on the known sampling rate f. e and excitation frequency f out The number of sampling points N per cycle is calculated as follows: N=f e / f out If all components in the excitation circuit remain stable and their parameters do not drift, the number of sampling points N per cycle remains constant. However, if the parameter of any component drifts, the excitation circuit will no longer be a purely resistive load but will become a capacitive or inductive load. At the same time, the resonant frequency of the excitation circuit will drift. The expression for the excitation current after the resonant frequency drift is as follows: In the formula, i a ′ b (n) represents the sampled value of the excitation current signal after the resonant frequency drifts, and I2 is the amplitude of the excitation current after the resonant frequency drifts. The phase angle generated by the excitation current after frequency drift; after the resonant frequency drift, the excitation current i a ′ b (n) Passing through the zero-crossing point at C, by moving point C forward by half a cycle of sampling points to point A, let point A at this time correspond to the original excitation current i ab If the magnitude of (n) is D, then: Then the phase angle can be calculated. for: By determining the absolute value of the phase angle The resonance state of the excitation system is determined by whether it is less than a set threshold θ. If the value is greater than zero, the excitation circuit is in a capacitive state, and the excitation frequency needs to be increased. If the phase angle is less than zero, the excitation circuit is in an inductive state, and the excitation frequency needs to be reduced.