Renewable Energy Questions/Discussion > Automation, Controls, Inverters, MPPT, etc

Tracking state of charge

<< < (2/2)

madlabs:
Ross, that is exactly what I do, although sadly, I use a factor of .85. This works ok, but it errs both high and low. I zero out the watt hours when the volts hit 14.4 and the net amps in is less than 20. Mostly works, but I do have to manually zero it out sometimes.

Jonathan

rossw:

--- Quote from: madlabs on February 09, 2012, 10:59:21 pm ---Ross, that is exactly what I do, although sadly, I use a factor of .85. This works ok, but it errs both high and low. I zero out the watt hours when the volts hit 14.4 and the net amps in is less than 20.

--- End quote ---

I think my inverter does something sort of similar - but without the adjusting for efficiency on charge :(

The 0.92 I used was from the original posters data of 92%.

frackers:
I think I've come up with something workable!!

When I'm both charging and discharging I save the current state of charge every 10 amp-hours either way in case the controller looses power.

What I'll try is on the discharge side I'll adjust the SOC value by my efficiency factor at the point I stash it in EEPROM, so very close to the way that Jonathan does it.

   // the ICA register, being only 8 bits wide, is not big enough to cover the charge
   // range of a large battery bank. For this reason we take the changes that
   // occur in it and use them to adjust a 16 bit variable. We keep the ICA register
   // in the centre of its range to avoid overflow.
   // We keep a copy of our 16bit pseudo ICA register in EEPROM so it is non-volatile
   gIca += Result.ICA - lastICA;
   lastICA = Result.ICA;
   if ((Result.ICA <= ICAREF - ICABAND) || (Result.ICA >= ICAREF + ICABAND))
   {
      // if discharging adjust ICA down by the efficiency of the charge cycle
      if (Result.ICA <= ICAREF - ICABAND)
         gIca -= (ICABAND * (1 - ((float)gDCA / (float)gCCA)));

      lastICA = ICAREF;
      SetICA (ids[battid], ICAREF);
      eeprom_write_block ((const void *) &gIca, (void *) &eeica, sizeof (gIca));
   }

   // remaining capacity (amp-hrs) = ICA / (2048 * Rshunt)
   gCharge = (int16_t) ((float) (gIca + 0.5) / (float) (2048.0 * Rshunt)); // beware of rounding errors here!!


No comments on my coding style please :)

madlabs:
Let us know how well it tracks, Frackers!

Jonathan

frackers:
Not much wind the last few days but 3 charge/discharge cycles seem to have proved that the new algorithm works OK.

The result is that having set the controller up to use 45 amp-hours to run the pool pump, the discharge curve is tweaked on the fly so that it actually uses 40 amp-hours but reads 45 amp-hours (i.e. about 10% less is used than is indicated). This ratio is derived from the charge counter registers in the DS2438 chip so should 'learn' how the battery bank actually performs.

Longer trials will be required but its better than having no correction at all!!

Navigation

[0] Message Index

[*] Previous page

Go to full version