Replies: 5 comments 6 replies
-
Is this on the Miyoo Mini or Miyoo Mini plus? Only the plus uses the AXP223, the regular mini has no such chip |
Beta Was this translation helpful? Give feedback.
-
Oh really? Interesting. Perhaps I can correct my own voltage curve to something more linear. Can you give me some guidance as to how the percentage is calculated at the moment and where in code that may be? I assume cause of the mostly constant voltage tho that may be impossible but I'd like to experiment. |
Beta Was this translation helpful? Give feedback.
-
Basically on the Miyoo Mini, all we have is the battery voltage. it is read and converted to a percentage by batmon here and then written to /tmp/.axp_result here MainUI (the closed source frontend) reads the value from that file and displays it accordingly. Because we only have battery voltage, the percentage can be inaccurate as the voltage dips with higher current draw (high CPU load) |
Beta Was this translation helpful? Give feedback.
-
You know what. I could just record the voltage over time. Use the curve to make a linear representation from 1 to 100 on a lookup table! Then if I can get power draw I'll try to incorporate it! |
Beta Was this translation helpful? Give feedback.
-
@tGecko here are my findings, and there is a issue with ADC data we are getting. #1 i smoothed the incoming ADC value more. Preventing sudden shutdown or battery warning at 30% when the voltage fluctuates #2 i made the correct voltage curve for li-ion that the miyoo mini has. just these 2 changes already has made the battery drain nice and linear. main...DevL0rd:Onion:mmv4-batteryaccuracy But there is the issue with ADC data. I tested from 100% to 0%. the data from adc is 100 to 0. but there is 30 - 40 minutes more battery life left after 0 before the 3.0V shutoff of the li-ion. and the curve becomes non linear after around 10% even tho i have the corrected curve lookup table. Then i realized. the miyoo mini plus and other handhelds using dingux may all us li-po no li-ion. I think the ADC data we are getting is thinking it's a li-po instead of li-ion and is sending 3.3V as 0 and it should be sending 3v as 0 for li-ion. After careful testing I can mostly confirm this is the case, but I am not sure how I can resolve it. any input @tGecko ? Solving this will finally fix the long lasting inaccuracies with the battery as already the new code is far more accurate :) |
Beta Was this translation helpful? Give feedback.
-
Checklist
Onions OS Version
4.3.1-1
Miyoo Firmware Version
202306282128
Provide a clear and concise description of the issue
My understanding is that onion os is getting battery percent readings directly from the AXP223 chippies.
Unfortunately it's the most in-accurate reading I have ever seen.
Additionally after reading over the document for this controller, there is in fact a calibration mode that can be set.
I believe calibrating it may resolve the issue with crazy battery readings.
May there possibly be a way to toggle the batteries calibration mode from the advanced tools?
My understanding is that you reset it in some way and charge and discharge it to get a more accurate calibration.
Steps to Reproduce
Please provide detailed steps that will help us replicate and investigate your issue
Provide any additional context or information that may help us investigate your issue
Use the onion os.
Cry at battery reading inaccuracies.
Beta Was this translation helpful? Give feedback.
All reactions