-
-
Notifications
You must be signed in to change notification settings - Fork 48
bugfix for LVC rampdown current computation #286
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
base: master
Are you sure you want to change the base?
bugfix for LVC rampdown current computation #286
Conversation
|
That could be it. Can someone re-upload it to version 1.5 with the changes? That would be great. |
|
No this is probably not your problem, since you're issue is LVC rampdown starting too early. The computation will work fine for higher values. You should just lower your LVC value if you want more power for longer. |
|
Okay, sorry if I'm asking such a stupid question, where do I set it? Well, mine says 54.6 when the battery is full and 39v when the battery is actually empty and that's how I set it but it doesn't help because the problem starts early on. With a battery voltage of 49v I can no longer get over 1000 watts and am at around 850-940 watts. If I have the 1.4 fw on it then I can run the battery down without the performance dropping too much. With a remaining battery of 48v I have 1400 watts, which is a bit strange. I noticed the same problem with my wife's e-bike. |
|
Okay with 54.6 V full and 39 LVC, you have a full voltage range of 15.6V, a padded range of 13.1V. So 0% battery SOC would be 39+1.2=40.2V and 10% SOC would be 40.2+0.1*13.1 = 41.5V. This is when LVC should kick in (starting from 41.5V roughly). I've checked the math in the FW, pretty sure it's fine, but lmk if you find any errors in the LVC algorithm. Could it be battery sag under load? Could be that when you hit the throttle the battery voltage under load drops below 41.5V. Remember that the displayed voltage is only updated every 2s after no power is applied, the battery voltage used for LVC is the floating minimum voltage (not sent to the controller, only updated in the FW during runtime). |
|
As I said, I have the problem that it is with the 1.5 and not with the 1.4, I can rule out a defect, I do not drive with the gas, the voltage is 0.3v so everything is OK so far, it is never strange that it is like that with the 1.5 fw and not with the 1.4.
Yahoo Mail: Suchen, organisieren, erobern
Am Do., Juli 10, 2025 at 13:39 schrieb Adrian ***@***.***>:
EigenMania left a comment (danielnilsson9/bbs-fw#286)
Okay with 54.6 V full and 39 LVC, you have a full voltage range of 15.6V, a padded range of 13.1V. So 0% battery SOC would be 39+1.2=40.2V and 10% SOC would be 40.2+0.1*13.1 = 41.5V. This is when LVC should kick in (starting from 41.5V roughly).
I've checked the math in the FW, pretty sure it's fine, but lmk if you find any errors in the LVC algorithm. Could it be battery sag under load? Could be that when you hit the throttle the battery voltage under load drops below 41.5V. Remember that the displayed voltage is only updated every 2s after no power is applied, the battery voltage used for LVC is the floating minimum voltage (not sent to the controller, only updated in the FW during runtime).
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you commented.Message ID: ***@***.***>
|
|
Can you check the event logger in the GUI and confirm that LVC limiting is the cause of the power-loss? If this is the case you should see this warning, along with the measured voltage. Lmk how this looks for you when your pack is ~49V and you still have this issue. |
|
There's nothing in the log file, sorry I can't help you with that, it's just that it's not there in version 1.4 and it is there in version 1.5.
Yahoo Mail: Suchen, organisieren, erobern
Am Do., Juli 10, 2025 at 16:41 schrieb Adrian ***@***.***>:
EigenMania left a comment (danielnilsson9/bbs-fw#286)
Can you check the event logger in the GUI and confirm that LVC limiting is the cause of the power-loss? If this is the case you should see this warning, along with the measured voltage. Lmk how this looks for you when your pack is ~49V and you still have this issue.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you commented.Message ID: ***@***.***>
|
|
Found the damn bug, the padded voltage range was not getting computed properly. This is why the LVC is kicking in way too early. |
|
that's great thank you 💪👍 |
|
@Larswagner1987 let me know if that is better i might also change to this fw |
|
@FazzFazz @EigenMania Hello, I've tested it and now it's wonderful, everything is correct and the voltage is right again, now it's fun again 💪👍 thank you for the quick help. |
|
@EigenMania Thank you for the firmware, but this one gives me error code 05 (Fault with the throttle) on the BBS02. |
|
Nice! |
|
@RoyMagne it looks like I might have made a mistake and built both solutions for BBSHD by accident, try this one: |
|
@EigenMania Thanks for the quick update! This one seems to be working as expected 😊👍 |
|
@Larswagner1987, @RoyMagne and to anyone else trying the fix, please also test that LVC rampdown still works and report back in the PR request with a comment so we can know (ie just once ride the bike to empty and confirm that it still kicks in, just at the lower battery level). Technically it should start at 10% battery level, but with voltage sag it's likely that it starts earlier, I'd guess ~20% or so depending on how you ride. |
|
@EigenMania Hello, my battery 🔋 has 42 volts and everything is fine so far. Now the wattage restriction is starting to work. Uphill speeds of 18 km/h are possible, the descent is about 7%. The battery does not start at 40 volts but it is no longer possible to continue driving. So I would say everything is great. To put it briefly, at 42 volts the power is reduced, which is great and works well. I have tested it with two different e-bike batteries. They did a good job. |
Proposing a safer method for this computation. If the input voltage to the clamping function is too low, the direct cast to uint8_t can cause the result to wrap. But this can even happen when casting the lvc_voltage. For example:
max_voltage = 58.8; (set in GUI)
lvc_voltage = 42; (set in GUI)
full_voltage_range_x100 = 1679;
padded_voltage_range_x100 = 1410; (using default padding of 8% on each side, set in fw)
lvc_ramp_down_end_voltage_x100 = 4334;
lvc_ramp_down_start_voltage_x100 = 4475;
LVC_LOW_CURRENT_PERCENT = 20; (default in fw)
Input voltage for the MAP32 function is limited to lvc_voltage_x100, but in this case the MAP32 function would actually wrap
uint8_t tmp = (uint8_t)MAP32(4200, 4334, 4475, 20, 100);
Gives tmp = 200 since the result of MAP32 is negative.
Safer to cast to int8_t so the result is between -127 and 127, then CLAMP from 0 to 100, then cast back to uint8_t.