So I wrote the controller and logger for my wind turbine some 3-4 years ago and it has worked really well.
One of the things that I think I sorted really well was the tracking of charge in the battery bank. I use a 1-wire DS2438 battery monitor chip which can 'coulomb count' by measuring the current 30 times a second and integrating the values into a register that can be read out as amp-hours. As well as the instantaneous value, the chip also hold historic totals of charge in and out and I use these values to work out the overall efficiency of the system which I use to adjust the measured value of charge!
So far so good until 1.6 megawatt hours have passed through the system when it all went pear shaped
So what is with the magic number? the charge totals in and out are 16 bit numbers so they go to 65535 and then roll round to 0 and 65535 * 24 volts is 1.6 MWh. The efficiency I was calculating went from 92% down to 40% when the registers rolled over - I didn't notice until the charge one was at 6500 and the discharge one at 435. No wonder it thought that it was pulling 100amp-hrs from the battery bank was actually only 45amp-hrs and hence nowhere as discharged as it thought.!
My dump load has been busy the last few days loosing the excess power that should have been shunted off to the swimming pool filter pump.