Totalizing volume with a level transmitter

Robb B

Lifetime Supporting Member
Join Date
Feb 2011
Location
BC, Canuckistan
Posts
356
Is this reasonable to do?

I am using a SLC 5/05 so there's no totalizing instruction, I think I have to make my own. Anybody done this, any starting points to consider?

To make it even more fun, the receiver tank may or may not be emptied during the cycle, and may or may not have leftover from a previous cycle.
 
Usually totalizers are used with flow meters. Is that what you have?

Using a level transmitter, you should be able to calculate the volume based on the current level. You will need the tank dimensions and a little math.
 
Calculated volume change.


It depends if tank is filled before emptying or filled same time than emptying.

Now as it same time emptyed and filled, you need to know both level change and output flow to outside from tank same time. (Volume = flow out + level change * tank bottom area)

If both filling and pumping out is same speed, level never changes and it makes everything more fun.






Is emptying allways with same flow or is flow changing all time?

(If speed / flow is constant, you can forgot level change and calculate only pumping time (s) * flow litres / s = volume
 
Last edited:
Usually totalizers are used with flow meters. Is that what you have?

Using a level transmitter, you should be able to calculate the volume based on the current level. You will need the tank dimensions and a little math.

No flow meter, I believe it's a magtech level transmitter. I can get the volume okay, it's how to add it that I'm not sure on. Obviously the ADD instruction, but how can I use the max value before it gets emptied? And then add that to the next quantity, and so on.
 
Calculated volume change.


It depends if tank is filled before emptying or filled same time than emptying.

Now as it same time emptyed and filled, you need to know both level change and output flow to outside from tank same time. (Volume = flow out + level change * tank bottom area)

If both filling and pumping out is same speed, level never changes and it makes everything more fun.






Is emptying allways with same flow or is flow changing all time?

(If speed / flow is constant, you can forgot level change and calculate only pumping time (s) * flow litres / s = volume

The source of condensate is from a vacuum cycle, so the flow will be irregular. In addition it may be repeated several times until no more condensate accumulates. I will be adding an input signal to the PLC for when the tank is drained by a valve.
 
Well I think I have an in-progress solution. I think it is simpler than I was considering. For whatever reason I can't add pictures from this location (IT issue I think) but basically it's just moving the calculated volume to a register, then adding the moved volumes each time the tank is drained (can't add to the tank while draining, since it's part of a vacuum circuit). Then I just have to program it to deal with operator errors...
 
I haven't worked the problem since then, but now have to.

I have a level transmitter, reading level in inches, but I convert to gallons for Panelview HMI already. I am thinking to use this level in a chart on Ignition, but need to figure out how to only add the initial minimum to the next maximum, then add the next minimum to maximum spans, and repeat this for however many times the tank is emptied. Essentially, I need to only sum the positive increases in volume. I am very new to Ignition, and we're using an SLC 5/05, so no fancy tags available.
 
I haven't worked the problem since then, but now have to.

I have a level transmitter, reading level in inches, but I convert to gallons for Panelview HMI already. I am thinking to use this level in a chart on Ignition, but need to figure out how to only add the initial minimum to the next maximum, then add the next minimum to maximum spans, and repeat this for however many times the tank is emptied. Essentially, I need to only sum the positive increases in volume. I am very new to Ignition, and we're using an SLC 5/05, so no fancy tags available.

I would lean toward doing this in the SLC especially if that PLC has access to other control information like the status of a drain cycle or valve command.

If all you have available is the level signal, then using the Ignition database power might make more sense. The Ignition Forum is quite good. There are folks over there who are masters with database querying and Ignition scripting.
 
Ignition scripting is Python (or Jython), isn't it? That is not to different from simple ST. Anyway, the language doesn't really matter. It's the algorithm that needs to be right, especially for the edge cases.


One major edge case is noise in the signal.


For example, one simple approach would be to attribute any increase in level as material being added to the tank, and any decrease in level as material being removed from the tank and delivered downstream.


It seems like it is the former that you are looking for. So a simple approach would be to subtract the current level from the previous level, and if the result is positive then add it to the running total. However, what if all valves are closed and any variation in level is only due to noise in the instrument, so it goes up 0.01 inch, then down 0.01 inch, then up, then down, etc.? The simple approach described would add each down-to-up transition to the running total, even though no liquid was entering the tank.


To deal with that noise, with no other information, the code could keep track of the most recent maximum and minimum levels, and any time the current level goes more than some amount below the maximum, then assume that indicates the start of a draining event, and vice versa for filling events. So draining event triggers (1) using the last minimum to the current maximum as the amount to ADD to the running total, and (2) resetting the minimum to the current value. Likewise a filling event triggers resetting the maximum to the current value.



You also mention that there is some indication of when the tank is filling and/or when it is draining, so perhaps that could also be used to trigger when the maximum and minimum values are reset.


There are probably other edge cases e.g. what about power cycles? What about operator errors? That is where you are going to spend the most time.
 
Robb B said:
I haven't worked the problem since then, but now have to.

I have a level transmitter, reading level in inches, but I convert to gallons for Panelview HMI already. I am thinking to use this level in a chart on Ignition, but need to figure out how to only add the initial minimum to the next maximum, then add the next minimum to maximum spans, and repeat this for however many times the tank is emptied. Essentially, I need to only sum the positive increases in volume. I am very new to Ignition, and we're using an SLC 5/05, so no fancy tags available.

Perhaps you might find the examples in this technote of use?

ID: QA2273 | Access Levels: Everyone
RSLogix 500 Totalizer Examples

Regards,
George
 
a little info please.
what is in the tank?
what is the shape of the tank?
what is the dimensions?

we do this all the time, but i need info to help.
james

Tank contains mostly water, but mixed with creosote and bunker C, plus whatever else is in the wood.

Tank is a vertical cylinder. I do not have the dimensions exactly, other than nominal capacity is 185.1 imperial gallons.

I already calculate the volume from the level transmitters via SCP instruction.
 
Ignition scripting is Python (or Jython), isn't it? That is not to different from simple ST. Anyway, the language doesn't really matter. It's the algorithm that needs to be right, especially for the edge cases.


One major edge case is noise in the signal.


For example, one simple approach would be to attribute any increase in level as material being added to the tank, and any decrease in level as material being removed from the tank and delivered downstream.


It seems like it is the former that you are looking for. So a simple approach would be to subtract the current level from the previous level, and if the result is positive then add it to the running total. However, what if all valves are closed and any variation in level is only due to noise in the instrument, so it goes up 0.01 inch, then down 0.01 inch, then up, then down, etc.? The simple approach described would add each down-to-up transition to the running total, even though no liquid was entering the tank.


To deal with that noise, with no other information, the code could keep track of the most recent maximum and minimum levels, and any time the current level goes more than some amount below the maximum, then assume that indicates the start of a draining event, and vice versa for filling events. So draining event triggers (1) using the last minimum to the current maximum as the amount to ADD to the running total, and (2) resetting the minimum to the current value. Likewise a filling event triggers resetting the maximum to the current value.



You also mention that there is some indication of when the tank is filling and/or when it is draining, so perhaps that could also be used to trigger when the maximum and minimum values are reset.


There are probably other edge cases e.g. what about power cycles? What about operator errors? That is where you are going to spend the most time.

The main problem I have is that the tank may be emptied more than once in a cycle, and I need to capture the total volume added during the cycle. I can certainly add the volume captured at the moment when the tank emptied, but that may not be volume from the current cycle, but instead from a previous cycle. This is why I thought ignition might be useful, as I do something similar with preservative volume used during the cycle.

I think I can filter out the noise, by setting a limits check on the min value of the volume. If the value hasn't changed by X amount in Y time, MOV that value to the amount to add from. Maybe something similar for the max value?

Like you said, quite a few edge cases to accommodate.
 

Similar Topics

Hello, all. I’ve worked with totalizers based on a flow meter. However, I am trying to use ladder logic on totalizing a tank based on volume. I...
Replies
1
Views
1,112
Hello everyone! I've got something I'm trying to figure out and I'm possibly overthinking it. I've got a 25,000 gallon bulk chemical tank with an...
Replies
12
Views
2,166
Hi, please i wish to do batch totalizing ( automatic flow control) i wish to use Endress+Hauser flow transmitter with Allen Bradley 1400 to do...
Replies
30
Views
5,891
Hey GE guys, wondering if any of you had any experience with getting the TOTALIZER instruction working in Proficy Machine Edition. Seems...
Replies
9
Views
3,561
We currently have 2 system measuring a liquid similar to water. Density is around 8.3lbs/gal. We take the flow in lbs/min and calculate lbs per...
Replies
15
Views
3,982
Back
Top Bottom