2016-04-18 0:08 GMT+02:00 Igon
<igg...@gmail.com>:
Pawel, can you explain how the voltage calibration works -
As I understand - the first point - input voltage.. What about second point?
Also how to use p1 & p0 correctly and can such calibration help with Thunder's crater between 1 and 15 volts?
This is how it works:
1. we measure i_adc_[Vout_plus_pin] - ADC readings between red plus wire and GND;
2. we measure i_adc_[Vout_minus_pin] - ADC readings between black minus wire and GND;
from this two values we calculate the output voltage taking into account calibration:
Vout = calibrateValue(Vout_plus_pin, i_adc_[Vout_plus_pin]) - calibrateValue(Vout_minus_pin, i_adc_[Vout_minus_pin])
The calibrateValue function is just a linear interpolation of the two points: p0, p1.
when you do a simple calibration p0 is set to {0,0} by default - which means: a ADC=0 is 0V, and you only set the second point: p1.
To be more precise, when you "edit" a cell voltage in "calibration->voltage" we:
1. take x = i_adc_[Vout_plus_pin] reading
2. take y = "V1-6:" displayed voltage
and we set p1 to {x, y} for the Vout_plus_pin input
we also set the same value p1 = {x,y} for the Vout_minus_pin input,
(both inputs are calibrated with the same p1)
p0 for these inputs is untouched and should be = {0,0}.
-----------------------------------------------------------------------
Performing a 2 point calibration for Vout, (proposition):
1. go to "calibrate->expert DANGER!"
2. set "calib. p.:" to 1
3. take a battery ~15V, connect it to GND (not the black minus wire, but the PCB's GND) and to the red plus wire.
4. measure battery voltage and set it in "Vplus:"
5. set "calib. p.:" to 0
6. take a battery ~1.5V, connect it to GND and to the red plus wire.
7. measure battery voltage and set it in "Vplus:"
8. set "calib. p.:" to 1
9. take a battery ~1.5V, connect it to GND and to the black minus wire.
10. measure battery voltage and set it in "Vminus:"
note: we use low voltage to calibrate the minus wire since there is voltage on it only when current is flowing and it is quite small (<1V), we also leave p0 at {0,0}.
(Y axis - difference between Vout indication and real voltage in calibration mode, balancer is not connected)
T610out - output voltage error of HW-modded Thunder T610 in LED mode
Strange but PWM "DAC" linearity is much better than ADC
I fixed a bug recently in the ADC routine:
maybe it will help.
also this may be interesting:
Do we have some more eeprom space for multipoint voltage calibration
For example for 1-2-5-10-20v?
To be honest, I'm not a big fan of this approach,
even with 2 points the calibration procedure is quit complicated,
and I'm not even sure if it gives any benefits.
The problem is that when you connect a constant voltage to the output
and you start charging (current is flowing) then the i_adc_[Vout_plus_pin]
and i_adc_[Vout_minus_pin] values start to rise,
when p0 != {0,0} or there are more points
you could experience a voltage change even when the voltage is constant.