No announcement yet.

BBSxx Output Current Map

  • Filter
  • Time
  • Show
Clear All
new posts

    BBSxx Output Current Map

    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 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 Keep Current at PAS Speed Limit %. Additional measurements will be required going forward to better define the rate of change, linear should be a good first guess.

    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
    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.

    I can't see any graphs/attachments.


      In case anyone else can't see the graphics either, they're attached as jpg format pictures here.

      Attached Files


        Nice work. I really like what you ate trying to do here. It is a little unclear at first what data is from experimental result and what is from assumptions on how the controller operates?

        My experimental results indicate that the current does not taper all the way down to the speed limit like in your graphs. Instead it remains flat at the keep current level. That assumes that you have the speed limit for pas set higher than the current decay speed range.


        • AZguy
          AZguy commented
          Editing a comment
          These graphs have the global speed limit at 30mph and like he noted it has impacts throughout the operation. I'd like to see some comparisons with it set to the maximum.

        Thanks McB, consider most of it to be assumptions. I've been looking for feedback to refine the calculations. If you have any data that you can share, it will either support or challenge my assumptions. I'm hoping that as more is learned, the accuracy will improve. This is an evolving process. I don't know much at the moment, so this is more of a journal of my learning that will hopefully be of use, not a lecture based on knowledge that exists.

        I took the current to Zero beyond the speed limit setting because when the bike is off the ground, even full throttle will not exceed the speed limit setting. When I set the limit to 60, the wheel maxed out at 44.6 at full throttle and below 44.0 would not exceed the Speed Limit setting. So I took the speed limit as an absolute, beyond whatever the speed limit is set, the current is cut. I'm still working out whether or not the Current Decay is based on the difference between PAS max amps and Keep Current or just the PAS max amps %. This iteration assumes that the Current Decay is based on the maximum amps at a given PAS level, which actually allows the current to the motor to ultimately be slightly less than the Keep Current value. I've been working backwards from the ground speed and gear ratio to get a value for cadence, then the range of cadence that the Current Decay effects.

        At the moment the assumptions for Current Decay (1-8) are a 50 rpm effective range. CD1 works from 30-80rpm, CD2 is 35-85rpm, CD3 is 40-90rpm, . . .CD7 is 60-110rpm, and CD8 is 65-115rpm. This may ultimately be complete BS, limited information regarding any hard values to use for Current Decay required a guess and big leap of faith. At least it allows calculations to be made and a rough comparison between speed, cadence, power, and gear ratios. I've found it to NOT contradict actual operation, it may not be accurate yet, but it's not contradicted with the bike's behavior either.

        If you provide your configuration, I can map it. Then you can check the map against your actual operation. I only have direct access to two BBSxx motors and the map makes sense to us, just needs refinement to be more accurate. At any rate, the learning continues.


          At the moment the assumptions for Current Decay (1-8) are a 50 rpm effective range. CD1 works from 30-80rpm, CD2 is 35-85rpm, CD3 is 40-90rpm, . . .CD7 is 60-110rpm, and CD8 is 65-115rpm. This may ultimately be complete BS, limited information regarding any hard values to use for Current Decay required a guess and big leap of faith.
          I now have a Watt Meter and Cadence display mounted where I can see them more easily without crashing so I am working my way through the Current Decay settings recording the start and end cadences for each setting. So far I it looks like the range of cadence from start to end is about 20rpm but this might be impacted by the Keep Current setting. I will report back when I have more data.


            Restructuring the Mapping logic took longer than expected. The speed based data no longer begins reducing Amps at 44% motor speed, Keep Current is maintained at high cadence until PAS speed limit % is reached. The "gentle" reduction at speed starts at 95% and ends at 105% of PAS speed limit, this softens the resulting Amps being output to motor near the speed limit. I've also fixed the z-axis (Amps) at 30, now the magnitude is scaled visually for each PAS, rather than looking the same with a different vertical scale.
            McBafang is running out Current Decay / Cadence rpm tests and I'll incorporate his data when he publishes. At that time I'll start a new thread to minimize confusion and re-publish the updated charts.
            Once we have agreement on map surface (or minimal dissension) specific bike gearing can be applied as a vertical slice through the surface to show how a set of BBSxx configurations behaves on a specific bike in a specific gear. My "guinea pig" friend with a BBSHD is happy with the results of this learning process, and my BBS02 is easier to adjust as I better understand the effects of the parameter settings in controller. I'm still adjusting my controller settings, but I'm now down to changing PAS settings 1% at a time for PAS 1-4.