Why is the callibration needed.
If I use a CT sensor with the burden resistor then too is the callibration needed?
Furthur, not able to understand these lines in emonTX3_4_continuous_kwhtotals:
1)
const float powerCal_CT1 = (276.9*(3.3/1023))*(90.9*(3.3/1023)); // <---- powerCal value
const float powerCal_CT2 = (276.9*(3.3/1023))*(90.9*(3.3/1023)); // <---- powerCal value
const float powerCal_CT3 = (276.9*(3.3/1023))*(90.9*(3.3/1023)); // <---- powerCal value
const float powerCal_CT4 = (276.9*(3.3/1023))*(16.6*(3.3/1023)); // <---- powerCal value (2000 / 120R burden resistor)
2)
phaseCal_int_CT1 = phaseCal_CT1 * 256; // for integer maths
phaseCal_int_CT2 = phaseCal_CT2 * 256; // for integer maths
phaseCal_int_CT3 = phaseCal_CT3 * 256; // for integer maths
phaseCal_int_CT4 = phaseCal_CT4 * 256; // for integer maths
3)
DCoffset_V_long = 512L * 256; // nominal mid-point value of ADC @ x256 scale
DCoffsetV_min = (long)(512L - 100) * 256; // mid-point of ADC minus a working margin
DCoffsetV_max = (long)(512L + 100) * 256; // mid-point of ADC minus a working margin
Please explain why all this is done.
Re: need of callibration
Calibration is needed because no component is ever perfect - there will always be some variation between the stated value and the actual value. You can read more about calibration in Building Blocks.
The value measured by the analog to digital converter depends on many factors - the ADC reference voltage, the ratio by which the supply voltage is divided down before it reaches the ADC, and the current transformation ratio and the value of burden resistor that converts the current into a voltage for the ADC. Those equations incorporate the translation between the units used inside the sketch and engineering units (volts and amps) that are more meaningful to you and I, and give you the opportunity to perform the calibration steps that are described in the comments in the sketch.
You will find much more information about the functional parts of the system in Building Blocks.
Re: need of callibration
From where the values specified in the sketch are got is still not clear like 90.9 and 256. What are the calculations needed to get those values.
Re: need of callibration
"You can read more about calibration in Building Blocks."
You didn't read that, did you?
"256" gives the value a sensible range as it is limited to integer values. Integer calculations are much faster than floating point, which is why almost all the maths is done with integers.
Re: need of callibration
Thanks, now read it. But i have doubt in this part:
int voltageThresholdOffset = 250; // in ADC steps from mid-point
why 250 is taken, it is nowhere around 512.
Re: need of callibration
The line immediately above that statement explains what this item is for:
// for voltage failure detection logic
int voltageThresholdOffset = 250; // in ADC steps from mid-point
This item is part of a mechanism to detect when there is a failure of the AC voltage signal. It has nothing to do with the normal operation of the measurement system, or calibration.
OK?
Re: need of callibration
ok
thanks