Analysis and Implementation of Noncontact Level Sensing for a Pressurized Cylinder

Fluid level detection for a sealed and pressurized mobile container is very useful for the provider to schedule the delivery of a new one before it runs out of the liquid.This study suggested using the frequencies of tone generated by knocking on the outside surface of the container to detect the liquid level inside. A detailedmodel based on Euler-Bernoulli beam theory has been proposed to study the feasibility of this method for a cylinder with complicated but practical structure. Household gas cylinders were used to validate the proposed model and the results show that experimental data agree well with the theoretical analysis. The results indicate that the proposed model can accurately explain the behavior of the vibratory frequencies under different liquid levels. An apparatus has been successfully implemented to automatically sense the near empty condition of the gas cylinder.


Introduction
Level detection is a very important technique in commercial and industrial applications.For example, liquefied petroleum (or propane) gas (LPG) cylinders have been widely used in households, and detection of their near emptiness is very important to avoid running out of gas during usage.Many methods have been proposed for level sensing based on different principles including mechanical [1,2], electrical (capacitive) [3,4], electromagnetic [5,6], optical [7,8], or ultrasonic [9].A device has been developed to measure the liquid level [10] and mass [11] of the LPG in a tank using RF (radio frequency).Matching a level detector with a particular application is crucial for successful and effective level sensing.
While these available approaches have been successfully applied in various applications, these methods all require a container to be opened for installing the measurement device inside.However, if an available cylinder is iron-made with thick-wall, opaque, sealed up and contains highly pressurized liquid, then it is not feasible to be opened for installation of a measuring device.Taking the widespread LPG cylinder as an example, we think it is more effective and safe to measure its level of liquid from the outside.Therefore, there remains a need for a novel and easy-to-install level sensor for the LPG cylinder.
A container filled with liquid will generate sound of different tone when physically excited as level of the liquid varies within.We propose to use this simple method to measure the level of liquid for a pressurized cylinder as we have here.A few researchers investigated this vibration phenomenon of cylindrical tube for different setups.Chan and Zhang [12] suggested a model of vibration to investigate the relationship between the vibrating frequencies and the level of liquid for a pipe which is free at top and clamped at bottom (clamped-free model).This study showed that if we can generate vibration on the cylinder partially filled with liquid (mass), the level might be estimated from the resonant frequency caused by the traverse vibration.Method based on this principle has also been used to measure the liquid level without contact for thin-opaque capillaries under high pressures by Jacobs et al. [13].Approach of Jacobs et al. [13] is similar to Chan's method [12], but it was configured to be fixed at the bottom as well as on the top (clamped-clamped model).
On the basis of the above two studies [12,13], we believe Euler-Bernoulli beam theory [14] that they used is proper for investigating resonance of a cylindrical object.However, the experiments in these two studies were all conducted under well-controlled environment with simple structure.Given a more practical usage condition and irregular boundaries at the ends of the container, like a commercial gas cylinder, a more general model is needed when Euler-Bernoulli beam theory is used to examine its resonance.
An approach based on Euler-Bernoulli beam theory was presented to study the traverse vibration of a commercial gas tank (cylinder) in this paper.Taking the structure of the gas cylinder into consideration, we presented a more detailed theory to deal with the complex boundary conditions for the traverse vibration of the cylinder.The significance of this research is that the proposed theory not only leads to the same results as those of the previous studies under simplified boundary conditions but also can provide more thorough vibration analysis for the commercial cylinder.To evaluate the proposed theory, we utilized a gas cylinder usually used in the household for the experiments.
The remainder of the paper will be given as follows.Section 2 discusses the theory for our proposed model of a cylinder with general structure and how it leads to the equations for the previous study under simplified boundary conditions.The proposed model is tested and verified in Section 3 by experiments using a commercial cylinder.The results are evaluated and discussed in Section 4. A device was implemented in Section 5 to detect the near-emptiness of a LPG cylinder.Finally, conclusions of the paper are stated in Section 6.

Bending Vibration Based on the Euler-Bernoulli Theory
Bending vibration of nonuniform beams has long been investigated [15].This issue contains 4th-order partial differential equations and two parameters, time  and axial length .A nonuniform beam has variable cross-section, and therefore, its mass density () and stiffness EI() are both dependent on axial position.Given a highly pressured steel-cylinder containing LPG, it has sudden changes of mass around the junctions of two different sections along its length.In the following discussion, we will propose a model to solve a more general traverse vibration problem.We will then prove that solutions for the previous studies can be obtained under simplified (or extreme) boundary conditions.

Proposed Model for a Pressurized
Cylinder.The drawing in the left part of Figure 1 shows a cylindrical container partly filled with liquid where welded seams are usually used to seal the container at both ends.When a tool was applied to strike at the surface of an iron-cylinder, the transverse vibration it triggered is similar to the one generated by a beam partially loaded with a distributed mass as shown in the right part of Figure 1.We assume that the cylinder has a uniform crosssection and its distributed mass per unit distance for the gas part and the liquid part is  and   , respectively.The traverse vibration of the cylinder after being knocked on the surface can be modeled and calculated by the Euler-Bernoulli beam theory given below.Note that the gas tank is actually modeled as a cylindrical shell, and treat the shell as being formed by infinite number of iron strips [16].Each iron strip (as a beam) will generate a traverse oscillation after being knocked and create a longitudinal wave along the gas cylinder.This wave is then analyzed by the Euler Bernoulli model, and the top and the bottom seams are two boundaries of the vibration.Based on the above assumption, the length of the strip (beam) is long in comparison to its diameter and transverse vibrations follow Euler Bernoulli model can then be considered.Depending on the loadings of the liquid, the frequency of this longitudinal wave caused by the traverse oscillation will be different.Given a cylindrical shell model, there also exists a circumferential wave that has been generated; this wave will be affected by the interaction between modeled strip; however, it is not related to the liquid level and was neglected.

Equations of Motions and Associated Boundary Conditions.
Let interface of the air and the liquid inside the cylinder be placed at origin of the coordinate system as shown in Figure 1.The segment between the two welded seams is defined as length of the cylinder , and the level of the liquid is assumed to be   .If the cylinder has a constant bending stiffness EI, then the transverse vibration of the cylinder is formulated as [14] EI where  1 (, ) and  2 (, ) are the displacements of transverse vibration for the liquid part and the air part, respectively.The main transverse vibration is assumed to be confined to the segment between the two welded seams.Since the welded positions are not ideally clamped, the transverse wave propagates on the surface may be damped at the welded line but it still can propagate over the boundary.We propose that these two boundary conditions can be modeled as strong torsional and linear springs and attached to the end of the boundaries, as shown in Figure 1.This complicated condition of boundaries can then be formulated as where  1 ,  1 are constants of torsional spring and linear spring for the bottom welded seam and  2 ,  2 are the corresponding constants for the top welded seam.The units for these two constants are   (N/m) and   (Nm/rad) (Newtonmeters/radian), respectively.A round and thin steel plate is connected at the bottom of the cylinder so it can stand stably.Therefore, the bottom of the body is stiffer than the top of the cylinder during traverse vibration and we can assume that  1 >  2 and  1 >  2 .At the air-liquid interface inside the cylinder, the continuity of the displacement, velocity, and acceleration applies so that equilibrium and continuity conditions are [11,13] The general solutions of the traverse vibration described in (1) for the cylinder are where Using the continuity and equilibrium conditions in (3), we can obtain the relationship of coefficients based on the solutions of  1 (, ) and  2 (, ) in (4).That is, where  = (/( +   )) 1/4 ,  1 = (1/2)(1 +  2 ), and Substituting ( 4) and ( 6) into (2), we obtain A clamped-clamped model investigated in [13]. (15)

Solution for the Proposed Model.
A nontrivial solution can be obtained if the determinant of (7) becomes zero; that is If the cylinder is empty, then   = 0,  1 = 0, and the traverse vibration has the maximum frequency,  0 (= 20).Under this condition,  2 =  2 ( −   ) = (/EI) 1/4 √ , which will be denoted as  0 and If the cylinder is full of liquid, that is, the air-liquid interface reaches the top welded seam, then   = ,  2 = 0, and  1 =  1  = (( +   )/EI) 1/4 √ .To record the relationship between the vibration frequency and the liquid level in the experiments, it is convenient to represent  1 and  2 in normalized form, or Taking EI and  as constant parameters, we can find an analytic relation between the ratio of the frequency   = / 0 and ratio of the length   =   / using computer numerically.This can be done by substituting items defined in (18) into (16), and the results will be presented later.

Obtained Numerical Model in Relation to Previous Study.
The model proposed above can provide more versatile condition of the boundaries.By varying the torsional and linear spring constants, it can lead to the previous model investigated.For example, if  1 =  1 =  2 =  2 ≈ ∞, the proposed model have clamped-clamped boundary conditions (clamped-clamped model).It has been investigated by Jacobs et al. [13] to conduct measurement of liquid level without contact in an opaque and thin capillary under high pressure.The original configuration of their investigation is illustrated in Figure 2. Since  1 =  1 =  2 =  2 ≈ ∞, values of  1 (, )  1 (, )/,  2 (, ), and  2 (, )/ in (2) must be zeros.Therefore, the conditions of the boundaries at  = −  and  =  −   for this clamped-clamped setup become which are the same as those suggested in [13].Since  1 =  1 =  2 =  2 ≈ ∞, the determinant of ( 16) under clamped-clamped boundary conditions is simplified to that in [13], or Therefore, the model we proposed is more universal to accommodate previous model.

Experimental Results
A household LPG cylinder was chosen to be placed on the ground of the laboratory for the experiments, as shown in Figure 3.This particular gas cylinder weighs 41.1 kg in total including the liquefied gas and the container.This type of LPG comprises 70% of propane and 30% of butane, which leads to an approximate density of 0.508 g/cm 3 .The construction of a gas tank consists of a cylinder having a value of 95.8 cm in circumference, a top cover, and a bottom base.These three parts of the tank were welded together, which left two seams with a distance of 53 cm between them on the surface of the tank.

Experimental Setup.
The measurements were conducted using the sequences shown in Figure 4.The bandwidth of the low pass filter is 1024 Hz, sampling frequency of the analog to digital conversion is 2520 Hz, and 1024 samples are used for the FFT computation.The goal of the conducted experiments was to tabulate the total weight of the gas tank and its homologous dominant frequency of vibration after being knocked, that is (  ,   []).Computation of the dominant frequency can be found in [17].Given this particular cylinder, the occurrence of this frequency fell between 700 Hz and 900 Hz.All the (  ,   []) data pairs were plotted and shown in Figure 8.The results show that the higher the liquid level is (more weight), the lower the measured frequency will be.The experimental data will be verified by fitting them with a theoretical curve generated by our proposed model in Section 3.2.Note that while many modes exist in the vibration after being knocking, we only trace one mode for the liquid level detection instead of doing detailed analysis for all the modes it generated.

Analytic Curve Fitting for the Experimental Data.
Given the measurement data collected in Figure 5, we need to convert the weight of the gas tank (  ) to the real level of the liquid (  ) in order to fit these data to the theoretical model.
The formula to do this conversion would need the parameters in Table 1.
On the basis of these parameters and given a weight (  ) for the gas tank, the height of the liquid-gas interface from bottom of the cylinder is The height of the liquid-gas interface measured from the bottom welded seam is The measurement data (  ) illustrated in Figure 5 can now be converted to the height of the liquid-gas interface (  ) by ( 22) and fitted to a theoretical curve of the proposed model in Figure 6.Note that the data are presented in normalized forms, that is, frequency ratio   (= 2  []/ 0 ) versus length ratio.Moreover, the cylinder was 86% full of the liquefied gas (maximum   is 0.86); and this had been confirmed by the gas tank supplier.
To fit the experimental data of  frequency ratio versus length ratio with the best theoretical curve, we formulate the problem as finding the boundary coefficients of the tank that the error function is minimized.The error function is defined as the sum of the squares of the errors between the experimental and the theoretical frequencies.Let  ex  and  th  be the experimental and theoretical frequency ratios at a given length ratio and let  be the number of experimental data.Then, solutions of  1 ,  2 ,  1 , and  2 can be obtained by minimizing the least square (LS) error between the experimental data and the theoretical value, where the minimization problem and its constraint are On the basis of LS minimization, the fitted theoretical curve (or response curve) was calculated by using  = 0.9 and we obtained the best result when  1 = 370 (N/m),  2 =  78 (N/m),  1 = 4.1 (Nm/rad), and  2 = 7.5 (Nm/rad), with an average deviation of 5%.This confirms our boundary conditions for a real cylinder.Furthermore, the linear spring constant at the bottom of the cylinder is larger than the top one; that is,  1 >  2 .This is also reasonable because the bottom welded seam ( 1 ) is attached to a circular steel and standing the ground, which makes it stiffer than the top welded seam ( 2 ).

Discussion
One interesting phenomenon worth investigating is the shape of the vibration.We are interested in how the spring constant (  ) and the torsional constant (  ) affect the displacement () and slope of the displacement (SOD,   ), respectively, around the boundaries.Theoretically, the larger the   value is, the smaller the displacement will be; also, the larger the   value is, the smaller the SOD becomes.The shape of the vibration based on the parameters in Section 3.2 for a halffilled gas cylinder was computed by using ( 4)- (16), and the result is shown in Figure 7.The right part of the figure is the computed result drawn in relative amplitude form, and the left part is a sketch to illustrate the displacement on the cylinder surface.As can be seen in Figure 7, a larger linear spring constant at the bottom ( 1 = 370 N/m) welded seam caused the vibration displacement to be slightly smaller than that of the top welded seam ( 2 = 78 N/m).The relative amplitudes at top and bottom welded seams are not large enough to claim a free boundary, and their nonzero values also made it differ from a clamped boundary.Furthermore, a smaller torsional constant at the bottom seam ( 1 =  4.1 Nm/rad) caused the SOD there to be higher than that of the top seam ( 1 = 7.5 Nm/rad).

Implementation and Application
LPGs stored in highly pressurized cylinders are used very commonly in households where gas pipe cannot be provided.People use gas cylinders almost anywhere to supply gas for water heaters and cooking devices.An apparatus, which can automatically foresee that the gas will be exhausted and notifies the supplier to deliver a new and full gas cylinder before it runs out, would greatly reduce the pressure of the providers and remove the inconvenience from the users.
A device has been therefore built to put our study into real application for sensing liquid level from outside of the cylinder, as shown in Figure 8(a).This compact apparatus can be attached to the surface of a gas tank under measurement using four strong permanent magnets (Figure 8(b)).It uses a TI MSP430 low power CPU as the processing unit for controlling the knocking device, computing the FFT and recording the dominant frequency for level tracking.The knocking device is illustrated in Figure 9, where a tube made of acrylic material and enclosed with coil is working with a powerful (permanent) magnet to create the pushing (knocking) and pulling action.The pushing and pulling is controlled by the direction of the current flowing through the coil.
The purpose of this device is to detect the near-empty condition of the gas tank by accomplishing most of the work flow shown in Figure 4.However, in actual practice, the knocking action executed one time per day at designated time, and the first step of "measurement and recording the total weight of the gas tank (  )" is not necessary.Furthermore, gas was not released but consumed through normal usage.The device will send out an alarm signal when the tank is close to empty.Several tests run on different gas tank under normal use were evaluated and four sets of data recorded by the device are demonstrated in Figure 10.One data point represents one day of measurement, and each set has different shape and length of data due to different tank and usage.If each of them is fitted with theoretical curve, they will apparently have different  1 ,  1 ,  2 , and  2 values; however, they will follow the proposed model.
If we can calibrate each gas cylinder to obtain its response curve, then the curve can be used to find its fluid level given the dominant frequency at any given time.Because every gas cylinder has a different response curve and the user might obtain a different cylinder on each new delivery, it is not practical to use the curve directly to measure the level.Fortunately, the gas providers only need near-empty condition (e.g., 1/4 of gas left); this is when they need to be notified so that they have enough time to schedule the delivery.
During repeated experiments, we found that the gas cylinder always follows its own curve for each usage, and  empirically, when   []/  [0] is close to 1.2, the liquid level is about 1/4 of the full level (shown as dotted line in Figure 10).Therefore, the only information we need for near-empty detection is the dominant frequency when the gas tank is full (  [0]) and the continuous monitoring of the measured   [].The factor 1.2 can be slightly increased if the provider needs a lower liquid level to be notified.

Conclusions
In this paper, we proposed a model for a partly filled and pressurized cylinder with general boundary conditions and solutions for the transversal vibration were presented.
To verify the model and method of calculation, we tested several household LPG gas cylinders to measure the dominant frequencies of vibration under various liquid levels.These tests were conducted both in the laboratory and at different locations of practical usage.The results showed that the experimental data of frequency ratio versus the length (or level) ratio can be fitted by a theoretical curve based on the Euler-Bernoulli equation.The frequency versus liquid level of a gas cylinder is explained by setting proper torsional and linear spring constants under the proposed model.Standing on the foundations that were laid by the former researchers, our proposed model has gone a step further to consider more complicated boundary conditions and includes previous study as special solution.A device has been built to successfully detect the near-empty condition for the commercial gas cylinder based on the proposed model.The advantage of our proposed method is that the measurement can easily be conducted at any proper time and is accurate enough for practical usage.The disadvantage of the current approach is that to obtain absolute value of liquid level, a calibration process similar to that we conducted in Section 3 is needed.More widespread field tests are currently under investigation by cooperating with local gas providers to collect more data for further improvement.

Figure 1 :
Figure 1: Schematic representation of a gas cylinder showing two different mass densities  and   along with properly modeled boundary conditions.
Distance between two welded seams: 53 cm Bottom of the cylinder to the welded seam: 9 cm

Figure 3 : 1 Figure 4 :
Figure 3: Image of a commercial gas cylinder with parameter values.

Table 1 :Figure 5 :
Figure 5: Frequencies of vibration with respect to the weight of the gas cylinder.

Figure 6 :
Figure6: The experiment data (dot line) can be successfully fitted and matched to a theoretical curve.Model studied in[13] was plotted for comparison.

Figure 7 :
Figure 7: Vibration generated by using (4) given the estimated spring and torsional constants.

Figure 8 :
Figure 8: (a) The contents of the measuring device, where a black ring on the right photo enclosed a hole to allow the knocking action.(b)The device is attached to the surface of the gas cylinder during measurement process.

Figure 9 :
Figure 9: A knocking device made of permanent magnet and coil.The sound generated from knocking is picked up by a microphone next to it.(a) Pulling action and (b) pushing action.