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 September 27th, 2018, 02:10 PM   #1
jrsnydley
Member
United States

jrsnydley is offline
 
Join Date: Dec 2014
Location: Minnesota
Posts: 121
Programming a curve for 4-20 mA input

Hey everyone,

I have a sensor that gives a 4 - 20 mA signal that is not perfectly linear. There is a bit of a curve in it. I would like to hook the sensor directly up to a 1756-IF16 input card. Is there a way to program in the curve or does it have to be linear?
  Reply With Quote
Old September 27th, 2018, 02:18 PM   #2
Bullzi
Lifetime Supporting Member
United States

Bullzi is offline
 
Join Date: Jun 2012
Location: Colorado
Posts: 1,313
Never seen a 4-20mA transmitter that wasn't linear. What kind of transmitter is it?
__________________
There is never enough money to do it right but there is always enough money to do it again.
  Reply With Quote
Old September 27th, 2018, 02:20 PM   #3
travispedley
Member
United States

travispedley is offline
 
Join Date: May 2012
Location: Sanford, NC
Posts: 91
How is it not linear? What kind of sensor is it?
  Reply With Quote
Old September 27th, 2018, 02:24 PM   #4
widelto
Member
Colombia

widelto is offline
 
widelto's Avatar
 
Join Date: Jul 2005
Location: barranquilla
Posts: 2,628
You can use Fgen instruction and solve your problem.
__________________
My two cents.
  Reply With Quote
Old September 27th, 2018, 02:25 PM   #5
cardosocea
Member
United Kingdom

cardosocea is offline
 
Join Date: Nov 2016
Location: Fields of corn
Posts: 1,116
I've worked with load cell sensors that weren't linear... apart from that, the only other piece of equipment was a potmeter. Not that it isn't linear, but it shouldn't feel like for the user most times.

However, how noticeable is that curve? In my experience, you can just do a "look up" table of sorts with your ranges so that you approximate a curve with a number of "linear" ranges.

Input - Output
0 -20 - 0 - 10
21-40 - 11 - 22
41-60 - 23 - 40
61-80 - 41 - 60
81-100 - 61 - 100


The scale is funky and just as an example, but should be a curve of sorts.
  Reply With Quote
Old September 27th, 2018, 02:26 PM   #6
jrsnydley
Member
United States

jrsnydley is offline
 
Join Date: Dec 2014
Location: Minnesota
Posts: 121
It is an ammonia sensor. The gas is injected into it which changes the resistance. I have attached a copy of the curve. It's not much of a curve but there is one.
Attached Files
File Type: zip CI21_1000ppm.zip (18.8 KB, 41 views)
  Reply With Quote
Old September 27th, 2018, 02:34 PM   #7
jrsnydley
Member
United States

jrsnydley is offline
 
Join Date: Dec 2014
Location: Minnesota
Posts: 121
widelto,

I just build an x and y array with the given chart attached above and the Fgen instruction should scale it correctly?
  Reply With Quote
Old September 27th, 2018, 02:40 PM   #8
g.mccormick
Member
United States

g.mccormick is offline
 
Join Date: Jul 2012
Location: IN
Posts: 521
How about use excel to create curve equation. Then use a math instruction (assuming this is an option) to use the equeation with the raw 4-20ma input.
  Reply With Quote
Old September 27th, 2018, 02:43 PM   #9
Dirt
Member
Sweden

Dirt is offline
 
Join Date: Apr 2008
Location: Stockholm
Posts: 224
Fgen as stated or use excel to find a polynomial approximation for those points.

Edit: too slow.. mccormick was first on that one.
  Reply With Quote
Old September 27th, 2018, 03:06 PM   #10
Mispeld
Member
United States

Mispeld is offline
 
Mispeld's Avatar
 
Join Date: Feb 2017
Location: VA
Posts: 391
As per attached Excel chart:

y = 0.0385*x*x + 5.9753*x + 22.754

where:
y = NH3 in PPM
x = Analog input in percent (0 to 100)
Attached Images
File Type: jpg curve.jpg (18.5 KB, 153 views)
__________________
"The greatest enemy of knowledge is not ignorance, it is the illusion of knowledge." -Stephen Hawking
  Reply With Quote
Old September 27th, 2018, 09:32 PM   #11
brendan.buchan
Member
Australia

brendan.buchan is offline
 
Join Date: May 2010
Location: Melbourne
Posts: 435
Was looking into this just the other day, on an AB PLC as well.

Use the FGEN instruction. It can only be used in Function Block though, so you need the Pro license for Logix/Studio 5000.

But I had it up and running simulating my non-linear curve within a matter of minutes.

Simply plot in the data points for your curve in the X and Y arrays and you're done.
  Reply With Quote
Old September 27th, 2018, 11:17 PM   #12
Bullzi
Lifetime Supporting Member
United States

Bullzi is offline
 
Join Date: Jun 2012
Location: Colorado
Posts: 1,313
That is what I love about this Forum!! I have been using the Excel Polynomial method for years. It has working for the most part but was always off at the extreme ends of the curve. I just re did a program that was using the Polynomial method with the FGEN function block and it works very slick and is way more accurate when compared against my data set.

You learn something new every day in the business!!
__________________
There is never enough money to do it right but there is always enough money to do it again.
  Reply With Quote
Old September 28th, 2018, 07:12 AM   #13
jrsnydley
Member
United States

jrsnydley is offline
 
Join Date: Dec 2014
Location: Minnesota
Posts: 121
I went with the FGEN instruction. I have not tested it yet. Thanks everybody!
  Reply With Quote
Old September 28th, 2018, 09:17 AM   #14
jrsnydley
Member
United States

jrsnydley is offline
 
Join Date: Dec 2014
Location: Minnesota
Posts: 121
I hit a snag, I need to set off an alarm at greater than or equal to 25 ppm. The output of the FGEN instruction will latch at 30 ppm due to 4 mA = 30 ppm. I have the scaling of the input channel set up so that 4.0 mA = 4.0 and 20.0 mA = 20.0 and the input range is 0 - 20 mA.

Will the excel spreadsheet and equation method resolve this or is there a way to fix this with the FGEN? I tried to adjust the scaling so 0.0 mA = 0.0 and 20.0 mA = 20.0 but that did not make a difference.

The range on the sensor is supposed to be 0 - 1000 ppm.
  Reply With Quote
Old September 28th, 2018, 09:38 AM   #15
Mispeld
Member
United States

Mispeld is offline
 
Mispeld's Avatar
 
Join Date: Feb 2017
Location: VA
Posts: 391
Quote:
Originally Posted by jrsnydley View Post
The range on the sensor is supposed to be 0 - 1000 ppm.
The chart shows 30 PPM at 0% output. That seems to be a problem regardless of the linearization technique. It may be best to contact the manufacturer of the instrument on whether it is advisable to extrapolate below 4 ma output.
__________________
"The greatest enemy of knowledge is not ignorance, it is the illusion of knowledge." -Stephen Hawking
  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
1756-IF16 Analog Input Module/Configuration jtashaffer LIVE PLC Questions And Answers 49 April 2nd, 2015 08:11 PM
1762-IF2OF2 Analog Input Problem davidgay LIVE PLC Questions And Answers 22 August 14th, 2013 05:25 AM
cheapest 4-20 mA analog input card automan LIVE PLC Questions And Answers 11 April 12th, 2005 04:40 PM
Scale a 4 to 20 mA input Combo LIVE PLC Questions And Answers 4 March 16th, 2005 12:36 PM
adding two 4 to 20 mA analog input to one output in slc 500 05 bks LIVE PLC Questions And Answers 2 December 5th, 2004 02:38 PM


All times are GMT -5. The time now is 09:59 AM.


.