Ladder logic flow integration

Steve Bailey

Lifetime Supporting Member + Moderator
Join Date
Apr 2002
Location
The boondocks of Western Massachusetts USA
Posts
8,591
There have been many threads started about integrating the signal from an analog flow sensor to get a total volume along with comments (some by me) that it's not the most accurate or reliable method. And if the flow meter has an option to output a pulse at some increment, to use that signal as the more reliable.
So, I set out to see how well I could integrate a signal in ladder logic. I used a 25 year-old GE Fanuc 90-30 CPU351. I didn't bother with an analog signal. Instead I started with constant flow rate of 100 (let's say GPM, but it could represent anything that varies with time) and imposed a +/- 10 percent sinusoidal variation on that rate so that it varied between 90 and 110 at some frequency.
I've implemented three methods; integration over a time period with samples taken at a constant interval, integration over a number of samples taken at a constant interval, and integration over a fixed time period with samples taken every scan.
I've included some results along with the ladder logic in the attachment. If anyone cares to look it over, I've got a pretty thick hide, so comment away. If you've got any suggestions for other approaches or other tests you'd like to see, I'm open to suggestions.
 
I like the simulations and testing different methods. I would simply count/accumulate pulses over time if counts are provided. I would use the real time clock for measuring the time period. The only assumption is that the flow sensors can respond accurately to higher frequency changes inflow. Another issue is often do you need the total volume?

The analog only problem requires short intervals between the samples. Otherwise, there could be a short burst of flow that could be missed between samples. I would use a 10 ms timed interrupt.

Something I would look at is the bandwidth of the analog flow sensor and the analog input card. I would be tempted to put a scope in the analog output of the flow sensor to see how much noise there is or how the data is filtered.
 
Very nice work Mr. Bailey! ...and noted!

As you mentioned, the best accuracy will come from a pulse output. I've did a job in the fuel industry where they used a highly sophisticated mass flow meter that compensated for temperature and pressure. (Just to mention other factors)

As for the analog, I share Peter's concerns about noise. I've found the more accurate you measure, the more you factor in, including....

Wouldn't the scan-based sampling be much faster than the analog conversion time?

There are a lot of great points to be noted from your experiments. Thanks for sharing!
 
Wouldn't the scan-based sampling be much faster than the analog conversion time?
That will depend on the analog module and the scan time. In the 90-30 the spec for an analog module was 2.5 mS conversion for all channels. My application was running longer scan times, so no problem. With a newer, faster model PLC it could have been an issue.
 

Similar Topics

I'm running an Allen Bradley CompactLogix L32E plc with Logix5000. I am in need of a method to which fmy Function Block flow totalizers to Ladder...
Replies
5
Views
7,799
Can any one advise to the process to carry out when converting ladder logic to state flow diagrams?
Replies
1
Views
3,776
In ladder logic, how can I generate totalized flow data from a flowmeter input? My flowmeter input is 12 bit analog (0-4095) which I use in a PID...
Replies
14
Views
17,297
I got my PanelView Plus 7 working with a Micrologix 1500. How would I connect my laptop to the PanelView to view the ladder logic while operating...
Replies
6
Views
138
Hello, I am trying to replicate a piece of logic on the PLC5 onto an SEL RTAC. I am using ladder on SEL and FBD. I am having issue on the ladder...
Replies
13
Views
233
Back
Top Bottom