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

Just have a new fitted bbshd. Without dismantling it just want to confirm that there's only 1.4 and 1.5 revisions.

Saying that just saw I can check MCU with programmer cable when that arrives
 
Last edited:
I just want to say a big Thank You to Daniel for his awesome work that he did creating this firmware. I have a 2400Wh 60V (16S8P / 21700) leftover battery that I was using with BBSHD but I was unable to charge it above 58.5V as this would trigger the overvoltage software protection. With this firmware, I can go all the way up to 63V, it is still not 67.2V, but at least I hit the sweet spot of the battery getting 80% of its capacity which will also prolong battery life as opposed to being always at 50% of battery capacity. Now that the software limit has been removed, I can finally set my own low voltage cutoff to 52V which is truly great. Moreover, it also calculates the battery power % correctly. What I would like to see the most is some collaboration work between the SPEEED app (GitHub - mkopa/speeed: Awesome E-bike Configuration Tool and Display) and Daniel's firmware to be possible to change settings from smartphone on the go. That would truly be awesome.
 
Firmware 1.4.0 beta compiled from source:

New:
  • More options for switch normal/sport mode. You can now use light on+PAS 0-9 (not only PAS0), it also can be set braking at boot for starting in sports mode. Hope in the future we can use more advanced ways alike brake on boot + light in PASX, or light in PASX + light in PASY
Fixed:
  • In my BBS02 the 0% battery bug appears to be solved (same for BBSHD? I really don't know)

I've compiled this preliminary version (tested in about 100km without any throuble in my BBS02B).
hey mate i flashed this, it needs fixed for BBSHD users, reports my bbshd as a bbs02 and relevant settings in config tool when flashing the bbshd version of the fw you provided.

also temp sensors dont work because it thinks its a bbs02


edit*

I hash checked both files, they identical you basically uploaded the bbs02 firmware twice but its renamed wrong
 
Last edited:
Hello!
I ordered a bbshd 1000w 48v motor. I had a 48w 24.5 samsung cell battery made for it in Pilisvörösvár.
My problem is that it doesn't accelerate as it should. I had a bbs02 engine before, it accelerated much better!
I have a cable for it, maybe you know a good firmware for it? I took a photo of the numbers on the engine.
Thanks in advance if you can help.
 

Attachments

  • Screenshot_2023-05-03-04-57-41-040_com.miui.gallery.jpg
    Screenshot_2023-05-03-04-57-41-040_com.miui.gallery.jpg
    1.4 MB · Views: 7
  • Screenshot_2023-05-03-04-57-00-714_com.miui.gallery.jpg
    Screenshot_2023-05-03-04-57-00-714_com.miui.gallery.jpg
    1.2 MB · Views: 8
  • Screenshot_2023-05-03-04-57-22-197_com.miui.gallery.jpg
    Screenshot_2023-05-03-04-57-22-197_com.miui.gallery.jpg
    1.2 MB · Views: 7
Last edited:
Firmware 1.4.0 Beta aus Quelle kompiliert:

Neu:
  • Weitere Optionen zum Umschalten zwischen Normal- und Sportmodus. Sie können jetzt Licht ein+PAS 0-9 (nicht nur PAS0) verwenden, es kann auch beim Starten im Sportmodus gebremst werden. Ich hoffe, dass wir in Zukunft fortschrittlichere Methoden wie Bremse am Kofferraum + Licht in PASX oder Licht in PASX + Licht in PASY verwenden können
Fest:
  • In meinem BBS02 scheint der Fehler bei 0 % Batterie behoben zu sein (dasselbe gilt für BBSHD? Ich weiß es wirklich nicht)

Ich habe diese vorläufige Version zusammengestellt (getestet in etwa 100 km ohne Probleme in meinem BBS02B).
Ich habe es bisher auf meinem BBS02b, okay, aber wenn ich das Tool zum Einrichten öffne, stellt es keine Verbindung her, es findet den USB-Anschluss, aber wenn ich eine Verbindung herstellen möchte, geht es nicht weiter und das grüne Leerzeichen läuft immer durch ohne Verbindung, was kann das sein?
 
Compiled last 1.4.0 firmware and tool today (8 jun 2023), named as "Beta 2". I hope this time BBSHD fw is the right binary

Edit: because I was compiling it wrong, there was 2 identical firmware binaries (BBSHD is this post, BBS02 in previous), it's now fixed and each FW must be the right one
 

Attachments

  • BBS-FW_1.4.0_BETA2-6-11-23.zip
    630.2 KB · Views: 33
Last edited:
New member here. Flashed 1.3.1 onto my BBSHD (1.5) and set power to 33A - it makes a noticeable difference!

Fantastic bit of work, I have donated.

Used the bike for the first time to go to work today, after maybe 5 miles I started getting a jerky power delivery when on full power. I stopped and put my hand on the motor casing - it was barely warm.

I reduced power from level 9 (100%) to level 8 (90%) and it was fine after that, even with a big hill to climb.

I have read the previous posts and it's down to one of the temperature sensors, is that correct? Or was another reason concluded?

Many thanks.
 
New member here. Flashed 1.3.1 onto my BBSHD (1.5) and set power to 33A - it makes a noticeable difference!

Fantastic bit of work, I have donated.

Used the bike for the first time to go to work today, after maybe 5 miles I started getting a jerky power delivery when on full power. I stopped and put my hand on the motor casing - it was barely warm.

I reduced power from level 9 (100%) to level 8 (90%) and it was fine after that, even with a big hill to climb.

I have read the previous posts and it's down to one of the temperature sensors, is that correct? Or was another reason concluded?

Many thanks.
what was your battery voltage at that moment it happened? also what bms does your battery have?
 
Compiled last 1.4.0 firmware and tool today (8 jun 2023), named as "Beta 2". I hope this time BBSHD fw is the right binary
Hello warning the file bbs02b in your archives also corresponds to the version BBSHD fortunately the error was not fatal for my controller.
 
I know that I'm asking probably what was already answered or commented on the previous messages, but in the middle of so many bugfixing and small issues, I cannot have a clear decision about change the original firmware to this that look very good.
So, I need from your experience to tell me if I'm going to get a good improvement on mine BBS02B 36V 500W and display 500C (bought on Aliexpress - Tripath Electric Bike Store in Nov 2022), brake sensors, thumb throttle, shift sensor and use a battery 36V 14,5Ah with real Panasonic NCR18650BD grey cells.
Thanks in advance.
 
Last edited:
New member here. Flashed 1.3.1 onto my BBSHD (1.5) and set power to 33A - it makes a noticeable difference!

Fantastic bit of work, I have donated.

Used the bike for the first time to go to work today, after maybe 5 miles I started getting a jerky power delivery when on full power. I stopped and put my hand on the motor casing - it was barely warm.

I reduced power from level 9 (100%) to level 8 (90%) and it was fine after that, even with a big hill to climb.

I have read the previous posts and it's down to one of the temperature sensors, is that correct? Or was another reason concluded?

Many thanks.
temperature thermal rollback is a gradual reduction it wouldnt be jerky.
if you flash the firmware you have an option in the config software to show temperature in walk mode data display

vX3lCyf.png


just while riding if its jerky start walk mode (holding pas down usually) can be done while braking

your screen will show you doing XX speed in walk mode, this is the temp .
 
Hello warning the file bbs02b in your archives also corresponds to the version BBSHD fortunately the error was not fatal for my controller.
Thanks for warning, it happened to me for 2nd time and therefore it's now fixed (I was using the dirty folder to compile the bbs02 firmware before bbshd, and .make software was using the first bbshd code despite I've declared bbs02, from now on I'll use twice clean firmware folders to compile both firmwares).

.zip file must be now fixed
 
Merci pour l'avertissement, cela m'est arrivé pour la 2ème fois et donc c'est maintenant corrigé (j'utilisais le dossier sale pour compiler le firmware bbs02 avant bbshd, et le logiciel .make utilisait le premier code bbshd malgré que j'aie déclaré bbs02, à partir de maintenant sur j'utiliserai des dossiers de firmware deux fois propres pour compiler les deux firmwares).

Le fichier .zip doit maintenant être corrigé
Merci pour la correction, la compilation est-elle possible facilement ? Parce que je voudrais compiler des tests de développement sur le changement de vitesse sans tourner les manivelles
 
Last edited:
Merci pour la correction, la compilation est-elle possible facilement ? Parce que je voudrais compiler des tests de développement sur le changement de vitesse sans tourner les manivelles
At least, to compile this firmware (just an .hex file for an specific motor) and Windows software (.exe), I'm using Make software to obtain firmware file and Visual Studio (latest and free version) to obtain executable toolkit.

Use of make (FW File):

  1. Download latest code from github in .zip file (just click on the green <>Code button and then click on 'Download ZIP')
  2. Extract into any folder (I will use Desktop for this guide), you must see a folder named 'bbs-fw-master'
  3. Download and install Make software (choice latest version)
  4. Open Windows file manager and place it to C:\Program files(x86)\GNUWin32\bin\
  5. Copy (DON'T MOVE) all content (3 files) in Desktop\bbs-fw-master\src\firmware\
  6. Placed in the prior path, right click and open terminal
  7. In terminal, type .\make.exe TARGET_CONTROLLER=(your controller without space: BBS02B or BBSHD or TSDZ2)
  8. After a few lines show, you will find a new .hex file (once .hex in folder), just rename it and move it to Desktop or anywhere
  9. Now you can flash alike a new or official build (if you wanna compile for another motor, delete all main project folder and download it again or it will be corrupted)

Use of Visual Studio:

  1. Install Visual Studio 2022
  2. Download project .zip from github (previous steps 1 and 2)
  3. Open Windows explorer and double click on Desktop\bbs-fw-master\src\tool\bbs-fw-tool.csproj
  4. In main panel, you will see at your right a panel which shown a terminal icon with the words 'bbs-fw-tool', then right click and compile
  5. It's time to publish: right click again on 'bbs-fw-tool' and Publish
  6. In the assistant, just select you desktop or anywhere you wanna place the final .exe file
  7. Once finished assistant, then click on 'Publish' button near the top-mif of the window
  8. You will see a new executable file or program in you desktop or folder, let's flash firmware and use the tool which will work with every controller (delete .pdb file, it's a junk file used only for visualstudio)
 
Au moins, pour compiler ce firmware (juste un fichier .hex pour un moteur spécifique) et le logiciel Windows (.exe), j'utilise le logiciel Make pour obtenir le fichier du firmware et Visual Studio (dernière version gratuite) pour obtenir une boîte à outils exécutable.

Utilisation de make (Fichier FW):

  1. Téléchargez le dernier code de github dans le fichier .zip (cliquez simplement sur le bouton vert <>Code, puis cliquez sur 'Télécharger ZIP')
  2. Extraire dans n'importe quel dossier (j'utiliserai Desktop pour ce guide), vous devez voir un dossier nommé 'bbs-fw-master'
  3. Téléchargez et installez le logiciel Make (choisissez la dernière version)
  4. Ouvrez le gestionnaire de fichiers Windows et placez-le dans C:\Program files(x86)\GNUWin32\bin\
  5. Copiez (NE PAS DEPLACER) tout le contenu (3 fichiers) dans Desktop\bbs-fw-master\src\firmware\
  6. Placé dans le chemin précédent, faites un clic droit et ouvrez le terminal
  7. Dans le terminal, tapez .\make.exe TARGET_CONTROLLER= (votre manette sans espace : BBS02B ou BBSHD ou TSDZ2)
  8. Après quelques lignes, vous trouverez un nouveau fichier .hex (une fois .hex dans le dossier), renommez-le simplement et déplacez-le sur le bureau ou n'importe où
  9. Maintenant, vous pouvez flasher une version nouvelle ou officielle (si vous voulez compiler pour un autre moteur, supprimez tous les dossiers du projet principal et téléchargez-le à nouveau ou il sera corrompu)

Utilisation de Visual Studio :

  1. Installer Visual Studio 2022
  2. Télécharger le projet .zip depuis github (étapes précédentes 1 et 2)
  3. Ouvrez l'explorateur Windows et double-cliquez sur Desktop\bbs-fw-master\src\tool\bbs-fw-tool.csproj
  4. Dans le panneau principal, vous verrez à votre droite un panneau affichant une icône de terminal avec les mots "bbs-fw-tool", puis faites un clic droit et compilez
  5. Il est temps de publier : cliquez à nouveau avec le bouton droit de la souris sur "bbs-fw-tool" et publiez
  6. Dans l'assistant, sélectionnez simplement votre bureau ou n'importe où vous voulez placer le fichier .exe final
  7. Une fois l'assistant terminé, cliquez sur le bouton 'Publier' près du haut-mif de la fenêtre
  8. Vous verrez un nouveau fichier ou programme exécutable sur votre bureau ou dossier, flashons le micrologiciel et utilisons l'outil qui fonctionnera avec chaque contrôleur (supprimez le fichier .pdb, c'est un fichier indésirable utilisé uniquement pour visualstudio)
Thank you i will try this 😉
 
temperature thermal rollback is a gradual reduction it wouldnt be jerky.
if you flash the firmware you have an option in the config software to show temperature in walk mode data display

vX3lCyf.png


just while riding if its jerky start walk mode (holding pas down usually) can be done while braking

your screen will show you doing XX speed in walk mode, this is the temp .
Yeah I wouldn't have expected thermal rollback to be all jerky and it's an inconsistent jerk too.

I have set the temperature to display in walk mode, so when it happens again I will take a look. (I am on Daniel Nielson's 1.3.1 firmware)

Update from this morning's ride:
As my previous ride had the jerky power delivery I was getting after a period of time at full power @ 33A I decided to disable the motor temperature sensor and run just on the controller temp sensor, I left the power @ 33A.

Rode in this morning (probably a similar ambient air temp, if anything it's a few degrees warmer) and no issues. I was a bit heavier this morning as I had maybe 6/7kgs in my backpack but otherwise the same.

So I guess I will leave the settings as they are for the time being and see if I got lucky today or indeed the motor temp sensor is over-sensitive. I do remember when I changed the settings (which was around 1 hour after I got home so things would have cooled down) that in the event log the motor was showing around 15-20c hotter than the controller.

So at the moment it's a good bet the motor temp sensor is out of wack.
 
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.

throttle.jpg
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.
 
Another idea I have is to add an option for precise speed calibration.

Currently you just select your wheel size and hope for the best. A more elegant solution would be to have an option to fine tune the speedo, one could be the original wheel size input box as we do now and another box below which is a number which represents RPM of the wheel @ 1mph (or whatever speed people think is best)
In my case if you selected a 26" wheel the RPM @ 1mph is 12.93. 12.93 is displayed in a box which you can fine tune to get an exact speed match (against GPS on your phone).

This came into my head today because even though I thought my speedo was good-enough it only showed 9 miles to my work when it's more like 10miles. Over long distances it makes the odometer pretty useless.
 
Another idea I have is to add an option for precise speed calibration.

Currently you just select your wheel size and hope for the best. A more elegant solution would be to have an option to fine tune the speedo, one could be the original wheel size input box as we do now and another box below which is a number which represents RPM of the wheel @ 1mph (or whatever speed people think is best)
In my case if you selected a 26" wheel the RPM @ 1mph is 12.93. 12.93 is displayed in a box which you can fine tune to get an exact speed match (against GPS on your phone).

This came into my head today because even though I thought my speedo was good-enough it only showed 9 miles to my work when it's more like 10miles. Over long distances it makes the odometer pretty useless.
You can adjust your screen more precisely by adjusting in centimeters or inches instead of generic setting 26"27.5" 29
 
I flashed this fw yesterday on my 52v bbshd.
On my first run the bike went into thermal slowdown, once when climbing a steep off-road dirt hill, but this is one I done regularly with my original fw with no temperature errors. The bike again ramped power down on a high speed road run, flat road at about 30mph after 4 minutes.
I since went into the configuration editor tool and disabled the temp sensors and bike runs fine again with no errors.
The temp sensors settings in the fw are definitely set to low.
Also the gear sensor doesn't work anymore, but I was probably expecting that to happen.

However the bike does feel a lot more responsive overall.
Not sure if it's worth the hassle of flashing this fw to be honest.
Depends what you want from it.
 
Back
Top