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

OK, so I did another speed run today. The ambient is around 83°F. At about 6.8km this time I experienced thermal throttling. Check temps on the stator showing 70.8°C (top speed was about 65km/h, the wind speed seemed negigible although I suspect it was slightly at my back)
My turn around time was about 5 minutes. Temps had dropped to 68.8°C. Not wanting to be bouncing off the thermal limit the entire way back I set my speed to 40km/h. I did a couple km's at 40km/h and noted the temps was dropping about 4°C/km.

I increased to 50km/h and the temperature seemed steady. It had cooled down to about 49°C and stayed around 50°C while maintaining 50km/h.

Cooling is all about the ambient temp and I have to say 40°C is hot. 28°C is relatively temperate. Perhaps even more importantly is the temperature of the road, I have to think being 12" from the asphalt the actual cooling air is well above ambient. Either way a 12°C difference is going to be noticeable.

By "hot" I'd say after 1 second your brain goes in to reflex mode and you pull away. (I really need to dig out my digital thermometer, this is very unscientific)

Off hand I's say you're reading is on the high side. In my experience at 40-50km/h the motor goes to about 25°C above ambient and stays there. If you have a head wind that's going to change a lot. At 60km/h the temperature rises to about 30°C above ambient pretty quick, then continues to rise about 2°C every km. At 65km/h that increases to about 4 or 5°C every km. Rough guess.

It's not going up to 40°C here anytime soon so you're going to have to do some mathematical gymnastics to see if your observations fit or not.

Thank you for the huge amount of detailed information! Yes haha I agree 40°C is definitely hot, I've only ridden the ebike twice in the morning in 2 months because of it haha. Maybe so, it's not completely horrible until you hit a red light and then you really start to feel it.

That's probably what I would expect with the hand temp. Well the problem with my data at least is I'm trying to compare my external temps when I ran a shunt mod to the internal sensor with a ludi v2. I have noticed a huge discrepancy from exterior to interior though. I have mine to throttle at 90°C (luna sets it to 100°C but I set it lower) and I did a .5 mile hill climb and at the top I was throttling at 90°C but exterior was only 43°C. Makes me interested in what the internal temp would be when I would take it to 60°C external.... But I ran that shunt mod for 2500 miles and when I opened it the copper it looked brand new so 60°C exterior seems like a good temp to stay below. It also doesn't help that bafang has used two different sensors and put them in different locations during the bbshd production, so maybe ours are different which I'm sure also wouldn't help. When temps outside cool down I probably will experiment with raising the temp limit and checking external temps to compare my internal vs 60°C external. It was a harder to bring the motor to throttling when it was around your temps though, right now feels like I can do it in a blink of an eye haha.

For what it's worth mine also cools down a lot faster than yours, usually when I'm close to throttling temps I back off to around 25km/h'ish with PAS around 200w, and I would say within a minute I go from 90°C to 55°C. Makes me think maybe my sensor is placed very close if not on the coils where yours is more far away. Resulting in mine peaking a lot but yours giving a more steady reading? Idk but interesting to hear about your experience with temps vs mine, very hard to find people talking about interior temps on the bbshd!
 
Thank you for the huge amount of detailed information! Yes haha I agree 40°C is definitely hot, I've only ridden the ebike twice in the morning in 2 months because of it haha. Maybe so, it's not completely horrible until you hit a red light and then you really start to feel it.

That's probably what I would expect with the hand temp. Well the problem with my data at least is I'm trying to compare my external temps when I ran a shunt mod to the internal sensor with a ludi v2. I have noticed a huge discrepancy from exterior to interior though. I have mine to throttle at 90°C (luna sets it to 100°C but I set it lower) and I did a .5 mile hill climb and at the top I was throttling at 90°C but exterior was only 43°C. Makes me interested in what the internal temp would be when I would take it to 60°C external.... But I ran that shunt mod for 2500 miles and when I opened it the copper it looked brand new so 60°C exterior seems like a good temp to stay below. It also doesn't help that bafang has used two different sensors and put them in different locations during the bbshd production, so maybe ours are different which I'm sure also wouldn't help. When temps outside cool down I probably will experiment with raising the temp limit and checking external temps to compare my internal vs 60°C external. It was a harder to bring the motor to throttling when it was around your temps though, right now feels like I can do it in a blink of an eye haha.

For what it's worth mine also cools down a lot faster than yours, usually when I'm close to throttling temps I back off to around 25km/h'ish with PAS around 200w, and I would say within a minute I go from 90°C to 55°C. Makes me think maybe my sensor is placed very close if not on the coils where yours is more far away. Resulting in mine peaking a lot but yours giving a more steady reading? Idk but interesting to hear about your experience with temps vs mine, very hard to find people talking about interior temps on the bbshd!
I'll dig out my thermometer today. The controller side should be the closest internal/external temps because of the heatsink. Unfortunately I'm using the stator temp sensor because the controller seems to be reading high. Or it just may be because it's closer to the mosfets.
 
All right so here's some data. Going in to town today I was able hit the thermal cutback. The limit is pretty much perfect, I dropped from about 63km/h to 43km/h, which allows the motor to cool. After a few minutes at that speed I was back to full power.

When I got to town the display was reading 59.3°C. I immediately took the temperature of the stator and it was 53°C. However, after about a minute the display read 59.2°C but the stator case had risen to 58.5°C. I just got back and the display initially read 62.9°C and the stator was 56.6°C but after a minute they were almost equal. After about 2 minutes the display read 60.9°C but the stator had risen to 62.5°C. Both times the controller was significantly lower in temp, a little less than 10°C lower than the stator side.

All in all I'd say the stator temp sensor on my BBSHD is very accurate. The windings are probably a few degrees warmer, and the case a few degrees cooler but the temps seemed to equalize very quickly once the power was cut.

The controller temp sensor on mine is way off. I know it read much higher than the stator sensor, and if it's actually 10°C lower that means it's probably 20°C off. Or the internal temperature is much higher and it isn't transferring heat to the casing. It could also be localized to the area near the temp sensor. I've been running with this firmware for about a year now and I haven't had any problems with the controller.
 
All right so here's some data. Going in to town today I was able hit the thermal cutback. The limit is pretty much perfect, I dropped from about 63km/h to 43km/h, which allows the motor to cool. After a few minutes at that speed I was back to full power.

When I got to town the display was reading 59.3°C. I immediately took the temperature of the stator and it was 53°C. However, after about a minute the display read 59.2°C but the stator case had risen to 58.5°C. I just got back and the display initially read 62.9°C and the stator was 56.6°C but after a minute they were almost equal. After about 2 minutes the display read 60.9°C but the stator had risen to 62.5°C. Both times the controller was significantly lower in temp, a little less than 10°C lower than the stator side.

All in all I'd say the stator temp sensor on my BBSHD is very accurate. The windings are probably a few degrees warmer, and the case a few degrees cooler but the temps seemed to equalize very quickly once the power was cut.

The controller temp sensor on mine is way off. I know it read much higher than the stator sensor, and if it's actually 10°C lower that means it's probably 20°C off. Or the internal temperature is much higher and it isn't transferring heat to the casing. It could also be localized to the area near the temp sensor. I've been running with this firmware for about a year now and I haven't had any problems with the controller.
Interesting how yours seems to stick very close if not equal but mine I've observed to have a rather large difference at times. You've convinced me to reattach my temp sensor to the exterior of the stator to test more on hot it it gets vs the inside temp. I really don't want to have to open the motor up again haha but I might just do it depending on what I find out. My issue might also be because I know luna had to write some code like Daniel to account for both different temp sensors that could be found, wonder if maybe it reads high and more off the warmer it gets 🤔 because the stator temp is usually 3°C warmer than the controller after fully cooling down like after 24 hours ie basically ambient and close enough imo

Now though I am a little curious, you mention that the controller temps are way off, what would you say the temp reading was when the stator was at 60°C? I had a thought that maybe you the "stator" temps is the controller and the "controller" is the stator. When I ran the stock controller I found the exterior temp of the stator and controller to often be very very close so much to that when I installed the temp probe I actually put it on the inside heatsink of the controller (and I noticed the interior would read around 3-5°C warmer than exterior). Just trying to say I could see even with testing if those numbers got swapped it would be hard to spot. I also want to ask how old would you say your bbshd is, I've seen people online state that the older models had a worse positioned temp sensor, and looking at older stator photos online it almost looks like its not even touching the stator (so maybe just reading the inside air? looked like a temp sensor on a pcb) vs the newer models having a probe wired to the stator(mine). I can show photos to better explain what I mean if you want.
 
Last edited:
Bafang (BBS02) 48v 750w file attached.

I've got a suspicion that I may have been selecting the wrong clock frequency in the STC programming tool when trying these Bafang hex files (should be 18.432MHz), which would explain why I could get none of them to work. So maybe you'll have some success with this, I'd be interested to know how you get on.
EDIT: Hmm, the forum software doesn't seem to like .hex files and won't attach it - I'll try giving it a different extension..
Ok, now attached as a .txt file, make sure you change the extension to .hex after you download it.
the firmware file went over without any prob's but still juddery have now just replaced controller and all is good thanks for your help
 
Interesting how yours seems to stick very close if not equal but mine I've observed to have a rather large difference at times. You've convinced me to reattach my temp sensor to the exterior of the stator to test more on hot it it gets vs the inside temp. I really don't want to have to open the motor up again haha but I might just do it depending on what I find out. My issue might also be because I know luna had to write some code like Daniel to account for both different temp sensors that could be found, wonder if maybe it reads high and more off the warmer it gets 🤔 because the stator temp is usually 3°C warmer than the controller after fully cooling down like after 24 hours ie basically ambient and close enough imo

Now though I am a little curious, you mention that the controller temps are way off, what would you say the temp reading was when the stator was at 60°C? I had a thought that maybe you the "stator" temps is the controller and the "controller" is the stator. When I ran the stock controller I found the exterior temp of the stator and controller to often be very very close so much to that when I installed the temp probe I actually put it on the inside heatsink of the controller (and I noticed the interior would read around 3-5°C warmer than exterior). Just trying to say I could see even with testing if those numbers got swapped it would be hard to spot. I also want to ask how old would you say your bbshd is, I've seen people online state that the older models had a worse positioned temp sensor, and looking at older stator photos online it almost looks like its not even touching the stator (so maybe just reading the inside air? looked like a temp sensor on a pcb) vs the newer models having a probe wired to the stator(mine). I can show photos to better explain what I mean if you want.
When the stator temp was reading 60°C I think the controller was reading 53°C

My BBSHD is a few years old. I have no clue the exact age of the controller, I think it's the one that came with this motor, but it could be one of the older ones. All are the new version with spade connectors, I think I have one with the light wire.

I don't think I ever got a straight answer from Daniel what sensor was being displayed when both were turned on. All I know is with both on it got jerky and was cutting out very quickly, 2-3KM. I turned off the stator one, same issue. Turned of the controller one and that's the way it's been ever since. I'm not worried about burning a controller and I think they can take more heat than the stator anyways. Running 3000W I expected the stator to be the hotter of the two.
 
Hey guys, I ran into an issue with my new BBS02 build and thought I'd ask here since I am using this firmware since day 1 and I'm not sure if this is a hardware or software issue.
I bought the motor a month ago, and constantly had a problem where the motor would fully cut power for 1-2 seconds and then continue working. First I thought it was an issue with my brake sensors, so I bought a new set of Magura MT5e's because I already needed an upgrade. Now these built in sensors are working flawlessly but I still get the random power cuts a once or twice every day and the brake sensors can not be the reason because I'm not even touching the levers. It doesn't matter if I'm using the throttle or PAS, it happens in both cases. Otherwise its working as expected without other issues. I'm running a 52v 15Ah battery, and usually its fully charged as I only use it for smaller trips around town. Any tips? I am a little bit out of ideas. Any suggestion is appreciated.
 
BBS02 is currently not working with this firmware. There are changes on github already that should fix this problem (issue #114) but it is not released yet. Hopefully BBS02 will be useable when v1.4.0 gets released.

Known Issues
⚠️ Unstable on BBS02 controllers!
 
BBS02 is currently not working with this firmware. There are changes on github already that should fix this problem (issue #114) but it is not released yet. Hopefully BBS02 will be useable when v1.4.0 gets released.
I just looked it up on github and this sounds definitely like my problem. It happens relatively rarely so I will just wait for the release, or I'll compile it myself if I have the time. Thank you for the help!
 
I just looked it up on github and this sounds definitely like my problem. It happens relatively rarely so I will just wait for the release, or I'll compile it myself if I have the time. Thank you for the help!
I think someone has posted the current working beta version in this topic already.
It is running fine with bbs02.
 
My new BBSHD controller is throwing the code 10 error, so I downloaded the software onto a Windows 11 laptop and after extracting I get an "app not compatible" error. Is there something I am doing wrong?
 
My new BBSHD controller is throwing the code 10 error, so I downloaded the software onto a Windows 11 laptop and after extracting I get an "app not compatible" error. Is there something I am doing wrong?
i looked up error 10 and its a temp sensor error. try disable the temperature sensor in the config Tool
 
Mon nouveau contrôleur BBSHD génère l'erreur code 10, j'ai donc téléchargé le logiciel sur un ordinateur portable Windows 11 et après l'extraction, j'obtiens une erreur "application non compatible". Y a-t-il quelque chose que je fais mal?
hello if you compiled the configuration software before 6 p.m. today there was a bug that has been fixed since maybe recompiling the software
 
im interested in this bbshd firmware however i have not bought a motor yet so i just got some quick questions ;
if i buy a motor now will the controller be compatible?
also does it matter if i buy 48v version of motor to run with 52v battery?
——————————————————————————————————————————
skysmotor.co.uk is a professional online supplier of brushless electric motor and linear stepper motor. We offer competitive prices and efficient services to our customers.
 
if i buy a motor now will the controller be compatible?
also does it matter if i buy 48v version of motor to run with 52v battery?
Should be compatible, and it doesn't matter for the firmware(it is configurable),
while it might matter for display(I'm not sure), if you intend to use one.
 
This is great!
Thanks to @danielnilsson9 for coming up with this :)

I've flashed 1.4 on a 36v bbs02 which seems to work... ish. But I can't really test this one atm.
I've also flashed it on a 52v bbshd which I've been testing for a couple of days and it seems to be working great so far.

I do have a couple of minor issues:
The auto-off doesn't work. I'm using the C961 display. Does auto-off work for others?

Also, I use mph which limits my max speed to 62. I use Walk Mode Data Display for battery level and it never goes higher than 62.4 :/ lol Although it does seem to be working when my battery level goes below that.
Is there any reason why we can't allow a max speed of 100mph?
 
Sorry, but I don't have a BBSHD or any firmware for it.
Bafang hex file links are available on the web (and back in this thread I think), suggest you do a quick search....
Or are you referring to Daniel's firmware?
yes, daniel's version. firmware + config tool.

I dont know how to compile his code from github and there's changes committed since recently.
Would be nice if releases on github would be compiled automatically.

Or please provide instructions how to do it.
Thank you so much.
 
Question, how to configure this firmware so the engine output is increased the faster the pedals are spinning? Is it even possible?

It is so unconfortable to ride the bike by pedaling because it constantly tries to go to max power tuned for the power assist level. My current ramp up is set to 7A/s and as soon as I pedal slow or fast, doesnt matter how fast, the engine will always try to max out current power assist. I find myself driving most of the time with the throttle because the power output can be controlled. With pedals Im clown pedaling most of the time. No resistance unless I reduce power assist but then when I need more power I have to mess around with power assist again instead of simply pedaling faster.
 
Question, how to configure this firmware so the engine output is increased the faster the pedals are spinning? Is it even possible?

With pedals Im clown pedaling most of the time. No resistance unless I reduce power assist but then when I need more power I have to mess around with power assist again instead of simply pedaling faster.
Not possible and it would be even worse I think. Bike would just keep accelerating faster and faster until it outruns your pedaling.
You need to set PAS power so that you can still pedal with resistance. When you need more power, change to higher PAS level (that's why different PAS levels are there) or use throttle. Or you could get a torque sensor motor.
 
Question, comment configurer ce firmware pour que la puissance du moteur soit augmentée plus les pédales tournent vite ? Est-ce même possible ?

Il est si inconfortable de faire du vélo en pédalant car il essaie constamment d'aller à la puissance maximale réglée pour le niveau d'assistance électrique. Mon accélération actuelle est réglée sur 7A/s et dès que je pédale lentement ou rapidement, peu importe la vitesse, le moteur essaiera toujours de maximiser l'assistance électrique actuelle. Je me retrouve à conduire la plupart du temps avec l'accélérateur car la puissance de sortie peut être contrôlée. Avec des pédales, je pédale la plupart du temps comme un clown. Aucune résistance à moins que je ne réduise l'assistance électrique, mais lorsque j'ai besoin de plus de puissance, je dois à nouveau jouer avec l'assistance électrique au lieu de simplement pédaler plus vite.
Salut, je vous laisse un peu de lecture pour mise sur bafang :
pour compiler le firmware il faut lire cette partie 🙂 :
Last firmware for bbs02b and bbshd rename .txt to .hex and BBSFWTool .txt to .exe :
 

Attachments

  • bbs02-fw.txt
    59.3 KB · Views: 12
  • bbshd-fw.txt
    63.6 KB · Views: 17
  • BBSFWTool.txt
    144.5 KB · Views: 23
  • Bbsfw.xml.txt
    4.9 KB · Views: 22
Last edited:
I do have a couple of minor issues:
The auto-off doesn't work. I'm using the C961 display. Does auto-off work for others?

Also, I use mph which limits my max speed to 62. I use Walk Mode Data Display for battery level and it never goes higher than 62.4 :/ lol Although it does seem to be working when my battery level goes below that.
Is there any reason why we can't allow a max speed of 100mph?
Auto-off is working for me, but with different displays. And this is something
I can't see how the firmware could affect even. Afaik., this is 100% on display.

Unsure about the mph thing, but have you selected mph on both,
firmware configuration with the tool, and in the settings of your display?
Sounds like a bug, if you have.
 
Auto-off is working for me, but with different displays. And this is something
I can't see how the firmware could affect even. Afaik., this is 100% on display.
Yeah, I'd have thought so too. Yet I have 2 displays, both working with stock fw, both not working with this :/ Does seem a bit strange.
Unsure about the mph thing, but have you selected mph on both,
firmware configuration with the tool, and in the settings of your display?
Sounds like a bug, if you have.
Yeah, both set to mph seems to limit the upper range of the number displayed to the imperial equivalent of 100kmh.
Both set to kmh seems to work ok.
Both set differently is just wrong! :/ lol
 
Back
Top