Updating the battery percentage based on voltage in flight is difficult if not impossible, but would it be possible to update the capacity automatically before the flight by having the cube read consumed mah? Is there any sort of scripting available that can hijack the current sensor BATT_1 telemetry to subtract the estimated current from the battery voltage prior to arming and update the percentage without actually sending the current through the current sensor?
For example, Battery is plugged in (in our case, 25000mah 6s)
Voltage is read as 24.14v
6s 100% charge is 25.2
6s 0% is set as 22.12 (actually 10% battery voltage)
Range of 3.08v from (0%-100%)
Battery percentage is calculated as 65%
65% of 25000mah is 16250mah
Cube Orange reads the 16250mah as spent.
This could also maybe be a raspberry pi plugged into the BATT_2 port that reads the voltage and spits out the amount estimated to have been consumed by playing as if it is a current sensor. Maybe? Kind of just brainstorming here.
Basically, condensing my question into one sentence:
Does the 16250mah need to physically pass through the hall sensor to be marked as spent, or is there a script that can just tell the cube that 16250mah has been spent so that the percentage updates immediately?
Probably not super clear, but I’d love some help solving this problem
You are over simplifying the problem. The discharge curves of LiPo batteries are highly non-linear. We will get invalid results when interpolating charge based on the resting voltage.
What you want is called SOC (State-of-charge) calculation and there are many PhD Thesis on the topic, because it is a very complex one.
So, no, there is no way of correctly setting the value you want. You need to always provide a fully charged Akku at the beginning of the flight and then everything will work as expected.
Ok, that makes sense. So every time you power up the flight controller it begins at 100% regardless of the actual state of charge, and a parameter of battery capacity sets the scaling for battery % remaining.
So for the original poster, he could just modify the akku capacity parameter to whatever his “best guess” is given the no load voltage observed. Or just fully charge the battery and use the rated mah number as you suggested.
Yeah it sounds like this will be the best bet for now. I’m not looking for an exact number, just an estimate that shows “Hey, this battery does NOT have a full charge” when you plug it in.
Do the discharge curves vary from battery to battery, or does each battery follow a similar discharge curve? Also, I use a “Cell checker” that plugs into the balance port of the lipo prior to placing a load on the battery. Is this inaccurate, and also, what is the margin of error using this method?
Thanks for linking this, I’ll check it out. Our VTOL is fairly large so it should be able to take a BAB, and the weight gain might be worth seeing an accurate percentage.