-
-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Weird battery level indicator thing #116
Comments
Battery state of charge estimation is a hard problem, this firmware makes no effort to get it right. This firmware applies a simple voltage based approach, the logic is as follows:
I.e. in your case:
What kind of battery do you have? 53.4 - 43 volt sounds like a really small range, I can see why the above logic gives a bad result for you. There is sort of a bug, the percentage in calculation should be on the useable configured range and not fixed on the end values because that gives a bad result on lower voltage batteries and especially in your case with a small voltage range. I will rework that to something more sensible for next release, should give a better result on lower voltage batteries. The current values makes sense for a 52V (58.8V - 42V) but are not very good for yours. |
Another idea that jumped in, maybe it would be better to seperate the different types of calculations by the battery voltage. |
Hello I do not know if my problem is linked on my BBS02B with 48V battery when I turn it on there is the battery gauge which remains red 3-4 seconds at startup |
Every battery is different and the same battery also changes over time. If you are trying to make decisions based on battery percent then you probably should be displaying voltage and learning what voltage means for your battery, bike, riding style and terrain. I know just by looking at my battery voltage how far I can go and where. Sometimes I make a mistake and curse as I ride the last bit home with no power. |
Yes every battery is different and will change over time. |
The voltage calibration is because every controller is different. It is not related to the actual battery. Different temperatures will also introduce inaccuracies. SOC (state of charge) counting is the only accurate way to do smooth battery percent but has one problem. A partial battery charge must estimate the SOC count accurately and the only measurement for that is battery voltage/percent and we start to go around in circles. Full battery charge and no problem when you know the actual mah of your battery. A lookup table will work better than a MAP for battery percent but it will be different for each battery. That's my two cents worth. And yes Daniel, you are simply amazing. Your programming and problem solving is simply out of this world. |
Anyone knows if there is a way to calculate which battery SOC icon corresponds to which actual battery voltage? From my C961 manual: https://i.imgur.com/1dvD4g6.png |
Could this be sagged voltage creeping into battery.c where - motor_disabled_at_ms > BATTERY_NO_LOAD_DELAY_MS? |
@kb79000 Its a known "feature", 0% is reported until a reading is available. Will see. maybe I fix it too. |
Fix implemented in master for both issues but not yet tested on real bike Not sure it's possible to fix the 0% battery shown after boot, some display seems to show 0% until they have retrieved the first reading. But should be faster now at least. |
The release of a new version to test your modifications? Thank😉 |
In my display (750C BLE, BBS02B, 48V battery), sometimes -not always- it's shown 0%, after 5 or 10 seconds it takes the right read. I'm gonna compile and flash and tell you |
Since I've flashed 1.4.0 I didn't noticed 0% read. Turned on/off about 20 or 30 times in different moments and it seems it's now OK |
Hello how do you get version 1.4.0 ? Thank |
I've uploaded here: https://endless-sphere.com/sphere/threads/bbs-fw-open-source-firmware-for-bbshd-bbs02-controller.117092/page-10 |
Thx Is it possible to have the technic to compile the source ?😉 |
There are instructions link in main page. You will need terminal software (make, used in terminal only) and visual studio for the config tool. It's not easy if you're not almost an advanced user Therefore, I'll compile early versions and publish on endlesphere forum |
Ok thx 😉 |
|
After compiling a beta FW including the implemented fixes, now my battery status works flawlessly, perfect solution. |
Sounds good, I'm closing this. I have also added a compile time option for mapping battery % to displays having a non linear battery bar indicator, like SW102 and 800S (maybe?). I.e where 1 bar != <20%, 2 bar != <40% ... If 800S is affected a mapping can be added if you report which percentages correspond to amount of bars on the display. |
The battery had 3 bars when I started the ride and the immediatelly it dropped to 2 bars (around 40%) on the screen, what is a perfectly normal behaviour in my humble opinion.
I rode 3 km-s in the city, on PAS 3 (I have it set up for max current 30%), after that I went out to the main road and started cruising home.
The battery percentage was constantly showing me 2 bars, and I thought it is legit too since I only went around 5km-s aboat that time, so it should have been real.
I was cruising fixed 30 km/h and then a car went in front of me so I stopped pedalling and braked. After this the battery started blinking as it was completely empty.
It was not, still had 45.1V when I got home and connected the controller to my laptop. (so the previous around 40% indication was indeed right)
The battery max voltage has been set to my 1 year old battery, it can hold 53.4V and I set the minimum voltage to 43V, so at 45.1 the battery indicator should have not blinked.
I was able to get home (it was a very windy day though), the battery had charge in it so it was "fine", but because the ramp down mechanizm I was only getting 100-150 watts of power and that is also normal.
Not sure why this happened of what could cause this, just thought to let you know.
Thanks in advance, and for your work making this cool firmware.
The text was updated successfully, but these errors were encountered: