Steve Bailey
Lifetime Supporting Member + Moderator
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.
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.