Hard Maths question

hi
can someone help me please, got a hard maths question (well for me anyway) i need to work out a % error and compensate for it,

my current sensor result is 0.014 ish under no load (nothing connected) im trying to get this as close as poss to 0.000, im asuming the error is the copper on the track in my circuit.

the current sensors output is 100mv/a (i can adjust this in the code) can someone show me the equation to get rid of this error
thank you

new_result = result - .014

?

Pete

hi pete, i had this code written for me as i cant code only way a can get rid of this error is by using maths thanks

What is the 0.014

Is it a mV signal, ie 0.014mV or 14mV or a multiplier factor. Clarification required

Is it fixed or does it vary with the measured current

The standard linear equation is Y=(AX + B)mV
where Y is the measured voltage (mV in this case)
A is the scale multiplier (100/amp in your case
X is the current flow
B is the offset (normally should be zero but in your case looks like 0.014)

So to reset your offset back to zero simply and assuming the 0.014 represents an offset error of 14mV, simply subtract 0.014 from your measured mV value.

hi jack

sorry the 0.014 is milliamps.

thats the reading i get when no load is applied to the sensor, i see now i think this is the error

so i will subtract this from the 0.1 v/amp, the output of the sensor, so i will change the code to 0.86 v/amp.

thank you very much

so i will change the code to 0.86 v/amp.

No! If it's an offset error (a somewhat reasonable assumption) you add 0.014 to all results.

Since you only have one calibration point (zero), we are only guessing that you have a constant offset.

Typically, you'd make two calibration adjustments - Offset (addition/subtraction) and gain (multiplication). In order to do that, you make a measurement at (or near) zero and make the offset correction. Then, make a 2nd measurement at (or near) the maximum, and correct that with a gain correction. Since the multiplication factor (gain) has no effect when the reading is zero, this correction does not affect the offset correction you've applied at zero.

If you don't have a way of accurately making a 2nd non-zero measurment, of course you can't make a gain correction.
Sometimes, different offsets are applied to sections of the "curve". Where I work we digitally calibrate an ADC by applying 10 different correction factors over its range

I don't know anything about the device you are using... Depending on what you are working with, sometimes there are nonlinearities at the extremes. For example, zero may read 0.014 and a true value of 0.010 may also read 0.014. In that case, making a constant offset corection can make things worse overall. And, there is always some noise and drift... The offset error could be positive today, and negative tomorrow! (Again, this depends on what you are working with... You have hinted that there is some small noise in your reading.)

hi doug

yes i will have a play tommrow and see what i get
the device is an acs 712
here - http://www.sparkfun.com/datasheets/BreakoutBoards/0712.pdf

i think the 0.014 error is the copper of the circuit, ive measured the output streight off the ic and its very close to 0.

thanks very much for your help

sorry the 0.014 is milliamps.

Hmm, I strongly suspect you mean 14mA...

Why do you think this is a problem - that's miles within spec.

Device has "total output error" of +/- 1.5% of full scale.

You don't say which device, but I'll assume the +/-5A one - that will have an error of +/-1.5% of 5A, ie +/-75mA

14mA is way less than 75mA so no issue at all, all working nicely.

MarkT:
14mA is way less than 75mA so no issue at all, all working nicely.

Yep. The "math problem" occurred long before you took the first reading with it.