Thanks guys, I managed to compile and test my own firmware for my BBS02 with BBSHD controller today.
Works now fine for me (also for trail riding).
I am a bit proud because this is the first created firmware in my life and it is a joy to ride.
I enjoyed to process to build, test, program and now ride this old ~4kg mid-drive with huge 1800W peak power (15s battery and 33A controller) smoothly with very good software and without spending too much money (motor still looks neat, not like a DIY-solution.).
My main change in the app.c:
- Smoother change/ramp up of PAS-current without overshoots (only for this motor+controller combination a big improvement) in the app.c:
Change to more conservative ramp-down at high
temp-values in the fwconfig.h to avoid too much stress of the nylon gear at higher temps (because this is of course a weak point of the highly tuned BBS02 because the nylon gets soft at higher temps):
60°C controller temp: 33A
65°C = 23A
70°C = 10A
(The BBS02 has no motor-temp-sensor, so it ramps down only based on the controller-temp. I think with this software I will have a good reliability as long as I am aware that the actual nylon-temp might be much higher than the controller-temp when riding with very low cadence and high torque / when the motor is in an inefficient state).
My three needed
powershell-commands for creating the .hex firmware (I use Powerhell instead of CMD and Win10/Win11):
- make clean
- make all TARGET_CONTROLLER=BBSHD
- cmd /c """C:\Users\correctusername\scoop\apps\sdcc\4.2.0\bin\packihx.exe"" bbs-fw.ihx > bbs-fw.hex"
To clarify my confusion from my post above:
By default Powershell (but not CMD) saves the compiled .hex in the UTF-16 character encoding.
But by using my third (3.) powershell-command not powershell itself but CMD is used for the .ihx > .hex converesion step - and CMD uses UTF-8.
UTF-8 needs only have the size of UTF-16 (
.hex has now 67kb instead of ~130kb).
The binary of the .hex has only ~23kb, see explanation attached.
My slightly changed firmware based on Daniels 1.5.0 is attached if anyone wants to combine the power of a up to 33A BBSHD-controller with the weight of the BBS02b (use at own risk).