The present disclosure relates to methods for determining a level of a medium in a container, computer readable media, and probing systems.
Determining the level of a medium (for example a fluid, in particular a liquid, such as oil or water, or a mixture of different fluid) in a tank or container with high accuracy may be an important task in various applications.
The fluid as referred to herein may be a liquid.
The level of the medium may be determined from Time Domain Reflectometry (TDR) sensor data, which may also be referred to as an echo curve.
As explained with reference to
Presently used methods may use a thresholding procedure where a positive value is defined and a reflection in the echo curve exceeding this level is considered to be from the medium level. Its location (in other words: its time-instant) may be used to estimate the ToF. This may be combined by an interpolation method to improve the ToF estimation. Such a method, however, cannot reliably measure the medium level when the fluid level within the container is low (for example less than 7 cm) and/or the fluid has foam above it and/or the medium is a layered medium.
Presently used systems may address TDR performance issues for low fluid levels with TDR sensor probes having a vertical and horizontal part. Thus, mechanical changes to conventional TDR sensors with a straight probe may be made. This, however, may limit the applicability of the TDR sensors due to a complicated shape of the probe. For example, the horizontal part of the probe cannot be easily instrumented within typical containers. Moreover, it is a costly solution and difficult to manufacture.
Other presently used system may formulate the ToF estimation problem with sampling below Nyquist rate using finite rate of innovation approach. This, however, may lead to degradation in performance due to using sub-Nyquist rates which are no longer a limitation with other innovations, e.g. time-equivalent-sampling, enabling data acquisition at the required rates within longer time windows, and may require a substantial change to the hardware of the TDR sensors (for example for established legacy designs).
In presently used methods, the TDR sensor may send a narrow(er) pulse, i.e. wideband in the frequency domain, to address challenges due to overlapping pulses in the echo curve. This, may however complicate and increase the cost of the hardware involved, for example the processing chain, and may have limited impact on the achieved accuracy for low fluid levels.
It is an object of the present invention to provide methods, computer readable media and probe systems for determining a level of a medium in a container. In particular, methods, computer readable media and probe systems shall be provided which have the above mentioned properties of being able to reliably determine a level of a medium in a container even under difficult circumstances like low medium level, layered medium or foam on the medium.
The object is satisfied by a computer implemented method for determining a level of a medium in a container according to claim 1, a non-transitory computer readable medium according to claim 15, and a probing system according to claim 16. Embodiments are given in the subclaims, the description and the drawings.
In one aspect, the present disclosure is directed at a computer implemented method for determining a level of a medium in a container, comprising the following steps carried out by computer hardware components: sending a plurality of pulses through a probe in the container; sensing responses caused by reflections of the pulses; determining a statistical model related to the medium in the container based on the responses; and determining the level of the medium in the container based on the statistical model.
In other words, a statistical model may be used for determining the level of the medium. This may allow a robust detection of the level of the medium.
The statistical model may represent an echo curve. It has been found that instead of analysing a single echo curve, analysing a statistical model of the echo curve may increase robustness of the determination of the level of the medium.
The statistical model may comprise a probability distribution. The probability distribution may represent probabilities of peaks.
The statistical model may be determined based on fitting parameters of the probability distribution to the sensed responses. The parameters may comprise one or more of: mean, amplitude, and number of peaks.
The statistical model may be determined using a Markov Chain Monte Carlo interference technique.
Determining the statistical model may comprise adding peaks (which may be referred to as a “birth” of a peak), removing peaks (which may be referred to as a “death” of a peak), or maintaining a number of peaks. In any case (adding a peak, removing a peak, or maintaining the number of peaks), data such as location of each peak and amplitude of each peak may be updated based on measurement data.
A prior (in other words: a starting assumption on the probability distribution) and/or proposal distributions (in other words: (probability) distributions which may be used to update the estimate for the probability distribution) in the statistical model may be determined based on a peak proximity parameter (PPP, which may also be referred to as δ). It has been found that avoiding detecting peaks too close to each other may increase the robustness of the determination of the level of the medium.
The computer implemented method may further comprise determining point estimates for locations and amplitudes of (for example positive) pulses based on the statistical model. The level of the medium in the container may be determined based on the point estimates.
The computer implemented method may further comprise determining locations of the reflections based on the point estimates. The level of the medium in the container may be determined based on the locations of the reflections. The level of the medium in the container may be determined using at least one pre-determined rule based on the locations of the reflections.
The computer implemented method may further comprise tracking of the level of the medium in the container. This may increase robustness of the determination of the level of the medium by including a history of previous measurement data.
The computer implemented method may further comprise decomposing the statistical model into a plurality of reflections. The computer implemented method may further comprise identifying the medium based on the plurality of reflections.
The computer implemented method may further comprise identifying a medium situation based on the plurality of reflections. The medium situation may comprise at least one of a situation with one and only one layer of medium, a situation with a plurality of layers of medium, or a situation with presence of foam.
According to another aspect, a non-transitory computer readable medium may comprise instructions which, when executed by a computer system, make the computer system carry out the computer implemented method as described herein.
According to another aspect, a probing system may comprise: an emitter configured to send a plurality of pulses through a probe in a container; a sensor configured to sense responses caused by reflections of the pulses; and a determination circuit configured to determine a statistical model related to a medium in the container based on the responses, and to determine a level of the medium in the container based on the statistical model. The emitter and the sensor may be provided in a shared device, which may be referred to as “probe”, and may share parts; for example, some parts of the probe may be used while emitting, and the same parts may be used for detection.
The methods as described herein may also be applied to radar sensors (where also overlap of pulses may occur), for example freely emitting radar sensors, for example without any specific probe to transmit pulses. Similarly, a probing system using radar pulses may be used.
Exemplary embodiments and functions of the present disclosure are described herein in conjunction with the following drawings, showing schematically:
According to various embodiments, an advanced Bayesian estimation method may be provided for the estimation of the locations of all reflections in the echo curve and their amplitudes. With these methods, the medium level may be estimated accurately even if it is very low and layered.
Accurate estimation of the medium level may be achieved by fitting the echo curve into a statistical model.
As will be described in more detail below, at any time instant tk, the echo curve may be described by the sum of an unknown number N of Gaussian pulses ϕ(tk|μn, σ2), wherein the means μn (in other words: location along time axis) and scaling values An are to be estimated, and the variance σ2 (in other words, the width of the sent pulse) is known. Thus, the echo curve at a time instant tk may be expressed as
where Gaussian noise ε(tk) is added to represent measurements errors.
By defining statistical priors on the unknowns, i.e. An (for example Gaussian with a standard deviation of 1000), μn (for example uniform distribution with non-zero support from zero to the latest possible reflection from the probe end) and N (for example a discrete set of possibilities such as N∈{3,6,10,25,30}, etc.):
According to various embodiments, a reversible jump Markov chain Monte Carlo method may be provided for efficient inference for the general problem of pulse fitting. In particular, the potential of an adopted parametric model overfitting to the (noisy) data via the inclusion of a peak proximity parameter may be reduced. This may facilitate learning a more representative underlying model and may reduce the computational cost. Synthetic and real data may be used to demonstrate the efficacy of the introduced Bayesian technique.
“Reverse Jump MCMC (RJ-MCMC) inference algorithm for TDR with a peak proximity parameter” may be a principled formulation for determining the number of pulses in the echo curve.
Pulse fitting may refer to a problem occurring in many applications, such as Nuclear Magnetic Resonance spectroscopy and Time Domain Reflectometry (TDR). The goal of pulse fitting may be to estimate the parameters of underlying pulses from which the observed data are generated. For example, amplitudes may be used to inspect the faultiness of wires. In TDR, which follows the same principles as guided radar, an electromagnetic pulse may be sent down a probe and the combination of attained reflections yields the echo curve. Another TDR instrumentation, with numerous uses in the food, beverage, and pharmaceutical industries, may be employed to measure the medium/fluid levels in sealed industrial containers. Here, the location of the pulse reflected by the fluid surface may correspond to its level in the container (so can be seen as a Time of Flight (ToF) inference problem). Estimating this pulse location may be especially challenging when the reflection pertaining to the fluid surface is severely obfuscated by other reflections, for instance, from the probe's end when the fluid level is low (i.e., the peak at τ2 can be too low to detect or be concealed by that at τ3, as illustrated in
For simplicity, and without loss of generality, details may be provided for a one-dimensional case. It will be understood that a higher dimensional case may be provided accordingly.
Each datum, yk, may be assumed to be a discretised observation of a continuous curve of pulses, x(t), with additive Gaussian noise. To further simplify, pulses may be illustrated to be restricted to (unnormalised) Gaussian shapes of equal and known variance, σ2. Other pulse shapes, such as log-normal or Lorentzian may also be used. Thus, for all k=1, . . . , K,
where tk is the kth sampling time of t=(t1, . . . , tK)T and σy2 is the measurement noise variance. The quantities of interest are the peak locations, μ=(μ1, . . . , μN)T, and the amplitudes, A=(A1, . . . , AN)T, with N the number of peaks, which is unknown. The methods according to various embodiments may determine μ, and/or A, and/or N.
As used herein, vectors are printed in bold, and scalars and matrices are printed non-bold.
According to various embodiments, a peak proximity parameter (PPP), which may be referred to as δ, may be introduced into both the prior and the proposal distributions of a Markov Chain Monte Carlo (MCMC) method. Markov Chain Monte Carlo are known as such and are widely used.
According to various embodiments, a Reversible Jump MCMC (RJ-MCMC) inference scheme for pulse fitting may be provided. As described herein, methods both with and without use of the PPP are compared to demonstrate the value of this addition on both synthetic and real data.
In the frequency domain (and/or in the frequentist domain), pulse fitting may be handled by a non-linear least squares approach, or with a variation thereof, such as a weighted least squares method, which focuses on fitting the most meaningful peaks. Within a Bayesian framework, a RJ-MCMC scheme may be utilised, where the reversible jump may be used to generate samples with different numbers of peaks. To achieve a variation in peak numbers, a birth-and-death MCMC scheme may be used, where additional peaks may be introduced (corresponding to “birth”) or where peaks may be removed (corresponding to “death”). Due to the data-driven proposal distributions used, dimension-changing steps (for example “birth” step or “death” step) being rejected too often (which would make the sampling inefficient) may be largely circumvented, as proposals may have high likelihood contributions.
RJ-MCMC may be an extension of MCMC which allows so-called ‘reversible jump’ moves. These may yield a parameter's sample having different dimensionality to the previous. As described herein, (single) peak birth and death move types may be used, as well as a fixed dimension Metropolis-within-Gibbs move type, derived from the standard Metropolis-Hastings (MH) and Gibbs sampler schemes, as will be described in more detail below.
Vectorising equation (1) yields y=FA+ε where F:=F(t, μ) is a matrix satisfying Fki=ϕ(tk|μi, σ2). Linearity in A is beneficial, but is not available for μ. A Metropolis step may be used to sample μ, which may require a proposal distribution to be chosen. The prior, p(μ|N), may typically be uninformative, and the likelihood complex, so the proposal is normally a random walk MH. Slice sampling may be used to propose new samples for each μi. This method may provide a replacement for the random walk MH that does not require tuning. It may depend on the current μi sample, and so can produce several consecutive samples which yield a low acceptance probability. According to various embodiments, a proposal distribution may be provided which avoids this dependence, which may allow for better mixing of the RJ-MCMC sampling.
One way to avoid the complexity of allowing dimension-changing steps is to assume excessive dimensionality, in this case, assuming a fixed number of peaks which is more than the curve could comprise. The hope is that the amplitude samples of excess peaks are close to zero. As will be shown further below, peaks may cancel or combine to fit the data better as it can use the extra complexity to better explain the noise. However, this results in the samples poorly capturing the true curve. This remains a concern even when using RJ-MCMC schemes. However, according to various embodiments, the PPP may be provided to avoid this overfitting. Another method to overcome it is to propose peak merging and peak splitting steps. The strategy proposed here is simpler, by just preventing peaks from being near enough that a split or merge step would be necessary.
The RJ-MCMC scheme according to various embodiments will be described in the following. This involves specifying the reversible jump steps, which may be of birth and death varieties, as well as the fixed dimension step type. Within this last, which is responsible for the majority of the exploration of the parameter space of each dimension, a Metropolis-within-Gibbs scheme may be provided.
Let j index the S samples, {μj, Aj}, the first B of which are discarded. Then, with bracketed tildes being optional, define
where {tilde over (μ)}ij is the jth proposed sample for μi as is {tilde over (μ)}bj, but for a new peak (in other words: a new-born peak, indicated by index “b”). Define these similarly for A (where relevant). Also, let ω−I=ω\ωI, for any vector ω. Finally, the number of peaks, N, may have a Poisson prior, whose parameter is λ: p(N)˜Po(λ).
The choice of prior for the amplitudes is chosen to yield tractability, and so is chosen to be Gaussian,
By standard Gaussian theory, the posterior becomes
where I∘ is the ∘×∘ identity matrix. Then, p(Ai|A−i, μ, y, N), which can be derived by more Gaussian properties, becomes
It is from this that most amplitude samples will be generated.
The prior on the locations may be chosen to be independently uniform. However, in another embodiment, a modification to this may be provided, for example by using of the peak proximity parameter, δ. For the interval, L=[t1, tK],
with 1(∘) being the indicator function.
Using this (with or without δ), the posterior is intractable, jointly or conditionally on the other locations. Thus, it may be desirable to define a proposal distribution for peak i, qμ, from which to get samples. For computational efficiency whilst retaining sample quality, use of the data within the proposal may be essential. As such, qμ may be based on a discrete convolution between a discretised Gaussian peak and the ‘unexplained’ data, placing high probability of peak placement near to areas of insufficient data explanation. At all tk within δ of any μi′, i′≠i, the proposal, to match the prior, is set to zero. Then,
where rk′i=yk′−F(tk′, μ−i)A−i is the k′th ‘unexplained’ datum without using peak i. As possible locations are continuous, qμ is defined continuously by linear interpolation. With a slight abuse of set notation, let {tilde over (t)} be, in ascending order, t and all points exactly δ from a current peak: {tilde over (t)}=t∪{τ∈L|∃i′≠i:τ=μi′+δ}. Hence, qμ({tilde over (t)}k| . . . )=qμ(tk′| . . . ) if {tilde over (t)}k=tk′, and zero if {tilde over (t)}k∉t, is well defined. Thus, for t∈[{tilde over (t)}k, {tilde over (t)}k+1), we have
The normalising constant for (7), Q*, may be computed as
Now the RJ-MCMC step types may be described: birth, death, and fixed dimension. For the fixed dimension type at step j (thereby accepting Nj=Nj-1), each peak i may be sampled,
Both μij={tilde over (μ)}ij and Aij=Ãij may be accepted with probability αij=min(1, {tilde over (α)}ij), where, after cancelling all distributions of the unchanged peak parameters, and the location priors, one finds
To clarify, a new peak i is proposed, and this proposal is accepted (or rejected) before proposing the following peak.
For a birth type at step j, Ñj=Nj-1+1 is proposed, as is the new peak, together with all amplitudes jointly
The apparent redundancy of sampling all amplitudes, rather than just that of the new peak, Abj, may be justified by the desire for all Aij to be conditioned on this new peak's location. This choice may increase both the birth and death acceptance rates.
For a death step, Ñj=Nj-1−1 may be proposed, along with the peak to be deleted, I, which may be done with probability p(i|Aj-1, Nj-1)∝|Aij-1|−1 (placing higher probability on less significant peaks), and all remaining amplitudes. That is,
For the (generalised) acceptance probabilities of these step types, we define a useful function ρ=ρ(μ, A, a, i),
where N=dim μ, qN=(N|N′) is the proposal of the step type for N and N′, and R=∫L1((μ−iT, t)T∈SN)dt is the length of all points >δ from all peaks. The acceptance probabilities (which include accepting Nj=Ñj) for birth and death, βj=min(1, {tilde over (β)}j) and γj=min(1, {tilde over (γ)}j), respectively, are then
For qN, we choose qN(N+1|N)=qN(N−1|N)=c, for some c, when N>0, and qN(1|0)=1. Finally, initialization may be done with N0=0 peaks.
The RJ-MCMC method according to various embodiments may be summarized as follows, wherein S may be the number of sampling steps to be performed:
In the following, experimentation results will be provided.
The method according to various embodiments, using the PPP, is compared against the same model, only without the PPP; this may illustrate the effect of δ. The model without the PPP may only differ from its counterpart in the prior on locations, which is now simply uniform, and the proposal distribution, qμ, which simplifies by avoiding the need to define {tilde over (t)}, instead being just the linear interpolation of qμ(t| . . . ).
Comparisons are made on both synthetic 1D (one-dimensional) data and real measurements from a TDR sensor.
Each of the 100 synthetic data sets is generated from the priors of the model without the PPP. From the samples generated, a ‘fitted curve’ can be found:
Five metrics are considered. Firstly is the Root Mean Square Error (RMSE) between the true and fitted curves. The next two, ‘overlap’ and ‘cancellation’ averaged over samples, aim to quantify overfitting, by comparison to the same on the true curve. The ‘overlap’ for i, i′ same-sign peaks (i.e., sign(Aij)=sign(Ai′j) is
including standardisation via division of the total peak area. The ‘overlap’ metric is (17) summed over all same-sign peaks, and averaged over samples. Cancellation is simply the area under the linear interpolation of |FjAj|, standardised as for overlap, and averaged over samples. The final metrics are the average number of peaks per sample, and the average run time, in seconds (machine: Apple M1, CPU@3.2 GHz, 16 GB RAM). If a method has much higher overlap and cancellation than the true curve, but fits the data well, then this indicates probable overfitting.
Both methods are given the same hyperparameters, which, where relevant, are the same as those used to generate the data. Namely, (S, B, σ2, A, c, σy2)=(300, 100, 20, 5, 0.1, 1). All peaks are treated symmetrically and independently, so (mA, ΣA)=(0N, σA2IN), ∀N, with σA2=100. Additionally, for the model using it, the PPP is
Its relatively small size compared to the peak ‘width’, ≈6σ′, is noteworthy.
The averaged results for all 100 data sets are shown in Table 1.
For further evaluation, real unprocessed TDR measurements may be used. This data may be for an oil medium with a dielectric constant of approximately 2, at a low level (24.7 mm) in a sealed container; TDR vertical probe is of length ≈900 mm. The resultant echo curve may be provided with a sampling period of T≈60.9 ps.
Inference on this data set yields
Whilst the ‘true curve’ is unknown, the fluid level's peak is known in the experiment. An estimate of this, {circumflex over (μ)}, is found for both methods and, as the synthetic experiment suggested may be the case, the use of the PPP results in a better representation of the curve, shown by the more accurate fluid level estimate. It is noted that the pulse reflected from the medium level (with positive amplitude) is not clearly visible in
When making a crude (but reasonable) approximation to the full posterior
by fixing the number of peaks to the best estimate, Ñ, only one result (for the fixed number of peaks) may be provided.
The methods according to various embodiments may use Reversible Jump MCMC, which may make a better approximation of the full posterior (albeit at higher cost) by varying N in a more complex way.
Each surface is shown with two plots (for two peaks
The four peaks in
According to various embodiments, the statistical model may represent an echo curve.
According to various embodiments, the statistical model may include or may be a probability distribution.
According to various embodiments, the statistical model may be determined based on fitting parameters of the probability distribution to the sensed responses.
According to various embodiments, the parameters may include or may be one or more of: mean, amplitude, and number of peaks.
According to various embodiments, the statistical model may be determined using a Markov Chain Monte Carlo interference technique.
According to various embodiments, determining the statistical model may include adding peaks, removing peaks, or maintaining a number of peaks.
According to various embodiments, a prior and/or proposal distributions in the statistical model may be determined based on a peak proximity parameter.
According to various embodiments, the method may further include determining point estimates for locations and amplitudes of (for example positive) pulses based on the statistical model. According to various embodiments, the level of the medium in the container may be determined based on the point estimates.
According to various embodiments, the method may further include determining locations of the reflections based on the point estimates. According to various embodiments, the level of the medium in the container may be determined based on the locations of the reflections.
According to various embodiments, the method may further include tracking of the level of the medium in the container.
According to various embodiments, the method may further include decomposing the statistical model into a plurality of reflections.
According to various embodiments, the method may further include identifying the medium based on the plurality of reflections.
According to various embodiments, the method may further include identifying a medium situation based on the plurality of reflections.
Various embodiments provide a method for pulse fitting with RJ-MCMC via the use of a peak proximity parameter, δ. This prevents pulses from encroaching on one another, reducing overfitting by not considering an excessive number of underlying peaks. The benefits of this approach are demonstrated on both synthetic and real TDR data. Results show that the formulation according to various embodiments not only significantly improves the learning of the latent data model, but also substantially reduces the computational complexity, as captured by the run times. These derive from the reduction of peaks being modelled, thus circumventing the aforementioned overfitting and requiring fewer computations. Various embodiments may be applied to high dimensional signals.
The methods as described herein, including MCMC, may effectively find the best model that fits the observed data (in other words: best fits the TDR echo curve), including the number of pulses it contains. Thus, the method according to various embodiments may be a pulse fitting (optimisation) method, which may also be referred to as pulse separation method.
The methods according to various embodiments provide a solution with the statistical nature, i.e. involving statistical approaches. The possibility of both negative and positive reflections may be addressed by the Bayesian pulse fitting methods according to various embodiments by enabling to learn N (i.e. the number of pulses). The methods according to various embodiments provide an efficient MCMC scheme due to both the marginalised sample acceptance approach (i.e. accept/reject each proposed {tilde over (μ)}n individually, rather than accepting/rejecting their collective, {tilde over (μ)}), and a data-driven proposal distribution used to sample said pulse means, improving efficiency.
The methods according to various embodiments may accurately estimate medium levels under different scenarios, including for low level fluids and layered mediums. The methods may not require a mechanical change to the TDR sensor probe. The methods may not entail any changes to the processing chain or hardware. The methods may permit incorporating, in a principled way, known prior information (for example based on the probe length and/or type of fluid) to deliver accurate TDR sensing.
According to various embodiments, the sensed medium may be fully characterised by decomposing the echo curve into individual pulses. This may permit additional TDR sensing capabilities such as the automatic identification of the medium (for example identification of the type of the fluid) and the measurement scenario (for example whether a medium with one layer is present or whether a multiple layers medium (in other words: a medium with more than one layer) is present, and/or whether foam is present).
According to various embodiments, the medium level may be tracked over time via extending the MCMC formulation to include a dynamical model on the medium level. This may improve the robustness of the results (for example to mitigate outliers).
The computer system 800 may include a processor 802, a memory 804, and a non-transitory data storage 806. A probe 808 (which may include an emitter and a sensor) may be provided as part of the computer system 800 (like illustrated in
The processor 802 may carry out instructions provided in the memory 804. The non-transitory data storage 806 may store a computer program, including the instructions that may be transferred to the memory 804 and then executed by the processor 802. The probe 808 may include (or may act as) an emitter configured to send a plurality of pulses through a probe in a container. The probe 808 may further include (or may further act as) a sensor configured to sense responses caused by reflections of the pulses.
The processor 802, the memory 804, and the non-transitory data storage 806 may be coupled with each other, e.g. via an electrical connection 810, such as e.g. a cable or a computer bus or via any other suitable electrical connection to exchange electrical signals. The probe 808 may be coupled to the computer system 800, for example via an external interface, or may be provided as parts of the computer system (in other words: internal to the computer system, for example coupled via the electrical connection 810).
The terms “coupling” or “connection” are intended to include a direct “coupling” (for example via a physical link) or direct “connection” as well as an indirect “coupling” or indirect “connection” (for example via a logical link), respectively.
It will be understood that what has been described for one of the methods above may analogously hold true for the computer system 800.
Number | Date | Country | Kind |
---|---|---|---|
23196989.0 | Sep 2023 | EP | regional |