|
Post by saegilro on Aug 10, 2017 1:04:43 GMT -8
Can we measure Remaining amount of battery power on SunAirPlus board? How?
|
|
|
Post by SDL on Aug 10, 2017 8:50:20 GMT -8
You can make an estimate of power remaining by looking at the battery voltage. Here is some code we used to estimate percent power left on Project Curacao:
def returnPercentLeftInBattery(currentVoltage, maxVolt):
scaledVolts = currentVoltage / maxVolt if (scaledVolts > 1.0): scaledVolts = 1.0 if (scaledVolts > .9686): returnPercent = 10*(1-(1.0-scaledVolts)/(1.0-.9686))+90 return returnPercent
if (scaledVolts > 0.9374): returnPercent = 10*(1-(0.9686-scaledVolts)/(0.9686-0.9374))+80 return returnPercent
if (scaledVolts > 0.9063): returnPercent = 30*(1-(0.9374-scaledVolts)/(0.9374-0.9063))+50 return returnPercent
if (scaledVolts > 0.8749): returnPercent = 30*(1-(0.8749-scaledVolts)/(0.9063-0.8749))+20 return returnPercent
if (scaledVolts > 0.8437): returnPercent = 17*(1-(0.8437-scaledVolts)/(0.8749-0.8437))+3 return returnPercent
if (scaledVolts > 0.8126): returnPercent = 1*(1-(0.8126-scaledVolts)/(0.8437-0.8126))+2 return returnPercent
if (scaledVolts > 0.7812): returnPercent = 1*(1-(0.7812-scaledVolts)/(0.7812-0.8126))+1 return returnPercent
return 0
Best, BP
|
|
|
Post by saegilro on Aug 13, 2017 0:01:55 GMT -8
Thanks a lot
|
|
|
Post by foxi352 on Jan 30, 2019 7:36:13 GMT -8
Wow, that was me next question to ask. Thank you !
|
|
|
Post by foxi352 on Jan 30, 2019 7:48:57 GMT -8
Quick questions:
What is maxVolt ? The 3.7V printed on the LiPo itself, or do you measure the voltage when the battery is really full ?
Is currentVoltage = ina3221_SAP.getBusVoltage_V(SAP_LIPO_BATTERY_CHANNEL + 1);
where
#define SAP_LIPO_BATTERY_CHANNEL 0
Just to be sure :-)
|
|
|
Post by SDL on Jan 31, 2019 11:40:05 GMT -8
4.14 or so generally. You can measure your fully charged batter to fine tune it. Current voltage is what you suggested.
BP
|
|
|
Post by lbendlin on Feb 1, 2019 10:07:17 GMT -8
also please keep in mind that voltage measured during charging does not necessarily equate to the actual voltage level. If possible, suspend the charging to take a measurement.
And the "remaining" voltage also depends on the actual hysteresis cutoff point of the board. It varies by board, and probably also by temperature. I've seen values from 3.42 up to 3.51 V where the hysteresis kicked in and the output got disconnected - what you would normally call " 0 % capacity " (even though technically there's still some juice left in the battery.)
|
|
|
Post by foxi352 on Feb 2, 2019 6:57:13 GMT -8
Thanks SDL. Yes lbendlin, i'm aware of this LiPo complete discharge protection circuit. I'll measure full voltage with disconnected batterie, and keep an eye on cutoff point to calibrate 0%.
Thank you all. Will try this ...
|
|