You are not registered yet. Please click here to register!


 
 
plc storereviewsdownloads
This board is for PLC Related Q&A ONLY. Please DON'T use it for advertising, etc.
 
Try our online PLC Simulator- FREE.  Click here now to try it.

---------->>>>>Get FREE PLC Programming Tips

New Here? Please read this important info!!!


Go Back   PLCS.net - Interactive Q & A > PLCS.net - Interactive Q & A > LIVE PLC Questions And Answers

PLC training tools sale

Reply
 
Thread Tools Display Modes
Old March 1st, 2018, 02:07 PM   #1
svarney
Member
United States

svarney is offline
 
Join Date: Feb 2012
Location: So. Wi
Posts: 4
Analog Flow to Pulse output

I am trying to figure out how to take a analog signal (flow) and generate a pulse very 1000 gallon for a flow totalizer on my panel. Using Logix5000.

I am stumped.
thanks scott
  Reply With Quote
Old March 1st, 2018, 02:12 PM   #2
gclshortt
Member
Canada

gclshortt is offline
 
gclshortt's Avatar
 
Join Date: Dec 2014
Location: Cobourg
Posts: 2,458
http://www.plctalk.net/qanda/showthread.php?t=77686

The above thread may help you out.
Regards,
__________________
Garry
http://www.accautomation.ca
Connect with us on Facebook: facebook.com/accautomation/
  Reply With Quote
Old March 1st, 2018, 02:22 PM   #3
svarney
Member
United States

svarney is offline
 
Join Date: Feb 2012
Location: So. Wi
Posts: 4
that really did help much. I don't have a pulse output on the DP cell to use. I guess I will have to look for other options. I was hoping there was a AIO block in the 5000 platform.
  Reply With Quote
Old March 1st, 2018, 02:32 PM   #4
boneless
Lifetime Supporting Member + Moderator
United States

boneless is offline
 
Join Date: Feb 2008
Location: OKC
Posts: 1,414
I think you could use a regular output, one pulse per 1000 gallons won't have a very high frequency I imagine?
  Reply With Quote
Old March 1st, 2018, 03:39 PM   #5
Bullzi
Lifetime Supporting Member
United States

Bullzi is offline
 
Join Date: Jun 2012
Location: Colorado
Posts: 1,235
You could create your own AOI to do this.

First you will need to create a flow totalizer in the logic so you know when 1000 gallons is coming up. There are lots of posts on the site that explain how to take an analog flow signal and create a totalizer out of that.

Then when the 1000 gallon mark is met you can turn on the output and keep it high for a certain amount of time then turn it off. Or you can create a 50/50 pulse and have it on for 500 gallons and off for 500 gallons. That is how most low resolution pulse are done in my industry.
__________________
There is never enough money to do it right but there is always enough money to do it again.
  Reply With Quote
Old March 1st, 2018, 03:50 PM   #6
Steve Bailey
Lifetime Supporting Member + Moderator
United States

Steve Bailey is offline
 
Steve Bailey's Avatar
 
Join Date: Apr 2002
Location: The boondocks of Western Massachusetts USA
Posts: 6,467
If I understand the OP's question, he has an analog input to his PLC that represents flow. He wants to generate an output pulse at each 1000 gallons of flow.

Let's assume you have already scaled the 4 - 20 mA signal from the flow meter to engineering units like gallons per minute. Once per second capture the GPM value and divide it by 60 (because one second is 1/60th of a minute) and add the result to a running total. When the running total reaches 1000 generate your pulse output, subtract 1000 from the running total and wait for it to reach 1000 again.
If the flow varies a lot and you need more accuracy, instead of using the captured GPM value each second, take the average of the current sample and the value you captured one second ago.
  Reply With Quote
Old March 1st, 2018, 04:13 PM   #7
lfe
Member
France

lfe is offline
 
Join Date: Jun 2007
Location: Barcelona
Posts: 179
You need something called integration, at constant and small period of time you add the measured flow to a total.

The time period must be precise and not smaller than the flow reading period, each period need a new flow reading, if the flow oscillates then you need shorter periods, a fast integration.

How to convert the total to gallons depends of flow scale and the period too, it will need some math calculation. When the total arrives to the equivalent to 1000 gallons then you subtract the equivalent to 1000 and generate a pulse.

The calculation should be evaluated to avoid overflow, for me the best is to use a 32bit integer for the total, not a floating point.
__________________
Suppanel HMI

Last edited by lfe; March 1st, 2018 at 04:30 PM.
  Reply With Quote
Old March 2nd, 2018, 08:23 AM   #8
svarney
Member
United States

svarney is offline
 
Join Date: Feb 2012
Location: So. Wi
Posts: 4
Thank you I will work with the advice given here.

This was very helpful.
  Reply With Quote
Old March 2nd, 2018, 09:00 AM   #9
daba
Lifetime Supporting Member + Moderator
United Kingdom

daba is offline
 
daba's Avatar
 
Join Date: Jul 2004
Location: uk
Posts: 4,341
Quote:
Originally Posted by Steve Bailey View Post
If I understand the OP's question, he has an analog input to his PLC that represents flow. He wants to generate an output pulse at each 1000 gallons of flow.

Let's assume you have already scaled the 4 - 20 mA signal from the flow meter to engineering units like gallons per minute. Once per second capture the GPM value and divide it by 60 (because one second is 1/60th of a minute) and add the result to a running total. When the running total reaches 1000 generate your pulse output, subtract 1000 from the running total and wait for it to reach 1000 again.
If the flow varies a lot and you need more accuracy, instead of using the captured GPM value each second, take the average of the current sample and the value you captured one second ago.
+1 : but I would make the "running total" a REAL, so you don't lose precision on the divide.
__________________
___________________________
ControlLogix & SLC Training
a-b train ltd.
abtrain@tiscali.co.uk
www.abtrain.co.uk
tel: 07506 73 9999
nil illegitimi carborundem


  Reply With Quote
Old March 2nd, 2018, 09:10 AM   #10
lfe
Member
France

lfe is offline
 
Join Date: Jun 2007
Location: Barcelona
Posts: 179
Using a REAL to totalize has a risk, try for example to add 20,000,000 and 1 with REALs, the result will be 20,000,000, the 1 will not be added.
For me better to use a big integer
__________________
Suppanel HMI
  Reply With Quote
Old March 2nd, 2018, 10:07 AM   #11
daba
Lifetime Supporting Member + Moderator
United Kingdom

daba is offline
 
daba's Avatar
 
Join Date: Jul 2004
Location: uk
Posts: 4,341
Quote:
Originally Posted by lfe View Post
Using a REAL to totalize has a risk, try for example to add 20,000,000 and 1 with REALs, the result will be 20,000,000, the 1 will not be added.
For me better to use a big integer
I'm aware of that risk, but as Steve suggested, GRT 1000.0, SUB 1000.0 works for me....
__________________
___________________________
ControlLogix & SLC Training
a-b train ltd.
abtrain@tiscali.co.uk
www.abtrain.co.uk
tel: 07506 73 9999
nil illegitimi carborundem


  Reply With Quote
Old March 2nd, 2018, 11:40 AM   #12
cardosocea
Member
United Kingdom

cardosocea is offline
 
Join Date: Nov 2016
Location: Fields of corn
Posts: 822
Obviously, we are all assuming the flow rate is fairly constant...
  Reply With Quote
Old March 2nd, 2018, 12:08 PM   #13
Steve Bailey
Lifetime Supporting Member + Moderator
United States

Steve Bailey is offline
 
Steve Bailey's Avatar
 
Join Date: Apr 2002
Location: The boondocks of Western Massachusetts USA
Posts: 6,467
Quote:
Obviously, we are all assuming the flow rate is fairly constant...
What makes you say that? When you sample the flow rate once per second and add that sample to the running total you are making accommodation for changes in the flow rate. You can sample more frequently than once per second if necessary, limited only by the PLC's scan time and the update rate of the analog input module's A/D conversion.
  Reply With Quote
Old March 2nd, 2018, 12:13 PM   #14
OkiePC
Lifetime Supporting Member
United States

OkiePC is offline
 
OkiePC's Avatar
 
Join Date: Mar 2005
Location: ENE of Nowhere Oklahoma
Posts: 9,732
I would follow Steve's advice except I would flip/flop every 500 gallons for as close as possible to a square wave pulse.
__________________
It's not all the variables I am most concerned with, it's the undiscovered constants.
  Reply With Quote
Old March 2nd, 2018, 12:59 PM   #15
cardosocea
Member
United Kingdom

cardosocea is offline
 
Join Date: Nov 2016
Location: Fields of corn
Posts: 822
Quote:
Originally Posted by Steve Bailey View Post
What makes you say that? When you sample the flow rate once per second and add that sample to the running total you are making accommodation for changes in the flow rate. You can sample more frequently than once per second if necessary, limited only by the PLC's scan time and the update rate of the analog input module's A/D conversion.
We know little of the specifics, and even less of the accuracy that is to be achieved so it doesn't hurt to keep in mind a possible source for error.
  Reply With Quote
Reply
Jump to Live PLC Question and Answer Forum

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Topics
Thread Thread Starter Forum Replies Last Post
Flow meter analog output question... Matchu04 LIVE PLC Questions And Answers 4 January 16th, 2014 06:54 PM
can i use one analog output to control two VFD's? baracuta61 LIVE PLC Questions And Answers 9 December 16th, 2013 02:08 PM
Someone just had to ask. Peter Nachtwey LIVE PLC Questions And Answers 213 November 17th, 2008 06:36 PM
Analog Output from 224XP help nehe bhimaji LIVE PLC Questions And Answers 4 December 7th, 2007 09:00 PM
analog output to driver baden LIVE PLC Questions And Answers 2 August 21st, 2002 10:18 AM


All times are GMT -5. The time now is 04:24 AM.


.