BBSxx Output Current Map

Starting down the path of learning how to configure my BBS02 controller, I saw a bunch of numbers and percentages without any clear or simple understanding of what some of the parameters were doing. I likened it to adjusting a carburetor, there’s only 4 adjustments yet randomly making changes is not going to result in the shortest path to a happy outcome. If trial and error doesn’t work very well with only 4 parameters, I didn’t want to use that approach to solve the 30+ variables in the Bafang controller.

Time to learn, found the Hacker’s Guide and Karl’s Guide in the Knowledge Base and started reading, after a couple of times through the documents, it was still not clear. Large matrices of numbers can hide the obvious in plain sight, a visual overview was required for my simple mind. Started out with a pencil and paper to sketch out the power curve. First attempt made a pretty graph, but it had discontinuities, unknowns, and contradicted the source documents. Second graph had fewer contradictions and disconnected points, but there were still too many independent variables preventing the prediction of a numeric output current. Design of Experiments used to reduce the independent variables down to Speed and Cadence to map the dependent variable, Output Current.

Current (Amps) was selected over Power (Watts) due to the different voltages used with the BBSxx family of motors. Just multiply the Amps by nominal Voltage for Watts.

Knowing that I can’t draw a two dimension graph with two independent variables was my first anchor to reality, a three dimensional surface is required to visualize the operating envelope. Now I just need to find the parameters that use speed and cadence as inputs in the controller settings. Speed was the easy one, PAS levels, speed limits, wheel diameters, and motor speed were easy to locate. Where’s cadence?

There’s nothing in any parameter name that even mentioned cadence. That didn’t make sense, something had to be based on crank cadence to affect the current output. More reading discovered the

With a single parameter setting dealing with cadence, it can’t be the primary control of output current to the motor. That leaves Speed as the primary control of output current. There’s a sufficient number of parameters that link speed and current in both the Basic and Pedal Assist screens of the configuration tool. Off to graph the output current to speed.

The Speed vs Current graph shows a line for each PAS setting, since each PAS setting is controlled by individual

Plotting the

The speed based output current initiation point is based on the 44% motor speed. That works out to the

The

It worked, it generated an output that was continuous, made sense, didn’t contradict anything that I’m aware of, and I could see the differences between the PAS levels. At this point I realized that recalculating and replotting the Speed vs Current graph was going to be tedious at best, spreadsheets are a wonderful thing. Going forward, the graphs are Excel generated, based on the parameters contained in the “.el” files.

In order to see the differences between parameter sets, two widely published sets will be compared side by side. The first is the “em3evbb02.el” and the second is the “kepler.el”. To keep this document constrained, only PAS 1, PAS 5, and PAS 9 for the full three dimensional maps are presented although all 9 levels are calculated. Each 3D map has 240 equally spaced data points over the cadence and speed range.

The

Overview of the two “.el” files reviewed here. The original speed limits were set “By Display’s Command” in the files and changed to 30 for this review. Not all of the parameters are used, no throttle settings were considered in the map creation.

The following pages will show these two configurations side by side.

Questions, comments, and challenges to what I’ve assembled here are welcomed. To get a spreadsheet to calculate and generate the following charts required several assumptions. I started with linear rates of change which can be modified should they prove to be less accurate than desired.

The speed and cadence ranges are consistent for all graphs. The output Amps scale (vertical) varies with the configuration parameters. There are several details that exhibit Excel’s limitations for dealing with 3D surfaces.

Starting down the path of learning how to configure my BBS02 controller, I saw a bunch of numbers and percentages without any clear or simple understanding of what some of the parameters were doing. I likened it to adjusting a carburetor, there’s only 4 adjustments yet randomly making changes is not going to result in the shortest path to a happy outcome. If trial and error doesn’t work very well with only 4 parameters, I didn’t want to use that approach to solve the 30+ variables in the Bafang controller.

Time to learn, found the Hacker’s Guide and Karl’s Guide in the Knowledge Base and started reading, after a couple of times through the documents, it was still not clear. Large matrices of numbers can hide the obvious in plain sight, a visual overview was required for my simple mind. Started out with a pencil and paper to sketch out the power curve. First attempt made a pretty graph, but it had discontinuities, unknowns, and contradicted the source documents. Second graph had fewer contradictions and disconnected points, but there were still too many independent variables preventing the prediction of a numeric output current. Design of Experiments used to reduce the independent variables down to Speed and Cadence to map the dependent variable, Output Current.

Current (Amps) was selected over Power (Watts) due to the different voltages used with the BBSxx family of motors. Just multiply the Amps by nominal Voltage for Watts.

Knowing that I can’t draw a two dimension graph with two independent variables was my first anchor to reality, a three dimensional surface is required to visualize the operating envelope. Now I just need to find the parameters that use speed and cadence as inputs in the controller settings. Speed was the easy one, PAS levels, speed limits, wheel diameters, and motor speed were easy to locate. Where’s cadence?

There’s nothing in any parameter name that even mentioned cadence. That didn’t make sense, something had to be based on crank cadence to affect the current output. More reading discovered the

**Current Decay (1-8)**parameter, but what do the eight settings mean? This is still an open question, I found a “Power vs Cadence BBS01” graph. The first 5 series show a %, but a percent of what? The last series linked 40% to Current Decay 8, there’s useful information here if I can figure out what I’m being shown. I normalized the deltas and the six series almost fell on top of one another. There was something consistent and repeatable going on with the**Current Decay**settings. Still don’t know how to apply this knowledge but at least it’s repeatable and doesn’t contradict anything.With a single parameter setting dealing with cadence, it can’t be the primary control of output current to the motor. That leaves Speed as the primary control of output current. There’s a sufficient number of parameters that link speed and current in both the Basic and Pedal Assist screens of the configuration tool. Off to graph the output current to speed.

The Speed vs Current graph shows a line for each PAS setting, since each PAS setting is controlled by individual

**Current Limit %**and**Speed Limit %**. With the**Start Current %**and**Keep Current %**defining the start and end of each PAS level output current, the maximum output current is the PAS**Current Limit %**and the maximum speed is the**Speed Limit %.**Plotting the

**Start Current %, Current Limit %,**and**Keep Current %**results in a rectangle. While this outline doesn’t contradict anything, it doesn’t show any sensitivity to speed. Those parameters are the boundary points. Two additional points were required, one to terminate the**Slow-start Mode (1-8)**and the other to initiate the output current reduction based on speed.The speed based output current initiation point is based on the 44% motor speed. That works out to the

**Speed Limit***times*the**PAS speed limit %***times***0.44**in whatever units of speed being used.*Assumption**, the reduction of current is linear between the 44% point and the*Additional measurements will be required going forward to better define the rate of change, linear should be a good first guess.**Keep Current**at**PAS Speed Limit**%.The

**Slow-start Mode (1-8)**like the**Current Decay (1-8)**allows the use of 3 bits to hide the actual goings on. My guess is that both parameters are PID controller type settings, which would explain the extreme warnings on setting**Slow-start Mode**too low. The instantaneous current spike will overshoot and at zero speed (no work) it just makes HEAT at 100% efficiency. Additional measurements will be required going forward to better define the rate of change, linear within the first 1% of speed should be a good first guess.It worked, it generated an output that was continuous, made sense, didn’t contradict anything that I’m aware of, and I could see the differences between the PAS levels. At this point I realized that recalculating and replotting the Speed vs Current graph was going to be tedious at best, spreadsheets are a wonderful thing. Going forward, the graphs are Excel generated, based on the parameters contained in the “.el” files.

In order to see the differences between parameter sets, two widely published sets will be compared side by side. The first is the “em3evbb02.el” and the second is the “kepler.el”. To keep this document constrained, only PAS 1, PAS 5, and PAS 9 for the full three dimensional maps are presented although all 9 levels are calculated. Each 3D map has 240 equally spaced data points over the cadence and speed range.

The

**Speed Limit**evaluated here is**30 mph**. Any valid value can be used, but changing it generates all new maps since**Speed Limit**is used in many of the calculations.Parameter |
Em3evbb02 |
Kepler |

Low Volt Cutout | 41 | 41 |

Current Limit | 25 | 20 |

PAS0 Current % | 1 | 100 |

PAS1 Current % | 52 | 10 |

PAS2 Current % | 58 | 20 |

PAS3 Current % | 64 | 30 |

PAS4 Current % | 70 | 40 |

PAS5 Current % | 76 | 50 |

PAS6 Current % | 82 | 60 |

PAS7 Current % | 88 | 70 |

PAS8 Current % | 94 | 85 |

PAS9 Current % | 100 | 100 |

PAS0 Speed % | 1 | 1 |

PAS1 Speed % | 44 | 100 |

PAS2 Speed % | 51 | 100 |

PAS3 Speed % | 58 | 100 |

PAS4 Speed % | 65 | 100 |

PAS5 Speed % | 72 | 100 |

PAS6 Speed % | 79 | 100 |

PAS7 Speed % | 86 | 100 |

PAS8 Speed % | 93 | 100 |

PAS9 Speed % | 100 | 100 |

Wheel Diameter | 26 | 26 |

Speed Limit | 30 | 30 |

Start Current % | 10 | 30 |

Slow-start (1-8) | 3 | 6 |

Crank Trigger | 4 | 4 |

Work Mode | Undetermined | 10 |

Stop Delay (x10ms) | 25 | 25 |

Current Decay (x10ms) | 4 | 8 |

Stop Decay (x10ms) | 0 | 20 |

Keep Current % | 60 | 60 |

Start V (x100mV) | 11 | 11 |

End V (x100mV) | 35 | 35 |

Mode | Current | Current |

Assist Levels | 9 | 9 |

Speed Limit (throttle) | 30 | 24.9 |

Start Amps % | 10 | 10 |

The following pages will show these two configurations side by side.

Questions, comments, and challenges to what I’ve assembled here are welcomed. To get a spreadsheet to calculate and generate the following charts required several assumptions. I started with linear rates of change which can be modified should they prove to be less accurate than desired.

The speed and cadence ranges are consistent for all graphs. The output Amps scale (vertical) varies with the configuration parameters. There are several details that exhibit Excel’s limitations for dealing with 3D surfaces.

## Comment