Parameter optimization method, signal processing method and related device of mass flowmeter
The PI control parameters and signal processing methods of the Coriolis flowmeter are optimized by the Grey Wolf algorithm. Combined with Fourier transform and Hilbert transform, the problem of inaccurate PI control parameter values is solved, high-precision flow and density measurement is achieved, and it is suitable for flowmeter measurement in complex environments.
Patent Information
- Application Number
- CN202411954294.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-27
- Publication Date
- 2025-10-10
- Estimated Expiration
- 2044-12-27
AI Technical Summary
The proportional algorithm Kp and the integral algorithm Ki in the PI amplitude control algorithm of the existing Coriolis flowmeter use empirical values, which makes it difficult to completely eliminate the steady-state error, affecting the measurement accuracy. In addition, the performance of the Kalman filter deteriorates when the noise does not conform to the Gaussian distribution.
The gray wolf algorithm is used to optimize the parameters Kp and Ki of the PI controller. Combining Fourier transform and Hilbert transform techniques, the position of the gray wolf individual is iteratively updated through the target fitness function, the amplitude control of the sensor signal is optimized, and temperature compensation is performed.
It improves the accuracy of the signal and the measurement precision, ensures the reliability and stability of the sensor signal, adapts to flow measurement in complex environments, and maintains high precision and robustness.
Smart Images

Figure CN119880077B_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the technical field of Coriolis flowmeter signal processing, and specifically relates to a parameter optimization method, a signal processing method and related devices for a mass flowmeter. Background Art
[0002] The Coriolis flowmeter is a flowmeter that works based on the principle of the Coriolis effect. When a fluid flows through a pipe that vibrates at a certain frequency, the mass and flow rate of the fluid will generate a Coriolis force perpendicular to the flow direction, causing a slight distortion in the pipe, which in turn produces a vibration phase difference at both ends. There is a linear relationship between this phase difference and the mass flow rate of the fluid. By accurately measuring the phase difference, the flowmeter can calculate the mass flow rate of the fluid. Due to the difficulty in modeling fluid flow and complex structures, the coupling characteristics of the Coriolis flowmeter are difficult to fully reveal through theoretical models. Therefore, the signal processing research of Coriolis flowmeters by domestic and foreign research teams mainly focuses on the influence of the frequency, amplitude and phase difference of the flow tube vibration on the measurement accuracy. Currently, the commonly used signal processing methods include PI amplitude control method, zero-crossing method, etc.
[0003] The PI amplitude control method adjusts the input through the proportional algorithm and integral algorithm of the error to achieve the purpose of stable vibration of the flow tube, so that the vibration of the flow tube reaches the desired vibration value. However, the current proportional parameter K p and the integration parameter K i Using empirical methods to determine the value is difficult to guarantee, making it difficult to completely eliminate steady-state errors, which affects measurement accuracy. The zero-crossing method is less reliable than more complex phase difference measurement methods because its accuracy can be affected by noise and waveforms.
[0004] In addition, the sensor output signal of the Coriolis flowmeter is currently filtered through Kalman filtering for noise. If the noise does not conform to the Gaussian distribution or the model is inaccurate, the performance of the Kalman filter may be greatly reduced. In addition, the model parameters are determined manually, and the filtering effect depends on the accurate system model and noise assumptions. The small noise of the Coriolis flow tube cannot be filtered well. Summary of the Invention
[0005] The purpose of this application is to provide a parameter optimization method, signal processing method and related device of a mass flow meter to solve the problem of proportional algorithm K in the PI amplitude control algorithm in the prior art. p and integration algorithm K i It is difficult to ensure the accuracy of the values obtained by empirical means, which makes it difficult to completely eliminate the steady-state error and affects the technical problem of measurement accuracy.
[0006] In order to achieve the above objectives, the first aspect of the present application provides a method for optimizing parameters of a mass flow meter, comprising:
[0007] Initialize a group of gray wolf individuals, where the position of each gray wolf individual includes a proportional parameter and an integral parameter randomly selected within a preset range;
[0008] Constructing a target fitness function, the target fitness function is used to describe the deviation between the amplitude of the vibration sampling signal corresponding to the gray wolf individual and the expected amplitude, the vibration sampling signal being obtained by sampling the output signal of the vibration sensor of the mass flowmeter;
[0009] Based on the gray wolf algorithm and the target fitness function, iteratively updating the position of the gray wolf individual in a direction of decreasing fitness value;
[0010] After the iteration is completed, the position of the gray wolf individual with the smallest fitness value is selected as the optimal parameter and output.
[0011] In one embodiment, the objective fitness function is as follows:
[0012]
[0013] Where, is the fitness value of the i-th gray wolf individual, are the proportional parameter and integral parameter of the i-th gray wolf individual, Ahope is the expected amplitude, x1[n] is the vibration sampling signal, n=1,2,3,…,N, N represents the number of sampling points.
[0014] In one embodiment, the step of iteratively updating the position of the gray wolf individual in a direction of decreasing fitness value based on the gray wolf algorithm and the target fitness function includes:
[0015] Before each iteration, all gray wolf individuals are traversed, the positions of the traversed gray wolf individuals are output, corresponding vibration sampling signals are obtained, and fitness values of the gray wolf individuals are calculated based on the target fitness function, and the gray wolf individuals are sorted according to the fitness values;
[0016] Select the three gray wolf individuals with the smallest fitness values as α wolf, β wolf, and δ wolf, and the other gray wolf individuals as ω wolf;
[0017] Based on the positions of α wolf, β wolf, and δ wolf, update the position of each ω wolf.
[0018] In one embodiment, the step of updating the position of each ω wolf based on the positions of the α wolf, the β wolf, and the δ wolf is specifically as follows:
[0019] Calculate the distances between the current positions of wolf α, wolf β, wolf δ and the target wolf ω respectively to obtain three distance parameters;
[0020] Based on the positions of α wolf, β wolf, and δ wolf and the three distance parameters, the updated position of the target ω wolf is obtained.
[0021] In one embodiment, the step of iteratively updating the position of the gray wolf individual in a direction of decreasing fitness value based on the gray wolf algorithm and the target fitness function further includes:
[0022] Before each iteration, determining whether the current number of iterations is greater than or equal to the maximum number of iterations; and / or determining whether the fitness value of the gray wolf individual with the smallest fitness value is less than or equal to a preset threshold;
[0023] If so, the iteration is complete; otherwise, continue the iteration.
[0024] In order to achieve the above-mentioned object, the second aspect of the present application provides a parameter optimization device for a mass flow meter, comprising:
[0025] An initialization module is used to initialize a group of gray wolf individuals, where the position of each gray wolf individual includes a proportional parameter and an integral parameter randomly selected within a preset range;
[0026] a function construction module for constructing a target fitness function, wherein the target fitness function is used to describe the deviation between the amplitude of the vibration sampling signal corresponding to the gray wolf individual and the expected amplitude, wherein the vibration sampling signal is obtained by sampling the output signal of the vibration sensor of the mass flowmeter;
[0027] An iterative module, configured to iteratively update the position of the individual gray wolf in a direction where the fitness value decreases based on the gray wolf algorithm and the target fitness function;
[0028] The output module is used to select the position of the gray wolf individual with the smallest fitness value as the optimal parameter and output it after the iteration is completed.
[0029] In order to achieve the above-mentioned object, the third aspect of the present application provides a signal processing method for a mass flow meter, comprising:
[0030] Obtaining optimal parameters based on the parameter optimization method described in any of the above embodiments;
[0031] Acquire a vibration sampling signal from a vibration sensor of the mass flowmeter, adjust the amplitude of the vibration sampling signal based on the optimal parameter, and output the adjusted signal as a driving signal to the excitation driving system;
[0032] Obtain vibration sampling signals from two vibration sensors of the mass flowmeter, perform Fourier transform on the two vibration sampling signals respectively, and obtain two frequency domain signals;
[0033] Perform Hilbert transform on the two frequency domain signals respectively and calculate the phase difference;
[0034] Based on the phase difference, the mass flow rate and density of the fluid are calculated.
[0035] In one or more embodiments, the step of adjusting the amplitude of the vibration sampling signal based on the optimal parameter is specifically as follows:
[0036]
[0037] Where x[n] is the vibration sampling signal, is the optimal scale parameter, is the optimal integral parameter, ΔA[n]=A hope -|x1[n]|, Ahope is the expected amplitude, x1[n] is the sampling signal, n=1,2,3,…,N, N is the number of sampling points.
[0038] In one or more embodiments, the step of performing Fourier transform on the vibration sampling signal is specifically as follows:
[0039]
[0040] Where y[n] is the filtered vibration sampling signal, j is the imaginary unit, N is the total number of sampling points of the signal, k is the frequency index, and k = 0, 1, 2, ..., N-1.
[0041] In one or more embodiments, the steps of performing Hilbert transform on the two frequency domain signals and calculating the phase difference are specifically as follows:
[0042] φ[k]=arg(Y[k])
[0043] Δφ 12 [k]=φ1[k]-φ2[k]
[0044] Where Y[k] is the frequency domain signal, φ[k] is the instantaneous phase obtained after Hilbert transform, φ1[k] and φ2[k] represent the instantaneous phases of the two vibration sensors respectively, and Δφ 12 [k] is the phase difference.
[0045] In one or more embodiments, further comprising:
[0046] A temperature sampling signal is acquired, and a signal processing result is compensated based on the temperature sampling signal and a temperature compensation model.
[0047] In order to achieve the above-mentioned object, the fourth aspect of the present application provides a signal processing device for a mass flow meter, comprising:
[0048] A parameter optimization module, configured to obtain optimal parameters based on the parameter optimization method of any of the above embodiments;
[0049] an amplitude adjustment module, configured to obtain a vibration sampling signal from a vibration sensor of the mass flowmeter, perform amplitude adjustment on the vibration sampling signal based on the optimal parameters, and output the adjusted signal as a drive signal to the excitation drive system;
[0050] The Fourier transform module is used to obtain the vibration sampling signals of the two vibration sensors of the mass flowmeter, and perform Fourier transform on the two vibration sampling signals to obtain two frequency domain signals;
[0051] The Hilbert transform module is used to perform Hilbert transform on the two frequency domain signals and calculate the phase difference;
[0052] The result output module is used to calculate the mass flow rate and density of the fluid based on the phase difference.
[0053] In order to achieve the above-mentioned objectives, the fifth aspect of the present application provides a signal processing chip for a mass flowmeter, comprising:
[0054] at least one processor; and
[0055] A memory storing instructions, which, when executed by the at least one processor, causes the at least one processor to perform the signal processing method as described in any one of the above embodiments.
[0056] In order to achieve the above-mentioned objectives, the sixth aspect of the present application provides a machine-readable storage medium, which stores executable instructions. When the instructions are executed, the machine executes the signal processing method as described in any of the above-mentioned embodiments.
[0057] In order to achieve the above-mentioned object, the seventh aspect of the present application provides a signal processing system for a mass flowmeter, comprising:
[0058] The signal processing chip described in any one of the above embodiments;
[0059] Temperature sensor, used to collect temperature signals;
[0060] at least two vibration sensors for collecting vibration signals at different positions of the flow tube;
[0061] an amplifying filter, configured to amplify and filter the output signals of the vibration sensor and the temperature sensor;
[0062] An analog-to-digital converter is used to sample the output signal after amplification and filtering to obtain a vibration sampling signal and a temperature sampling signal;
[0063] a lattice notch filter, configured to perform lattice filtering on the vibration sampling signal;
[0064] The excitation drive system is used to control the vibration of the flow tube based on the drive signal sent by the signal processing chip.
[0065] Different from the prior art, the present invention has the following advantages:
[0066] The parameter optimization method of the present application performs parameter optimization of PI control based on the Grey Wolf algorithm, effectively optimizes the amplitude control of the sensor signal, reduces the signal deviation, improves the signal accuracy, and thus improves the measurement accuracy of the mass flow meter;
[0067] The signal processing method of the present application, by combining Fourier transform and Hilbert transform techniques, can accurately extract phase difference information in the frequency domain, and then obtain more accurate mass flow and density values through phase difference calculation, meeting the requirements of high-precision measurement;
[0068] The signal processing system of the present application combines lattice filtering with amplification filtering to effectively remove noise interference, especially in complex environments, ensuring the reliability and stability of sensor signals, thereby improving the robustness of the system;
[0069] This application realizes the application of the Grey Wolf Algorithm in signal processing, which makes the method have strong adaptability and real-time adjustment capabilities, can quickly adjust parameters according to changes in actual signals, realize dynamic and real-time mass flow measurement, and show good adaptability in complex and highly variable flow measurement scenarios. It can cope with challenges such as large signal amplitude changes and strong noise, and maintain high measurement accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0070] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments recorded in this application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0071] Figure 1 It is a flow chart of an embodiment of a parameter optimization method for a mass flow meter of the present application;
[0072] Figure 2 yes Figure 1 A schematic flow chart of an implementation method corresponding to S300;
[0073] Figure 3 It is a schematic diagram of the gray wolf algorithm of this application;
[0074] Figure 4is a structural schematic diagram of an embodiment of a parameter optimization device of a mass flowmeter of the present application;
[0075] Figure 5 is a flowchart of an embodiment of a signal processing method of a mass flowmeter of the present application;
[0076] Figure 6 is a waveform diagram of two vibration sampling signals in an embodiment of the signal processing method of the present application;
[0077] Figure 7 is a phase difference schematic diagram in an embodiment of the signal processing method of the present application;
[0078] Figure 8 is a structural schematic diagram of an embodiment of a signal processing device of a mass flowmeter of the present application;
[0079] Figure 9 is a structural schematic diagram of a signal processing chip of a mass flowmeter of the present application;
[0080] Figure 10 is a structural schematic diagram of an embodiment of a signal processing system of a mass flowmeter of the present application;
[0081] Figure 11 is a waveform diagram of a vibration sampling signal before and after filtering. DETAILED DESCRIPTION
[0082] In order for those skilled in the art to better understand the technical solutions in the present application, the technical solutions in the embodiments of the present application will be described clearly and completely below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, but not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor should fall within the scope of protection of the present application.
[0083] At present, the signal processing methods of the Coriolis mass flowmeter mainly include PI amplitude control method and zero-crossing method. Since there is an optimal amplitude value in the process of flow tube vibration, the flow tube can maximize the measurement performance of the instrument and prolong the service life of the flow tube when it vibrates at this amplitude value.
[0084] Therefore, the purpose of the PI amplitude control method is to make the vibration of the flow tube reach the expected vibration assignment through the PI amplitude control algorithm, and to adjust the input through the proportional algorithm and integral algorithm of the error to achieve the purpose of stable vibration of the flow tube. However, in the system test, the two parameters K p , K i of the PI controller are very important, and must be properly valued according to the experience of predecessors or the performance of specific sensors. K pToo large may cause excessive response and oscillation, too small leads to slow response and large steady-state error, K i Too large may cause system oscillation or instability, too small may not be able to eliminate steady-state error. When adjusting these two parameters, the response speed, steady-state error and system stability need to be balanced, and the current manually preset parameters cannot meet the needs of high-precision measurement.
[0085] The zero-crossing method refers to finding the critical intersection time of the two sensor signals, that is, a set of corresponding positions of x1[n]=0, x2[n]=0 is t1 and t2, and the phase difference of the two signals can be obtained by calculating the zero-crossing time difference of signals t1 and t2, that is, Δφ 12 = ((t1-t2) / T)*360°, where T is the period of the signal. In the measurement of Coriolis force, high precision and fast response are usually required, and although the zero-crossing method can provide better real-time performance, its accuracy may be affected by noise and waveform, and it may not be as reliable as some more complex phase difference measurement methods.
[0086] To solve the above problems, the applicant has developed a parameter optimization method for a Coriolis mass flowmeter, which can optimize the two parameters K p , K i of the PI controller, provide a more reliable parameter for amplitude control, and thus help to improve the measurement accuracy and service life of the flowmeter.
[0087] Specifically, please refer to Figure 1 , Figure 1 is a flowchart of an embodiment of the parameter optimization method of the mass flowmeter of the present application.
[0088] As Figure 1 shown, the optimization method comprises:
[0089] S100, initialize a set of gray wolf individuals.
[0090] Specifically, the present embodiment optimizes parameters through the gray wolf algorithm. First, the gray wolf parameters can be initialized. Since the optimization target is the proportional parameter K p and the integral parameter K i , the dimension of the prey can be defined as 2, and the maximum number of iterations and the total number of wolf packs can be defined based on actual requirements.
[0091] Within the preset range, a randomly selected proportional parameter integral parameter can be assigned to each gray wolf individual as the position of the gray wolf individual. The preset range, i.e., the K p ,K i range of the prey, can be obtained based on actual requirements and experience, i.e., the position of the i-th gray wolf individual satisfies: For example, in one embodiment, the position of the i-th gray wolf individual may satisfy:
[0092] S200: Construct a target fitness function.
[0093] The target fitness function is used to describe the deviation between the amplitude of the vibration sampling signal corresponding to the gray wolf individual and the expected amplitude. The vibration sampling signal is obtained by sampling the output signal of the vibration sensor of the mass flowmeter.
[0094] In this embodiment, the optimization goal of the Grey Wolf algorithm is to minimize the deviation between the vibration amplitude of the flow tube and the expected amplitude, so that the flow tube vibrates at the expected amplitude to ensure measurement accuracy.
[0095] Therefore, the target fitness function can be constructed based on the deviation, and iterative updates are performed with the goal of minimizing the fitness value during the iteration process.
[0096] In one embodiment, the target fitness function may be as follows:
[0097]
[0098] Where, is the fitness value of the i-th gray wolf individual, are the proportional parameter and integral parameter of the i-th gray wolf individual, Ahope is the expected amplitude, x1[n] is the vibration sampling signal, n=1,2,3,…,N, N represents the number of sampling points.
[0099] The vibration sampling signal is a discrete time series obtained by sampling the output signal of the vibration sensor using an analog-to-digital converter. n is the discrete time index. By calculating the sum of the differences between the expected amplitude and the amplitude of the vibration sampling signal at each moment, a target fitness function is derived to characterize the amplitude deviation of the flow tube. This target fitness function can be used to evaluate the magnitude of the system error under different parameter combinations for different gray wolf individuals.
[0100] The expected amplitude may be preset based on actual needs. For example, in one embodiment, the expected amplitude may be 0.35.
[0101] S300, based on the gray wolf algorithm and the target fitness function, iteratively updating the position of the gray wolf individual in the direction of decreasing fitness value.
[0102] After completing the wolf pack initialization and the target fitness function construction, we can start iterative updating with the goal of minimizing the fitness value of the individual gray wolf.
[0103] Specifically, see Figure 2 and Figure 3 , Figure 2 yes Figure 1 A flow chart of an implementation method corresponding to S300 is shown in FIG. Figure 3 It is a schematic diagram of the grey wolf algorithm of this application.
[0104] like Figure 2 As shown, the iterative update method includes:
[0105] S301. Before each iteration, traverse all gray wolf individuals, output the positions of the traversed gray wolf individuals to the PI controller, obtain the corresponding vibration sampling signals, calculate the fitness values of the gray wolf individuals based on the target fitness function, and sort the gray wolf individuals according to the fitness values.
[0106] First, before each iteration, the position of each gray wolf individual can be output, that is, the proportion parameter K of the gray wolf individual p and the integration parameter K i Based on this parameter, the system can adjust the amplitude of the vibration sampling signal and drive the excitation drive system based on the adjusted signal. The flow tube vibrates under the drive of the adjusted excitation drive system. The vibration sensor can output a signal after detecting the vibration signal. The output signal can be sampled to obtain the vibration sampling signal corresponding to the gray wolf individual.
[0107] By substituting the vibration sampling signal into the above target fitness function, the fitness of the gray wolf individuals can be obtained, and the gray wolf individuals are sorted according to the fitness value.
[0108] S302. Select the three gray wolf individuals with the smallest fitness values as α wolf, β wolf, and δ wolf, and the other gray wolf individuals as ω wolf.
[0109] S303: Based on the positions of the α wolf, the β wolf, and the δ wolf, update the position of each ω wolf.
[0110] like Figure 3 As shown in the figure, the gray wolf algorithm selects three gray wolves with the best parameters, namely α, β, and δ, while the remaining gray wolves are considered ω. α, β, and δ guide the hunting process. As α, β, and δ move to surround the prey, ω searches for and attacks the prey, completing the hunting optimization process and ultimately achieving the optimal solution.
[0111] In this embodiment, the three gray wolf individuals with the lowest fitness values are designated as α, β, and δ, respectively, to update the position of ω. The specific updating method may include: calculating the distances between α, β, and δ, and the current position of the target ω, to obtain three distance parameters; and obtaining the updated position of the target ω based on the positions of α, β, and δ and the three distance parameters.
[0112] The update formula can be as follows:
[0113] D α =|C1·X α -X i |,D β =|C2·X β -X i |,D δ =|C3·X δ -X i |
[0114] X1=X α -A1·D α ,X2=X β -A2·D αβ ,X3=X δ -A3·D δ
[0115]
[0116] Where, X α 、X β 、X δ are the positions of wolf α, wolf β, and wolf δ respectively, and D α 、D β 、D δ They are three distance parameters respectively, C1, C2, and C3 are random weight coefficients, and A1 and A2 are two other random coefficients used to control the update amplitude.
[0117] By repeating the above iterative process, the position of the individual gray wolf is updated until the iteration ends.
[0118] Specifically, the condition for the end of iteration can be that the number of iterations reaches a preset maximum number of iterations, or the fitness value of the gray wolf individual reaches a preset threshold, such as Figure 2 As shown, the iterative update method also includes:
[0119] S304. Before each iteration, determine whether the current number of iterations is greater than or equal to the maximum number of iterations.
[0120] If yes, then:
[0121] S305, iteration completed.
[0122] S306: Determine whether the fitness value of the gray wolf individual with the smallest fitness value is less than or equal to a preset threshold.
[0123] If yes, then:
[0124] S307, iteration completed.
[0125] It can be understood that in the actual iteration process, when any one of the conditions of the current iteration number reaching the maximum iteration number and the minimum fitness value of the gray wolf individual reaching the preset threshold is met, it can be determined that the iteration goal is achieved and the iteration can be ended at this time.
[0126] S400: After the iteration is completed, the position of the gray wolf individual with the smallest fitness value is selected as the optimal parameter and output.
[0127] Based on the above step S300, the position of the gray wolf individual can be updated to ensure that under the parameters of the gray wolf individual, the deviation between the vibration amplitude of the mass flow meter and the expected amplitude is minimized; further, the position of the gray wolf individual with the smallest fitness value can be output as the optimal parameter.
[0128] Based on the parameter optimization method of each of the above-mentioned embodiments, through the adaptive adjustment of the Grey Wolf algorithm and the PI control strategy, the amplitude control parameters of the sensor signal can be effectively optimized, which helps to reduce the signal deviation in subsequent signal processing, improve the accuracy of the signal, and thus improve the measurement accuracy of the mass flowmeter.
[0129] This application also provides a parameter optimization device for a mass flow meter, see Figure 4 , Figure 4 It is a structural diagram of an embodiment of a parameter optimization device for a mass flow meter of the present application.
[0130] like Figure 4 As shown, the parameter optimization device includes an initialization module 21, a function construction module 22, an iteration module 23, and an output module 24.
[0131] The initialization module 21 is used to initialize a group of gray wolf individuals, and the position of each gray wolf individual includes a proportional parameter and an integral parameter randomly selected within a preset range;
[0132] The function construction module 22 is used to construct a target fitness function, which is used to describe the deviation between the amplitude of the vibration sampling signal corresponding to the gray wolf individual and the expected amplitude. The vibration sampling signal is obtained by sampling the output signal of the vibration sensor of the mass flowmeter;
[0133] The iteration module 23 is used to iteratively update the position of the gray wolf individual along the direction of decreasing fitness value based on the gray wolf algorithm and the target fitness function;
[0134] The output module 24 is used to select the position of the gray wolf individual with the smallest fitness value as the optimal parameter and output it after the iteration is completed.
[0135] As above Figures 1 to 3, a parameter optimization method according to an embodiment of this specification is described. The details mentioned in the above description of the method embodiment are also applicable to the parameter optimization device of the embodiment of this specification. The above parameter optimization device can be implemented using hardware, software, or a combination of hardware and software.
[0136] The present application also provides a signal processing method, which performs amplitude adjustment on the optimal parameters obtained based on the parameter optimization method of each of the above-mentioned embodiments, performs signal processing on the two signals obtained after the amplitude adjustment, and outputs the final signal processing result.
[0137] Specifically, see Figure 5 , Figure 5 It is a flow chart of an embodiment of a signal processing method for a mass flow meter of the present application.
[0138] like Figure 5 As shown, the signal processing method includes:
[0139] S10. Obtain optimal parameters based on a parameter optimization method.
[0140] First, the optimal parameter, namely the proportional parameter K, is obtained based on the parameter optimization method of each embodiment described above. p and the integration parameter K i .
[0141] S20 , obtaining a vibration sampling signal from a vibration sensor of the mass flowmeter, adjusting the amplitude of the vibration sampling signal based on optimal parameters, and outputting the adjusted signal as a driving signal to a vibration driving system.
[0142] Acquiring the vibration sampling signal of the vibration sensor is the same as the related description of S200 . The vibration sampling signal is obtained by sampling the output signal of the vibration sensor through an analog-to-digital converter.
[0143] Based on the optimized scale parameter K p and the integration parameter K i , the vibration sampling signal can be amplitude-adjusted and used as the drive signal for the excitation drive system. Under the influence of the adjusted signal, the excitation drive system can drive the flow tube to vibrate at an amplitude that is less deviated from the desired amplitude, thereby effectively improving subsequent measurement accuracy.
[0144] In one embodiment, the formula for adjusting the amplitude of the vibration sampling signal based on the optimal parameters may be as follows:
[0145]
[0146] Where x[n] is the vibration sampling signal, is the optimal scale parameter, is the optimal integral parameter, ΔA[n]=A hope -|x1[n]|, Ahope is the expected amplitude, x1[n] is the sampling signal, n=1,2,3,…,N, N is the number of sampling points, is the integral term, which represents the accumulated error of the signal amplitude.
[0147] S30 , obtaining vibration sampling signals from two vibration sensors of the mass flowmeter, and performing Fourier transform on the two vibration sampling signals respectively to obtain two frequency domain signals.
[0148] After the amplitude is adjusted, the vibration sampling signals of the two vibration sensors of the mass flow meter can be obtained. Figure 6 , Figure 6 It is a waveform diagram of two vibration sampling signals in one embodiment of the signal processing method of the present application.
[0149] By performing Fourier transform on the two vibration sampling signals respectively, the discrete time signal can be converted into a frequency domain signal.
[0150] In one embodiment, the specific formula of Fourier transform may be as follows:
[0151]
[0152] Where y[n] is the filtered vibration sampling signal, j is the imaginary unit, N is the total number of sampling points of the signal, k is the frequency index, and k = 0, 1, 2, ..., N-1.
[0153] S40, performing Hilbert transform on the two frequency domain signals respectively, and calculating the phase difference.
[0154] After the Fourier transform, the frequency domain signal can be further triangulated using the Hilbert transform to obtain the instantaneous phase, and then the phase difference between the two instantaneous phases can be calculated.
[0155] See also Figure 7 , Figure 7 This is a schematic diagram of the phase difference in one embodiment of the signal processing method of the present application.
[0156] In one embodiment, the calculation formulas for the Hilbert transform and the phase difference may be as follows:
[0157] φ[k]=arg(Y[k])
[0158] Δφ 12 [k]=φ1[k]-φ2[k]
[0159] Where Y[k] is the frequency domain signal, φ[k] is the instantaneous phase obtained after Hilbert transform, φ1[k] and φ2[k] represent the instantaneous phases of the two sensors respectively, and Δφ 12 [k] is the phase difference.
[0160] S50. Calculate the mass flow rate and density of the fluid based on the phase difference.
[0161] Those skilled in the art know that after obtaining the vibration phase difference between the two ends of the flow tube of the Coriolis flowmeter, the mass flow rate and density of the fluid can be calculated.
[0162] In one embodiment, the mass flow rate of the fluid may be calculated as follows:
[0163]
[0164] Where C1 is a constant related to the characteristics of the Coriolis flowmeter, Δφ 12 [k] is the phase difference.
[0165] The calculation formula of density ρ can be as follows:
[0166]
[0167] Where C2 is a constant that is dependent on the fluid and the geometry of the Coriolis flowmeter.
[0168] Since the measurement results of the Coriolis flowmeter are greatly affected by temperature, and different materials have different sensitivities to temperature, an increase in temperature will cause the elastic modulus of the vibration tube material to decrease, thereby affecting the vibration frequency and amplitude, and ultimately leading to measurement errors.
[0169] In order to ensure the accuracy of the measurement results, the signal processing method also includes:
[0170] S60: Acquire a temperature sampling signal, and compensate the signal processing result based on the temperature sampling signal and a temperature compensation model.
[0171] The temperature compensation model is a well-known model in the art, which can be established based on a model in which the elastic modulus of a material changes with temperature, and will not be described in detail here.
[0172] Based on the signal processing method of each embodiment described above, the proportional parameter K obtained by optimizing the gray wolf algorithm is used. p and the integration parameter K i, adjusts the amplitude of the vibration sampling signal and uses the adjusted signal as the drive for the excitation drive system. This effectively reduces the deviation between the flow tube's vibration amplitude and the desired amplitude, significantly improving measurement accuracy and service life. Furthermore, by combining Fourier transform and Hilbert transform techniques, phase difference information can be accurately extracted in the frequency domain. This phase difference calculation yields more accurate mass flow and density values, meeting high-precision measurement requirements.
[0173] This application also provides a signal processing device for a mass flow meter, see Figure 8 , Figure 8 It is a structural diagram of an embodiment of a signal processing device for a mass flowmeter of the present application.
[0174] like Figure 8 As shown, the signal processing device includes a parameter optimization module 31 , an amplitude adjustment module 32 , a Fourier transform module 33 , a Hilbert transform module 34 and a result output module 35 .
[0175] The parameter optimization module 31 is used to obtain the optimal parameters based on the parameter optimization method of any of the above embodiments;
[0176] The amplitude adjustment module 32 is used to obtain the vibration sampling signal of the vibration sensor of the mass flow meter, adjust the amplitude of the vibration sampling signal based on the optimal parameters, and output the adjusted signal as a driving signal to the excitation driving system;
[0177] The Fourier transform module 33 is used to obtain vibration sampling signals of two vibration sensors of the mass flowmeter, and perform Fourier transform on the two vibration sampling signals to obtain two frequency domain signals;
[0178] The Hilbert transform module 34 is used to perform Hilbert transform on the two frequency domain signals and calculate the phase difference;
[0179] The result output module 35 is used to calculate the mass flow rate and density of the fluid based on the phase difference.
[0180] In one embodiment, the signal processing device further includes a temperature compensation module 36 , which is configured to obtain a temperature sampling signal and compensate the signal processing result based on the temperature sampling signal and a temperature compensation model.
[0181] As above Figures 1 to 7 , a signal processing method according to an embodiment of this specification is described. The details mentioned in the above description of the method embodiment are also applicable to the signal processing device of the embodiment of this specification. The above signal processing device can be implemented using hardware, software, or a combination of hardware and software.
[0182] The application also provides a signal processing chip of a mass flowmeter, please refer to Figure 9 , Figure 9 Fig. 1 is a structural schematic diagram of a signal processing chip of a mass flowmeter according to an embodiment of the application.
[0183] As shown in Figure 9 , the signal processing chip 40 comprises at least one processor 41, a memory 42 (for example, a non-volatile memory), an internal memory 43 and a communication interface 44, and the at least one processor 41, the memory 42, the internal memory 43 and the communication interface 44 are connected together via a bus 45. The at least one processor 41 executes at least one computer readable instruction stored or encoded in the memory 42. In one embodiment, the processor 41 can be a DSP.
[0184] It should be understood that the computer executable instructions stored in the memory 42, when executed, cause the at least one processor 41 to perform various operations and functions described above in conjunction with Figure 1-Figure 5 various embodiments of the present application.
[0185] According to one embodiment, a program product such as a machine readable medium is provided. The machine readable medium can have instructions (i.e., the above-mentioned elements implemented in software) that, when executed by a machine, cause the machine to perform various operations and functions described above in conjunction with Figures 1-8 various embodiments of the present application. Specifically, a system or apparatus equipped with a readable storage medium on which a software program code implementing the functions of any of the above-mentioned embodiments is stored, and causing the computer or processor of the system or apparatus to read and execute the instructions stored in the readable storage medium can be provided.
[0186] In this case, the program code read from the readable medium itself can implement the functions of any of the above-mentioned embodiments, so the machine readable code and the readable storage medium storing the machine readable code constitute a part of the present application.
[0187] Embodiments of the readable storage medium include floppy disks, hard disks, magneto-optical disks, optical disks (such as CD-ROM, CD-R, CD-RW, DVD-ROM, DVD-RAM, DVD-RW, DVD-RW), magnetic tapes, non-volatile memory cards and ROM. Alternatively, the program code can be downloaded from a server computer or the cloud over a communication network.
[0188] The application also provides a signal processing system of a mass flowmeter, please refer to Figure 10 , Figure 10 Fig. 2 is a structural schematic diagram of an embodiment of a signal processing system of a mass flowmeter according to the application.
[0189] As shown in Figure 10As shown, the signal processing system includes a signal processing chip 40 of any of the above embodiments, two vibration sensors 10, a temperature sensor 20, an amplifier filter 30, an analog-to-digital converter (ADC) 50, a lattice notch filter 60 and an excitation drive system 70.
[0190] The two vibration sensors 10 are used to collect vibration signals at different locations of the flow tube of the mass flowmeter. More specifically, in one embodiment, the two vibration sensors 10 can be used to collect vibration signals at both ends of the flow tube.
[0191] The temperature sensor 20 is used to collect temperature signals.
[0192] The amplifying filter 30 is used to amplify and filter the output signals of the vibration sensor 10 and the temperature sensor 20 , thereby achieving signal amplification and noise suppression.
[0193] The analog-to-digital converter 50 is used to sample the amplified and filtered signal to convert the analog signal into a digital signal to obtain a temperature sampling signal and a vibration sampling signal.
[0194] The lattice notch filter 60 is used to perform lattice filtering on the vibration sampling signal, thereby eliminating interference signals of specific frequencies and improving signal stability and performance.
[0195] The excitation drive system 70 is used to receive the excitation signal sent by the signal processing chip 40 and drive the flow tube to vibrate at a preset amplitude based on the excitation signal.
[0196] In one embodiment, the excitation driving system 70 specifically includes a direct digital synthesizer (DDS), a multi-channel digital-to-analog converter (MDAC), a power amplifier, and an actuator connected in series, for generating and amplifying signals.
[0197] The signal processing chip 40 includes a processor 41 and a memory 42, which is used to determine the optimal parameters for signal processing, namely the proportional parameter K, by a parameter optimization method. p and the integration parameter K i ; Obtain the filtered vibration sampling signal, adjust the signal amplitude with the optimal parameters, and transmit the adjusted signal as the excitation signal to the excitation drive system; Obtain the adjusted two-way excitation sampling signal, combine the Fourier transform and Hilbert transform technology to accurately extract the phase difference information in the signal, and then calculate the mass flow and density value through the phase difference; Obtain the temperature sampling signal, perform temperature compensation on the output result based on the temperature sampling signal and the temperature compensation model, and output the final measurement result.
[0198] The signal processing system based on the above embodiments combines lattice filtering with amplification filtering. Figure 11 , Figure 11 This is the waveform diagram of the vibration sampling signal before and after filtering in this application, which can effectively remove noise interference, especially in complex environments, ensure the reliability and stability of the sensor signal, and thus improve the robustness of the system.
[0199] It will be apparent to those skilled in the art that the present application is not limited to the details of the exemplary embodiments described above, and that the present application can be implemented in other specific forms without departing from the spirit or essential characteristics of the present application. Therefore, the embodiments should be considered in all respects as illustrative and non-restrictive, and the scope of the present application is defined by the appended claims, not the foregoing description, and all variations within the meaning and range of equivalents of the claims are intended to be included therein. Any reference sign in a claim should not be construed as limiting the claim to which it relates.
[0200] In addition, it should be understood that although this specification is described in terms of implementation methods, not every implementation method contains only one independent technical solution. This narrative method of the specification is only for the sake of clarity. Those skilled in the art should regard the specification as a whole. The technical solutions in each embodiment can also be appropriately combined to form other implementation methods that can be understood by those skilled in the art.
Claims
1. A method for optimizing parameters of a mass flowmeter, characterized in that: include: Initialize a group of gray wolf individuals, where the position of each gray wolf individual includes a proportional parameter and an integral parameter randomly selected within a preset range; Constructing a target fitness function, the target fitness function is used to describe the deviation between the amplitude of the vibration sampling signal corresponding to the gray wolf individual and the expected amplitude, the vibration sampling signal being obtained by sampling the output signal of the vibration sensor of the mass flowmeter; Based on the gray wolf algorithm and the target fitness function, iteratively updating the position of the gray wolf individual in a direction of decreasing fitness value specifically includes: Before each iteration, all gray wolf individuals are traversed, the positions of the traversed gray wolf individuals are output, corresponding vibration sampling signals are obtained, and fitness values of the gray wolf individuals are calculated based on the target fitness function, and the gray wolf individuals are sorted according to the fitness values; Select the three gray wolf individuals with the smallest fitness values as α wolf, β wolf, and δ wolf, and the other gray wolf individuals as ω wolf; Based on the positions of α wolf, β wolf, and δ wolf, the position of each ω wolf is updated. Specifically, the distances between α wolf, β wolf, δ wolf and the current position of the target ω wolf are calculated to obtain three distance parameters; based on the positions of α wolf, β wolf, δ wolf and the three distance parameters, the updated position of the target ω wolf is obtained; After the iteration is completed, the position of the gray wolf individual with the smallest fitness value is selected as the optimal parameter and output; Wherein, the target fitness function is as follows: ; Where, is the fitness value of the i-th gray wolf individual, are the proportion parameter and integral parameter of the i-th gray wolf, Ahope is the expected amplitude, is the vibration sampling signal, n=1,2,3,…,N, where N represents the number of sampling points.
2. The parameter optimization method of a mass flowmeter according to claim 1, characterized in that: The step of iteratively updating the position of the gray wolf individual along the direction of decreasing fitness value based on the gray wolf algorithm and the target fitness function further includes: Before each iteration, determining whether the current number of iterations is greater than or equal to the maximum number of iterations; and / or determining whether the fitness value of the gray wolf individual with the smallest fitness value is less than or equal to a preset threshold; If so, the iteration is complete; otherwise, continue the iteration.
3. A parameter optimization device for the parameter optimization method of the mass flowmeter according to claim 1 or 2, characterized in that: include: An initialization module is used to initialize a group of gray wolf individuals, where the position of each gray wolf individual includes a proportional parameter and an integral parameter randomly selected within a preset range; a function construction module for constructing a target fitness function, wherein the target fitness function is used to describe the deviation between the amplitude of the vibration sampling signal corresponding to the gray wolf individual and the expected amplitude, wherein the vibration sampling signal is obtained by sampling the output signal of the vibration sensor of the mass flowmeter; An iterative module, configured to iteratively update the position of the individual gray wolf in a direction where the fitness value decreases based on the gray wolf algorithm and the target fitness function; The output module is used to select the position of the gray wolf individual with the smallest fitness value as the optimal parameter and output it after the iteration is completed.
4. A signal processing method for a mass flowmeter, characterized in that: include: Obtaining optimal parameters based on the parameter optimization method according to any one of claims 1 to 2; Acquire a vibration sampling signal from a vibration sensor of the mass flowmeter, adjust the amplitude of the vibration sampling signal based on the optimal parameter, and output the adjusted signal as a driving signal to the excitation driving system; Obtain vibration sampling signals from two vibration sensors of the mass flowmeter, perform Fourier transform on the two vibration sampling signals respectively, and obtain two frequency domain signals; Perform Hilbert transform on the two frequency domain signals respectively and calculate the phase difference; Based on the phase difference, the mass flow rate and density of the fluid are calculated.
5. The signal processing method of a mass flowmeter according to claim 4, characterized in that: The step of adjusting the amplitude of the vibration sampling signal based on the optimal parameter is specifically as follows: ; Where, is the vibration sampling signal, is the optimal scale parameter, is the optimal integration parameter, , Ahope is the expected amplitude, is a sampled signal, n=1,2,3,…,N, where N represents the number of sampling points; and / or, The steps for Fourier transforming the vibration sampling signal are as follows: ; Where, is the filtered vibration sampling signal, is the imaginary unit, is the total number of sampling points of the signal, is the frequency index, and and / or, The steps of performing Hilbert transform on the two frequency domain signals and calculating the phase difference are specifically as follows: ; ; Where, is the frequency domain signal, is the instantaneous phase obtained after Hilbert transform, and Represent the instantaneous phase of the two vibration sensors, is the phase difference.
6. The signal processing method of a mass flowmeter according to claim 4, characterized in that: Also includes: A temperature sampling signal is acquired, and a signal processing result is compensated based on the temperature sampling signal and a temperature compensation model.
7. A signal processing device for a mass flowmeter, characterized in that: include: A parameter optimization module, configured to obtain optimal parameters based on the parameter optimization method according to any one of claims 1 to 2; an amplitude adjustment module, configured to obtain a vibration sampling signal from a vibration sensor of the mass flowmeter, perform amplitude adjustment on the vibration sampling signal based on the optimal parameters, and output the adjusted signal as a drive signal to the excitation drive system; The Fourier transform module is used to obtain the vibration sampling signals of the two vibration sensors of the mass flowmeter, and perform Fourier transform on the two vibration sampling signals to obtain two frequency domain signals; The Hilbert transform module is used to perform Hilbert transform on the two frequency domain signals and calculate the phase difference; The result output module is used to calculate the mass flow rate and density of the fluid based on the phase difference.
8. A signal processing chip for a mass flowmeter, characterized in that: include: at least one processor; as well as A memory storing instructions, wherein when the instructions are executed by the at least one processor, the at least one processor executes the signal processing method for a mass flow meter according to any one of claims 4 to 6. 9 . A machine-readable storage medium storing executable instructions, wherein when the instructions are executed, the machine executes the signal processing method for a mass flow meter according to claim 4 .
10. A signal processing system for a mass flowmeter, characterized in that: include: The signal processing chip according to claim 8; Temperature sensor, used to collect temperature signals; at least two vibration sensors for collecting vibration signals at different positions of the flow tube; an amplifying filter, configured to amplify and filter the output signals of the vibration sensor and the temperature sensor; An analog-to-digital converter is used to sample the output signal after amplification and filtering to obtain a vibration sampling signal and a temperature sampling signal; a lattice notch filter, configured to perform lattice filtering on the vibration sampling signal; The excitation drive system is used to control the vibration of the flow tube based on the drive signal sent by the signal processing chip.
Citation Information
Patent Citations
Coriolis mass flowmeter (CMF) amplitude control method
CN107102586A
Feature selection method based on improved grey wolf optimization algorithm
CN117874614A