Tank weights and a 3hr avg

jtashaffer

Member
Join Date
Aug 2009
Location
KY
Posts
415
I am trying to get a rolling 3 hr avg of the tank weight loss of all 3 tanks.

3 tanks on 3 different scales with a 4 to 20mA signal to a Controllogix PLC. The tanks start at 2000lbs a piece. So I subtracted the tank original weight by the tank scaled weight for all 3 tanks. easy part. Then I used a cpt instruction to calculate all 3 tanks total usage. I am using a GSV instruction for timing. Any Ideas
 
If it were me, I would poll the weight once an hour and move that value to one position in a dint. Then as often as you want the average to update, add the three values, and divide to get your average. If you want better accuracy, then repeat the process more often. Hope that helps.

Will.
 
...3 hr avg of the tank weight loss of all 3 tanks
The Loss-in-Weight Average of a 3 tanks is a slightly different function than the Average Weight of 3 tanks.
 
Yes, you are on the right track. For each X time, subtract the current weight from the original starting weight for each tank, then average all of the tank weight losses over a rolling 3-hour period.

I think this average weight loss would have limited uses. Are you using the average weight losses to control a process? For most process control, the immediate tank weight loss works better than an average weight loss.
 
Last edited:
Yes I am. The rolling avg can't exced a certain limit in three hours or an alarm goes off if it does
 
Why can't you treat the tanks individually? Change the weight to level of each tank (0-100%). Add the 3 levels and divide by 3. If the value is less than X alarm out.
 
As of right now that is how I have it setup but I am not getting the right numbers after I do that. The number for the rolling avg is way to high. The alarm output is going off the whole time. That is why I was wanting a programming example of anyone has done a setup like this.
 
Maybe your scaling is not correct:
(Ouputlow-Ouputhigh)/(Inputlow-Inputhigh)=X
Outputhigh-(X*Inputhigh)

Process variable*((Ouputlow-Ouputhigh)/(Inputlow-Inputhigh))+(Outputhigh-(X*Inputhigh))
 
Last edited:
Scaling for the weight? I don't know if it my expresions or the moving of data from hour 1,2 or 3.
 
rocksalt your lost me. I am not understanding your expressions. The start weight for each tank is 2000 and the limit is 486 in a rolling 3hr avg.
 
Here's my outline of the procedure:


Initialization
1. Add current weight all three tanks -> 'Prev Total Current'
2. Place zero -> 'Usage hour 1', 'Usage Hour 2', 'Usage Hour 3'

Each Hour
1. Add current weight all three tanks -> 'Total Current'
2. Subtract that from 'Prev Total Current' -> 'Usage Hour 1'
3. Store 'Total Current' -> 'Prev Total Current'
4. Add 'Usage Hour 1', 'Usage Hour 2', 'Usage Hour 3'
5. Divide this by 3 -> 'Rolling 3 Hour Average Usage' - Compare and alarm if needed.
6. Shift 'Usage Hour 2' -> 'Usage Hour 3', 'Usage Hour 1' -> 'Usage Hour 2'

Note multiply number of storage postions as necessary for more frequent measurements.
 
Last edited:

Similar Topics

I want to measure the tank level and get the sensor output to the PLC. Below are the details : Tank Height =0 - 3m, the sensor is stalled 0,2m...
Replies
15
Views
611
Does anyone have RSLogix 5000 ladder diagram program of tank leveling (factory IO). Fill valve, discharge valve, set point, level, etc? I looked...
Replies
2
Views
156
I seem to remember a number of posts regarding calculation the actual level or volume in a horizontal tank, here is the formula written in ST...
Replies
15
Views
1,541
I'm coming from a background of PLC ladderlogic/rockwell products. I am new to blocks. Can you point me in right right direction? What I would...
Replies
5
Views
1,558
Back
Top Bottom