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

It was around 33°C ambient for me during my tests, I actually was really surprised the max I saw was at 45°C, But I do run heat sinks on the exterior and I did put thermal paste around the stator and housing (which in my tests observed a 5~7° drop with the internal sensor, nothing really notable on the exterior). It's now around 45°C where I live with the heat index so bikes been sitting in the garage for me. Maybe watercooling is needed.... :LOL:
it's the same for me, the 45° is the maximum I've seen without any modification and I'm careful not to use the accelerator when it's at this temperature.
 
Running at high temp for a longer periods will in time kill controller. My BBSHD controller dies almost every year riding it uphill in very steep Alps. Constant temp of motor core is around 90C, controller migh be even higher.

I had to disable controller temp sensor on Daniels FW as it limited me too much compared to stock.
 
Running at high temp for a longer periods will in time kill controller. My BBSHD controller dies almost every year riding it uphill in very steep Alps. Constant temp of motor core is around 90C, controller migh be even higher.

I had to disable controller temp sensor on Daniels FW as it limited me too much compared to stock.
How many controllers have you gone through haha, if I was burning the stock one every year I would have swapped to something aftermarket after the second one. It probably would have been cheaper in the long run while also getting all the features a aftermarket controller brings.
 
Last edited:
Wondering if anyone else has come across my issue. According to my display my bbshd won't go above 28.5A's dispute thir firmware being set to 32A right now.
I have tried setting it at 33A and 32A's.
I have a 48V 20Ah battery which I was using to power my previous hub motor at 40A's so that can't be the issue.
It's a fairly new BBSHD with the build date late winter. Unfortunately it came with 52V 28A firmware but I have successfully flashed stock 48V 30A firmware and the BBS tool reported it as 30A's. I'm currently running this 1.4 beta firmware and it runs great other than the current, I have also flashed the previous 1.31 firmware.
Dispite trying all the different firmwares it still won't go past 28.5A's so is their something different with these latest motors?
___________________________

And to add it's a 850C display.
 
Wondering if anyone else has come across my issue. According to my display my bbshd won't go above 28.5A's dispute thir firmware being set to 32A right now.
I have tried setting it at 33A and 32A's.
I have a 48V 20Ah battery which I was using to power my previous hub motor at 40A's so that can't be the issue.
It's a fairly new BBSHD with the build date late winter. Unfortunately it came with 52V 28A firmware but I have successfully flashed stock 48V 30A firmware and the BBS tool reported it as 30A's. I'm currently running this 1.4 beta firmware and it runs great other than the current, I have also flashed the previous 1.31 firmware.
Dispite trying all the different firmwares it still won't go past 28.5A's so is their something different with these latest motors?
___________________________

And to add it's a 850C display.
i assume that the displays not showing correct values. my 500c display also never shows the correct power drawn, at high amps.
 
Wondering if anyone else has come across my issue. According to my display my bbshd won't go above 28.5A's dispute thir firmware being set to 32A right now.
I have tried setting it at 33A and 32A's.
I have a 48V 20Ah battery which I was using to power my previous hub motor at 40A's so that can't be the issue.
It's a fairly new BBSHD with the build date late winter. Unfortunately it came with 52V 28A firmware but I have successfully flashed stock 48V 30A firmware and the BBS tool reported it as 30A's. I'm currently running this 1.4 beta firmware and it runs great other than the current, I have also flashed the previous 1.31 firmware.
Dispite trying all the different firmwares it still won't go past 28.5A's so is their something different with these latest motors?
___________________________

And to add it's a 850C display.
Could be your display firmware lol, I know mine can cause communication issues if I use the stock dpc18 vs the luna cycle one. But maybe you should mod the controller for more power with beefing it up mosfets and the busbar or replacing it with a bac 800 controller.
 
I have not checked this thread for a while I see... That is some interesting information, only info I had was there was two different sensors (NTC(10k) vs PTC(1k)) for the stator temp in the BBSHD motor. Maybe two different sensors have been used in the controller too. Do you know anything more?
Hey was wondering if you are still working on the next update of the firmware for bbs02b? or you just to busy with life?
 
i hope its still maintained... there's still some features to be added! like for example;

-let us choose at which temperature the motor power sets back (because why not?)
-make it possible for the throttle to override set speed limit
-give us more ways to switch between the 2 modes(for example pas 7 with lights button)
-give us a option for the pas to initiate faster from a standstill( my motor starts to assist at around 4kph, which makes me start with the throttle most times)
 
i hope its still maintained... there's still some features to be added! like for example;

-let us choose at which temperature the motor power sets back (because why not?)
-make it possible for the throttle to override set speed limit
-give us more ways to switch between the 2 modes(for example pas 7 with lights button)
-give us a option for the pas to initiate faster from a standstill( my motor starts to assist at around 4kph, which makes me start with the throttle most times)

Are the developers open to suggestions for improvements?

I have a few of my own coming from a car tuning background.

In the software there is a tab for 'calibration' where you can set the SOC for the controller/display.
What would be really nice is a way to calibrate the throttle so power could be ramped in a more controlled fashion.

View attachment 335156
So instead of a linear line you could map the throttle to provide more control at low inputs (as an example).

There doesn't have to be a graphical display in the software, simply providing load sites in 100mv steps where you could fill in what percentage of power you wanted. So for example:
1000mv = 1%
1100mv= 2%
1200mv = 3%
etc....

In-between those values the system would use interpolation?

I have no idea about coding so I don't even know if this is possible, but it would be a great addition.

Gradual power ramp up at throttle start would be nice. In current state there's an immediate burst of power on throttle start and its causing a strain on the pawls of the bbs clutch, paws of freewheel of the cassette, chain and the cogs of cassette. If the rear wheel is lifted (for lubrication, maintenance etc) just touching the throttle sends the real wheel spinning with substantial speed.


My current ramp up is set to 6A/s. BBSHD.
I drive MTB off road on forest trails and mostly using throttle. Coming to near complete stop then starting rapidly.
Past 6 months bent all the cogs on two cassettes because of this sudden and rapid acceleration of the throttle from zero spin.


When driving with throttle aggressively then letting go the front chainwheel and the cassette still spin slightly and lose direct engagement with the paws of the bbs clutch and freewheel hub of the cassette. Next engaging the throttle aggressively spins the front chainring which engages and slams the paws of the bbs clutch into the main gear inside bbs. Then chain snaps hard on the cogs of the casette and this slams the paws of the hub of the freewheel into its hub. Each of these sequentially produce loud pops and strain components worse than if it was directly engaged when driving with pedals when chain and paws are already engaged from pedaling before engine delivers any power from PAS.
 
i hope its still maintained... there's still some features to be added! like for example;

-let us choose at which temperature the motor power sets back (because why not?)
-make it possible for the throttle to override set speed limit
-give us more ways to switch between the 2 modes(for example pas 7 with lights button)
-give us a option for the pas to initiate faster from a standstill( my motor starts to assist at around 4kph, which makes me start with the throttle most times)

Theirs a 1.4.0 beta a few pages back, just make sure you go for the second posting of it (beta2) if your running a bbshd.

1's not implemented but 2 and 3 definitely have been and I think 4 is if your wanting pas to kick in sooner on pedal rotation.
 
still personally trying to figure out how to enable cruise control, i dont know if it needs set first or its on by default and how to use the combo properly

if someone could explain it better would be great
 
That particular BBS02B was purchased in July 2016, so fairly old but I have another that's older still. It's version details were:-
Hardware vers. V1.1
Firmware vers. V2.0.1.1
(as shown in the Bafang config tool).

My feeling is that I may have got careless at some point with all the plugging/unplugging that's involved with reflashing and managed to pop something in the controller, but I can't be certain about that.

Is the old (non working) controller any use to you? You're welcome to it if you think it may help you, if so pm me your details.

I've now acquired some "BBS02B 48v 750w" Bafang firmware (My thanks to Golden Motor, N. America). It came along too late to test it on the faulty controller but I'll post it up if anybody needs it - but do bear in mind it hasn't as yet been tested.

EDIT: I've now tried the Golden Motor f/w on two different bikes with both early and late version controllers and it always gives 'Error 30' on power up. Not a problem for me as Daniel's f/w works without problems but it looks like this isn't going to work.

In fact all the Bafang f/w I've found online fails 'Error 30'....... :?
hi m8 ill give it a try as i have the same prob' here worth a try befor i get another controller
 
hi m8 ill give it a try as i have the same prob' here worth a try befor i get another controller
Hi, that was a while back now, but I'm pretty sure I've still got it stored on my pc somewhere, I'll see if I can dig it out.
Haven't got any spare time today but should be able to do this tomorrow.
 
Hi, that was a while back now, but I'm pretty sure I've still got it stored on my pc somewhere, I'll see if I can dig it out.
Haven't got any spare time today but should be able to do this tomorrow.
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.
 

Attachments

  • CRR10948V750W24E010007.3_BBS-9T_161207.txt
    40.9 KB · Views: 12
Last edited:
Bafang 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.
thanks m8 i will report back with how i get on
 
Greetings! 👋🏻

Made an account just to post into this thread with great excitement and gratefulness. It's clear that so much work has gone into constructing this open firmware. I'm excited to give it a shot soon! There's so much history on this (and other) forums around how to tune a BBSHD and what parameters / dials to change for what outcomes etc. — most of which is based on guesses around what the various parameters actually do... but having an actual open-source firmware with a responsive author and clear mapping between what the settings are called and what they do is just great. I'm really glad to have found this. There's something like 8 years of BBSHD/02 history across the web and all of it pales compared to this firmware. Thanks to everyone for the iterations and testing (which I hope to contribute to as well) but a round of applause for @danielnilsson9 for this new frontier in BBS motor controllers.

Many of the other posts over the last 8 years have built up some serious Google SEO sauce so I'd consider it likely that this new firmware hasn't been seen yet by many users that would use it, but I hope to use it myself, find great success with it, and write posts / spread the word about it thereafter.
 
Greetings! 👋🏻

Made an account just to post into this thread with great excitement and gratefulness. It's clear that so much work has gone into constructing this open firmware. I'm excited to give it a shot soon! There's so much history on this (and other) forums around how to tune a BBSHD and what parameters / dials to change for what outcomes etc. — most of which is based on guesses around what the various parameters actually do... but having an actual open-source firmware with a responsive author and clear mapping between what the settings are called and what they do is just great. I'm really glad to have found this. There's something like 8 years of BBSHD/02 history across the web and all of it pales compared to this firmware. Thanks to everyone for the iterations and testing (which I hope to contribute to as well) but a round of applause for @danielnilsson9 for this new frontier in BBS motor controllers.

Many of the other posts over the last 8 years have built up some serious Google SEO sauce so I'd consider it likely that this new firmware hasn't been seen yet by many users that would use it, but I hope to use it myself, find great success with it, and write posts / spread the word about it thereafter.
Yes, the Bafang BBS units are great pieces of hardware, quiet, powerful and pretty reliable but somewhat let down by some rather inaccessible and cranky oem firmware.
Daniel's fw offers an easy to understand and configure user interface and gives a drive that operates smoothly without any throttle/pas conflicts or other hiccups - something the mighty Bafang corporation couldn't seem to get right.
 
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.
Can you please compile the latest code for BBSHD?
 
Can you please compile the latest code for BBSHD?
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?
 
Yeah that probably has a big factor, I've thought about replacing the sensor myself after I opened the motor up fully to add thermal paste to the stator and realized how easy it would be. Maybe a future upgrade, I've also had the idea of watercooling the motor but right now I'm thinking it might just be better myself to move to a bigger motor / bike so not sure what I will do. Doesn't help that the heat index is crazy right now so I've only ridden maybe 20 miles in the past two months so motivation is low. I have seen someone melt the Andersons, best to replace to xt150's which I personally will if I manage to do. But that's more of a aftermarket huge power issue if I had to guess. And with the nylon gear I've seen people speak about how it looses a lot of its strength well below that temperature, High Voltage has a batch of custom Peak gears for their customers just made recently and has stated that they might sell to the public if enough interest is there so I might do that as well.

Good to hear, interested to hear what you will report.
Warm here yesterday and I was able to get it up to 70 again. I ran full out doing getting up to 64km/h for about 7km, then full out coming back doing about 55km/h back. It started to cut power around 1km from home. Both the motor and controller were hot to the touch. I'd say the stator side was a bit hotter but it was pretty even.
The motor doesn't shed heat very well. I'm thinking a simple spray bottle might provide enough evaporative cooling to keep the heat down.
 
I ran full out doing getting up to 64km/h for about 7km, then full out coming back doing about 55km/h back. It started to cut power around 1km from home. Both the motor and controller were hot to the touch.
That's some serious juice! ~40mph for ~8 miles? That's a lot of watts! Are you running a shunt or something? That feels beyond the capacity of the default 30A/48-52v BBSHD setup!
 
Warm here yesterday and I was able to get it up to 70 again. I ran full out doing getting up to 64km/h for about 7km, then full out coming back doing about 55km/h back. It started to cut power around 1km from home. Both the motor and controller were hot to the touch. I'd say the stator side was a bit hotter but it was pretty even.
The motor doesn't shed heat very well. I'm thinking a simple spray bottle might provide enough evaporative cooling to keep the heat down.
Curious what warm is for you in degrees. Sitting at 64km/h for 7km without overheating / throttling seems crazy to me, when I ran a 45a shunt mod just accelerating for say 25km/h with the motor almost at ambient temps to 64km/h (which was the top speed I could get) I would be dangerously close to back off temps using a external sensor, and within 10 seconds I would be over 60°C (external) and need to back off. And that was at 25°C ambient, today was almost 40°C 🥵. How hot was the exterior temp on the hard, burning or could you hold finger on it for at least a second? Makes me think that might be incorrect in its reading, or that maybe mine is in correct. I thought about installing another temp probe myself when I planned to open mine but forgot when I actually had it open.

I had the idea of getting a stator housing, taking it to someone smart enough to 3d design it, have them increase the size and fins to help that and then taking it a company to get cnc'd or milled out of aluminum or copper but I'm sure that it would be some crazy amount to do. Would be cool if I had a lot of disposable income but at that point a LightningRods Big Block would be cheaper, more powerful, and rated way higher. The water definitely works well, last summer I rode around with a bag of ice and water and half way through a ride when the motor was heat soaked it helped a lot to bring temps down (also a good water bottle is smart and also can hydrate you!). My town also has water fountains in parks that have a spout that fills a dog bowl which is at the ideal height for cooling a bbshd, ask me how I know :sneaky:
 
That's some serious juice! ~40mph for ~8 miles? That's a lot of watts! Are you running a shunt or something? That feels beyond the capacity of the default 30A/48-52v BBSHD setup!
Yes, I'm shunted to 50A. (I think, I always need to do the math). Then pushed to 33A with Danial's firmware for a 55A total. @ 58.8V ~3234W on a full battery.
 
Last edited:
Curious what warm is for you in degrees. Sitting at 64km/h for 7km without overheating / throttling seems crazy to me, when I ran a 45a shunt mod just accelerating for say 25km/h with the motor almost at ambient temps to 64km/h (which was the top speed I could get) I would be dangerously close to back off temps using a external sensor, and within 10 seconds I would be over 60°C (external) and need to back off. And that was at 25°C ambient, today was almost 40°C 🥵. How hot was the exterior temp on the hard, burning or could you hold finger on it for at least a second? Makes me think that might be incorrect in its reading, or that maybe mine is in correct. I thought about installing another temp probe myself when I planned to open mine but forgot when I actually had it open.

I had the idea of getting a stator housing, taking it to someone smart enough to 3d design it, have them increase the size and fins to help that and then taking it a company to get cnc'd or milled out of aluminum or copper but I'm sure that it would be some crazy amount to do. Would be cool if I had a lot of disposable income but at that point a LightningRods Big Block would be cheaper, more powerful, and rated way higher. The water definitely works well, last summer I rode around with a bag of ice and water and half way through a ride when the motor was heat soaked it helped a lot to bring temps down (also a good water bottle is smart and also can hydrate you!). My town also has water fountains in parks that have a spout that fills a dog bowl which is at the ideal height for cooling a bbshd, ask me how I know :sneaky:
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.
 
Back
Top