I'm building an autonomous boat which contains a li-ion battery pack and I want to know how much charge it still left in it. To do this I measure the voltage of the battery pack. I let it run for about 14 hours and let it deplete and I get a nice discharge curve. So far so good.
But when I'm running this when the boat operates on the water, the voltage suddenly drops when the motor is switched on and jumps back up when the motor is switched off. And those changes also differ depending on how much throttle I give to the motor. The result is that the discharge curve is a total mess and it leaves me more or less guessing what the actual charge of the battery is in percentages.
The behaviour which I observe is also shown in this example I found of li-ion discharge curves:
So the behaviour I see is that my measurements switch between these various discharge curves. I guess I could make the percentage calculation dependent on whether the motor is powered. This method will be quite messy though. I also have to take into account how much I power the motor and when I change the motor, the battery or other parts of the electrical setup (which I do fairly often since I'm working on it) I guess I would have to manually recalibrate this whole calculation.
Does anybody know a good way to get a representative battery charge as a percentage when having changing power usage?