Research on Tuning Fork Dimension Optimization and Density Calculation Model Based on Viscosity Compensation for Tuning Fork Density Sensor

At present, real-time online measurement of ﬂuid density is of great signiﬁcance to improve the automation level of petrochemical and food industries. The tuning fork density sensor is widely used because of its characteristics of real-time online measurement, high measurement accuracy, simple structure, and convenient use. The traditional tuning fork density sensor in the market has the dis-advantage of low resolution and being susceptible to liquid viscosity, which makes the sensor’s measurement accuracy low and not suitable forthemeasurementofhigh-viscosityliquid density.Themeasurement resolutionand antiviscosityinterferencecapabilityofthe tuning fork density sensor are two major indexes to measure the measurement performance of the sensor, among the antiviscosity interference capability refers to the degree to which the measurement results of the sensor are aﬀected by viscosity properties. However, the structural design of the tuning fork density sensor results in the conﬂict between the measurement resolution and the antiviscosity interferencecapabilityofthesensor,andtheimprovementofoneperformance isboundtoaﬀecttheperformanceoftheother.Aimingat the problem of how to balance the measuring performance of the tuning fork sensor, a density calculation model based on viscosity compensation is proposed in this paper. By studying the working principle and structure design of the tuning fork, the vibration characteristics of tuning fork in liquid with diﬀerent viscosities and densities are modelled and simulated. From the results of simulation analysis, the better set of dimensions with balanced measuring performance is selected. Not only does the structure of the tuning fork have the characteristics of high resonance frequency, but also the measured results are less aﬀected by the viscosity of the liquid. To solve theproblem thatdensity measurementisstillaﬀected byhigh-viscosityliquid aftertuningforkdimensionoptimization,in thispaper,the partial least square model is used to ﬁt the experimental data of the frequency-density characteristics; then, the density calculation model based on the viscosity compensation is obtained by combining the frequency-viscosity characteristic experiment. Finally, through the performance test experiment comparing with the traditional tuning fork density sensor, the measurement resolution of the improved tuning fork density sensor is as high as 0.0001g/cm 3 ; within the viscosity range of 180MPa · s, the accuracy reached ± 0.001g/cm 3 , and within 480MPa · s, the measurement accuracy reached ± 0.002g/cm 3 . When the liquid viscosity reaches more than 10MPa · s, the improved tuning fork density sensor has better overall measurement performance than the traditional tuning fork density sensor, and both of its measurement resolution and antiviscosity interference capability have been greatly improved.


Introduction
In the process of chemical production, the determination of liquid density can be used to approximate the quality and chemical composition of the fluid. e accuracy and stability of the measurement directly affect the quality of the product, and the real-time measurement even endangers the stability and safety of the process equipment. erefore, the density sensor is widely used in chemical production plant, which is of great significance to chemical production. At present, the commonly used liquid density measurement methods include vibrating tube density detection method, ultrasonic density detection method, static pressure density detection method, and float detection method [1][2][3]. e vibration tube density detection method [4] uses the sensitive element for the elastic oscillator. When the measured medium flows through the tube, the natural oscillation frequency of the elastic oscillator will change with the density of the measured medium, and the measurement results of this method are accurate and repeatable, but it is expensive to add the control and temperature automatic cleaning system. e float detection method [5] based on Archimedes principle, the float displacement (the displacement of the spring), and buoyancy changes immersed in the measured liquid are converted into a variety of electrical or mechanical detection signals to measure the liquid density. However, the timeliness of the measurement results is poor, which is easily affected by temperature and vibration. e basic principle of the static pressure method for density detection [6] is that the static pressure of the liquid column to be measured at a certain height is proportional to its density, and it can indirectly measure the measured medium and be applied to liquids with large viscosity. However, the static pressure density measurement is greatly affected by the structure, and the measurement error is large. e ultrasonic density detection method [7] uses the different velocity of ultrasonic wave propagation in the liquid of different density to measure the liquid density, but due to the large volume of the ultrasonic density detector in the use process, the measurement results are easily affected by the field environment, so it cannot be used flexibly in some special environments, such as pipelines and deep wells. e tuning fork density sensor uses the principle of changing the resonant frequency of the tuning fork when the fluid flows through the fork body to measure the liquid density. Compared with the above several density measurement methods, it has the characteristics of real-time online measurement, high measurement accuracy, strong stability, simple structure, convenient use, and strong ability to be disturbed by the outside world, and it can be used in some narrow and complex environments. e measurement resolution of the tuning fork density sensor is reflected in the resonant frequency of the tuning fork. e higher the resonance frequency, the higher the resolution of the measurement frequency. e measurement precision of the measuring sensor is an important index. Furthermore, the resonant frequency of the tuning fork in liquid is affected by the density property of the liquid as well as by other factors; among which, the viscosity property of the liquid is also a factor. e higher the viscosity is, the greater the influence will be on the resonant frequency of the tuning fork, and density measurement will be affected. e influence on density measurement can be reduced by changing the structure or dimension of the tuning fork. In this paper, "antiviscosity interference capability" refers to the degree to which the measurement results of the sensor are affected by viscosity properties; in other words, it is the sensor's capability to resist the effects of viscosity on the measured results. It is the index of measuring stability of the sensor. e stronger the antiviscosity interference capability, the less the influence of viscosity on resonance frequency in highviscosity liquid, so the error of density measurement results is less. e measurement resolution and antiviscosity interference capability of the tuning fork density sensor are both important manifestations of the measuring performance of the tuning fork density sensor. e traditional tuning fork density sensor in the market has the disadvantages of low measurement resolution, and the measurement result is easily affected by the liquid viscosity, so the sensor has low measurement accuracy and large measurement error in the liquid with high viscosity, which is difficult to meet the measurement standard. e structural design of the tuning fork density sensor leads to the conflict between the measurement resolution and antiviscosity interference capability of the sensor. erefore, how to improve the measurement resolution and antiviscosity interference capability of the sensor at the same time becomes the key to improve the overall measurement performance of the sensor.
In recent years, many scholars have done a lot of research on the structure design of the tuning fork density sensor and the influence of liquid viscosity on the measurement results. Heinisch et al. conducted resonance experiments of rectangular cross-section tuning forks and circular cross-section tuning forks in liquids of different density and viscosity [8]. It is verified that the resonant frequency of the rectangular section tuning fork is less affected by liquid viscosity than that of the circular section tuning fork with the same effective mass. Patimisco et al. proposed a new method based on the simulation analysis experiment of the tuning fork characteristic frequency combined with the resonance characteristics of piezoelectric tuning fork sensors in different media [9], and the effective mass of the tuning fork body is reduced by reducing the dimension of the tuning fork can reduce the resonant frequency of the tuning fork. In addition, it can also increase the frequency of the tuning fork by reducing the length of the tuning fork beams and increasing the thickness of the tuning fork beams [10,11]. On this basis, González et al. designed a small rectangular crosssection tuning fork density sensor [12]; compared with the traditional tuning fork density sensor, the tuning fork density sensor has a high resonance frequency and high measurement accuracy in low-viscosity liquids. However, the sensor is not suitable for use in high-viscosity liquids, and the measurement error of tuning fork resonance frequency increases due to the influence of liquid viscosity. Heinisch et al. designed a tuning fork density sensor with a large volume structure by using a rectangular section tuning fork as a sensitive part [13,14]. Although the measurement stability of the sensor in high-viscosity liquid is higher than that of the traditional tuning fork density sensor, the low resonance frequency of the tuning fork makes the measurement accuracy in low-viscosity liquid lower than that of the traditional tuning fork density sensor. Jakoby et al. designed a tuning fork density sensor that can simultaneously measure the liquid viscosity and density by studying the relationship between the resonant frequency of the piezoelectric tuning fork and the liquid density and viscosity [15]. is kind of tuning fork density sensor compared with the traditional tuning fork density sensor can correct the density measurement result through the viscosity measurement result and reduce the partial influence of liquid viscosity on the density measurement, but the viscosity measurement error of the sensor is large; the structure design of tuning fork results in the large variation of resonant frequency of tuning fork in high-viscosity liquid and low frequency; as a result, the error of measurement results is large and cannot meet the field measurement requirements in practical application. e research on the tuning fork density sensor by scholars in the past has improved the measurement performance of the tuning fork density sensor in different degrees. However, the problem of how to improve the measurement resolution and antiviscosity interference capability of the tuning fork density sensor at the same time has not been solved. Combined with the above scholars' research foundation and unsolved problems, this paper aims at the defects of the existing tuning fork density sensor in the market, which have low resolution and high accuracy and are easily affected by the liquid viscosity. is paper discusses the influence of liquid viscosity and tuning fork dimension design, from tuning forks of different dimensions, and the better test performance tuning fork was selected by combining theoretical analysis, simulation analysis of the influence of tuning fork dimension, and liquid viscosity on tuning fork resonance frequency. e tuning fork model of this dimension has high resonance frequency and has little change in resonance frequency in high-viscosity liquid. e experimental data of frequency-density characteristics were fitted by the partial least squares model. e experimental data of frequency-density characteristics were fitted by the partial least squares model. en, by adding the viscosity variable parameters and combining with the analysis of a large number of experimental data of frequency-viscosity characteristics, a modified density calculation formula based on the viscosity compensation is obtained. Finally, through the performance test experiment comparing with the traditional tuning fork density sensor, the measurement resolution of the improved tuning fork density sensor is as high as 0.0001 g/cm 3 ; within the viscosity range of 180 MPa·s, the accuracy reached ±0.001 g/cm 3 , and within 480 MPa·s, the measurement accuracy reached ±0.002 g/cm 3 . Compared with the traditional tuning fork on market density sensor not only improves the resolution of frequency measurement but also makes the density measurement accuracy of high viscosity liquid higher. e improved sensor solves the problem of low resolution of the traditional tuning fork density sensor and large measurement error in high viscosity liquid.

Principle and Structure Analysis of Tuning
Fork Density Sensor 2.1. Working Principle. e tuning fork density sensor is mainly composed of tuning fork and piezoelectric components. As a harmonic oscillator, the tuning fork is driven by the piezoelectric actuator at the root of the tuning fork finger to vibrate together. Piezoelectric components include piezoelectric vibration initiator and piezoelectric vibration pickup. e piezoelectric vibration generator uses the inverse piezoelectric effect to convert the piezoelectric signal into mechanical vibration signal. e piezoelectric vibration pickup sensor uses piezoelectric effect to convert mechanical vibration signal into electrical signal output [16,17].
In industrial applications, tuning fork structure has been constantly improved. e common tuning fork structure is shown in Figure 1.
e tuning fork fingers are symmetrical and vertical. e distance between the fixed fork fingers is constant. e vibration state of the tuning fork body will not change with the depth of insertion into the measured medium when it is inserted into a liquid with low viscosity and without bubbles in the liquid.
Usually, the resonant frequency of the fork is fixed and equal to the natural frequency when the piezoelectric vibration generator is driven in vacuum. When the liquid to be measured flows through the tuning fork finger, the resonance frequency of the fork body changes. e resonant frequency of the fork is related to the effective mass of the fork. e liquid flows through the fork and attaches to the fork, which changes the effective mass of the fork, and thus, the resonance frequency of the fork shifts. e general relationship between vibration frequency and density is as follows [18]: where ρ denotes the density of the liquid to be measured, f is the output frequency of the sensor, and k 1 , k 2 , and k 3 are the constant coefficient of the sensor, and they are associated with the basic properties of liquids and the tuning fork structure. e fork part of the tuning fork density sensor is directly in contact with the measured liquid, and the structure of the fork also affects the natural frequency of the fork when it vibrates. erefore, the optimization of tuning fork dimensions has a vital impact on the accuracy and stability of measurement data.

Calculation of Natural Frequencies of Forks.
When the tuning fork works, it is fixed by threads with pipes or other installation positions [19]. e vibration of tuning fork is generated by the contraction vibration and bending vibration of fork body caused by electromechanical coupling. erefore, the visible tuning fork body part is a cantilever beam structure [20]. Its vibration frequency is related to the material, length, and thickness of the tuning fork.
From the Euler-Bernoulli beam model, the differential equation of transverse free vibration motion of the beam is obtained as [21,22] where E is the elastic modulus of the beam, J is the coefficient of bending section, ρ is the material density of the beam, b is the width of fork, and c is the thickness of Mathematical Problems in Engineering fork. y (x) is the main mode function of beam structure, and β is the characteristic parameters of mode shapes. e root of the fork body is taken as the elastic constraint end, and the constraint end of the fork body is taken as the boundary condition. e separation variable method is used to solve the problem. e boundary conditions at the constraint end are as follows: e boundary conditions at the free end are as follows: e equation is the motion equation of the classical Euler-Bernoulli beam model. In this paper, the detailed solution process is not given. Finally, the relationship between the i-order natural frequency P i of the fork and the related parameters of the fork is obtained as follows: where λ 2 is proportional to the natural frequency p i and λ is a function of the mode order of the fork. In the ideal cantilever equation, e free vibration of the tuning fork in air is similar to the free vibration of a cantilever beam fixed on one side. In general, the free vibration of the fork body is the first-order natural frequency. Bring λ 1 into equation (5), and the natural frequency can be calculated.

e Influence of Tuning Fork Structure on Measuring
Performance. When the piezoelectric tuning fork is driven by the measured liquid, the simplified vibration model of the piezoelectric tuning fork under the external force of the measured liquid is as follows: where F is the force of the liquid under test, c is the viscous force constant, v is the relative velocity of the liquid under test, m g the effective mass of the cantilever beam, and k is the elastic constant of the tuning fork. As shown in Figure 2, the measured liquid contacts with the surface of the fork and attaches to the surface of the fork, resulting in a change in the effective mass of the fork as a whole when the tuning fork vibrates downward and downward along the x-axis. e following contents will be analyzed by two different contact surfaces and action modes of liquid and tuning fork.
If the effect of the shear plane in the x-axis direction on the tuning fork body is not considered, only the l × c plane contacts and interacts with the measured liquid. Due to the influence of liquid viscosity and density and the change of damping state of fork, the force of fork oscillates accordingly. Under the inertia of Newtonian fluid, the effect of the mass of the liquid adhering to the fork is equivalent to the force exerted on the fork. en, the simplified vibration model of the tuning fork body under the external force of the measured liquid is as follows: where Δm represents the equivalent mass of the liquid adhering to the tuning fork and y represents the displacement of the liquid layer. Reynolds number is defined as where η is the liquid viscosity, l is the length of the fork, w is the resonant frequency of the tuning fork, and ρ is the liquid density. When the tuning fork is in a Newtonian liquid with a high Reynolds number and if it ignores the effect of the viscosity of the liquid, the effective mass Δm 1 of the measured liquid that attached to the tuning fork body can be as follows: Tuning fork Piezoelectric ceramics

Mathematical Problems in Engineering
where m g is the effective mass of the piezoelectric tuning fork. When only the influence of the shear plane in the x-axis direction is considered, the b × c and l × c planes at the root of the fork shear with the liquid. e effect of liquid on the shear area of plane b × c is negligible because of its small contact area with the measured liquid. e effective mass Δm 2 of the liquid tested attaching to the tuning fork body is expressed as where η is the viscosity of the liquid under test and ω is the vibration frequency of the tuning fork in the liquid under test. e effective mass of the tested liquid adhering to the tuning fork body can be expressed by equations (10) and (11) as follows: whereΔm � ρV 1 , where V 1 is the volume of liquid attached to the fork, which is the function related to the length, width, and thickness of fork, l, c, and b, which is proportional to V 1 . m g � ρ 1 lcb, and ρ 1 is the density of the material that makes up the tuning fork. erefore, from equation (11), it can be obtained that in the tested liquid, the relationship between resonance frequency and corresponding parameters of liquid and tuning fork is If η and ρ remain the same, reduce fork dimensions l, c, and b, the resonance frequency of tuning fork increases with the influence of viscosity, and the slope of the curve ω � f(n) increases at the corresponding point. It can be shown that the decrease of fork dimensions will make the resonant frequency of tuning fork increase under the influence of viscosity η. If the influence of the measured liquid on the surface of the fork is neglected, the vibration frequency of the fork without interference is as follows: where k is a constant related to the dimensions of the tuning fork. When the tuning fork density sensor works in the measured liquid, if the total effective mass of the liquid attached to the fork body is Δm, the vibration frequency of the piezoelectric tuning fork in the measured liquid is as follows: e resolution of the measurement frequency of the piezoelectric tuning fork is as follows: e frequency resolution of the tuning fork has an important influence on the result of density measurement. It can be seen from equation (17) that the measurement resolution is related to the resonance frequency of the fork and the effective mass of the liquid attached to the fork. e effective mass of the liquid is far greater than the liquid which attached to fork, so the effective mass of the attached liquid can be ignored. erefore, the smaller the effective mass of the fork, the higher the resolution of the sensor and the higher the sensitivity of the measurement.
Combined with equations (13) and (17), there is a conflict between the resolution of frequency measurement of the tuning fork and the antiviscosity interference capability. Although increasing the tuning fork dimensions can reduce the influence of liquid viscosity on the tuning fork resonance frequency, it also reduces the resonant frequency and the resolution of frequency measurement, decreasing the tuning fork dimension results in the reverse. erefore, the relationship between the resolution of the balanced tuning fork frequency measurement and the antiviscosity interference capability is the key to improve the overall measurement performance of the tuning fork density sensor.
In the following part, the relationship between the dimension of the tuning fork and the resolution of the frequency measurement and the antiviscosity interference capability of the tuning fork will be explored in combination with the simulation experiment, so as to improve the dimension of the tuning fork and improve the overall measurement performance of the tuning fork density sensor. e following part will study the relationship between the dimension of tuning fork and the resolution and antiviscosity interference capability of the tuning fork by simulation experiment.

Modal Analysis of Tuning Fork
Resonance. e resonant natural frequency of the tuning fork is simulated and analyzed by COMSOL. e natural frequencies of the first sixorder modes are obtained by COMSOL modal analysis to verify the calculation of the natural frequencies of the fork vibration.
e three views of the piezoelectric tuning fork are drawn by Solidworks as shown in Figure 3. e cross-sectional area of the fork model is 12 × 2 mm 2 , and the length is 40 mm. e structure design document is imported into COMSOL, solid mechanics is selected as the physical field, and the characteristic frequency and mode shape are selected as the research object. e material is selected as structural steel. e density of material parameters is 8030 kg/m 3 , the elastic modulus is 2.1 × 105 MPa, and Poisson's ratio is 0.3. e simulation starts after a series of preprocessing, such as grid construction and constraint application [23]. e lower the order, the easier the excitation and the lower the energy required. is is related to the excitation energy transmitted by the vibration generator composed of piezoelectric ceramic sheets. In practical measurement and experiment, the vibration mode of the tuning fork is the first order.
e vibration patterns of the fork under different modes are shown in Figure 4.

Simulation of Natural Frequencies of Tuning Forks with Different Structures.
e different structures of the tuning fork will lead to the change of the resonant frequency of the tuning fork. For the first mode shape of the tuning fork, by changing the length, width, and thickness of the tuning fork, the natural frequency of the first resonant frequency is simulated, compared with theoretical calculation equation (5) to verify the influence of the structure of the tuning fork on the resolution of frequency measurement in equation (17). Table 1 shows the simulation results of the first natural frequency of the tuning fork model with different length, width, and thickness for COMSOL simulation software. Among them, the tuning fork structure with the length l � 80 mm, width c � 20 mm, and thickness b � 5 mm is the common rectangular structure tuning fork density sensor in the market; according to equation (17), the length, width, and thickness of the tuning fork are reduced to reduce the effective mass m g of the fork body and improve the resolution of frequency measurement. e simulation results and theoretical calculation results of the first-order natural frequencies of tuning forks with different structures are shown in Table 1.
It can be seen from Table 1 that when the length of the tuning fork of the same cross-sectional area is 40 mm and 80 mm, respectively, the natural frequency is inversely proportional to the square of the length of the fork body, which is consistent with the relationship between the length of the fork body and its natural frequency in equation (5).

Simulation of the Influence of Liquid Viscosity on Tuning
Fork Resonance Frequency. COMSOL finite element was used to simulate the vibration frequency of the tuning fork in liquids of different viscosity, and the fluid-solid coupling was selected as the simulation physical field; the characteristic frequency was used as the research object to establish the model [24]. e fluid property is liquid water, and the density is set to 1 g/cm 3 . In the constraint condition of the fluid, the velocity parameters of the inlet and outlet are set to 0 m/s, and the static state of the liquid is consistent with the state of the liquid in the experimental environment. e geometric model is shown in Figure 5. e material property in the cuboid region is liquid water, and the color change of the fork is represented by the change of pressure. e setting of liquid density parameters is based on the density of different liquids measured by experiments, so that the simulation results and experimental results can be compared and analyzed easily.
In order to explore the influence of liquid viscosity on tuning fork resonance frequency, the overall measurement performance of the tuning fork density sensor was improved. In the process of simulation, the resonant frequencies of the rectangular cross-section tuning fork and circular cross-section tuning fork in liquid were simulated with the liquid viscosity as the parameter variable, and the circular cross-section tuning fork structure is used as a reference structure for comparison. By evaluating the frequency resolution and antiviscosity interference capability of the tuning fork, the tuning fork dimension with more balanced measuring performance is selected as the tuning fork used in the following experiment. Among them, the structure of the tuning fork with smaller dimensions and higher first-order natural frequency is selected as the research object.
e simulation results of resonance frequencies of different structural tuning forks in different viscosities are shown in Tables 2 and 3.
In the table, Δz is the change rate of the resonant frequency in the corresponding viscosity liquid and represents the influence of the liquid viscosity on the resonant frequency of the tuning fork. e larger the Δz is, the greater the influence of the liquid viscosity on the resonant frequency of the tuning fork is: where f 1 represents the resonant frequency of the structural tuning fork in a liquid with a viscosity of 1 MPa·s and a density of 1 g/cm 3 and f 2 represents the resonant frequency of the tuning fork under the current liquid viscosity. From Tables 2 and 3, it can be seen that the reduction of fork dimensions will lead to the reduction of antiviscosity interference capability of the tuning fork, and the resonance frequency of tuning fork will increase under the influence of liquid viscosity, and this is consistent with the derivation of the previous theoretical part. When the effective mass of the fork body is the same, the influence of liquid viscosity on the tuning fork with rectangular section is less than that with circular section; therefore, the traditional tuning fork density 6 Mathematical Problems in Engineering sensor mostly adopts the structure of the tuning fork with rectangular section. e change of Δz with the increase of viscosity that forms different dimensions of the tuning fork is shown in Figure 6.
With the increase of liquid viscosity, the change rate of resonant frequency of the first seven groups of tuning fork structures increases gradually but is relatively stable. In the last five groups, when the viscosity reached 150 MPa·s, Δz increased dramatically, and this shows that the tuning fork resonance frequency is greatly affected by the viscosity and a tuning fork of the corresponding dimension will have a huge deviation in measuring the liquid density in a liquid with a viscosity of 150 MPa·s. erefore, the last five groups are not suitable for density measurement in high-viscosity liquid. e first 7 groups should be selected.
Of the first 7 groups of measurements, Δz has small rate of change with the increase of viscosity η, and this shows that the influence of viscosity on the resonant frequency with the increase of viscosity in the measurement process is approximately similar. In addition, the choice of the tuning fork density sensor should be related to the actual measurement environment, which can be measured in limited space, so the sensor with simple structure and small dimension is preferred. erefore, group 6 and 7 are preferred, the resonant frequency of the two groups of tuning forks is less affected by the viscosity and Δz is almost the same with different viscosity. However, the resonant frequency of group 6 is higher, which means that the measurement resolution of the resonant frequency of this dimension tuning fork is higher, and this can also be said to be group 6 of tuning forks measured more performance. Finally, group  Figure 5: e construction of the geometric model. 6 of the tuning fork is selected in this paper, which has a length of 40 mm and a cross-sectional area of 12 * 2 mm 2 .

Simulation of Tuning Fork Resonance Frequency in Liquid with Different Density.
rough the simulation analysis of the influence of tuning fork dimensions and liquid viscosity on tuning fork resonance frequency, the rectangular tuning fork's dimension of 40 * 12 * 2 mm 3 with more balanced measurement performance is selected. e simulation results of resonance frequency of the tuning fork of this structure in liquids of different densities are shown in Figure 7, in which the viscosity of the liquid property is set to 1 MPa·s. e variation range of resonant frequency in the fluid medium of 0.88∼1.262 g/cm 3 is 984.19∼959.11 Hz. e resonance frequency changes obviously with the change of liquid density.

Experimental Equipment and Procedures.
In this experiment, the fork section area of tuning fork density sensor is 12 × 2 mm 2 , the length is 40 mm, and the material is 316 L   Mathematical Problems in Engineering steel. In order to avoid erroneous action when piezoelectric ceramics contact with liquid, piezoelectric ceramics are selected as exciter and pickup of the tuning fork. erefore, the installation position of piezoelectric ceramics is the root of the tuning fork. e bottom of the tuning fork is sealed with an airtight enclosure, as shown in Figure 8.
In the process of measurement, the change of the measured density will cause the resonance frequency deviation of the tuning fork sensor. erefore, in order to keep the tuning fork sensor working at the resonant frequency, it is required that the driving signal frequency can follow the change of tuning fork vibration frequency in real time. at is to say, the driving circuit should have frequency-tracking function. Because it is easy to realize the phase and amplitude conditions of self-excited oscillations of the tuning fork oscillator by using the phase-locked technology, the integrated phase-locked loop CD4046 is used in the driving circuit to realize the design of the frequency-tracking circuit. e resistance of piezoelectric ceramic chip in frequency signal sensitive element is very high, but the output signal of sensitive element is weak voltage signal or electric charge signal. erefore, the preamplifier must be added to the frequency measurement circuit to amplify the signal and then filter the signal [25].
e system block diagram of frequency detection circuit is shown in Figure 9. e charge conversion circuit transforms the high resistance signal from the piezoelectric ceramic plate as the vibration pickup into the low internal resistance voltage signal. e voltage signal is amplified by the amplifier circuit of the instrument. Finally, after filtering the high-frequency interference signal by the low-pass filter, the voltage signal is input into the oscilloscope to measure the resonance frequency of the fork [26]. e instruments used in the experiment include tuning fork density sensor, Terraco oscilloscope, 500 ml measuring cylinder, voltage regulator, 10 groups of sample solutions, and densitometer. e oscilloscope is used to accurately measure the frequency of electrical signals generated by fork vibration. e measuring cylinder is used to ensure that the fork penetrates into the liquid at the same depth. e regulated power supply is used for power supply. A densitometer is used to calibrate the density of sample solution, it is a high-precision electronic densitometer with a measurement accuracy up to 0.0001 g/cm , and the results are compared with those measured by the density sensor. A viscometer is used to calibrate the viscosity of liquid to test the influence of viscosity on the measurement results of the sensor, and the viscometer is a rotary viscometer with a measurement accuracy up to 0.01 MPa·s. e experimental equipment is shown in Figure 10. e specific experimental process is shown in Figure 11.

Density-Frequency Characteristic Experiment.
e stability of the resonant frequency of the tuning fork sensor affects the resolution of the instrument. e more stable the resonant frequency is, the higher the resolution of the instrument is.
At the temperature of 25°C, the density of the tested liquid is 0.9021 g/cm 3 . When the ambient temperature is fixed, the liquid to be measured is injected into the vector cylinder to make it level with the top cap of the tuning fork. After the sensor works stably, its resonance frequency is    recorded every 1 minute. e experimental results are shown in Table 4. According to the experimental data, the frequency stability curve of the fork sensor is shown in Figure 12. It can be seen from Table 4 that the data fluctuation range is small and the dispersion degree is small. No matter in which medium, the stability of the sensor is very good. e stability of resonance frequency in liquid is better than that in air that means the resonance frequency measurements in liquid have a smaller range of fluctuations than those in air, and the stability is 0.017%. A stable frequency output can reduce the measurement error. e fork part of the tuning fork density sensor is immersed in the sample solution completely. e comparison between the resonant frequency of the tuning fork in different density liquid and the simulated resonant frequency is shown in Table 5. e resonance frequency of the density sensor fork measured in the measured liquid is lower than the simulation result of COMSOL. e first natural frequency of the tuning fork obtained by COMSOL simulation is close to the actual resonant frequency, and the relative error remains at about 0.47%. Due to the influence of the actual measurement environment, such as the influence of air damping on the resonance motion of the fork, the impurities attached to the fork change the natural frequency of the fork, so the actual measured natural frequency is less than the simulation results.

Data Processing and Analysis.
Considering that there are errors in the measurement process of tuning fork frequency, which makes the measurement result nonrandom deviation, the partial least square model is selected for fitting [27]. e   density calculation model of density y and frequency x is obtained by fitting the relationship between vibration frequency and liquid density, equation (1): Figure 13 describes the frequency-density curve and its standard residual based on the least square model fitting.
It can be seen from Figure 13 that the distribution of residuals is satisfactory. e determination coefficient (R 2 ) measures the overall fit of the regression equation, and it always describes the linear correlation between the fitting curve and the measured data. e R 2 value of the fitting curve is 0.993, which indicates the high linear correlation of the measured points. e resonance frequency of the fork body of the density sensor in different solutions is substituted into equation (19) to obtain the fitting density and the fitting relative error calculated. Table 6 shows the comparison between the density of the measured liquid calculated by the frequencydensity fitting formula and the measurement results of the electronic densitometer, and the density range of the measured liquid is 0.8453-1.2761 g/cm 3 .
As can be seen from the data in Table 6, it is within the measurement range of 0.8453−1.2761 g/cm 3 . e maximum relative error between the calculated result of fitted densityfrequency relationship equation (19) and the actual measurement result is −0.21%, and the resolution of the system can reach 0.0001 g/cm 3 .

Effect of Viscosity on Measurement Results.
As an important property of liquid, viscosity has a great influence on the vibration frequency of the tuning fork. e high-viscosity liquid produces higher damping, which reduces the resonant frequency of the tuning fork. erefore, the frequency-density characteristic of the sensor is obtained by testing the influence of different viscosity liquid on the resonant frequency of the tuning fork. Combined with the theoretical analysis and data fitting to obtain the density calculation model based on viscosity compensation, this model greatly improves the measurement accuracy of liquid density.
e mixed solution of ethanol, propanol, isopropanol, glycerin, edible oil, crude oil, fruit juice, syrup, and other liquids was prepared as the test solution. e viscosity range was 0.21-182.81 MPa·s. In liquids of different viscosity, the comparison of the sensor measured density by the fitting formula (fitting density), and actual liquid density is shown in Figure 14; the relative error of the fitting density is also shown in the figure.
When the liquid viscosity deviates from 0.96 MPa·s, the fitting error of density will gradually increase with the increase of viscosity. Frequency-density fitting equation (19) is used to compensate the viscosity through the sensor's measurement results and the actual density of the liquid in the above different viscosity and different density range, in order to obtain the density calculation model suitable for liquids with different viscosity. González et al. [12] proposed that the relationship between tuning fork resonance frequency and liquid viscosity can be equivalent to where Δm is the effective mass of the tuning fork, V fl is the effective volume of the liquid attached to the tuning fork, L fl is the effective area of the viscous loss of the liquid, w is the resonant frequency of the tuning fork in the liquid, and f(w) is a function of the resonant frequencyω.Frequency-density fitting equation (21) is substituted to obtain the density calculation model based on viscosity compensation for the structural tuning fork density sensor: In the equation, the calculation of V fl , Δm, and L fl is complex, so the model is simplified: where k m/v and k l are the coefficients related to V fl , m, and L fl . e density calculation model of the tuning fork sensor based on viscosity compensation is obtained by using the partial least squares model fitting from the above experimental data: e density calculation model after viscosity compensation, the density calculation model without viscosity compensation, and the actual measured value are compared as shown in Figure 15.
Because the liquid used in the experiment is difficult to prepare the solution to the ideal viscosity in the preparation process, the viscosity of the measured point may be different from that shown in the curve. In different viscosity liquid, the actual measured value is more close to the curve after viscosity compensation, and the measurement accuracy is ±0.001 g/cm 3 . Figure 16 shows the frequency-viscosity curve of the density calculation model after viscosity compensation under the same density. In the experiment of low-viscosity liquid, edible oil and crude oil with the same density and different viscosity were used for testing, respectively. e viscosity of edible oil is 10 MPa·s. e maximum relative error between the actual viscosity and the calculated viscosity is 0.36%, and the resonance frequency of the sensor is stable.
In the experiment of high-viscosity liquid, syrup with high viscosity is used as the tested liquid. When the viscosity reaches 500 MPa·s, the slope of the curve tends to be stable. In the same density liquid, the resonance frequency will be reduced by 2.5 Hz for every 1 MPa·s increase of viscosity. If the model without viscosity compensation is used, the error of 0.06 g/cm 3 will be caused; at this time, the viscosity has a great impact on the tuning fork density sensor. erefore, the viscosity compensation of the density calculation model is very important to improve the measurement accuracy of the sensor.

Measuring Performance Test of Tuning Fork Density
Sensor. During the test, the traditional tuning fork density sensor is used. e cross-section area of the fork is 20 * 5 mm 2 , and the length is 100 mm. e resolution of the tuning fork density sensor is 0.0005 g/cm 3 , and the tuning fork density sensor has a resonance frequency of 481.65 Hz in the air. Compared with the traditional tuning fork density  Figure 13: (a) e frequency-density curve fitted based on the partial least squares model; (b) the standardized residual corresponding to the curve and the actual data.  sensor, the improved tuning fork density sensor has higher resonance frequency and higher resolution and sensitivity. At the same time, the density calculation model based on viscosity compensation can greatly reduce the measurement error in a certain range of viscosity. In the measurement performance test, the improved tuning fork density sensor is compared with the traditional tuning fork density sensor, and the measurement error and vibration frequency stability are used to verify whether the measurement performance of the sensor is improved.
It can be seen from Table 7 that the measurement accuracy of the traditional tuning fork density sensor is ±0.002 g/cm 3 in the liquid with a viscosity range of 50 MPa·s. However, with the increase of viscosity, the density measurement began to deviate from the actual value. At 182.81 MPa·s, the measurement error of the sensor is −0.007 g/cm 3 , which is lower than the industry average standard. At 480.11 MPa·s, the error is −0.065 g/cm 3 , which cannot meet the field measurement requirements.  e improved tuning fork density sensor has a resolution of up to ±0.0001 g/cm 3 in liquid with a viscosity range of 180 MPa·s, the measurement accuracy is ±0.001 g/cm 3 , and within 180-480 MPa·s, the measurement accuracy is ±0.002 g/cm 3 . In high-viscosity liquid, the accuracy of the improved tuning fork density sensor is much higher than that of the traditional tuning fork density sensor.

Conclusions
is paper identifies a better set of dimensions for a tuning fork in order to improve its performance compared to traditional tuning fork density sensor. In the process, although the resolution of the measurement is improved, the influence of viscosity on the resonant frequency of the tuning fork increases with the decrease of tuning fork dimensions. In order to solve this problem, this paper uses the partial least square model to fit the density calculation formula through the frequency-density characteristic experiment and then combines the frequency-viscosity characteristic experiment to get the density calculation model based on the viscosity compensation. e improved tuning fork density sensor has a resolution of up to ±0.0001 g/cm 3 , in a liquid with a viscosity range of 180 MPa·s, and the measurement accuracy is ±0.001 g/cm 3 . Within 180-480 MPa·s, the measurement accuracy is ±0.002 g/cm 3 .
rough the dimension optimization and the density calculation model based on the viscosity compensation, the improved tuning fork density sensor has the characteristics of high measurement resolution and high antiviscosity interference capability. Compared with the traditional tuning fork density sensor, the overall measurement performance of the sensor is higher than that of the traditional tuning fork density sensor in both high-and low-viscosity liquids. e problem that the traditional tuning fork density sensor has low resolution, not suitable for high-viscosity liquid, and the measurement performance of resolution and antiviscosity interference capability conflict with each other is solved.

Data Availability
e data used to support the findings of this study are available from the corresponding author upon request.

Conflicts of Interest
e authors declare that there are no conflicts of interest regarding the publication of this paper.