Vous êtes sur la page 1sur 9

2/15/13

Your Personal PLC Tutor Site

This board is for PLC Related Q&A ONLY. Please DON'T use it for advertising, etc.

"4-20 mA Conversions"
New Here? Please read this important info!!!

Please post ALL NEW questions in the NEW forum Click Here This forum will be archived(not deleted) VERY soon. Be sure to read the announcement there and REGISTER to get access to all convenience features!
Email this topic to a friend Printer-friendly version of this topic Previous Topic | Next Topic

Home

Conferences

*** LIVE PLC Q&A *** (Public)

Original message

Terry_Woods

- (1058 posts)

Apr-14-02, 09:41 PM (EST)

"4-20 mA Conversions" This is to make up for the bone-head mistake I made regarding the 4-20mA Offset. 4-20mA comes from the field to the PLC. The PLC converts the 4-20 mA signal to an Internal Value. You then need to convert the Internal Value to a displayable value that means something.

www.plcs.net/dcforum/DCForumID1/2755.html

1/9

2/15/13

Your Personal PLC Tutor Site

www.plcs.net/dcforum/DCForumID1/2755.html

2/9

2/15/13

Your Personal PLC Tutor Site

There, now I feel better! (What a Moron!)


Alert Edit | Reply | Reply With Quote | Top

Table of contents

RE: 4-20 mA Conversions, kalle, Apr-15-02, (1) RE: 4-20 mA Conversions, Tom Jenkins, Apr-15-02, (2) RE: 4-20 mA Conversions, phil, Apr-15-02, (3) RE: 4-20 mA Conversions, Tom Jenkins, Apr-15-02, (5) RE: 4-20 mA Conversions, phil, Apr-15-02, (4) RE: 4-20 mA Conversions, Jim Dungar, Apr-15-02, (6) RE: 4-20 mA Conversions, Terry_Woods, Apr-15-02, (7) RE: 4-20 mA Conversions, Allen Nelson, Apr-15-02, (8) RE: 4-20 mA Conversions, Terry_Woods, Apr-16-02, (9) RE: 4-20 mA Conversions, Allen Nelson, Apr-16-02, (10) RE: 4-20 mA Conversions, Terry_Woods, Apr-17-02, (11) RE: 4-20 mA Conversions, John Whittum, Aug-31-04, (12) RE: 4-20 mA Conversions, Terry Woods, Mar-16-05, (13)
Lobby | Topics | Previous Topic | Next Topic Messages in this topic

kalle - (17 posts) 1. "RE: 4-20 mA Conversions" Regarding 1 points- and 2 points-calibration, here is another way to look at it:

Apr-15-02, 07:08 AM (EST)

Equation for a straight line: y = ax + b

y . |. +(,0 0y) r.| . | ------------ x -+--+------> . | |

sn@ i dlay/r etdlay eta=tn@=---= ------ =---a -------cs@ o dlax/r etdlax etb=y 0
If the ratio delta-y/delta-x is known, then it is possible to make a 1 points calibration (offset + gain): e.g 0-20 ma and 0 - 100% : delta-x =20 ma and delta-y = 100% -> a = 5 and if y0=0 (without offset, goes through origo) the equation become: y % = 5 %/ma * x ma + 0 % with offset: 0-20 ma and 4 ma = 0% and 20 ma = 100% -> y = 6,25 * x - 25
www.plcs.net/dcforum/DCForumID1/2755.html 3/9

2/15/13

Your Personal PLC Tutor Site

It is also possible to make a generally 2 points calibration: Doesn't know offset and/or gain but have measured 2 points: (x1,y1) and (x2,y2). We have: delta-y = y2 - y1 delta-x = x2 - x1

y -y 2 1 y=(----*x --) +y 0 x -x 2 1 ad n y -y 2 1 y =y -----*x 0 1 --1 x -x 2 1 y -y 2 1 y -y) 2 1 y -y 2 1 = y=(--- *x +y -(----*x) = ----*( -x) +y > ---) 1 ---1 --x 1 1 x -x 2 1 x -x 2 1 x -x 2 1
Remove | Alert Edit | Reply | Reply With Quote | Top

Tom Jenkins - (975 posts) 2. "RE: 4-20 mA Conversions"

Apr-15-02, 08:33 AM (EST)

One additional note - Terry's method as explained is specific to some of Allen Bradley's and a few other analog input modules. The underlying math is universal, as explained by Kalle. But some analog modules inherently compensate for the 20% offset. For example, on the Koyo inputs 20 mA is 4095 and 4 mA is 0. 3.9 mA is also 0. On some modules a bit is set to indicate loss of signal, and on others 0 mA is still zero. The message is to read the manual for your specific I/O card.
Remove | Alert Edit | Reply | Reply With Quote | Top

phil - (5 posts) 3. "RE: 4-20 mA Conversions"

Apr-15-02, 09:20 AM (EST)

Well gotta put mt two cents in hear since you guys are assuming alot of things. 1. 4 to 20ma analog input signal must be set properly, 2. Determaning the correct setting is to first determine wheather the analog card is a 12 bit or 16 bit capability. Wheather the analog card is bi-polar or single ended, then the appropriate function can be determined to satisfy the PID calculations. 3. Varience in ladder programming regarding analog inputs exist between manufacturers, but the common factor is the ladder calculation. I love those who a verbosely into math matical equations with implicit redundencies that have a tendency malgamate the simplicity of the equation. The simplicity is the followin: 1. 12 bit analog cards using single ended inputs are 0 to 4095, with probability that the center range is 2048 (10ma) use the availabel PID function that is in the ladder program for dead band applicability. 2. double ended or bi polar 12 bit analog cards using 4 to 20ma use -2048 to +2048 with a sign bit useally the MSB in the channel address of the analog card slot address. 3. 16 bit analog cards use 0 to 65535 range and are invariably Bi-polar where a 4 to 20ma signal is converted to -32xxx to +32xxx again use the inherent PID loop of the PLC to calculate the dead band and tune for offset. To try to figure the offset by hand is ok but depending on tolerances ther is an error factor that could range as much as 20%. Wish y'all good luck I've been programming these wonderful PLC's for well over 20 years when they were called RLL.
Remove | Alert Edit | Reply | Reply With Quote | Top

Tom Jenkins - (975 posts) 5. "RE: 4-20 mA Conversions"


www.plcs.net/dcforum/DCForumID1/2755.html

Apr-15-02, 12:15 PM (EST)

4/9

2/15/13
LAST EDITED ON Apr-15-02 AT 12:16 PM (EST)

Your Personal PLC Tutor Site

A lot of what you said is certainly correct and is covered by my RTFM (Read The F*****g Manual) comment. But I think there is some misleading info in your post: 1) There are a lot of uses for analog inputs besides PID calculations, and you can use PID without converting to engineering units (although I personally don't like to do it that way.) 2) All 12 bit cards aren't inherently 0-4095 at 4-20 mA. Some may be 0-4095 at 0-20 mA and you have to correct for the 20% offset using Kalle's method in one form or another. 3) 10 mA is 37.5% of a 4-20 mA signal, and 50% of a 4-20 mA signal is 12 mA. 4) I can't for the life of me see why you would get an error factor of 20% figuring the offset by hand! This is a simple linear equation and span and offset can be back calculated precisely. You use your simulator to input 4 mA, note the data, then use your simulator to input 20 mA, and note the data. If you are converting to engineering units (which was, I think, the original problem) you use Kalle's or Terry's procedure. I usually simplify this by using the following, which assumes integer math: DataOffset = Data at 4 mA (or zero analog signal of whatever range - for example, 0 VDC on 0-10 VDC transmitter) DataSpan = Data at 20 mA - Data @ 4 mA FACTOR = arbitrary factor (multiple of 10) needed to get proper resolution and accuracy EU = Engineering units x FACTOR EUOffset = Engineering Units @ 4 mA x FACTOR EUSpan = (Engineering Units @ 20 mA - Engineering Units @ 4 mA ) x FACTOR DATA = Actual data reading EU = ((EUSpan x (DATA - DataOffset))/DataSpan) + EU Offset EXAMPLE: Transmitter = 14.7-164.7 psia at 4-20 mA FACTOR = 10 Data @ 4 mA = 6050 Data @ 20 mA = 31900 DataOffset = 6050 DataSpan = 31900 - 6050 = 25850 EUOffset = 14.7 x 10 = 147 EUSpan = (164.7 - 14.7) x 10 = 1500 DATA = 18975 EU = ((1500 x (18975-6050)) / 25850) + 147 = 897 897 / FACTOR = 89.7 psia ( or 75 psig), the actual engineering unit reading.
Remove | Alert Edit | Reply | Reply With Quote | Top

phil - (5 posts) 4. "RE: 4-20 mA Conversions"

Apr-15-02, 09:24 AM (EST)

Well gotta put my two cents in hear since you guys are assuming alot of things. 1. 4 to 20ma analog input signal must be set properly, 2. Determaning the correct setting is to first determine wheather the analog card is 12 bit or 16 bit capability. Wheather the analog card is bi-polar or single ended, then the appropriate function can be determined to satisfy the PID calculations. 3. Varience in ladder programming regarding analog inputs exist between manufacturers, but the common factor is the ladder calculation. I love those who use verbose mathmatical equations with implicit redundencies that have a tendency malgamate the simplicity of the equation. The simplicity is as follows: 1. 12 bit analog cards using single ended inputs are 0 to 4095, with probability that the center range is 2048 (10ma) use the availabel PID function that is in the ladder program for dead band applicability. 2. double ended or bi polar 12 bit analog cards using 4 to 20ma use -2048 to +2048 with a sign bit useally the MSB in the channel address of the analog card slot address. 3. 16 bit analog cards use 0 to 65535 range and are invariably Bi-polar where a 4 to 20ma signal is converted to -32xxx to +32xxx again use the inherent PID loop of the PLC to calculate the dead band and tune for offset. To try to figure the offset by hand is ok but depending on tolerances ther is an error factor that could range as much as 20%. Wish y'all good luck I've been programming these wonderful PLC's for well over 20 years when they were called RLL.
Remove | Alert Edit | Reply | Reply With Quote | Top

Jim Dungar - (193 posts)


www.plcs.net/dcforum/DCForumID1/2755.html

Apr-15-02, 04:53 PM (EST)

5/9

2/15/13

Your Personal PLC Tutor Site

6. "RE: 4-20 mA Conversions" Just another country to be heard from. Tom is abolutely right in saying RTFM. The math examples are correct for method, just check to make sure you are using the actual ranges of the module, not what you think they might be based on the number of bits. For example: The Modicon TSX Compact module #ASBADU205 set for 4-20mA (also for 0-20mA, the card deals with the offset). 20mA = 4095 (12 bit), 65520 (16 bit), 32000 (15 bit +sign) but the ASBADU206 module is: 20mA = 4000 (12 bit), 64000 (16 bit), 32000 (15 bit +sign)
Remove | Alert Edit | Reply | Reply With Quote | Top

Terry_Woods

- (1058 posts)

Apr-15-02, 06:53 PM (EST)

7. "RE: 4-20 mA Conversions" The purpose of my illustration was to show, first, that the 4-20mA signal, or any analog signal for that matter, comes from the field in a mA form to the PLC. Then that mA signal was converted to an Internal Value. And that, finally, the Internal Value is converted to Engineering Units for display. Whatever analog signal you have and whatever internal value range you have, it's all a game of interpolation. You simply need to know what the extreme values of the ranges are. Which means, you gotta know your hardware! Regarding Kalle's methods, the math appears correct (although I'm having a hard time reading the second section). However, the application of the single-point method, requiring that you know the rate-of-change does not apply to this particular situation. It can, if you know the rate, but it shouldn't in any case! The problem with the single-point method is that it relies on an accurate "delta-t" as well as an accurate "delta-y". Neither is going to be accurate (Are we Slicing Pickles? Maybe, Maybe Not!). In that case you have 2 inaccurate factors whose inaccuracies are varying with time. Even the time is varying with time. In the point-between-extremae method (interpolation - some point between one extreme and the other) where you interpolate the corresponding position from one scale onto another, you are subject only to the inaccuracies of the source of the signal (resolution). If you say that there might be inaccuracies in the two scales, well, those inaccuracies also exist in ALL measuring systems. The point of the interpolation method is to eliminate one of those inaccurate data sources. UNDERSTAND THIS: ERROR CAN NOT BE ELIMINATED! NO-HOW, NO-WAY! This is ABSOLUTELY TRUE in the Digital World AND, although the Analog World has the capabilitiy of minimizing error, at least, more so than the Digital World, it too can NOT eliminate error! You just do what you can to eliminate as many of the sources of error that you can! Again, all I was showing was the "PROCEDURE" for getting from A to B to C.
Remove | Alert Edit | Reply | Reply With Quote | Top

Allen Nelson

- (270 posts)

Apr-15-02, 08:55 PM (EST)

8. "RE: 4-20 mA Conversions" Terry: I can't figure out why you are doing all the breast-beating, sackcloth-and-ashes stuff. Even sarcastically What you posted was correct for any linear scaling.

Y=m +b X
where m is the slope, and b is the zero-crossing point. The slope, m, is given by

m = R s / R n = ( 2 - Y) / ( 2 - X) ie u Y X 1 1
I learned this in Junior High School (Middle School to the East Coasters). The "mistake" that was made was by Frageo in confusing the 4 mA "zero" with a 0 mA "zero", in trying to calculate the b. Or perhaps that's where you made your "mistake". The zero-interept point is defined as the coordinate (0,b). Since the slope is the same between (0,b) and ((X1,(Y1) as it is between ((X2,(Y2) and ((X1,(Y1), you get

www.plcs.net/dcforum/DCForumID1/2755.html

6/9

2/15/13

Your Personal PLC Tutor Site

(1-b /(X -0 Y ) ) = ( 2 - Y) / ( 2 - X) Y X 1 1 1

(1 -b /X =m Y ) 1

b=- X +Y m 1 1

Which generates the equation the Kalle showed. All you had was the "special case" of X1 = 0. Many electricians think of the PLC as a "black box" (where undoubtedly "black magic" occurs). When I play "I AM THE PLC", the real world is the black box. Inside the PLC (in the programming environment), there is no such thing as 4 mA or 0 mA or 20 mA. There is only the counts from the card. Sometimes the "zero" of the counts is '0'. Sometimes (as Tom pointed out with certain AB cards) "zero" is 3277, or 4000, or, in Frageo's case, 6430. In the 12-bit IFE cards (AB PLC-5s), you can set your own scaling limits if you chose, instead of 0-4095. If someone is going to use the equations, they had better understand how to use them. As has been said here many times - you can't have enough of a foundation in basic math.
Remove | Alert Edit | Reply | Reply With Quote | Top

Terry_Woods

- (1058 posts)

Apr-16-02, 08:32 PM (EST)

9. "RE: 4-20 mA Conversions" Allen, I appreciate what you said. But, if I am going to be critical of anyone else (that could happen, couldn't it?), I had damned well better be damned critical of myself first! No one is more of a critic on me than myself. If I find that I have made a mistake, I go looking for the 2x4 before my Keepers do! Granted, Frageo was mistaken in his application of the formula. But, when I came back to show the whole process of Field-to-PLC-to-Display, I made what I consider to be the mistake of a novice! In the 0-32000 scheme, 4mA is 6400. I neglected to include that in my description. It was a stupid mistake on my part! Being the Good, Irish, Catholic kid from Chicago that I am, well, I was required (for historical reasons if nothing else) to do the "...breast-beating, sackcloth-and-ashes stuff. Even sarcastically...". However, it was not sarcastic at all - it was sincere!
Remove | Alert Edit | Reply | Reply With Quote | Top

Allen Nelson

- (270 posts)

Apr-16-02, 09:35 PM (EST)

10. "RE: 4-20 mA Conversions" Ah! A documentation error. Well, 20 lashes for you. We expect better of you, a former tech writer, (I should know, I'm married to a tech writer. Thank goodness she doesn't edit my posts (although they'd certainly be clearer if she did.)) I remember once back in college, there was an exam question, which looked like a simple plug-these-numbers-intothat-equation deal. But when I tried to plug in the values, i realized that the equation assumed a constant pressure, and in the question the pressure changed throughout. So I wound up having to re-derive the equation based on a changing pressure. It was ugly, but it was right. All the other students just plugged in values, and got partial credit (I've always wondered if the prof came up with the correct answer before, or after grading mine). Maybe that's the difference between a B.S. and an AA or a well-trained technician. The B.S. knows (or at least is supposed to know) the theory behind the equation, and not just apply it indescriminately.
www.plcs.net/dcforum/DCForumID1/2755.html 7/9

2/15/13
Remove | Alert

Your Personal PLC Tutor Site


Edit | Reply | Reply With Quote | Top

Terry_Woods

- (1058 posts)

Apr-17-02, 07:24 AM (EST)

11. "RE: 4-20 mA Conversions" A documentaion error is like a black-mark (remember those from grade school?) that follows you through life; or, at least, through the life of the product. Once the document is published with your name on it, the contents are associated with you - for better or worse! There's usually a chance to issue a revision of the manual where the blunder is repaired, but, those original copies are still out there somewhere. "Maybe that's the difference between a B.S. and an AA or a well-trained technician. The B.S. knows (or at least is supposed to know) the theory behind the equation, and not just apply it indescriminately." Exactly So! As you say, if you know the formula, that is, where it came from, why it was necessary and how it was derived, then, when necessary, you can re-derive the formula (time permitting) in the middle of a test (been there, got the grey-matter scars to prove it). Another benefit, if you know AND understand the formula, is that you can, when necessary, selectively (and carefully) choose portions of a formula to suit a particular need. A good example of that is the PID equation. If you know and understand the PID equation, you can "roll-yer-own" by selectively applying only those portions of the equation that apply to a particular instance/time. That PID thing is much simpler than some would have you think! A decent programmer can easily create a PID routine that matches the performance of most canned PID routines. If you have an understanding of Fuzzy-Logic you can create a PID control scheme that is better than a lot of the canned routines! I'm off to get my 20 lashes.
Remove | Alert Edit | Reply | Reply With Quote | Top

John Whittum - (2 posts) 12. "RE: 4-20 mA Conversions" Terry,

Aug-31-04, 04:38 PM (EST)

I know you wrote this post over two years ago. I am a newbie to PLCs. I found your post to be very useful. I was wondering however why you use "150" as your multiplier when converting the internal values into meaningful units/display values? Is that a standard engineering value to convert with?
Remove | Alert Edit | Reply | Reply With Quote | Top

Terry Woods - (2 posts) 13. "RE: 4-20 mA Conversions" It was fun revisiting this old thread... thanks Kalle.

Mar-16-05, 08:19 AM (EST)

I read it to the bottom and saw that John Whittum asked a question regarding the scaling target... "I was wondering however why you use "150" as your multiplier when converting the internal values into meaningful units/display values? Is that a standard engineering value to convert with? No John. It just happened that I used "150". It could have been any value. The normal routine is to use the maximum value that is meaningful, representative and might in fact occur. In this example, I assumed a tank of water that held a maximum of 150 units of something... gallons, inches, cubicfeet,... John asked this question last year... I wonder if this response (a year later) will actually make it to the board... somehow...
Remove | Alert Edit | Reply | Reply With Quote | Top

Lock | Archive | Remove

Lobby | Topics | Previous Topic | Next Topic Rate this topic (1=skip it, 10=must read)? [ 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 ]

www.plcs.net/dcforum/DCForumID1/2755.html

8/9

2/15/13

Your Personal PLC Tutor Site

Select another forum

GO!
Your Personal PLC Tutor Site Learn Now!!.

www.plcs.net/dcforum/DCForumID1/2755.html

9/9

Vous aimerez peut-être aussi