Determining Consumption and Refill in a Tank

UserFriendly

Member
Join Date
Mar 2012
Location
USA
Posts
2
Hi all,

I'm working with an application with small chemical pumps drawing from a tank sitting on a weight scale with transmitter (measured in lbs).

I need to:
A). measure the consumption of the chemicals
B). measure the refill amount following a refill

The time to refill would probably be between 3 and 15 minutes depending on the size of the tank.

The time to consume the whole tank would be over 2-3 days.

For A.)
I found a thread on here describing oil consumption, to sum up:

Move analog value X to a memory location every Y seconds/minutes, set a bit.

Move analog value Z to different memory location over same period.

Subtract X-Z and average.

Totalize average consumption.

Is there a simpler way of doing this?

B.) It seems I should be doing the same but the opposite here. I feel the timing may really be important.

Unfortunately both of these will be difficult to test with an active system, so any help or previous experience would be most appreciated.

I'm using a Micrologix 1400 with RSLogix500 8.40.

Thanks!

UserFriendly
 
User,

A). Measure the consumption of the chemicals:
1. At the end of each "T" seconds (when a Timer gets done timing to T seconds, move the analog value Chemical Weight (current weight in lbs) to a memory location "New Weight", then
2. Subtract Old Weight minus New Weight, and save difference to memory location "Difference in Lbs", then
3. Divide Difference by T seconds, save result in "Consumption (Lbs per Second), then
4. Move New Weight to Old Weight, then
5. Restart Timer and run next Consumption calculations. You can do the Steps 1 to 5 as often as you need the consuption to be update - T = 1 second, 10 seconds, 100 seconds, whatever.

B). Measure the refill amount following a refill:
The refill can be done automatically if you refill with a solenoid valve from a larger tank. However, if it is a manual refill, then you need a switch to tell the PLC that you are going to Refill Mode.

1. When the Refill Switch is OFF (= 0 or false), move the Chemical Weight (current weight in lbs which you already have from Part A) to a new memory variable called "Weight B Just Before Refill".
2. Turn on the Refill Switch and refill the tanks. When the Refill Switch is turn ON (= 1 or true), move the Chemical Weight (current weight in lbs which you already have from Part A) to a new memory variable called "Weight A After Refill".
3. Subtract Weight A minus Weight B = Refill Amount in Lbs, and save to whatever variable you want to call it.
4. Turn off the Refill Switch.

I have RSLogix examples if you need to see some. One is an actual running program that has 9 small chemical pumps feeding out of small burrettes hanging from load cells, to calculate the chemical feed rate for operator display, and to control the pumping rate (speed of pumps), and also to compute the refill point of the burrettes (which are refilled automatically when the total weight = refill weight for that burrette).
 
Last edited:
Hi UserFriendly,

I note your tank usage time is over a couple of days. one thing you'll need to experiment with is how often you update your calculation - if you do it too often (say every 1 second, if the tank volume is only turned over every 2 days) then measurement error in your analog input as well as your weight sensor could cause accumulated error / error propogation (can't remember the correct term for it!).

Basically each time you do your calculation you're adding in a little bit of error, especially if the level is only changing by a very small amount between measurements.

I'd say you'd be best placed to start doing your calc every 15 minutes, assuming product is used continuously. If possible, I'd trend the tank level over those 2-3 days and observe the change in level to get a feel for a suitable delta t.
 
One thing you'll need to experiment with is how often you update your calculation - if you do it too often (say every 1 second, if the tank volume is only turned over every 2 days) then measurement error in your analog input as well as your weight sensor could cause accumulated error / error propogation
From experience, it depends on for what you use this calculation. In my case I was using it not only to compute the Tank Refill point, but also to control the speed of the chemical pumps (based on calculated flow rate from the tank loss-in-weight per unit of time. 15 minutes would be much too long for speed control using LIW.

On the other hand, the error introduced by 1-second time period would not matter very much if the only use is to determine a refill point every 2 or 3 days. (Besides, the error is going to depend more on the load cell accuracy and the resolution of the load-cell-to-plc transisiton. Using a shorter time period only introduces a small error based on the PLC scan cycle, and there is a way around that, if needed.) If the tank is 1000 liters and the PLC says "Refill" but you have used only 950 liters - so what? You just add 950 liters and you are done. As long as you did not run out before the PLC indicates "Refill" then you are okay. Your error must be on the + side so that you always have some left at the refill point. For chemical process tanks, it is okay to still have a little left, but not okay to run dry.

The time to refill would probably be between 3 and 15 minutes depending on the size of the tank. The time to consume the whole tank would be over 2-3 days.
User,

There is something unexplained here. If the time to refill is 15 minutes, then how can it take 3 days to consume the whole tank? I think you must mean the "Time to Refill a Downstream Tank - call it Small Tank B" is 15 minutes, and the that the time to consume the original Large Tank A on the load cell is 2 to 3 days. That would make sense, so your chemical pump would be feeding out of Tank A for 15 minutes to refill Tank B. After 3 days (or whenever your Consumption = Refill Point), then signal that Tank A needs a refill.

Or do you mean there is only one Tank A, and it lasts for 3 days, but when it is refilled, that it takes 15 minutes to do the refill? That is a slightly different ball game.
 
Last edited:
Consumption time is independent of refill time.

Depends on the fill device and the rate of consumption.

The issue of cumulative error is most noticeable when the tank overflows.

I hope this is just for rate of use general information , you should be using a low and high level to fill the tank.

Timers and math will fail you eventually without some input or reset point.

That's why CNC machines have a HOME position, to zero out the accumulated errors.
 
Consumption time is independent of refill time.
Say what?

If I have one tank, and it takes 60 minutes to "consume" the chemical in that tank, then how often will I need to refill said tank? Would you call that independent.
 
Say what?

If I have one tank, and it takes 60 minutes to "consume" the chemical in that tank, then how often will I need to refill said tank? Would you call that independent.

yes exactly.

Process requires 1 gallon per batch
10 batches a day.
10 gallons a day.
Consumed in 100 days.
12 inch fill line on a 1000 gallon tank will not take 100 days to fill the tank at any reasonable pressure.

In my experience the fill and drain of a tank do not have to be the same size and often the fill or drain are significantly different, sometimes intentionally.
 
I think I see now. We are talking about two different variables. You are talking about the amount of time required TO fill the tank. I was talking about the time UNTIL the next refill.

The amount of chemical processing that can be done is the time until the next refill, or Total Time - Refill Time = Processing Time. Normally you want to minimize the time needed to refill in order to maximize the processing time.
 
Last edited:
While the OP hasn't really explained what's pumping where and what sort of process this is, it sounds quite similar to something I have to do every now and then, which is to calculate a "dosage rate" based on drop in tank level (Water & Waste Water treatment plants).

The Tank might be 1000L, but chemical is only dosed at anywhere between 1-5L/hr. That equates to a 0.1% to 0.5% drop in tank level per hour, and i've found that sampling too often just gives erratic results since there's not enough difference between measurements to yield an accurate number.

Most of the time the operators will only look at the trend once a week and compare it to pump speed to see if the chemical lines are starting to block (Lime slurry, horrible stuff).

They also then connect a second, manual pump and wonder why the "pump flow" calc suddenly goes up...
 
So much easier and more robust to actually measure the level and report it. Use actual level to calculate the rate of usage if you like.

Of course if it isn't worth the money to install a level indicator, it probably isn't that critical.

Nothing beats looking at actual data.
 
The Tank might be 1000L, but chemical is only dosed at anywhere between 1-5L/hr. That equates to a 0.1% to 0.5% drop in tank level per hour, and i've found that sampling too often just gives erratic results
What we did was hang a 50 milliliter burrette on a precision load cell below each tank, and weigh the change in the burrette, which gives much better resolution. We had no trouble seeing the change there. When the burrette is 80% empty, we start a Refill Mode, freeze the pump speed so that is is not upset by the Refill, open a solenoid to the large nurse tank, monitor the burrette weight and stop the Refill when the burrette reaches its full weight. When the Refill Mode ends, the pump is switched back to the normal loss-in-weight speed control. We thought that we would have set the sample time to 10 seconds in order to see the small weight change, but found that the pump speed and refill worked best at a 1-second sample time. The pumping rate is in the range of 1 drop per second.

The total weight from the large tank is also monitored, so that its refill point can be calculated using the same weights from the burrette load cells. That is an efficient triple-function for one load cell: pump speed control to control the rate of injection into the process, burrette level control and refill, and main nurse tank level and refill.
 
Last edited:
User,

There is something unexplained here.

Sorry, there is a bulk tank which is manually filled by truck delivery. The day tank is filled from the bulk tank by a transfer pump which is activated manually by the operator.

Thanks everyone for your notes on Consumption.

For the refill, correct me if I'm wrong, but I think we'll need to determine:
1. When the tank is being refilled
2. When it is done filling
3. Have a measurement for each of these states to determine how much was added.

For (1), I think if a value increase above the size of error, could trigger a bit for "Refilling", the current weight is moved to a register "Weight1".

(2) Maybe a time off delay to trigger when "Refilling" goes FALSE, current weight is moved to a register "Weight2", subtract Weight2-Weight1 = amount filled.

I'm curious if anyone sees any possible errors with this method. I feel there may be some amount of weight lost between when the tank is physically being filled and the "Refilling" bit goes TRUE.

Use actual level to calculate the rate of usage if you like.
I need to do the same for another location which uses level instead of weight. Would this method be similar? I'm trying to think of how this would be different.
 
I need to do the same for another location which uses level instead of weight. Would this method be similar? I'm trying to think of how this would be different.
Level switches for High and Low allow you to use the switch contacts directly to control program functions, where as for loss-in-weight control, you must do some calculations. The main reason for using loss-in-weight control is usually that the liquid material is highly corrosive, or for solids and powders, there are no suitable economical level switches available.

I'm curious if anyone sees any possible errors with this method. I feel there may be some amount of weight lost between when the tank is physically being filled and the "Refilling" bit goes TRUE.
The Refill Mode requires special handling to prevent errors. For example, in normal mode, the loss in weight of the tank is used to calculate the flow rate of material leaving the tank.

But in Refill Mode, things are reversed. The flow rate is "frozen" at the last known measured rate, so that a calculation of the the weight leaving can be made (frozen flow rate LBS/SECOND multiplied by measured refill time in SECONDS = LBS of weight lost during refill) and addded to the Total Consumed even while the tank is being filled. True, the pumping flow rate will vary somewhat, and that is why it is important to keep the flow rate during refill as constant as possible and to keep the refill time as short as possible. For a wildly-varying flow rate, this method does not work very well.

It is important not to reset Refill Mode until 1 sample-time cycle AFTER the physical weight addition has stopped. The reason is so that the Old Weight gets set equal to the New Tank Full Refilled Weight. If the Refill Mode is stopped exactly when the weight addition stops, then the Old Weight will be less than the New Weight, so the flow rate calculation will prduce a negative flow rate. This is avoided by only resetting the Refill Mode relay when the sample timer reaches "DONE" 1 sample time period after the operator signals the end of physical refilling.
 
Last edited:

Similar Topics

We are in the process of installing a new DC drive to replace a 1373 series Speedpak drive. There are 8 leads coming out of the motor -- Two for...
Replies
5
Views
810
Good morning! I am looking for a clever method to determine the number of occurrences in a series using ladder logic. What I need to determine is...
Replies
6
Views
1,236
I have my PLC and HMI connected to my local network over DHCP just like my laptop. I can upload and download including VNC to the HMI over wifi...
Replies
2
Views
1,129
We have a DC Drive (ABB DCS800) which is running a load (initially) at a fixed speed. For testing purposes, we want to simulate a different...
Replies
20
Views
6,157
ive been tasked, due to a restructure of our inventory, to find out how big our SLC programs are. specifically, we have several dozen 5/05s at...
Replies
4
Views
1,592
Back
Top Bottom