analog input error calcuation

o_O Thats what I get for cutting and pasting. Thanks for the catch Dan.


🍺 Ian is a funny guy. And 5/15 isn't .3333 but if I typed out the exact answer this thread would never end.


Did you spot the small 'r'
I put that in for 'repeating'
🍻
 
Last edited:
Please remember the Binary numerical system
MSB (Most Significant Bit)
LSB (Least Significant Bit)

Each point is a bit
MSB ............ 16 - 8 - 4 - 2 - LSB
4 bit ----------- 8 - 4 - 2 - U
Max Value ---- 1 - 1 - 1 - 1
Total is -------- 8 + 4 + 2 + 1 = 15 - Maximum
Min Value ------- 0 - 0 - 0 - 0 = 0 - Minimum
Absolute number of available points is 16
Remember our standard numbering system is 0 - 9 (10)
not 0 - 10 (11)

the Binary calculation
(4 bit) 2^(n)-1 = 2^4 - 1 = 16-1 = 15
so with (12 bit) = 2^12 - 1 = 4096 - 1 = 4095

🍻
 
Do it how you want to then.

We have taken our own time and tired to explain it. You didn't like the explanation. I don't know what else to say except that you might want to choose an A/D converter that is capable of actually measuring 10 Volts instead of 9.375 volts.

Good luck.
 
Zero in Binary has a value so that means 0 = the 1 st count.

The 1st count in decimal is = to 1
because zero in decimal is = to nothing.

So that means 16 divisions in decimal = binary 1111 which = 15

Try it out on the Scientific Calculator that comes with Windows.
 
Do it how you want to then.

We have taken our own time and tired to explain it. You didn't like the explanation. I don't know what else to say except that you might want to choose an A/D converter that is capable of actually measuring 10 Volts instead of 9.375 volts.

Good luck.

I posted the link and text simply to find out why there are two ways to calculate the voltage resolution.

In the link, the author find the voltage resolution by dividing the max voltage by 2^n while you divide it by 2^n-1. Why? Is it because there are different types of digitizing methods?
 
I posted the link and text simply to find out why there are two ways to calculate the voltage resolution.

In the link, the author find the voltage resolution by dividing the max voltage by 2^n while you divide it by 2^n-1. Why? Is it because there are different types of digitizing methods?

Yeah later in the link you posted the guy discusses the resolution problem of how the converter will never measure full voltage with his digitization method. If you do (range/2n) instead of 2n-1, then at full voltage in, the calculated voltage will always read (range/2n) low, so in the case of 4 bits with 0-10v in, then with 10v in and binary 15 (1111) out, then your converter would read 10-(10/2^4), or 9.375. His solution for this is to add a half-step feed forward bias of .3125. So then with no voltage in, you read .3125, and with 10v in, you still read 9.6875. Way unacceptable. He later suggests using cards with higher resolution, which helps to "mask" the error, but still the error lies in the author's assumption of the how the converter scales the incoming signal, or "digitizes" it.

If you just disregard this author's faulty assumption, and make the step value equal to (range/2n-1) or .66667 for 0-10v or .33333(r!) for 0-5v, then the math works out fine, as TConnolly has already illustrated.

danw said:
No, it's because the other guy whom you quoted doesn't understand it. He's wrong.

Agreed. (y)

Nothing wrong with asking for clarification, though.

Hope this helps clear things up for you.
 
Over the years I've learned that sometimes a fresh perspective helps so lets look at this a completely different way.

Lets graph it and then use the point-slope line equation yf - yi = m(xf-xi) to describe the line mathematically.

Referring to the graph, let the x axis be our raw value from our analog A/D and the y axis be our scaled result, or measured voltage. The four bit value returned from the A/D converter ranges from 0 to 15 and our voltage range is 0 to 5.


Rearrange the point-slope line equation to solve for m (slope).

m = (yf - yi)/(xf-xi)

Now lets plug in some numbers.

m = (5-0)/(15-0)

m = 5/15

m = .3333 volts/count.

C012512-1.JPG
 
If we look at the specifications posted for the four bit converter and filter "marketing data" from "engineering data" then we see that this converter is not a 10 volt converter but a 9.375 volt converter. Setting aside why a manufacturer would build an A/D converter that was less than the 10 volt range typical of most instruments or why a customer would buy an A/D converter that couldn't tell him if his tank was full or just 93% full, lets solve for a 9.375 volt range.

9.375/(2n-1) = 9.375/15 = .625 volts/count. The math works when you get the actual input range right.

One habit to develop is to carefully check the engineering specifications of an analog input. The catalog might list it as a 10 V analog input but if you look at the engineering specs one model might be 10V while another might be 10.5V. Another might say its 4-20mA input but the engineering spec. reveals it is a 0 to 21 mA input. You'll want to select one that can at least measure the full range of your process. Resolution dictates how you quantize the process. Getting the end points right (eg, the A/D can measure or exceed the entire 10V range) dictates how accurately you measure the quantized steps of the process. Analog input accuracy is not a function of resolution, its a function of the quality and design of the card. A four bit analog input could be made to be extremely accurate. However even a super precise four bit analog input will suffer from a large quantization error. Quantization error is not a reflection of the analog input accuracy, it is the step function of the truncated measurement from the A/D. Quantization error is decreased by increasing resolution. Analog input error is decreased by buying quality hardware and adhering to good wiring practices and maintaining/calibrating the equipment
 
Last edited:
I posted the link and text simply to find out why there are two ways to calculate the voltage resolution.

In the link, the author find the voltage resolution by dividing the max voltage by 2^n while you divide it by 2^n-1. Why? Is it because there are different types of digitizing methods?

david90 - there are definately NOT two digitising methods
n = number of available columbs (bits)

Binary-
2^n is the maximum number of sample bits including 0
2^n - 1 is the MSB - most significant bit - highest number

Decimal-
10^n is max no' of bits
10^n - 1 Highest number

If n = 1 this is 1 columb -
binary max sample including 0 is 2 (0.1)
Highest bit is 1

Decimal max sample bits is 0~9 (10)
highest decimal number is 9

with decimal
if n=2 - 2 columns

10^2 = 100 - this is 3 columns not 2 and can not be used
But IT IS the maximum number of sample bits (EDITED)
99 is the highest number available

youe calculations need to be highest number available = highest voltage or measurement point (5 volts etc)
 
Last edited:
I'm currently experimenting with the ALlen Bradley 1746-NI4V analog input module, and I found out that the analog input module outputs data in two's complement format.

Is it possible to configure the 1746-NI4V so that it outputs data in the 0 to ~65000 for -10 to +10V format? According to the manual, it's not possible but I just want to make sure I"m not missing anything.
 
The SLC platform does not support unsigned integers. The NI4V will return a signed 16 bit value between -32768 and +32767.

You can use the carry and borrow bits to perform unsigned math if you have to - there is technote in the AB knowledgebase on how to do that.
 
I'm currently experimenting with the ALlen Bradley 1746-NI4V analog input module, and I found out that the analog input module outputs data in two's complement format.

Is it possible to configure the 1746-NI4V so that it outputs data in the 0 to ~65000 for -10 to +10V format? According to the manual, it's not possible but I just want to make sure I"m not missing anything.

I think you have missed the point.
for the analogue output to give -10v to +10v

the PROGRAM needs to see -32768 to +32767
Why do you want to use 0 to 65000
If absolutely needed
use 0~65000 and subtract 32768
You will need to use Floating point notation

This is programming
 

Similar Topics

Hey guys, I am using ML1200 with Analog module IF4. When i apply voltage (0-10V) across Terminals of Analog module i am getting wrong value on...
Replies
24
Views
4,752
Hi everyone, Our company has had a problem with a vendors machine, it keeps failing parts. As we all know, no one makes bad parts so its got to...
Replies
2
Views
3,314
Hello I'm using AB compact logix with its 1769 IF-8. For 4-20mA i configured the card to use the data format of 4000-20000. using a simulator...
Replies
2
Views
2,412
I'm having trouble calming down 2 Tempo Sonics. I'm using Studio 5000 CompactLogix my Raw value is jumping around from 8575.0 to 8755.0 at a...
Replies
30
Views
1,156
I cannot add SLC500 analog input tag (I: 8.3) to EZSeries Touch Panel Editor (V 5.3). I used all the listed tag datatype but it all says "Invalid...
Replies
10
Views
266
Back
Top Bottom