BBS-FW: Open Source Firmware for BBSHD/BBS02 Controller

Hi everyone. First, massive thanks to Daniel for this fantastic project; I successfully flashed the new firmware onto my BBS01B (which actually had a BBS02B MCU code, which was why I went ahead), and it unlocked it up to 25ah, with a notable increase in performance and the watts shown on my 850C screen - amazing.

I've recently bought a BBSHD (52v) to put on my cargo bike, which is really heavy, and I also live up a really steep hill, so I wanted the extra power. I've flashed the most recent version of the firmware onto the motor, but it seems to be stuck drawing around max 1450 watts, no matter what I set the max amps at between 28-33. The 850C controller tells me it's drawing max 28.5amps.

I've seen this mentioned a few times and wondered if there's a resolution to it? I saw one comment saying that they have a smart BMS which indicated that 33amps was being drawn - so is it just an issue with the display not giving a true reflection of the amps/watts being drawn? What's strange is that there was a notable increase in performance and wattage reading when I flashed my BBS01B, but I haven't had that with the BBSHD. 1450 watts is pretty decent, but the hill I live up is the steepest in the city and it's the road leading out of town too, so people drive pretty carelessly up it, so the reason I'm trying to push it further is because the more wattage the better! Cheers.
On my 02 it allowed me to set 30 amps rather than the 33A I know can be set on a HD controller. This is confirmed by the Eggrider charts. Are you sure your BMS is up to the job?
 

Attachments

  • Screenshot_20240814-232332.png
    Screenshot_20240814-232332.png
    166.9 KB · Views: 12
  • Screenshot_20240814-232424.png
    Screenshot_20240814-232424.png
    182.5 KB · Views: 12
On my 02 it allowed me to set 30 amps rather than the 33A I know can be set on a HD controller. This is confirmed by the Eggrider charts. Are you sure your BMS is up to the job?
Thanks for replying - the battery I've got is new and the BMS can handle up to 40A, so I think so, though I don't have a way of measuring what's coming out of the battery itself. I don't have an Eggrider - would that give me a more accurate measurement of what the motor is putting out?
 
Thanks for replying - the battery I've got is new and the BMS can handle up to 40A, so I think so, though I don't have a way of measuring what's coming out of the battery itself. I don't have an Eggrider - would that give me a more accurate measurement of what the motor is putting out?
BMS is what you should be looking at. And out of luck i would say, if it doesn't support outputting the value you want.
BT capable 30A(or 40A in your case) BMS doesn't cost much from china(less than 25eur shipped). It takes like 2hours to swap it.

Eggrider is a display, right? And displays can't measure anything related to this. It might show values beoynd some artificial
limits other displays are bothered with, but nevertheless it doesn't measure current nor "power".
 
A quick update: I flashed the controller with the firmware update posted by Tomblarom in this thread BBSHD Voltage Problem Firmware Update & Instructions and then edited the settings using the Luna Config Tool. Setting to 30A worked; the screen showed higher amps (30 vs. 28.5 with BBS-FW) and higher wattage (1550-1650, vs. 1400-1450 with BBS-FW) - subtle but noticeable on the hill near me that I tested on. So, it seems it is possible to push my controller & battery beyond 28.5A, and that the issue isn't the screen inaccurately reporting what the motor is drawing.

Best of both worlds for me would be be increased amps but with the BBS-FW programmer - the ability to switch between standard/sport is particularly useful. What's strange when flashing the BBS-FW is that everything else works; I can switch from standard to sport and can notice the difference in performance on the throttle, but it doesn't seem to register the increased amps (or increased voltage draw for the battery).

I noticed that the version and settings for the STC for the firmware update in the link above are slightly different to what's suggested for flashing the BBS-FW. The file in Tomblarom's link uses version 6.86 rather than 6.88, 18.432MHz rather than 20, and instructs to untick 'enable long power-on-reset latency'. I'm wondering whether flashing the BBS-FW using this version of the STC and these settings might overcome whatever issue is preventing the increased amps from registering with the BBS-FW? That way, I could increase the amps and use the BBS-FW programming tool.

The only thing that makes me slightly nervous is whether using alternative settings to those included in the instructions for flashing the BBS-FW carries any risk of bricking the controller?
 
I would suggest trying a lower value in BBS-FW and seeing if that makes a noticeable difference.
 
Just stopping in to say thanks to @danielnilsson9

Flashing to the new Firmware seems to have allowed me to fix a pesky Error 11: temperature sensor inside motor problem I've seen a few posts about with no resolution.

Every time the system powered up, I would get this error resulting in low power limp mode until I was able to climb a big hill and get some heat into the windings. Very annoying not to have full power from the BBSHD, especially first thing in the morning with 3 kids on the back of my cargo bike.

In any case, I chased the issue for a few weeks, opened it up to look for shorted wires, reprogrammed using the Luna tool, and no matter what I tried, the error wouldn't go away.

Then I noticed in the documentation for this project that you have the ability to select temp monitoring parameters and potentially bypass the offending sensor completely.

After some fiddling to get the software to run on my ancient windows laptop, I was able to pull the error log and see that the controller was reading -20c off the internal temp sensor on startup. Clearly bogus and either failed or shorting across the internal wires (didn't get past the silicone/potting). I was able to switch the setting to run on the controller temp sensor only, and on startup the error was gone! The motor felt pretty quick testing on the stand as well.

In any case I hope to put some miles on it this week and make sure everything is good to go, but it seems like a success at the moment.
 
Unfortunately developing anything "web based" is like cancer to me; no thanks:cool:.

Fixing what i've written to work with windows should be "one time only"-task:
just the listing of com ports, and (dis)connecting to it, otherwise the interface to
everything OS dependant is via gtk, and should not require anything(the part that
now needs fixing for windows is likely never to be touched again once working).

View attachment 361709 View attachment 361710

Now it is still missing stuff to support touching assist levels, but changing settings
from the "System"-page does already work beside the event log shown above:sneaky:
Finished the "one time only"-task already. Wasn't quite as easy as i thought it would be:sneaky:.
Wouldn't recommend to anyone looking for "something quick to do":rolleyes:;
16 files changed, 1496 insertions(+), 309 deletions(-)

Still missing a icon, about-dialog, and some other very small/irrelevant things, but i've also
already written one of the features i was after for with this(the "virtual display" in picture):
bbsfwtoolvdisp.png

and yes, gtk3 is relatively ugly on windows w/o any themes etc., but visual things are something
i don't much care about myself given i have other things to spend time and effort on:cool:
 
I have several bbs02 motors but only the newest has the pas/throttle problem. It is also the only hardware v2.0 motor with 1.0.0.4 firmware. All the others are h/w v1.1 with v2.0.1.1 f/w. I was hoping to try this firmware on the newer motor but incase anything goes wrong I would want to get back to a usable firmware. The only 'stock' one I've been able to find is crr1094824e010015.3_170815.hex.
I was wondering if anyone has used that firmware and if it still allows changes via the Speeed app or config tool?
Also, if anyone with a bbs02 motor who is using Daniel's firmware could comment on their experience that would be appreciated.
 
I have several bbs02 motors but only the newest has the pas/throttle problem. It is also the only hardware v2.0 motor with 1.0.0.4 firmware. All the others are h/w v1.1 with v2.0.1.1 f/w. I was hoping to try this firmware on the newer motor but incase anything goes wrong I would want to get back to a usable firmware. The only 'stock' one I've been able to find is crr1094824e010015.3_170815.hex.
I was wondering if anyone has used that firmware and if it still allows changes via the Speeed app or config tool?
Also, if anyone with a bbs02 motor who is using Daniel's firmware could comment on their experience that would be appreciated.
Of the 3 BBS02 controllers I have 2 are working fine with Daniels firmware but the third had issues, the o/s fw always sees the battery voltage as zero and will only run in restricted LVC mode.

I decided to revert this controller back to Bafang firmware to keep it operational but all the firmwares I've tried so far have some issue, usually the jerky throttle, I think you'll struggle to find a good Bafang BBS02 fw on the web. I've tried the fw you refer to, this had some issue, can't remember exactly what, probably the usual jerky throttle. Eventually I used the transistor fix to get this operational, I'm sure you've seen the thread on this elsewhere on the forum.

The other two BBS02 controllers are working faultlessly with Daniel's fw.
 
Of the 3 BBS02 controllers I have 2 are working fine with Daniels firmware but the third had issues, the o/s fw always sees the battery voltage as zero and will only run in restricted LVC mode.

I decided to revert this controller back to Bafang firmware to keep it operational but all the firmwares I've tried so far have some issue, usually the jerky throttle, I think you'll struggle to find a good Bafang BBS02 fw on the web. I've tried the fw you refer to, this had some issue, can't remember exactly what, probably the usual jerky throttle. Eventually I used the transistor fix to get this operational, I'm sure you've seen the thread on this elsewhere on the forum.

The other two BBS02 controllers are working faultlessly with Daniel's fw.
If you wanted, the firmware could also be built w/o "LVC mode" just for that troubled controller,
but that's not smart, unless you 100% trust your battery(the bms in it) to handle things properly.


I'm biased to comment anything on the firmware, but i do definately consider it an improvement
for bbs02(which i'm running too). I also wouldn't recommend bbs(02 nor hd) to anyone, if "bbs-fw"
didn't exist - you can actually feel the chinese quality of coding* on bafang firmware.

*) not really a thing that exists there, but they do mostly ok at hiding it all so no-one really knows
the crap we run with.
 
If you wanted, the firmware could also be built w/o "LVC mode" just for that troubled controller,
but that's not smart, unless you 100% trust your battery(the bms in it) to handle things properly.
I don't normally use a bms on my batteries, they seem to me to be more trouble than they're worth. I use a cell voltage tester occasionally to check the balance but find I rarely (probably never) need to make any adjustment. So like you say, disabling LVC probably isn't a good idea...:)
 
I recently got a new bbs02 (bbs-fw supported controller) with DM03 display (off + 5 speed selecton). I want to use the bbs-fw because of the ability to use motor without speed sensor. Im on linux so I compile the firmware 'make all' and flash it with 'stcgal -P stc15 -t 20000 bbs-fw.hex' after setting use_speed_sensor = 0;. The motor only seems to operate at one PAS level. Changing to PAS levels on the display does not seem to actually change it on the motor. Do the 5 speed displays have a different value for the ASSIST_N, where N is assist level? Or is it likely my motor is just in some other kind of state? I don't mind writing some code to add support for this display, but I am just curious of there is any other kind of information regarding displays like this and the bbs-fw. The display reads information from the motor, such as speed (when connected) and voltage levels. Maybe the signals from the display to the motor are meaningfully different? Im currently waiting shipment for a display extension cable so i can splice into and connect to analyzer if needed. Am i doing anything wrong or does anyone know of previous work on other displays with bbs-fw? Thank you
 
I recently got a new bbs02 (bbs-fw supported controller) with DM03 display (off + 5 speed selecton). I want to use the bbs-fw because of the ability to use motor without speed sensor. Im on linux so I compile the firmware 'make all' and flash it with 'stcgal -P stc15 -t 20000 bbs-fw.hex' after setting use_speed_sensor = 0;. The motor only seems to operate at one PAS level. Changing to PAS levels on the display does not seem to actually change it on the motor. Do the 5 speed displays have a different value for the ASSIST_N, where N is assist level? Or is it likely my motor is just in some other kind of state? I don't mind writing some code to add support for this display, but I am just curious of there is any other kind of information regarding displays like this and the bbs-fw. The display reads information from the motor, such as speed (when connected) and voltage levels. Maybe the signals from the display to the motor are meaningfully different? Im currently waiting shipment for a display extension cable so i can splice into and connect to analyzer if needed. Am i doing anything wrong or does anyone know of previous work on other displays with bbs-fw? Thank you
Wait, you haven't done the configuration yet? You kind of do need a machine w/windows for now,
or you could use the firmware to do the setup(manually editing cfgstore.c/load_default_config()).

I've written a replacement for the tool, but adding windows support to it made such a mess out of it,
that i'm unlikely to clean it up for having my name on it anytime soon, so not willing to share the src atm.:sneaky:
If you have rpi4 or 5 or something, i could perhaps give it as a binary.
 
Wait, you haven't done the configuration yet? You kind of do need a machine w/windows for now,
or you could use the firmware to do the setup(manually editing cfgstore.c/load_default_config()).

I've written a replacement for the tool, but adding windows support to it made such a mess out of it,
that i'm unlikely to clean it up for having my name on it anytime soon, so not willing to share the src atm.:sneaky:
If you have rpi4 or 5 or something, i could perhaps give it as a binary.
I tried to use windows in a VM but for whatever reason i couldnt seem to get USB passthrough to work correctly with the tool, so I directly edited the cfgstore.c file. No way i can run a binary. I'm comfortable with the programming part. I just initially assume there is a mismatch with the DM03 display, maybe with the extcom file regarding the PAS levels and msgbuf etc. My cable will arrive on thurday and i can physically see the data being transmitted. And if it's straightforward enough i can contribute for others to have support for other display. Wasn't sure if anyone else has already done any of this
 
Back
Top