Flow totalizing from analog input

R

Thread Starter

rta53

We have a system installed for a customer which consists of a SLC 5/04 and a Panel View 1000. We have Signet Flow transmitters that give us a 4-20mA signal which we monitor on the Panel View. The customer wants me to display a running total from these transmitters. Has anyone done ladder logic that can accomplish this? Obviously I would like it to be as accurate as possible. Any help would be appreciated.
 
W
Okay, you've hit my hotbutton, or one of them.

In the first place, most Signet transmitters have a scaled pulse output, in addition to the 4-20.

If they do, or you can add it to the existing transmitters, here is the way to do it the most accurate way possible.

Scale the pulse so that it is slow enough so that you can use the low speed contact closure input on your PLC. Take that contact closure to a register and increment the register each time the contact closes. Display the contents of the register. If you scale the pulse to one count every "n" gallons, where "n" is a reasonable value (like "10" in a 2" pipe for example), you are creating a direct reading totalizer input and the register is a direct totalizer output.

No fancy math or PLC algorithm required. No mucking about with scan time, and how to integrate under a curve.

And even if you have to add a circuit card to the transmitter, or a current to pulse converter, you will save money because writing programs costs way
more money than doing that.

Walt Boyes

---------------------
Spitzer and Boyes LLC
"consulting from the engineer
to the distribution channel"
21118 SE 278th Place
Maple Valley, WA 98038
Ph. 425-432-8262
Fx. 253-981-0285
[email protected]
www.spitzerandboyes.com
--------------------------
 
I have had to create totalizers in quite a few applications. Once you have your flow Scaled to GPM, GPH, or whatever your Eng Units are, Divide it back in the PLC to Units/second and add that "One_Sec_Sample" to the "N" file address that will be used as your "Total" every second. I suggest using the SLC's PLC "Seconds" status word rather than a 1 second timer as it's accuracy is not overly effected by scan time. You can do this by comparing the status word (in a "Not_Equal_To" instruction) to another "N" file address (I usually call "Sec_Count") and using that instuction's output to pulse an "Add" instruction that adds "1" to the "Sec_Count". This makes for a very accurate 1 Second Timer that can be used to drive a resetable Time Totalizer for something like an Run Time display or in your case a 1 second Pulse to clock the "One_Second_Sample" into your Totalizer. If you need it to update more often than once a second you can divide things out even farther, but it's not long before you start to run into the "Scan Time" problem again. Bill R. [email protected]
 
> Your flow signal how is it sent? I mean does the 4-20mA correspond to l/s?? m3?? <

4-20mA = 0-100 GPM
 
T
If you use the DN bit of a TON instruction you can have significant error accumulate over time because the time interval will actually elapse asynchronously with your scan, but you won't pick it up until the TON and DN bit is scanned again. Ie, you might have a 1 second interval but a 10mSEC scan, thus having a potential error of a full second after 100 seconds. After a few days your totalizer is significantly off. You could use the S4 word, the free running clock, but a simple method is to use a TON with a 0.01 time base and a preset of 32767. (It will never time out, read on...) You don't use the DN bit, but rather use a GRT instruction to compare the timer ACC with your interval, say 1 second intervals. If ACC is greater than 100, then SUB 100 from the ACC and put the result back in ACC. Then perform your totalizing. Any timer over-run is pushed back into the accumulator, minimizing totalizer error. It may be helpful to go to the knowledgbase on ab.com and look up a tech note on the internal workings of timers. This will help you understand ways to keep your timing accurate despite scan rate issues. Granted 99.9% of the time who cares, but when totalizing, it can matter. (Also, use floating point math for this to minimize rounding error)
 
The right way to handle it is with a totalizer pulse output from the meter. That way you know your instrument's totalizer and your PLC's totalizer will match as long as your PLC is running.

If you don't have a totalizer pulse output, then you can totalize the analog value. It's messy, though.

If your PLC has an integrator function built in, you might be able to use that. Otherwise you can build your own.

Take your raw input and add it to DWORD#1 every second. When DWORD#1 > 65536, then increment DWORD#2 and subtract 65536 from DWORD#1. Also, when DWORD#1 < -65536, then decrement DWORD#2 and add 65536 to DWORD#1. What you have created is a 48 bit integer that will totalize any raw analog value with at least 68 years of capacity before rollover. You can sample more frequently if you like, but you need to watch the rollover interval.

Totalized flow (in engineering units) = to_real(DWORD#2) * MaxFlow * 65536. / (MaxAnalogVal * 60. sec/min * samples/sec)

MaxFlow can be litres/min, gallons/min, drops/min, snowflakes/min or whatever rate you are measuring as long as is per minute.

MaxAnalogVal is the raw analog value your analog card generates when you apply the maximum input signal (i.e. 20ma on a 4-20ma input). For GEFanuc Versamax cards, it's 32000, for some 13 bit cards, it may be 8192.

You may also need to correct for sensor zero drift. When there's no flow, (i.e. flowmeter downstream of a pump, and the pump's off) there should be no change in the totalizer. Keep track of a live zero and subtract it from your raw analog value before totalizing.

Analog totalizing in this manner will always drift in time away from the instrument's totalizer (if it has one) because what the instrument uses to totalize the flow is different that what the PLC uses to totalize the flow. These differences will accumulate over time.

Best regards,

Joe Manns
Arden Environmental Engineering Inc.
3550 Lexington Ave.
N Shoreview, MN 55126
Ph 651-484-5415
Fax 651-484-5568
 
S

Steve Myres, PE

Actually, the sensor (minus the trasmitter) is a paddlewheel with a magnet in the wheel vanes and a hall effect sensor in the dry part of the probe. The sensor output is already a square wave. The transmitter is only necessary to convert the square wave into 4-20, so the pulse option is cheaper on the hardware AND software sides, if they'll still let you buy the sensor probe without the transmitter mounted to it. Sounds like he already has the transmitter, though.
 
The Signet totalizer inside the flow meter is a counter based on the number of pulses it receives from the flow sensor. If your model of flow meter has a pulse output use to count through a digital input which is very accurate. Using a 4-20 ma signal will cause from 2 to 5 % error in the total on the PLC counter in whatever way you program it.The smallar unit of flow you want to show on the screen the larger the error will be.

Hope this helps,

Best regards,
Sekar
 
You're right, Steve...unless it is a non-Hall Effect Signet, and they still make them. In which case it is a sine wave that a PLC can't see.

And yes, you can still buy just a sensor from Signet, and several other paddlewheel vendors.

Walt Boyes
Spitzer and Boyes LLC
21118 SE 278th Place
Maple Valley, WA 98038
Ph. 425-432-8262
Fx. 253-981-0285
[email protected]
www.spitzerandboyes.com
 
I have a mass flow meter having analog and pulse output functions. Analog output is configured on Rockwell PLC and showing different totalized flow on HMI from local display of flow meter. Error is around 10% sometimes.

Please suggest should i configure pulse output from flow meter with PLC, will it improve the results?

Thanks
Fahad Khan
[email protected]
 
Just because the previous posts are a decade old, does not invalidate them. Same situation today as back then.

Try reading the other posts on this thread.

They're all saying the same thing, in summary, "For accuracy, count pulses."

Analog totalizing can have serious issues, as you've experienced.
 
Top