[Nut-upsuser] blazer driver: Possible bugs with battery packs

Michail Pappas m.pappas at pieria.pkm.gov.gr
Tue Apr 2 11:49:04 UTC 2013


Michail Pappas wrote:
> Hello all,
 > [...]
> Now, please bear with me, my C skills are long gone and forgotten, plus
> my understanding of UPS operation is next to non-existent. In any case
> though from above, I see that NUT receives the following info:
>
>     1.546786     send_to_all: SETINFO battery.voltage "2.25"
>     [...]
>     5.437187     send_to_all: SETINFO battery.voltage "270.00"
>
> I think I found 2 problems, one of them an issue and another a bug.
>
> The issue first. According to the values above, NUT tries to autodetect
> the number of battery packs. LThe battery packs detection code in
> blazer.c is as follows:
>
> static double blazer_packs(const char *ptr, char **endptr)
> 135{
> 136    const double packs[] = {
> 137        120, 100, 80, 60, 48, 36, 30, 24, 18, 12, 8, 6, 4, 3, 2, 1,
> 0.5, -1
> 138    };
> 139
> 140    const char    *val;
> 141    int        i;
> 142
> 143    val = dstate_getinfo("battery.voltage.nominal");
> 144
> 145    batt.volt.nom = strtod(val ? val : ptr, endptr);
> 146
> 147    for (i = 0; packs[i] > 0; i++) {
> 148
> 149        if (packs[i] * batt.volt.act > 1.2 * batt.volt.nom) {
> 150            continue;
> 151        }
> 152
> 153        if (packs[i] * batt.volt.act < 0.8 * batt.volt.nom) {
> 154            upslogx(LOG_INFO, "Can't autodetect number of battery
> packs [%.0f/%.2f]", batt.volt.nom, batt.volt.act);
> 155            break;
> 156        }
> 157
> 158        batt.packs = packs[i];
> 159        break;
> 160    }
> 161
> 162    return batt.volt.nom;
> 163}
>
> Like I said, the VGN has battery strings of 20 batteries each. I would
> then expect for battery.packs to be equal to 120 (20 batteries * 6
> plates per battery). This does not happen. batt.volt.nom is 271.4 and
> the cell has a voltage of 2.25 (see above) so the detection algorithm
> does not succeed when trying "120" as the packs[i] value...
>
> I am not sure whether this is an issue or not. Or, if it is one, if the
> detection algorithm can be improved.

Mea culpa, I must have made an error here: batt.packs should be the 
correct number 120, after the snippet above completes! So no 
problem/issue there.

The problem with the miscalc when runtime values are entered have 
something to do with the fact that voltage is calculated to be 270V, 
which is lower than the nominal value of 271.4V, as reported by the UPS...

It feels as though a correction is only possible by adjusting 
override.battery.voltage.nominal. Any ideas as to some decent values I 
could use?

Plus, in which source file is override.battery.voltage.nominal read from?

BR,


Michael.-



More information about the Nut-upsuser mailing list