Sloshing calibration in tank - Page 1
Forum section: electronics / projects

author: bobisnoob
author_rank: Newbie
timestamp: March 02, 2013, 07:59:18 pm
content: Hi, I'm designing "Smart liquid level" for boats tanks which are irregular shape, the problem that I am facing is how to find out the level of the water in the tank when it start sloshing. I'm using pressure sensor to measure the height of the liquid, I was thinking to use gyroscope sensor to tell me when the tank starts tilting and as result of that the water in the tank will slosh around. So any good ideas of how to solve this problem? O0Best regards,Bob

author: Bloch
author_rank: Unknown
timestamp: March 02, 2013, 08:04:20 pm
content: Quote from: bobisnoob on March 02, 2013, 07:59:18 pmI think that the only one "proper" way is to measure weight.

author: cuban8
author_rank: Contributor
timestamp: March 02, 2013, 08:53:51 pm
content: Using gyros is not the proper way of doing it - the fuel in the tank doesn't care how the tank is oriented. It only cares where the acceleration vector is pointing. Use accelerometers to do this, then add additional (low pass) filtering to get rid of the sloshing effects. That's how it's done on airplanes (but these use normally capacitative probes, not pressure sensors).

author: bobisnoob
author_rank: Newbie
timestamp: March 02, 2013, 09:08:08 pm
content: Thanks for replies. The problem is for sailing boats the angle of the tank is kept at approximately 10-15 degrees, so the tank will be at that angle,therefore my pressure sensor will give me the wrong reading of the height. How would the accelerometer sensor help me to get the right reading?

author: cuban8
author_rank: Contributor
timestamp: March 02, 2013, 09:21:14 pm
content: The accelerometer tells you which way is "down" for the fuel. With this information you know how the fuel level is oriented (i.e. perpendicular to "down"). Knowing the shape of the tank and the location of your probe, you can then estimate the remaining volume from the probe reading. Since your probe is a pressure sensor, you might need to scale the reading based on the total acceleration as well (no idea how many "g"s a sailboat can achieve in a turn...).

author: Thor-Arne
author_rank: Unknown
timestamp: March 02, 2013, 09:27:13 pm
content: I'd suggest to use flow-meters to measure what comes in and goes out of the tank and calculate from there.

author: bobisnoob
author_rank: Newbie
timestamp: March 02, 2013, 09:30:25 pm
content: The problem with boat tanks is they have irregular shaped due to space issue so I won't be able to know the shape of the tank exactly.

author: IanB
author_rank: Super Contributor
timestamp: March 02, 2013, 09:31:27 pm
content: How often do you need to measure the level?The simplest answer is to use an accelerometer and a gyroscope to determine when the boat is level and not moving and only then take a reading. At other times store the previous good reading and don't update it until the boat is once more level and still.If that doesn't work you will need to put a variety of sensors at different points in the tank, use low pass filters to remove the noise and smooth out the readings, and then compute the amount of water from the measurements and the tank geometry.

author: IanB
author_rank: Super Contributor
timestamp: March 02, 2013, 09:33:08 pm
content: Quote from: bobisnoob on March 02, 2013, 09:30:25 pmThat is still a problem even for a level boat sitting in the dock. If you don't know the shape of the tank a level reading won't tell you how much water is in the tank unless you do a calibration of level against volume.

author: Thor-Arne
author_rank: Unknown
timestamp: March 02, 2013, 09:39:14 pm
content: Quote from: bobisnoob on March 02, 2013, 09:30:25 pmWith flow-meters the shape or sloshing won't matter.

author: cuban8
author_rank: Contributor
timestamp: March 02, 2013, 09:48:41 pm
content: The problem with the irregular shaped tank can be addressed with calibration. You fill the tank with a known amount of fuel, then tilt it in both axes to build a lookup table. For example, fill to 10%, then take readings at 0, +/-1, +/-2 etc. in x, then at 0, +/-1, +/-2 etc. in y. Then fill to 20% and repeat. Repeat up to 100%. With this lookup table you can correct the readings based on the accelerometer reading (obviously, you need a three axis accelerometer so you can measure tilt in both x and y).

author: bobisnoob
author_rank: Newbie
timestamp: March 02, 2013, 09:55:02 pm
content: Quote from: IanB on March 02, 2013, 09:33:08 pmI have no problem with that. I know how to calibrate the tank. I have question though, I've read about kalman filter and complementary filter to get accurate angle reading when you combine gyroscope with accelerometer. But I think this makes things complicated. Is there a way to use gyroscope to let me know when the tank is tilted and from calibration I have for the tank I need to compensate for the new reading?

author: bobisnoob
author_rank: Newbie
timestamp: March 02, 2013, 10:04:24 pm
content: Quote from: cuban8 on March 02, 2013, 09:48:41 pmI liked your idea, a friend of mine told me to fill the tank for example half full then go for sailing at that volume then from the readings of gyroscope or accelerometer as you proposed, I will get look up table for the readings at that volume. I thought about it but I'm not quiet sure if I understand it. If you don't mind can you explain more.Thank you

author: notsob
author_rank: Frequent Contributor
timestamp: March 02, 2013, 10:45:21 pm
content: Don't forget to allow for the delay that baffles will put on level changes in larger tanks.

author: IanB
author_rank: Super Contributor
timestamp: March 02, 2013, 11:01:32 pm
content: Quote from: bobisnoob on March 02, 2013, 09:55:02 pmA Kalman filter allows you to combine predictions of where you should be now with possibly inaccurate measurements of where you seem to be now to come up with a best estimate of where you actually are. So for instance if your accelerometer gives you a roll rate you can combine that with a time measurement to predict how far you have rolled (with some error involved). Your gyro gives you a measure of your current roll angle (also with some error involved). If you combine both measurements in the appropriate way you can determine the actual roll angle with less error. But a Kalman filter involves horribly complicated mathematics, so unless you have access to a black box that does it all for you, don't even think about it.What kind of tank are we talking about? Is it a fresh water tank? If so, Thor-Arne's flow meter would be a good idea. Fill the tank to a known level while in dock and reset the meter. Use the meter to monitor all water drawn from the tank. The meter will count down to zero and tell you exactly when the tank is approaching empty.

author: Rerouter
author_rank: Super Contributor
timestamp: March 02, 2013, 11:15:48 pm
content: though its probably the non smart way to go about it, a heavy average is the way its done in commercial fuel gauges, (in there case they use glycerine in the meter movement to slow down its rate of change) as if a boat is indeed rocking, and your pressure sensor is mounted towards the middle, your likely to end up with a correct average (unless you want down to the liter accuracy then it gets interesting,also curious why your using a pressure sensor over the standard resistive sender (as the crud in the fuel tank will clog the measurement point over time, the standard arm sender is un-ideal for this as the tanks are irregular, but you can get reed switch senders that effectively fit the same hole and do a better job (straight pole),now i am affiliated with this company, but its relevant,http://www.airco.com.au/PDF/Senders_Swiches_Adaptors.pdfbottom of page 81, is the type of sensor i am reccomending, if the pressure side of it does not work out,

author: ftransform
author_rank: Frequent Contributor
timestamp: March 03, 2013, 03:33:28 am
content: I thought that these systems typically measured flow.

author: SeanB
author_rank: Super Contributor
timestamp: March 03, 2013, 10:31:01 am
content: Simple method is to use a few sensors, placed near the corners, and then summed at the output to get a value that is an average of level in the tank. Works best in capacitive sensors, where you just wire them in parallel and then read the resulting value and convert to a quantity via some look up table ( or appropriate scaling in simple cases). The method can be used to do a variety of fluids by appropriate choice of sensor material, as they are invariable driven by an AC waveform.

author: Bloch
author_rank: Unknown
timestamp: March 03, 2013, 10:57:58 am
content: If it is so important then not just weight it with some load-cells ?

author: SeanB
author_rank: Super Contributor
timestamp: March 03, 2013, 12:49:33 pm
content: Measuring flow is good, but it breaks down if you have a leak or there is a difference in sensitivity between the sensor on input and output. As it is a boat the tank is essentially a part of the hull, so it will be difficult to fit a loadcell in there. The simple method often used is to have 2 sensors at opposite ends of the tank port and starboard, and then average the readings with a really long averaging time constant on the display, so that it takes literally a minute to show a step change. relies on the most common change being roll, not pitch. As well put the withdrawal pickup in the centre of the tank and if you are really going to run to empty have a small surge tank in the pipe after the pump to ensure continuous flow.

author: jh15
author_rank: Frequent Contributor
timestamp: March 05, 2013, 01:39:27 am
content: I worked in avionics and we built tubular capacitance probes for use in aircraft wing and center tanks.Be careful of electric power in tank though.After the TWA flight 800 explosion, the probes were redesigned to have less residual power delivered inside the tank as a precaution.