FreeCalypso > hg > freecalypso-hwlab
comparison vbat-adc/crude-cal-test @ 163:5f9dd4056420
vbat-adc/crude-cal-test: an experiment to prove VBAT MADC linearity
| author | Mychaela Falconia <falcon@freecalypso.org> |
|---|---|
| date | Fri, 04 Jun 2021 03:02:18 +0000 |
| parents | |
| children |
comparison
equal
deleted
inserted
replaced
| 162:72eac15f0917 | 163:5f9dd4056420 |
|---|---|
| 1 The data table that follows captures the results of this experiment: | |
| 2 | |
| 3 * An FCDEV3B modem board was powered from a bench PSU whose output voltage | |
| 4 is controlled by an analog rotary knob; | |
| 5 | |
| 6 * The PSU voltage knob was turned up and down to produce 0.1 V steps | |
| 7 from 3.2 V to 4.2 V; | |
| 8 | |
| 9 * At each PSU voltage step, VBAT MADC reading was captured with an | |
| 10 mpr 30 command in fc-tmsh, and the actual voltage was measured with a | |
| 11 digital multimeter. | |
| 12 | |
| 13 PSU voltage MADC reading Voltmeter reading | |
| 14 ------------------------------------------------- | |
| 15 3.2 V 473 3207 mV | |
| 16 3.3 V 488 3306 mV | |
| 17 3.4 V 502 3403 mV | |
| 18 3.5 V 517 3500 mV | |
| 19 3.6 V 532 3597 mV | |
| 20 3.7 V 546 3696 mV | |
| 21 3.8 V 562 3804 mV | |
| 22 3.9 V 576 3897 mV | |
| 23 4.0 V 592-593 [1] 4003 mV | |
| 24 4.1 V 606 4.08-4.09 V [2] | |
| 25 4.2 V 621 4.18-4.19 V [2] | |
| 26 | |
| 27 [1] on the cusp of MADC step, got alternating readings | |
| 28 | |
| 29 [2] My cheap multimeter's 4 V range was exceeded at this point, and I had | |
| 30 to switch to the next higher range in which only two digits after the | |
| 31 decimal point were displayed. | |
| 32 | |
| 33 If we apply the firmware's default VBAT calibration values of A=7000 B=0, | |
| 34 we see that VBAT numbers computed from MADC readings are higher than the | |
| 35 true VBAT by 24 mV at the low 3.2 V end and by 45 mV at the high 4.2 V end. | |
| 36 | |
| 37 Calibration math attempt from 3207 to 4003 mV, using MADC=592 at high end | |
| 38 ========================================================================= | |
| 39 | |
| 40 A=(4003-3207)/(592-473)*1024 = 6849 | |
| 41 | |
| 42 B parameter computed from each calibration point: | |
| 43 | |
| 44 MADC reading Voltmeter reading Computed VBAT w/o B B parameter | |
| 45 --------------------------------------------------------------------------- | |
| 46 473 3207 mV 3163 44 | |
| 47 488 3306 mV 3263 43 | |
| 48 502 3403 mV 3357 46 | |
| 49 517 3500 mV 3457 43 | |
| 50 532 3597 mV 3558 39 | |
| 51 546 3696 mV 3651 45 | |
| 52 562 3804 mV 3758 46 | |
| 53 576 3897 mV 3852 45 | |
| 54 592 4003 mV 3959 44 | |
| 55 | |
| 56 B values range from 39 to 46, a very small variation - thus the behaviour of | |
| 57 VBAT MADC really does fit the linear model, and linear calibration really does | |
| 58 work well. | |
| 59 | |
| 60 Calibration math attempt from 3207 to 4003 mV, using MADC=593 at high end | |
| 61 ========================================================================= | |
| 62 | |
| 63 A=(4003-3207)/(593-473)*1024 = 6792 | |
| 64 | |
| 65 B parameter computed from each calibration point: | |
| 66 | |
| 67 MADC reading Voltmeter reading Computed VBAT w/o B B parameter | |
| 68 --------------------------------------------------------------------------- | |
| 69 473 3207 mV 3137 70 | |
| 70 488 3306 mV 3236 70 | |
| 71 502 3403 mV 3329 74 | |
| 72 517 3500 mV 3429 71 | |
| 73 532 3597 mV 3528 69 | |
| 74 546 3696 mV 3621 75 | |
| 75 562 3804 mV 3727 77 | |
| 76 576 3897 mV 3820 77 | |
| 77 593 4003 mV 3933 70 | |
| 78 | |
| 79 B values range from 69 to 77, still a very small variation - thus we are not | |
| 80 too terribly sensitive to errors in the A parameter resulting from MADC values | |
| 81 being on the cusp. |
