A state of charge obsserver for lead-acid batteries