Go Down

### Topic: Volume Meassurement (Dry Method) (Read 10981 times)previous topic - next topic

##### Apr 22, 2014, 11:22 pmLast Edit: Apr 30, 2014, 03:03 pm by arduinoadrian Reason: 1
Hi:
I have been working on this project on and off for a long time. It has been my "Phoenix Project". Being defeated several times by it, I had to come back from my ashes with new ideas and lessons learnt. Although still needs some fine tuning, I think perseverance prevailed. The goal was to have an alternative to the thousands of years old immersion method to measure the volume of irregular objects, some of which can't be immersed. By extension, the system can be used to measure leaks in a sealed a container. The greatest obstacle was finding/fabricating a leak free container under pressure. I have tried about 10 different ones and all of them leak. I still have to work on that.
I would like to hear your suggestions, comments, ideas, critics and opinions.
Thanks.

Project built with Processing 1.5.1 and Arduino UNO.

#1
##### Apr 23, 2014, 03:05 pmLast Edit: Apr 23, 2014, 03:20 pm by arduinoadrian Reason: 1
Referring to the operation I can't find a convincing explanation for these 2 facts:

-The spike in the curve right when inflation finishes.
-The slight difference during the first half of deflation between the ideal exponential decay curve (pink) and the real pressure measured (top of the blue area). After that they are almost identical.

These are factors I've been weighing in to find answers:

-I'm using elastic (very flexible) silicone tubing which expands and contracts.
-Leaks in the system dependent on pressure, adding weight to the exponential decay at the beginning of deflation when the pressure is higher.
-The fact that air is a compressible fluid.
-Reduction in hose diameter to connect to the Pr. sensor.
-Delays in the transmission of the pressure waves inside the pneumatic system.
-Minute decreases in air temp as it enters the container and expands.
-The fact that I'm using a one piston compressor directly driving the pressure in the system and not from a stable pressure source such as a tank and inflating though a solenoid valve openning .
-The whole theory is wrong and I made too many approximations and assumed too many equivalences.

Even when these 2 facts appear to be constant and therefore systematic and the way I'm calculating the volume apparently effectively cancels them, it will be good to find answers to these questions.
Any ideas??
Thanks

#### B83s

#2
##### Apr 23, 2014, 04:38 pm
hello

When you compress/decompress a gaz in a closed volume, there is a change in it's temperature according this law P.V/T = constant (Pressure in Pa, Volume in m3 and Temperature in kelvin)

this could explain the spike (air is hot at the end of inflation in the bottle) and when you stop it is cooling and the pressure decrease ...
the slight difference between the deflation too (strong deflation at the begining causing a drop of the temperature ...)

#### MarkT

#3
##### Apr 23, 2014, 04:40 pm
[ I will NOT respond to personal messages, I WILL delete them, use the forum please ]

#4
##### Apr 23, 2014, 05:04 pm
Quote

this could explain the spike (air is hot at the end of inflation in the bottle) and when you stop it is cooling and the pressure decrease ...
the slight difference between the deflation too (strong deflation at the begining causing a drop of the temperature ...)

Interesting explanation and very possible. Thanks

Quote
Have you thought about differential methods or using acoustic resonance to probe
volume (the elastic constant of a container of gas depends on the volume of gas).

In practice, there are many different methods to solve the same problem. I had the intention to test this one, which by the way, I haven't found in use or tested anywhere else. Another alternative I think. Like any other, probably with some advantages as well as disadvantages.

#5
##### Apr 23, 2014, 05:14 pm
I started this Project because while working on the one below, I thought it was a good way to find out how many Gauges the operator had placed in the bench for real. This was perfect, as there was no need to add any extra hardware and only coding could solve the problem using the already installed hardware. I was seriously defeated at that time given the complexity of the whole thing, despite trying really hard for about a month and decided to tackle the problem in complete isolation from any other Project to better understand and study what was really going on.
I'm planning on posting a video with the rest of this project some day.

#6
##### Apr 30, 2014, 03:05 pmLast Edit: May 02, 2014, 11:33 pm by arduinoadrian Reason: 1
I still have to work more on this Project, sorry.

#### mirith

#7
##### May 02, 2014, 04:21 pm
The biggest difficulties I see with the problem, as you mentioned are
1) Making the container air-tight (which is an annoying problem),  Do you have access to a decent machine shop where you can talk to someone about this?  It might be more complicated than you think
2) Adding a fixed amount of air.  The basis for your measurement, similar to the 'wet' method, is there is a fixed and known amount of fluid entering the system.  Then based on this known amount, the object inside the measurement then affects the fluid, in the case of water (non compressible) increasing the measured volume of the liquid, and in the case of air (compressible), it increases the pressure.  This does however rely on a very accurate measurement of the amount of gas inside the container.  I'm not an expert on this, but I've been working with gas flow controllers for a while now, and that seems like a very expensive thing.

However, in writing this, I had a thought:
Take 2 containers that have a valve in between each other, Both with known volumes, and a pressure sensor inside each (Or maybe not).  One you can place an object whose volume is to be measured.  Place the object in, and purge gas down to atmospheric pressure, and make sure the two are at equal pressure before sealing them off from each other.  Now feed air into the one with the object.  This will increase the pressure in the object's container by some amount.  The amount is not important at the moment, but it will stabilize and equal something.  Record it.  Now open the valve between the two containers.  The pressure in the two containers will equalize to some other value.  What I believe (though I do not have good knowledge of fluid dynamics to be sure), is that depending on the size of the object in the first container, which will reduce the volume of the first container by some unknown amount, and by measuring the change in pressure between the two volumes (Container 1 - Object, and Container 1+2-Object), you should be able to calculate the volume of the object, because the amount of air inside the container did not change between the two volumes.  Assuming that the temperature stays the same (This might be unreasonable), or by measuring it and including it in your calculations, wouldn't this be true?

#8
##### May 02, 2014, 10:46 pm
Yes, making the container leak free has been really difficult. The main problem is the leaks change every time it is opened to place the sample inside. However, once the container is sealed and the test repeated, it looks the repeatability of the results is good (if temp does not changes significantly). I already checked a local machine shop with a proposed container to be built; but since my goal for now is to find if the method could be used, I have been delaying that.
The fixed amount of air looks a good assertion; but I'm using the air pressure drop in the vessel as an indirect method of finding the volume. The initial pressure from which deflation occurs is measured on every test. The time it takes to reach 36.7% of the initial value is recorded and the volume calculated. I have changed the initial pressure at which the container is filled and the time to reach 36.7% of the new initial Pr. appears to be about the same.
Another problem affecting the results is temp drift. The air volume required to reach the required initial Pr changes at different temps, and that affects the calculated volume. This is possible to solve (I think) and I have been trying to find the relationship between the measured volume and temp, (by also measuring the temp); but that has proven to be really difficult.
I don't know much about fluids dynamics either; but I wanted to test if this method could work.
I'm still working on this.

#9
##### May 03, 2014, 02:16 am
I've been thinking on the 2 containers method you suggested and seems very feasible too; but perhaps, I will have the same 2 problems again: containers leak and temp dependency of the amount of air entering the first container (the one with the object) and it will basically be the same thing; but I really don't know either??. So far, the results I've obtained with one container, apparently indicate the method is working; but I still have to solve these two problems, that I think  are the reasons for (greater) inaccuracies, which only appear, once I open the container or the temp changes substantially. The results repeat, when temp is about the same and leaks are about the same, which I can observe by repeating the test over and over without opening the container.
Thanks.

#10
##### May 04, 2014, 03:07 pm
This is a screen picture after one of my latest tests. The repeatability looks really good while the container is kept sealed and temp does not changes substantially. I definitely has to seek professional help to solve the container leaks problem; but that costs real \$\$\$ and not just my personal time on this. Please beware I'm still working on this; but anyhow if you have any ideas, let me know.

#### dlloyd

#11
##### May 05, 2014, 03:24 am
Interesting project ... I do see some similarities when comparing this with the testing of diaphragm gas meters by using a bell prover (something I used to do many moons ago). With the bell prover, a measured volume of room temperature air at only 2 oz pressure is passed through the meter. A photo-electric sensor monitors the test dial and starts/stops the test, then the true volume delivered is read from the prover. In both cases here, measuring temperature and pressure with high precision and accuracy is important.

However, I think there is a problem with precision ... it could be mathematical, poor matching of sensor range to ADC range, or perhaps higher ADC resolution is required. If its mathematical, sometimes 6 digits of precision is needed in order to get several digits of precision in the results (you're using exponential equations).

Start Pressure (hPa) jumps from 134.41 to 134.16 and back, indicating 0.25 hPa resolution.
Pressure @ TC (hPa) has many readings the same ... they change by 0.05 or 0.10 hPa.
Its good to know how much these changes are affecting your volume calculations.
Also, in all calculations, try using at least 6 digits of precision.

Quote
Referring to the operation I can't find a convincing explanation for these 2 facts:
- ...
-The slight difference during the first half of deflation between the ideal exponential decay curve (pink) and the real pressure measured (top of the blue area). After that they are almost identical.

Perhaps the compressibility factor (Z) of air is playing a role here.

#12
##### May 05, 2014, 07:29 amLast Edit: May 05, 2014, 07:32 am by arduinoadrian Reason: 1
Quote
I do see some similarities when comparing this with the testing of diaphragm gas meters by using a bell prover

I'm trying to measure the volume of the object not the gas. I have no idea about these tests you are mentioning or the diaphragm gas meters; but I will search as it seems to be very interesting. If you have a link to a website, please post it.
Quote
In both cases here, measuring temperature and pressure with high precision and accuracy is important.

That's very true. My intention so far was just to test if this could work, high accuracy is not the goal yet. These are just preliminary tests and results. I'm using some good enough sensors (I guess) for this trial; but perhaps in a future stage of this, I will need to use better ones. I didn't want to go for expensive ones without making sure it could be done, find out practical problems and details by testing, writing the code and making a prototype.
I'm using:
-For Pressure Honeywell SSCDRNN250MGAA5 datasheet (http://sensing.honeywell.com/index.php/ci_id/44282/la_id/1/document/1/re_id/0)
I chose this sensors mainly because of the simplicity of use and also because they are linear and should not introduce much problems other than constant errors which could be canceled by adding or subtracting a correction factor (if present). I placed means in the code for that. There could be small calibration issues and errors added as I don't have precise standards to check; but they will be systematic and possible to cancel. I'm more interested in "behavior" of the physical variables at this point than their exact values. Later on it all needs precise adjustment and you are right about that.

Quote
However, I think there is a problem with precision ... it could be mathematical, poor matching of sensor range to ADC range, or perhaps higher ADC resolution is required.

That I don't see very well; but I'll check your suggestions carefully.
-I'm rounding the results just for display on the screen; but calculations are done without rounding with full floats before displaying the results. I'll check anyway, there maybe some cases where its not. I though approximating 3 decimal digits was enough for display for now.
The AD conversion I'm using which includes averaging among other things, is resolving more than the 1024 normal steps the Arduino ADC can resolve (using it). I've been working on achieving this for a while now (you can check some of my previous Projects). That creates the 0.05hPa steps in the 0-250mbar range which will otherwise won't be possible to achieve and constitute a very good observation from you which I haven't noticed. Anyhow, the jumps and their differences in both cases (Start Pr and Pr@TC)  are more because of other factors, I think. The fact that Arduino takes time to read the values and the code takes time to find the thresholds as there are other things that need to be done also (communication, etc). As example, deflation starts by time 20 000 milliseconds after the inflation is stopped at 150hPa (that's what I set it for). Inflation is stopped by finding when the Pr surpasses that threshold and there is a small error involved there. Since time elapsed is the trigger, perhaps the resolution in the differentiation of time originated by the loop duration is creating the impression of the 0.25hPa. The loop duration is not fixed though, it depends on what needs to be done and that could be another factor. The 0.25hPa jumps you have observed, could be just this particular test. I have to observe if that repeats in others. On the other hand, Arduino finds the TC by looking for the Pr to drop to 36.7% of the initial value, then sends the value to the computer (the TC which is what I'm after and the Start Pr recorded). This is a true threshold comparison, different than the time elapsed triggering and the recording of the Start Pr and perhaps the reason for the diffrences in the resolutions you have observed in both cases (This could be more precise; but I don't know???).

This is something I might need to try to improve as it adds uncertainty to the results; but honestly, I don't think this is a major influential factor. The leaks and temp issues are, I guess. It will be good to be able to quantify how much uncertainty they add though, as you pointed out.

Also, much of the info such as Start Pr, Pr at TC is there as I placed all that from the very beginning of  the Project trying to solve the exponential equation as you thought. They are still there in case any calculations are needed; but in reality I'm not using them in the calculations or solving the exponential equation to find the volume. To do that, I needed to precisely know the flow restrictor value I used, which is a constant in the equation. The restrictor is just an obstruction I placed inside the bleeding hose, which value I don't know. I tried to calculate that and was difficult, so I opted for another more simple method. Since the container volume is a constant, the flow restrictor is a constant (assuming no leaks) and from the equivalences for a given volume there should be a Time "Constant" regardless of the initial Pr (as the TC concept suggests) the only factor affecting the TC (TC=R*C) is (C) the Volume of  the container (affected by the volume of the object). In other words, the volume the air occupies. So I set up tests using fairly equal batteries as standards for which I measured the volume and presumed each of them equal. Ran the test with 0, 1, 2, 3, 4 and 5 batteries inside the container (each test 10 times) and then plotted expected Object Volume (determined by the batteries) vs. average TC measured in Excel, with the data being logged automatically. From there, I got an equation which relates  Object Volume  vs. TC which is fairly linear as expected.
Since the TC is the only factor I really need to have precisely measured, I concentrated on that and did not place much emphasis on the rest of the values (not needed). That's probably why, you may have observed some precision problems; but they may not be affecting the results. Calculating the volume this way, gives much better results and accuracy than solving the exponential equation. This way any other factors influencing are contained in the equation by means of the TC. If the TC measurement is affected by anything constant (I'm aware of or not), the effect is present in the equation and effectively canceled. If trying to solve the exponential equation no other factor will be cancelled, unless I know about it and added it somehow to the calculations, if I can do that (probably not). Of course, all this procedure must be repeated precisely using a container and pneumatic system with zero leaks, real volume standards and at precise temperature. The repeatability should be improved considerably when all that and temp compensation are added. That's why I think this is apparently working fine. I'm consistently obtaining excellent repeatability, like the one shown, given the container is not opened and temp. does not changes substantially (stays within about 1 Celsius). As you can see, I still have to work more on this to get there. Now is when \$\$\$ is required.
Thanks.

#13
##### May 05, 2014, 01:42 pm
Quote
Perhaps the compressibility factor (Z) of air is playing a role here.

Perhaps, yes. This could also be influencing. I've been thinking maybe its a combination of factors, some of which I have no idea about.

It is important to mention that Relative Humidity and Atmospheric Pr are not being measured at this time and RH in particular, could be influencing the results also. That is pending.

I think, the results so far prove this is possible and the method is valid, however fine tuning is required. To be honest, I can't continue from this point on with this by myself, as it is a matter of resources to build the container(s) and perform precise measurements and adjustments with precise standards I don't have access to. Perhaps, someone here has access to these things or maybe a University or Institution is willing to help with this as a research Project with real practical applications. Any help or suggestions will be much appreciated.

Thank you so much.

#### dlloyd

#14
##### May 05, 2014, 05:02 pmLast Edit: May 06, 2014, 12:06 am by dlloyd Reason: 1
Quote
I'm trying to measure the volume of the object not the gas. I have no idea about these tests you are mentioning or the diaphragm gas meters; but I will search as it seems to be very interesting. If you have a link to a website, please post it.

Most all the same considerations are needed. In both cases we have temerature, pressure, flow and volume.

Some of the specifications and procedures are documented here(A, B, C) however, I wish I had kept my notes - it was pre-internet days.

Re: The compressibility factor (Z) of air - the curve is similar to the deviations you have found. It would only take some simple mathematics or use values from a look up table to correct for this.

Quote
That I don't see very well; but I'll check your suggestions carefully.
-I'm rounding the results just for display on the screen; but calculations are done without rounding with full floats before displaying the results. I'll check anyway, there maybe some cases where its not. I though approximating 3 decimal digits was enough for display for now.

Approximating 3 decimal digits might be enough for the display, but its how the numbers are determined that can influence the effective precision in the results. Certain equations can have a precision reducing effect.
For example, P = I2R where I = 1A and R = 1 ohm and both have been measured with 5% precision (not accuracy).
At the low end, we would get P = (0.95)2*0.95 = 0.857 Watt
At the high end, we would get P = (1.05)2*1.05 = 1.157 Watt
So, using numbers with 5% precision here affects the results by more than 15%

As mentioned, using floats is good - I would make sure all partial calculations do not truncate valid information. For some statistical MADT calculations, 6 digits of precision is required, for the meter testing I've performed, 12-bit ADCs were used - higher precision was desired but not available at the time.

From your link to the sensor, its pressure range is 1 psi to 150 psi (60 mbar to 10 bar) (69 hPa to 10,342 hPa). The datasheet notes High resolution (min. 0.03 %FSS), so this represents 3.1 hPa resolution. Note you are only using this at the very low end (0.5-2 psi range). Would a different low-cost sensor be available, say within 0-10 psi range?

I'm not sure how you have pre-conditioned the signal levels into the 10-bit ADC. Perhaps resolution could be improved as follows. If ADC code 0 represents the lowest pressure you'll ever measure, say 40 hPa, and ADC code 1023 represents the highest pressure you'll ever measure, say 140 hpa, then the resolution becomes only 0.09765625 hPa per step. You may only need an op-amp or 2 to achieve this.

\$\$\$ may not be required at this point yet ... there may be still room for low-cost or no-cost improvements.

EDIT:

Quote
The AD conversion I'm using which includes averaging among other things, is resolving more than the 1024 normal steps the Arduino ADC can resolve (using it). I've been working on achieving this for a while now (you can check some of my previous Projects). That creates the 0.05hPa steps in the 0-250mbar range which will otherwise won't be possible to achieve and constitute a very good observation from you which I haven't noticed.

Oops - missed this. If averaging (sensor resolution 3.1 hPa) among other things can get 0.05 hPa steps, then perhaps averaging readings with 0.098 hPa resolution could result in 0.01 hPa steps.

Quote

As example, deflation starts by time 20 000 milliseconds after the inflation is stopped at 150hPa (that's what I set it for). Inflation is stopped by finding when the Pr surpasses that threshold and there is a small error involved there. Since time elapsed is the trigger, perhaps the resolution in the differentiation of time originated by the loop duration is creating the impression of the 0.25hPa.

Yes - possible. All time values should also be floats (numbers like 20 could be expressed as 20.0 in calculations)

Valve Timing:
If the solenoid valves have AC coils and if your using a zero-crossing type relay there could be +/- 8.3 ms timing variance (@60Hz AC), if the relays are phase-type, this would be improved. Anyhow, for any type of solenoid (AC or DC coil) there is its response time to activate or deactivate that might have to be considered if the solenoids are controlling the testing start/stop.

Volume determination:
I'm wondering if the object's volume could be determined by looking at just a portion of the decompression test. Then using certain pressure readings within a window of the test to be the trigger points. Say for example 120 hPa as a start trigger and 80 hPa as a stop trigger. That way, more time could be allowed after pressurizing, after the valve opens and before the valve closes. This could be done just by taking data from a more stabilized, but definite portion of the results to determine volume.

Leaking problem:
What if the pump just pre-charges a small tank to around 5 psi. Then the check valve (I think this is the leak source) is replaced with an on/off solenoid control valve (which is inherently leak-free). Another benefit would be air that is much more stabilized with temperature and humidity for performing the tests.

(just some random and perhaps crazy thoughts in case something was missed)

Go Up