Closed FintasticMan closed 1 year ago
The first chart is a bit confusing. Can you create a chart of your test results with voltage on the vertical axis and time on the horizontal? I'm guessing the most significant improvement comes from the program you used to find the best fitting values, what do you think?
I agree that the first chart is confusing. The vertical axis is the "desired reported charge", based on the elapsed time since the measurement started. It is the time, normalised between 0 and 100, and then inverted (0 s elapsed should correspond to 100% remaining). I realise now that it makes more sense for it to be on the horizontal axis. Each line represents the theoretical best mapping of voltage to charge, for each test. This way, you can compare if a given approximation fits the lines well.
I can make a chart with voltage plotted against the time, but I'm not sure how useful it would be. This is because I then won't be able to incorporate how my values would change the reported charge. The time elapsed is also not very comparable between runs of the test, because I ran the tests each with different constant loads.
The program I used to calculate the values is quite a simplistic one, it just brute-forces all possible values and chooses the one that fits best. This is very slow (it took almost 6 hours using all 16 threads on my PC) but I can be certain that it definitely doesn't miss anything.
I can't figure out a good graph that shows everything neatly. I have uploaded my results to a GitHub Gist, along with a small writeup on how I got the data. It can be found here.
@Riksu9000 have you had any time to look over my results? I think this is a definite improvement, and would love to get that verified.
Everything looks good to me, but I still want to test this on a watch before approving it.
@Riksu9000 I presume you had the opportunity to check this new discharge curve on an actual device? Do you confirm @FintasticMan 's observations?
Yes, I've been running these changes for a while. The difference in practice isn't enormous, but I feel it's a bit better below 50%, and I trust the provided data, which shows the reported charge being overall closer to the real charge.
This pull request modifies the values of the discharge curve to slightly more accurately estimate the battery discharge. To calculate these values, I have run different tests on my 3 PineTimes, and then used some code to find the best fit. I can provide the raw data from the watches as well as the code I used on request.
In this last graph, the blue line is the original linear algorithm, the red line is with AlexXZero's values, and the yellow line is with my values.