Here is a list of everything you need to successfully configure/program your BBSHD/BBS02. A description of each follows:
BBSxx Configuration (programming) software:
Programming “How to’s” and tips:
A Hacker's Guide to Programming the BBS02 & BBSHD
Programming the BBS02 & BBSHD Without Frying Your Controller and Losing Your Sanity
Stefan Penov's BBSxx Config Help.pdf
BBSHD & BBS02 Configuration '.el' files
About the Bafang Programming Resources:
The BafangConfigTool.exe is in a zip file you can download on Penoff's Hobby Page and is a huge upgrade to the original configuration tool from Bafang. Bafang released the source code and Stefan Penoff (Penov) took it and made it better. I could have just provided a direct link to the zip file but I didn’t because I think you really should pay Stefan’s Hobby Page a visit. It is worth reading what the guy who did the work has to say. So the old configuration tool called Controllerst.exe from Bafang you should avoid because Penov''s is so much better. Unlike the original Bafang version, Penov’s actually works the way it is supposed to.
Here is what Stefan Penov says about it, "Basically I took the original software which also included all required source files and made it look better, fixed many bugs, improved its operation and added a small help file. Now you don’t need administrative rights under windows 8 and 10 to be able to see the available COM ports. The interface looks more tidy and well aligned and also uses better English. Numerous bugs were fixed, regarding error messages and error checking, communication, parameter limits and so on."
The next links are to where you can buy the programming cable that connects the usb on your computer to the BBSxx controller cable. Be sure to follow the instructions carefully on hooking it up. The pins in the controller green connector are very small. Be sure to line up the arrows on the connectors and push gently while wiggling the connectors a bit. It should slide right in. I am now very careful and never do this in the dark as I have bent pins and shorted wires burning out controllers by being in a hurry and not having enough light. Here is the cable you need:
Then come the links to two must read articles on the nuances of BBSxx programming delivered from the hard hitting pen of Karl Gesslein on his e-bike blog. Read Karl's words very carefully. There are some hidden nuggets in there like his warning about the "Time of Stop" parameter where he says, "I strongly recommend setting this to 5, especially if you want to use the PAS system without using e-brakes." Setting this higher (which is typical) can unexpectedly hurl you into traffic or into a tree if you are in the backcountry. I actually like to set this to 10 or 12 as I occasionally don’t down shift when I should and don’t want the motor to stop from timing out at slow cadences. Note: Stefan Penov renamed this 'Stop Delay' which makes more sense.
I should also point out that when you download Stefan's version of the Bafang software you will get another not to be missed gem in a pdf help file he wrote. It can save countless hours scratching your head trying to figure out how the controller configuration tool works and what the parameters do. I included it on its own in the above links but it also comes in Stefan’s zip file.
So in a nutshell, to configure the controller in a BBSHD or BBS02 you should go to Penoff''s Hobby Page and download his upgraded Bafang Configuration Tool. With it will come his help file. READ IT! Get a Bafang Programming Cable and don't forget to read Karl's articles for important insight into what you are about to do.
Stefan Penov is an engineer living in Norway where he commutes by bicycle - now e-bike. He posts occasionally on ES. On his hobby page in addition to rewriting the Bafang software he posted the blow by blow tale of his BBS02 conversion project in two parts and then concludes with this gem "Next post will follow after some time and it will be about the software used for tuning of Bafang’s controllers. I am currently rewriting it but it will take me some time. Why do I do that? Because I can." How cool is that? I think Stefan is describing a lot of folks in the DIY e-bike community that donate time to help newcomers and each other in all of the various e-bike forums. Why do we do it? Because we can. We also know the more we help others ride e-bikes the better the planet we live on will be for all of us.
Oh, and one more thing - a bit of a rant about the confusion surrounding configuration vs programming ... For some reason I think Bafang started the confusion by putting their configuration tool in a folder called 8funprogrammingsw. It is not really programming. Stefan Penoff made programming changes to the configuration tool but he rightly called it a configuration tool and not a programming tool. Stefan went into the source code and made changes to fix it and make it better, that is programming. When we use the tool to change parameters in the controller, that is more appropriately called configuration.
Matt at Empowered Cycles has been working with Bafang for many years and he told me that because you are only tweaking parameters and making configuration changes to the controller, it does not void the warranty as some have said. When you use this configuration tool you are not actually reprogramming your BBSxx controller. If you were to modify the firmware in the controller then you would in fact be reprogramming which could void the warranty. To my knowledge Bafang has not released the source code for the controller and no one is actually doing this.
The configuration tool only changes parameters that tune the motor for a particular bike and/or rider. Now that doesn’t mean you can’t make changes that are insane and even dangerous, it just means that with the configuration tool you have the freedom to make adjustments that fit your riding style and preferences and are free to explore the limits of what your bike and motor can do without voiding your warranty. You can even use it to force limits on your motor to make it fit within the legal limits of wherever you live.
With Bafang now shipping controllers with a built-in gear sensor cable and gear sensors now available from multiple U.S. resellers we now have a better option to consider to protect our drive train while shifting.
Now instead of figuring out how to shift safely under power by finding ways to manually cut the motor, we can add a shift sensor and let it and the BBSxx automatically handle it for us. We are now a step closer to those high-end factory ebikes that are so smooth but unlike our Bafang solutions are under-powered and over-hyped. They do still have one leg up on us though and that is PAS with torque sensing. That takes PAS to a whole new level but is not yet available on Bafang DIY mid-drive motors.
If you don't use PAS, you don't need the gear sensor unless you don't want to let off the throttle while shifting gears. To shift safely using the throttle just let off the throttle and shift. If you can't coordinate that then by all means get the gear sensor and it will lay off the throttle for you. Granted there are times riding single track that it is hard to lay off the throttle because of the grip you have on the bars. So mountain bikers that are using throttle only could definitely use a gear sensor.
If you use PAS and pride yourself in saving $50 by learning manual shift techniques like lightly squeezing the brake or back pedaling to cut the motor before shifting, you may not be a candidate for the new shift sensor. If you ever bought a car with a manual transmission for the pure joy of being in direct manual control, pressing in the clutch and moving the shift lever, you may also not be a candidate. However, you will not be doing something natural like pushing a clutch to shift, you will be unnaturally pulling the brake or back pedalling to shift which may not bring the same pure joy.
However, if you use PAS and like me don't like to do something unnatural like squeeze the brake or backpedal to shift and despite your best attempts to master these techniques find you occasionally shift before the motor cuts out and you hear and feel a hard 750W+ clunk go through your drive train then you are definitely a candidate for the gear sensor. The ability to shift gears just like you always have without worrying about what the motor is doing with the PAS system or whether you can even let off the throttle (think gripping the bars on a hill riding single track) has got to be nice.
If you use PAS without a gear sensor there is an often glossed over controller programming parameter under "Pedal Assist" called "Time of stop" that can make a huge difference. The "Time of stop" value is multiplied by 10 to get the number of milliseconds after you stop pedaling until the motor stops. Most vendors selling Bafang mid-drives are setting this to a value of 25 which introduces a full quarter second delay (250ms) between the time you stop pedaling and when the motor actually quits. This is why people use brakes and back pedaling to ensure that power to the motor is cut before shifting. If you set it to 5 (don't set it any lower or PAS will stop working) then it only waits 1/20th of a second (50ms) before cutting the motor so you can just stop pedaling and then shift and the timing works out. Karl Gesslein, in his "Hackers Guide to Programming the BBS02 and BBSHD" makes the statement, "I strongly recommend setting this to 5, especially if you want to use the PAS system without using e-brakes."
Even if you get a gear sensor you will want to adjust this value down to between 5 and 12 so the motor stops more quickly after you stop pedalling under PAS. Curiously, out of 5 vendors and experts with recommendations, all of them but Karl and now Luna recommend a value of 25. Trust me, changing this to 5 makes a HUGE difference. Unfortunately, a side effect of this setting is that at slow cadences the pulses from the PAS magnetic poles are coming slow enough that there is a greater than 50ms delay between pulses and the motor never engages. If this happens, you are probably in too high of a gear anyway.
The solution of course is to shift to a low enough gear that your cadence is high enough that it doesn't time out between PAS pulses or perhaps try a compromise value of 10 or 12. I set mine to 1o because I am sometimes lazy and don't always shift to a faster cadence. You can play with optimizing this for your own style by playing with numbers between 5 and 25 but it will be a compromise.
If you install a new gear sensor to cut the motor during shifting you will not need to worry about it. That's what I did and I really like the seamless shifting without thinking about it and potentially thrashing my drive train. You get smooth shifting without stopping pedaling or messing with the brakes to get the motor to stop. The motor cuts out as soon as I start to shift and comes back on right after shift completes. Timing is very smooth. Feels like a real pro set-up - sweet.
Have you made a decision on a gear sensor? Why or why not?
Gear sensor available here
Gear Sensor User Manual
Have you ever thought you don't get much out of that big bulky display that came with your BBSHD or BBS02 Bafang mid-drive motor?
Maybe you wish you could get rid of your display entirely because either you want to be super stealthy or you have a speedometer/computer you prefer and you find the display redundant. Maybe your wireless computer stopped working when you plugged in your Bafang display and you want it back. Maybe you want a real volt/amp/watt meter like the Batt Man and don't want yet another display on your bars. Maybe you just want your bars to be as clean as a regular bike. Maybe you thought that with a Bafang BBSHD or a BBS02 you were just stuck with it. How else can you turn your motor on and off? If any of these maybe’s ring any bells or match any of your thinking then read on.
You will be glad to know you can dump your display, turn your motor on and off, keep your throttle and still retain your favorite PAS setting. You can even get rid of the Bafang speedometer sensor and speedometer cable and just use the one on your computer or use the Batt Man watt meter from Luna which is a more useful display. This makes your throttle the sole e-bike addition to your bars. Here's how you can do it:
To turn on the motor without the display you just need to short the red and brown wires that are in the display cable together. Here is an image of the BBSxx display cable connector on the controller side:
The orange wire is PL and the brown wire is P+. Cutting into your cables to tie these wires together can be risky. The easiest and safest way to jumper them together is to just plug in the bafang programming cable and you are set. The brown and orange wires are tied together inside the programming cable. If you take this simple approach you can just buy a programming cable and plug it in but you will need to find a place to tuck the cable and usb/ttl/uart adapter part on your bike - but it is small. You will want a programming cable anyway so you can set up your controller to default to your favorite PAS level and set up other parameters for best throttle control. (More on configuration programming in a moment.)
Alternately, You can just buy a programming cable or one of these and cut the connector off. Just solder the orange and brown wires together, plug it in and you have display eliminating jumper.
If you don’t have an extra display connector and don’t want to wait to buy one you can pick up a jumper at your local hobby or electronics store and do this:
Just be careful to get the jumper on the right pins of the display connector on your controller cable and don’t accidentally bend them. The pins are very thin.
You can also put an on/off switch on the brown and orange wires if you don't want to plug/unplug your battery each time. So the whole project is that simple - program the controller and when you are done leave the programming cable or connector/jumper plugged into the BBSHD or BBS02 controller instead of the display and go for a displayless ride.
To turn the motor completely off you need to unplug the jumper/programming cable. If you are worried about potential battery drain (there is very little without the display) by leaving it on and don't want to plug/unplug it each time you can wire it to a simple 2 pole switch.
When you unplug your display and jumper the orange and brown wires using one of the three ways described above try just going for a ride. It might be just the way you like it. To configure the controller for optimal use without a display you will want to go to Penoff's Hobby Page and download the configuration software and read the help file that explains how it works. A list of programming resources can be found here.
If any of your controller settings are set to 'by displays command' you may want to change it because you DON'T HAVE A DISPLAY! They will however default to what your display was last set at. (If you disconnect your battery after rides that may not be true. I haven’t tested that). Start with a good set of program settings found in a file with the extension .el. Use the one that came pre-programmed into your BBSHD or use another one from someone you trust. A list of these and other great configuration insights can be found here.
Here are a few parameters you can play around with. On the Pedal assist tab- set designated assist to whatever PAS level you like best. For me that is 2 or 3. Set Speed Limited to 40Kmh, Time of Stop to 5 or a little higher if you like slow cadences, set Current decay to 6, Stop Decay to 0. I like Keep Current at 60 to ease off the motor when you come up to speed pedalling but others like it at 100 to keep the throttle on full no matter how fast you are pedalling. Lots of other tweaks you can make that apply to bikes with and without displays.
If you like to use a computer on your rides you may be in for an added bonus. Many wireless computers stop working when the Bafang display is plugged in. This is also true of many other ebike kit displays as well. So once you get rid of your display an added benefit is you get back accurate speed, distance, elevation, slope and more with your own computer.
So that's one way to clean off your bars. There are however many other compromises we are forced into with an e-bike conversion that make for less than satisfactory handlebars. I have struggled with messy bars on many bikes moving shifters, brakes, control switches and throttles all over the place with many less than ideal compromises before coming to what for me is the perfect solution. I finally got my bars exactly how I want them. Read about it here.
Oh, and one more thing. If you really like setting PAS levels on the fly while riding then you are like me and you are stuck with using a display. Thankfully we now have the DPC-14 which to me is the first display I don't absolutely resent giving handlebar real estate to. The above instructions are best for throttle junkies and those that find they use one PAS setting all the time.
What do you think about going displayless?
Handlebars can get pretty cluttered on an e-bike and some combinations of controls on a DIY e-bike just don't work well can get downright crowded and awkward. We often have to make less than ideal compromises in locating our handlebar controls and equipment. Here is a set of bars where the best compromise required the shifter to be placed so far from the grip that it is an awkward and sometimes dangerous maneuver to shift.
Now I happen to like half twist throttles and rapid fire shifters. Unfortunately, most rapid fire shifters do not clear the large bulge on the half twist throttle. After giving up trying to make the rear derailleur shifter work where it belongs on the right side, I ended up turning it upside down and moving it to the less cluttered left side - definitely not ideal.
Some DIYers just move the throttle over to the left and keep the shifters where they belong on the right but having spent years on motorcycles, I just couldn't get use to that. So the shifter ended up being upside down and backwards. It worked but not what I wanted. I wanted to find a way for all of my new e-bike controls to fit with the regular bicycle controls exactly where they are supposed to be. That is when I discovered Shimano I-Spec. brakes and shifters. I-Spec is simply a design that allows the shifter to share the same clamp as the brakes if they are both I-Spec compatible. It turns out SRAM was the first to do it and Shimano's answer was to come up with I-Spec. In improving it Shimano has released several versions, I-Spec A, B and II. I am not going to go over the differences here as there is a good article covering that here. While I was upgrading my drive train to a wide-range 1x10 cassette to give the best possible range of gears for a BBSHD, I took the opportunity to clean up my handlebars using Shimano I-Spec B components. I upgraded my Avid BB7's to Shimano Deore M615 Hydraulic Brakes which are I-Spec B compatible. I replaced my 9 speed Deore derailleur and shifters with Shimano XT 10 speed components. More about the unbelievably superb (for BBSHD conversions) wide range cassette and drive drain upgrade here. The shifter is an I-Spec B Shimano XT M780 10 Speed Trigger Shifter.
Not only does the I-Spec B shifter clear up space on your bars by sharing a clamp with the brake lever but the shifter levers are raised higher off the bars such that they clear the bulge in the e-bike twist throttle and are in the perfect location, Sweet. Additionally, the left side allows the Bafang Power/PAS control switch to be located in a better position right next to the grip.
If you like these ergonomic clamp on grips (I do), they are the Ergon GP1 single twist grip. The left grip is normal sized while the right one is shorter to match with the half twist throttle. If you get the Nexus/Rohloff version of the same grip it is an even better fit because the right grip is another 10mm shorter.
So that is how I got my bars exactly how I wanted them. Some of you may want to go a step further and get rid of your display entirely because either you want to be super stealthy or you have a speedometer/computer you prefer and find the display redundant. Maybe you just don't like a big bulky display and want your bars to be as clean as a regular bike. Maybe you thought that with a Bafang BBSHD or a BBS02 you were just stuck with it. How else would you turn your motor on and off? If that sounds like something you might be interested in click here.
Have you dealt with handlebar clutter on an e-bike?
Anything you have tried to make it work or simplify it?
Electric bikes and the positive impact they can make on your health, your wallet and the planet you live on
Mid-drive motors like the popular Bafang BBSHD and BBS02 have many advantages over hub motors including: 1. Low and middle center of gravity for better balance. 2. Use of the drive train by the motor. On a hub drive the motor only has a single gear while a mid-drive motor alomg with the cyclist gets to use all of the gears so the the motor's RPMs stay up in it’s most efficient range where power is maximized and battery use is more efficient. This allows the bike under motor power to 3. Go fast and climb steep hills much better. 4. Retain the quick release hubs on both wheels to make fixing a flat easy or removing the wheels quick - the way we like it. I remember adding a 19mm wrench to my seat bag toolkit so i could change a flat on the road with a rear hub motor - not ideal.
However despite these great benefits most mid-drive motors require a huge sacrifice over hub motors. These motors have a single gear up front requiring us to sacrifice our front derailleur and 2 or 3 chainrings to a single chainring. This means your 27 speed is now a 9 speed. If you want to go fast with a comfortable cadence you get a large chainring. If you want to climb hills you get a small one. Unfortunately, you can't have both. People with steep hills to climb are putting small chainrings on their BBSHD. Because of the architecture of the BBSHD chainrings smaller than 42 teeth tend to mess up their chain line. It also sacrifices their top speed. If you stay with the 46 tooth chainring that comes on the BBSHD or put an even bigger one on it you can bog the motor down on steep hills even in the lowest gear. Hence, we see the single track and San Francisco crowds putting on 42 tooth and smaller chainrings like the Luna Eclipse or Lekkie all the way down to the 30 tooth Luna Mighty Mini. These are great for climbing but at the expense of speed and chain line below 42t.
The 10 or 11 tooth high gear you have on your cassette is as high as it goes so if you want speed and a higher gear the only lever you have to play with is the front chainring. This you do at the expense of your low gears for climbing. But I did say you could have it all in the title above didn't I? Indeed you can if you upgrade to a wide range cassette. If you have an 11-32t or 11-34t like mine you are in for a hill climbing eye-opener when you move up to an 11-42T wide range cassette. You still have your top speed 11 tooth high gear but now you have a 42 tooth low gear in the rear to grind up the hills with. As for the front chainring no need to go below 42T for the steepest hills so you can keep your chain line intact. In fact I had a hard time finding hills the stock 46T couldn't handle. You will still want to upgrade it just on principle though (and to save weight) as it is a plain, heavy piece of stamped steel, whereas the new chainring upgrades from Luna and Lekkie are a lightweight and attractive upgrade.
So what is entailed in the upgrade? It depends on what you are starting with. If you have a 10 speed cassette already you are in luck. Most wide range cassettes are made for 10 or 11 speeds and you can just add a wide range cassette. Sunrace makes a good one that is 11-42T with 10 or 11 cogs. You may need to make some changes to your derailleur like a Wolf Tooth Components Goatlink or a longer B-screw to enable it clear the 42 tooth cog.
If however, you are like me and have an 8 or 9 speed cassette you will need to upgrade to a 10 speed as that is where the new wide range cassettes start. (Edit: the previous sentence is no longer true as Sunrace now makes wide range cassettes 11-40/11-42 for 8-speed and 9-speed drive trains. Available here.) Fortunately, Shimano and SRAM 8 and 9 speeds have the same cassette body type as the 10 speed so without needing to get a new hub and wheel you can upgrade the cassette. In addition to a new cassette you will also need a new shifter and derailleur. This can all be had for less than you might think. I will give a list of the components I used later. This is also an excuse and an opportunity to get some good performance components in your drive train. While I was at it in addition to a nice drive train upgrade, I took the opportunity to fix up my handlebars using Shimano I-Spec B components. Handlebars can get pretty crowded and awkward for DIY e-bikers. More about that upgrade here.
The bike I started with was a Cannondale Lefty with a 9 speed cassette. After doing a BBSHD conversion on it I loved everything about it except for the unfortunate tradeoff between speed and climbing ability the loss of 2 of my chainrings forced on me. It was while researching my options that I discovered that this limitation could be overcome with a wide range cassette but I would need to upgrade my drive train to a 10 speed. The best 11-42t 10 speed cassette at the best price I could find was made by Sunrace. I got the Sunrace CSMS3 steel cassette.
I recommend the Sunrace CSMS3 rather than the lighter and more expensive CSMX3 aluminum cassette. It is cheaper and made of steel but with the high torque of the BBSHD bearing down on it, it will hold together better. Karl Gesslein found out the hard way that the MX3 aluminum version will not hold together under BBSHD loads and he wrote about it here. In an update to the article and a picture of a trashed MX3 he says, "Forget about the aluminum version of this cassette, only buy the steel version CS-MS3 do NOT buy the CSMX3 which will catastrophically fail under any real power. You have been warned."
After researching more into drive train components I went with the Shimano XT M786 Shadow+ 10 Speed Rear Derailleur with a medium cage. The medium cage coupled with a Goatlink allows this mass produced (read that less expensive) high-end derailleur to clear the massive 42T cog on the Sunrace CSMS3 cassette. Here it is installed on the Lefty with the Wolftooth Goatlink and working flawlessly right out of the box.
I chose an I-Spec B compatible shifter so I could get my handlebars the way I wanted them. The shifter is a Shimano XT M780 10 Speed Trigger Shifter. More on getting the handlebars right here.
This upgrade turned a great mid-drive conversion into what for me is the ultimate e-bike. I love it and if you have struggled with the speed vs climbing power mid-drive motor issue, you will too.
What do you think about mid-drive gear ratios on your e-bike?