Jump to content

Wrong output in 'Linearize' Ladder function


kpetro07

Recommended Posts

  • MVP 2023

I split this off into a separate topic since it didn't belong where it was.

Regarding your question, the result looks correct to me. You are linearizing the value 11,159 to 0 - 10 from 255 - 65535. I didn't do the math, but 11,159 looks to be about 2 tenths of the way from 255 to 65535.

Edit: I see you've changed the attached picture since I posted my response. However, my answer remains the same. The linearization appears to be about right.

Link to comment
Share on other sites

18 hours ago, Flex727 said:

I see your problem now. The 4mA value would need to be 13107, not 255. Try that.

Hello,

we changed the values to:

B = 0

D = 32768 (15bit) and the output value is correct. 

The specification for the card is:
16 bit (Include Sign)
15 bits : 0.61uA/Bit(0~20mA), 0.49uA/Bit(4~20mA)

Link to comment
Share on other sites

  • MVP 2023

kpetro, have you changed the actual pressure and ensured that the readings over the full range are correct?  eg....0 bar = 0 on the plc read etc.

@Joe Tauser  or  @AlexUT  I repeat that I don't work with UniStream, but could either/both of you please elaborate on why kpetro's numbers work when the info available in the spec sheet has the data format listed as 16 bit.  Based on that info my thinking is that Flex's final answer is correct.  But I am confused when there is also reference to 15bits in the resolution.  How does one change this output behaviour?  Is there more info somewhere else that fully explains all of this  ie how you actually know  what is coming out of the  module?  If kpetro is indeed getting correct correlation between actual and read, the card/module must handle things differently to what I would expect.

EDIT:  I just paid more attention to the 2' compliment and that might account for part of my ask.  But it still doesn't explain why the numbers work for 4-20.

cheers, Aus

400T.gif.408bfc85f20519c1f455f6bdc434f5bf.gif

 

Link to comment
Share on other sites

  • MVP 2023

There can be only one answer.  I've said many times that empirical data is the best data.

If kpetro put 0 in and the linear block worked properly then the spec sheet is misleading and the scaling is spread over the whole 15 bit range, not starting with the 4 mA offset like we're used to.

I configured a remote I/O drop with that module.  You can choose what your input will be:

image.png.188eacbd53fe2fc75a99f2006dac74c8.png

I haven't personally used this module, but we can deduce that the module takes the configuration into consideration and returns 0 counts at 4 mA.  Allen Bradley does this on their CompactLogix I/O, so it's not out of the ordinary.  It would be nice if it were documented better, but I have a feeling that Unitronics is relying on the manufacturer for this.

Joe T.

 

Link to comment
Share on other sites

  • MVP 2014

I think the clue about the span of values is here:

15 bits : 0.61uA/Bit(0~20mA), 0.49uA/Bit(4~20mA)

The uA per bit is different depending on the range.

I think that the mention of the sign bit is superfluous (and therefore confusing) as the module only has unipolar inputs.

I think experienced Unitronics users are conditioned to expect a 4...20mA analogue range to not use the full span of the digtal word, based on experience with other Unitronics families.  But as Flex has commented some Vision modules (mainly outputs) will use the full digital scale regardless of whether they are 0...20mA or 4...20mA.

Link to comment
Share on other sites

  • MVP 2023
On 10/13/2019 at 1:56 PM, Joe Tauser said:

I've said many times that empirical data is the best data.

I agree.  But I really hate lack of info on something and having to discover it for oneself, when it can be presented as plain as day in the first place.

I once lost months and lots of hair because of inadequate manuals on a host of supposedly fantastic modbus modules that were constantly being updated by their maker.  No correct support forthcoming...or it came out 3 months later when it was 5 steps out of date anyway due to another lot of changes.  With modbus registers changing all the time such that you had the same mechanicals with fixed firmware using different registers for the same thing. Even in the supplied batch they were all over the place.  The maker was no help at all....in fact I helped them a lot (for no gain) in trying to resolve the issues.  "It doesn't do that" they would say.  "Well, yes it damn well does.  Look at this video".   "Ohhhh, so it does"  etc.  Stiff poops for me.   In the end had to change them all out to something else due to reliability issues arising later anyway.  Which in itself was an issue during initial replacements with the original maker's stuff as the registers had changed again!   Even "big" name makers can make crap stuff.  I think it is often badge engineering.

     🤬

cheers, Aus

Link to comment
Share on other sites

On 10/13/2019 at 1:06 AM, Ausman said:

kpetro, have you changed the actual pressure and ensured that the readings over the full range are correct?  eg....0 bar = 0 on the plc read etc.

@Joe Tauser  or  @AlexUT  I repeat that I don't work with UniStream, but could either/both of you please elaborate on why kpetro's numbers work when the info available in the spec sheet has the data format listed as 16 bit.  Based on that info my thinking is that Flex's final answer is correct.  But I am confused when there is also reference to 15bits in the resolution.  How does one change this output behaviour?  Is there more info somewhere else that fully explains all of this  ie how you actually know  what is coming out of the  module?  If kpetro is indeed getting correct correlation between actual and read, the card/module must handle things differently to what I would expect.

EDIT:  I just paid more attention to the 2' compliment and that might account for part of my ask.  But it still doesn't explain why the numbers work for 4-20.

cheers, Aus

400T.gif.408bfc85f20519c1f455f6bdc434f5bf.gif

 

Can someone explain the issue to me real slow with real simple words...?
Seriously, I understand that a note should be added to the specs for clarification, but I'm not sure what that should be...

 

Link to comment
Share on other sites

  • MVP 2023

Cara, keptro still hasn't answered on this so we all may be barking up the wrong tree, but it would appear that the module is internally recalibrating it's range according to what you choose in the Configuration.

So you need to say what the range is for each calibration spec.

You would have to thoroughly check this with your guys, but it would be something like:

"Set for 4-20ma then the range is 0-32768, with 4ma = 0 and 20ma = 32768.

Set for 0-20ma then the range is 0-32768, with 0ma = 0 and 20ma = 32768."  And whatever else may be relevant, as it still mentions 16 bit. 

This auto range adjusting behaviour is not what happens on a lot of Unitronics gear, hence the need for specifics.

The main thing is for ease of use with the user able to get full knowledge of the workings of the device from the spec sheet/install manual, without needing to dick about finding things for themselves.

Ps  Mr Cheeky says:  Hope the words are simple enough!

cheers, Aus

Link to comment
Share on other sites

On 10/13/2019 at 5:56 AM, Joe Tauser said:

There can be only one answer.  I've said many times that empirical data is the best data.

If kpetro put 0 in and the linear block worked properly then the spec sheet is misleading and the scaling is spread over the whole 15 bit range, not starting with the 4 mA offset like we're used to.

I configured a remote I/O drop with that module.  You can choose what your input will be:

image.png.188eacbd53fe2fc75a99f2006dac74c8.png

I haven't personally used this module, but we can deduce that the module takes the configuration into consideration and returns 0 counts at 4 mA.  Allen Bradley does this on their CompactLogix I/O, so it's not out of the ordinary.  It would be nice if it were documented better, but I have a feeling that Unitronics is relying on the manufacturer for this.

Joe T.

 

Hello all, 

I think that the configuration is set as @Joe Tauser mentioned. We have configured the input 4-20mA from the I/O module  and on the linearization we used 0 - 2^15 . The value seems correct now. 

@Flex727 suggested that the 4mA value would need to be 13107 but even with the configuration 0-20mA this does not work.

 
Link to comment
Share on other sites

  • MVP 2023
On 10/16/2019 at 6:25 PM, Ausman said:

Set for 4-20ma then the range is 0-32768, with 4ma = 0 and 20ma = 32768.

Set for 0-20ma then the range is 0-32768, with 0ma = 0 and 20ma = 32768." 

@Cara Bereck Levy

Yes.  Plus - 

1.  Ask one of the technoboys what happens if a negative signal is applied,  Have them actually hook one up if they have one.  If this is indeed single ended and non-isolated then it should return a zero for a negative input.    Get back to us with what happens.  Or, better yet, @kpetro07 already has one in place and maybe he can hook one up backwards and let us know the results.

 

2.   image.png.a0556a6aec9233aecab103e6509c31e2.png

Nobody cares.  Delete it.

 

3. image.png.3a31955a2116774ed34b3694e1c62af9.png

Depends on the test results from (1).  If the output of the module does return a negative number with a negative signal, then this is relevant.  If the module returns a 0 with a negative signal, then delete this as it implies that the module can read a negative.

Joe T.

Link to comment
Share on other sites

  • MVP 2023

+ to Joe's extras.

 

4 hours ago, kpetro07 said:

but even with the configuration 0-20mA this does not work

Thanks Kpetro.  But the essential bit that you happily haven't encountered is that on most Unitronics stuff you always had to relate the 4mA to what the total range was.  The maths was essentially 4/20 x the range.  So if you have 2^15 the (4/20) * 32768 = 6554.  Flex was going on the range being 2^16.  If you can be bothered you could try the 0-20 and set the linz B at 6554 and it should work ok.  But it won't give quite as good definition as the module appears capable of if the setting is 4-20.

cheers, Aus

Link to comment
Share on other sites

  • MVP 2014

Hi @Cara Bereck Levy I would agree with the above from @Joe Tauser and @Ausman.  

The way the ranges are currently expressed in the datasheet are scientifically correct (15 bits : 0.61uA/Bit(0~20mA), 0.49uA/Bit(4~20mA)) , but takes a  few steps of logic and caulculation to turn that around to something that is useful for the programmer.  It should be expressed in terms that apply directly to the programming, as @Ausman has done.

The sign bit is meaningless if the signal is always positive or zero.

Link to comment
Share on other sites

13 hours ago, Ausman said:

+ to Joe's extras.

 

Thanks Kpetro.  But the essential bit that you happily haven't encountered is that on most Unitronics stuff you always had to relate the 4mA to what the total range was.  The maths was essentially 4/20 x the range.  So if you have 2^15 the (4/20) * 32768 = 6554.  Flex was going on the range being 2^16.  If you can be bothered you could try the 0-20 and set the linz B at 6554 and it should work ok.  But it won't give quite as good definition as the module appears capable of if the setting is 4-20.

cheers, Aus

Sorry! I meant 6554. I have done the test now and is working if you choose 0-20mA! if you choose 4-20mA in the configuration you should start from zero! 

Link to comment
Share on other sites

On 10/18/2019 at 1:47 AM, Simon said:

Hi @Cara Bereck Levy I would agree with the above from @Joe Tauser and @Ausman.  

The way the ranges are currently expressed in the datasheet are scientifically correct (15 bits : 0.61uA/Bit(0~20mA), 0.49uA/Bit(4~20mA)) , but takes a  few steps of logic and caulculation to turn that around to something that is useful for the programmer.  It should be expressed in terms that apply directly to the programming, as @Ausman has done.

The sign bit is meaningless if the signal is always positive or zero.

Thanks for the additional information--I'm checking up on this :-)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...