Programming the Bafang Middrive BBS01+BBS02

Ken Taylor said:
I still can't think of any advantage in restricting cadence. Any more suggestions?

Setting a cadence limit allows you to maintain your preferred cadence more easily. Because controller eases the current off to maintain the rpm it allows you to set a higher current without the motor over revving and becoming uncomfortable. I think it is hard to picture for you with the BBS01 as it has a lower top rpm, but if you think about it trying to run up to 120 rpm all the time. Yes some people do pedal at that speed, if that is the case then no need to limit but for me my knees would explode at that speed. I limit to about 85 rpm just a little more that the BBS01.
The other bonus is you do save a bit of power on the flat and gentle down hill, also less fiddling with the setting to get the assist level just right as its a little more automatic.

I think a combination might be a good option with the throttle setting unlimited, this allows you to hit the throttle and spin up if required. and drop back to pace in PAS mode.
 
pjgold said:
Ken Taylor said:
I still can't think of any advantage in restricting cadence. Any more suggestions?
Setting a cadence limit allows you to maintain your preferred cadence more easily. Because controller eases the current off to maintain the rpm it allows you to set a higher current without the motor over revving and becoming uncomfortable.
Yes, I can see if there is more power being provided from the motor than is needed to maintain the current speed you could easily get a situation where the motor lifts the speed and hence cadence higher than is comfortable for a rider, which would be annoying. This happens when descending without a motor as well and you change up to avoid it. It would also be more likely to occur with higher assist power.
pjgold said:
I think it is hard to picture for you with the BBS01 as it has a lower top rpm, but if you think about it trying to run up to 120 rpm all the time.
Yes, I would never see that.
pjgold said:
Yes some people do pedal at that speed, if that is the case then no need to limit but for me my knees would explode at that speed. I limit to about 85 rpm just a little more that the BBS01.
Yes, I've found the BBS01 is a bit faster than advertised though it reduces as the battery voltage goes down.

So the 85 rpm you've chosen is about the same limit I complain about but I wouldn't want to go past 105 rpm and I now see an advantage in limiting cadence, thanks.
 
In response to speed vs current conversation. One issue I had with the speed setting is that when I stop peddling the sensor initially reads this as a lower cadence increasing the power. The resulted in the bike would actually accelerate when I stopped peddling.
I noticed the highest reading on my ca, when using pas every time I stopped peddling. Power would more than double go from 250 or 300 watt to well over 600. Note, I did not have ebrake switches, which would prevent this.
I like the idea of the power rolling off as I hit max cadence but in my experience I prefer the current mode to speed.
 
jpo said:
In response to speed vs current conversation. One issue I had with the speed setting is that when I stop peddling the sensor initially reads this as a lower cadence increasing the power. The resulted in the bike would actually accelerate when I stopped peddling.
I noticed the highest reading on my ca, when using pas every time I stopped peddling. Power would more than double go from 250 or 300 watt to well over 600. Note, I did not have ebrake switches, which would prevent this.
I like the idea of the power rolling off as I hit max cadence but in my experience I prefer the current mode to speed.
I'm not sure I've understood this but I've read it as the Mode setting on the Throttle Handle tab is affecting behaviour in PAS mode. I'm fairly confident this is not the case. Settings on the Throttle Handle tab only affect behaviour in throttle mode.

I've looked through my ride data and I don't find an increase in power as pedaling ceases. As an example, below is a bit more than 2 km of data while riding in a group. The average heart rate indicates a moderate human effort. The power trace is electrical input power with approximately 2/3 of that power at the wheel. The frequent abrupt reductions in cadence are to avoid colliding with the rider in front. Cadence goes to zero but doesn't show up as zero in the graph because the cadence sensor used to acquire the data has only one pulse per revolution and smoothing which reduces it's responsiveness. At the start we are climbing a 5% grade and I'm adding roughly 90W of assist at the wheel. I reduce the assist to around 40 watts at the wheel as we go over the crest and the grade undulates from there with me upping the assist as it steepens. Looking at the power curve there is only one small surge in power just before pedaling ceases at 49.2 km. Cadence at this point is a high 88 rpm which takes it above the limit for the BBS01. The slight power surge in this case is probably due to the cadence dropping to a level that the motor can keep up with, before pedaling ceases. The sampling interval of 1 second is not fast enough to capture the event clearly. A little after this at 49.4 km is a period of 6 seconds where the cadence rages from 95 rpm to 90 rpm and the inability of the motor to supply much assist at this cadence can be clearly seen.
file.php
PowerSurgeExampleFitzs.png
The setting Stop Decay(x10ms) on the PAS tab I found to affect run on when testing on the Kurt Kinetic rolling road. I tried a large value, I forget the upper limit but there is one, and it ran on upwards of a second (I forget exactly) but it seemed a long time. Run on time also seemed inconsistent but I didn't investigate why. I didn't want run on because if you are drafting and the gap starts to reduce you need to be able to stop human and motor power as fast as possible to avoid collision and you can't use the brakes or the person behind is likely to collide with you. I set this value at 0, which was how it was supplied from EM3EV and as far as I can tell there is no run on. As stated in the EM3EV post, pedaling detection is either on or off, so when I say there is no run on, the cadence has to be below a level that is detected as off before assist ceases. The cadence sensor produces 24 pulses per revolution and I think pedaling stopped, is determined by no pulses for the period defined in Time of stop(x10ms), 0.25 secs in my case. That model hasn't been disputed here but I haven't confirmed it by testing. Keep Current(%) values of less than 100 make power, cadence dependent and with the BBS01 it is easy to be pedaling at a cadence that takes the motor into a region that reduces power. In either of these circumstances you get an increase in power whenever cadence is reduced. Current Decay(1-8) changes behaviour as well but only at Keep Current (%) values of less than 100 as far as I can tell.

You should be able to find settings that will avoid a power surge when pedaling ceases except from high cadences with the BBS01 and in this case power will only surge to the value you have selected.
 
Ken is there any chance you can post your BBS01 settings? It would be interesting to compare what you have got against what I have currently which are based around pjgold's previous posts.

Thanks
Andrew
 
Aushiker said:
Ken is there any chance you can post your BBS01 settings? It would be interesting to compare what you have got against what I have currently which are based around pjgold's previous posts.

Thanks
Andrew
OK, but I don't consider them optimal yet and optimal depends on what you are aiming to achieve. I'm trying to optimise for 80km - 200km ranges, riding with stronger and lighter unpowered riders. Just enough assist to stay with the best of them. It is apparent there are no settings that get all the outcomes I want. For example, I never need assist when descending, being heavier, already gets you more power from gravity than everyone else. Therefore battery power used during descents is wasted but the controller will not automatically switch off power in descents. On the flats I can usually stay on a wheel without help, but not on the front. On a climb I always need help, roughly proportional to grade. I mostly deal with this by changing the assist level quite often. I don't have a throttle connected. It was previously useful but as the PAS settings get better it becomes superfluous. I recently climbed a long 10% grade, Black mountain, Canberra with a good rider (top 10% according to Strava times) and was shocked that I needed my best of about 220 watts and another 300 W of electrical assist, about 200 watts at the wheel, to stay with him.
From the saved settings file:-
[Basic]
LBP=31
LC=15
ALC0=0
ALC1=5
ALC2=18
ALC3=25
ALC4=32
ALC5=42
ALC6=55
ALC7=68
ALC8=82
ALC9=100
ALBP0=100
ALBP1=100
ALBP2=100
ALBP3=100
ALBP4=100
ALBP5=100
ALBP6=100
ALBP7=100
ALBP8=100
ALBP9=100
WD=12
SMM=0
SMS=1
[Pedal Assist]
PT=3
DA=0
SL=0
SSM=0
WM=0
SC=50
SDN=4
TS=25
CD=1
SD=0
KC=100
[Throttle Handle]
SV=11
EV=35
MODE=1
DA=10
SL=0
SC=5
 
Thanks Ken. I will compare them with my settings. I don't change my assist much preferring at this stage to try to find a happy medium but otherwise I think my approach is similar to yours.

Andrew
 
Paul's website now lists a display extension cable for $8. It says it's the "later" version with Higo plugs (I don't remember any reference to "Higo" plugs previously in this thread). Not sure if this is what has been called the "V2" cable earlier in this thread. Can anyone confirm one way or a other?

http://em3ev.com/store/index.php?route=product/product&path=46&product_id=191
 
Ken
Your records keeping is far more detailed than mine.
The surge was distinctive on all 4 of the 48 volt drives I have installed (3-750, 1-500). I have not noticed it on the 350. Maybe it is more pronounces with with the bbso2. Honestly I'm not collecting data like you are, I simply look at the ca and see what it says. This burp of power, that came when cadence was reduced all but went away after I adjusted the programming, but since I am just a faithful follower (using setting prescribed by others on this form) I can only guess why I got the result I did. Could it be from reducing the current and stop decay(s)? I see yours (Ken) is set very low 0 and 1. I set the keep current setting to 50%-60% depending on the bike. I'm shooting for 550-650 watts max in pas. If I need more I can use the throttle. I find that I have to change between assist levels as conditions change (congested urban to open road) and use 5 levels. Ideally power would stop the instant I stop peddling. I don't want to push the setting anywhere close to where I risk the controller. It's great that there is this community willing to risk it and ultimately improve the stock setting.
Is there any concern about having the CD and SD set so low?
thanks
Joe
 
tln said:
It is the V2 cable. I ordered a few, with the intention of amortizing the shipping -- PM me if you want one. I also have some cheap TTL USB on the way, and was intending to offer both as a mini kit.
Thanks!
 
jpo said:
I set the keep current setting to 50%-60% depending on the bike.

I'm pretty sure the surge will be coming from this setting, because when you stop pedalling the current will jump up to 100% briefly before shutting off. Reducing the Time to Stop and Stop Decay will help to close the gap between power surge and shut off. Increasing the Keep Current will reduce the size of the surge which in your case will be 40%-50%.
 
pjgold
With my current settings, which are very similar to kepler's, only difference being I set the keep current between 50-60% and time of stop to 5 and 10 (different bikes), I no longer get the surge when I stop peddling. The motor does still run on but it does not increase power when I stop peddling. I may try adjusting stop decay and current decay on Ken's recommendation as it seems that may be the solution to the run on issue.
Joe
 
Reducing the stop decay will help with run on, I have my Time of stop set to 5 and Stop Decay set to 0.
The Current Decay sets how high in the rpm range the keep current setting comes into effect, setting this at 8 is almost the same as setting keep current to 100%.
 
I just finished a programming cable using a display extension cable and Schmartboard female-female jumpers, available from radio shack ($6 for 10). No soldering / cable cutting needed! Just use jumpers from the pins in male end of the extension to your TTL device. Takes less than 5 minutes.

Here's how the finished product looks:

11801.jpeg

The attachment instructions are in the Software8FUN.zip file posted on post 1

connection.png
 
pjgold said:
The Current Decay sets how high in the rpm range the keep current setting comes into effect, setting this at 8 is almost the same as setting keep current to 100%.
I've found setting Keep Current(%) to 100 makes power largely independent of cadence which is not "almost the same" as the trace below with Current Decay set to 8 and Keep Current(%) set to 20.

In the other traces Keep Current(%) was also set to 20 but Current Decay was set to 4 which were the settings as supplied from EM3EV. The percentages are the Limit Current(%) as set in the Basic tab. While I don't know the model that produces this outcome I think these traces are inconsistent with the pjgold model provided for Keep Current(%) in post http://endless-sphere.com/forums/viewtopic.php?f=28&t=58780&hilit=proportional&start=525#p957582 .

The data was acquired without added human power and the pedals were manually rotated to keep the PAS operating on the Kurt Kinetic rolling road. Various gears were selected at a fixed level of assist, the data plotted in Strava and average powers and cadences read in regions that showed stability.
 

Attachments

  • PowervsCadenceKeepCurrent20.png
    PowervsCadenceKeepCurrent20.png
    14 KB · Views: 6,432
Ken if you have time would you be able to do another trace to isolate and compare the changes of the current decay.

What I'm looking for is same amount of assist say 30%-40% and compare

50% keep current - current decay 1
50% keep current - current decay 2
50% keep current - current decay 3
50% keep current - current decay 4
50% keep current - current decay 5
50% keep current - current decay 6
50% keep current - current decay 7
50% keep current - current decay 8
100% keep current

I would expect to see the point at were the power starts to drop off move up the range for each setting, but you never know!
 
pjgold said:
Ken if you have time would you be able to do another trace to isolate and compare the changes of the current decay.

What I'm looking for is same amount of assist say 30%-40% and compare

50% keep current - current decay 1
50% keep current - current decay 2
50% keep current - current decay 3
50% keep current - current decay 4
50% keep current - current decay 5
50% keep current - current decay 6
50% keep current - current decay 7
50% keep current - current decay 8
100% keep current

I would expect to see the point at were the power starts to drop off move up the range for each setting, but you never know!
I might give it a go but it's a long way down the priority list and it will not happen this weekend as I'm participating in the lifecycle event. It's too hot to ride at the moment, hence the reply. The data above is from early testing before I realised that setting Keep Current(%) to 100 mostly removes the cadence dependence, which I was keen to do. As far as I can tell Current Decay has no effect after that, so it isn't very interesting to me. Perhaps others can take this on. I proposed a model for what these settings do, which was little more than guesswork, but was disappointed not to get any feedback on its validity or otherwise.

Power does "move up the range for each setting" in the small data set above and a couple of others not plotted. However, it looks parallel and there is no "point at were (sic) the power starts to drop off". It must behave differently under some conditions or there would be no point having that setting. The only thing I'm confident of is that "setting this at 8 is almost the same as setting keep current to 100%" doesn't match the test results graphed above.
 
I'm using the Keep Current at 100% but have always wanted know how the current decay works.
You will be interested to know that after a fair bit of time riding with a rpm limit set I've ended up setting it back to 100%. At the end of the day if you like to pedal then having the motor hit a limit is nothing but annoying. There are just to many variables between gears, terrain and your legs on the day to set a perfect cadence and I have not seen any noticeable power savings. Even though you have a comfortable cadence its interesting how often you spin up past it and you don't even notice until you shut the assist off. I can fully understand how you say the the lower RPM of the BBS01 can be annoying.
What's the maximum voltage you can run through a BBS01? a few more volts for a bit more rpm might be well worth while.
 
pjgold said:
I'm using the Keep Current at 100% but have always wanted know how the current decay works.
Yes, I'm curious too. Hopefully I'll see an explanation here.
pjgold said:
You will be interested to know that after a fair bit of time riding with a rpm limit set I've ended up setting it back to 100%. At the end of the day if you like to pedal then having the motor hit a limit is nothing but annoying.
I thought the suggestion of a high limit to stop the the motor pushing faster than the rider can match was convincing.
pjgold said:
There are just to many variables between gears, terrain and your legs on the day to set a perfect cadence and I have not seen any noticeable power savings. Even though you have a comfortable cadence its interesting how often you spin up past it and you don't even notice until you shut the assist off.
There are substantial energy savings in limiting the assist speed, at a rideability cost.
pjgold said:
What's the maximum voltage you can run through a BBS01? a few more volts for a bit more rpm might be well worth while.
I don't know but on on the HobbyKing chemistry it can be as high as 41 volts off the charger dropping back quickly to 38V. On the Samsung chemistry it cuts out at 31 V and I can certainly feel the loss of upper end as the battery runs down.
Aushiker said:
[Basic]
SMM=0

I have my controller set to External, Wheel Meter. Is this what you have as zero?
I have my controller set to External, Wheel Meter. This data is from the saved settings file. You can save your settings, then look in the file to get your numbers.
Aushiker said:
[Pedal Assist]
WM=0

Is zero correct for Work Mode?

Zero is undeterminated. This setting I haven't tested much yet but so far I haven't found an effect. This corresponds to pjgolds testing, reported earlier in this thread.
Aushiker said:
[Throttle Handle]
MODE=1

Does this mean Current?
Yes. While I'm not using the throttle when riding, this I recently tested by clamping the throttle to a fixed value and changing gears on the rolling road. Ignore the erroneous speed trace.
file.php

ThrottleCurrentControl.png
Here you see a near constant current regardless of cadence. On most electric bikes, throttle controls voltage seen by the motor which makes assist change with speed and I think the BBS0x current control is better, in my view, the ideal way for a throttle to work. On the last 2 gears at the right power drops. This is where cadence is bumping up against the maximum possible for assist with the BBS01. You can see the dramatic roll off in motor power as cadence goes up by only 3 rpm in the final gear.

I also tested the throttle speed mode which turns out to mean cadence mode, so speed means cadence on both the Throttle Handle tab mode selection and Basic tab. Speed means speed elsewhere.The speed trace is working in the following plot.
file.php

ThrottleCadenceControl.png
The Kurt Kinetic rolling road varies load with speed. Here the gears are changed, to vary load, and the controller is adjusting motor power to maintain the same cadence. The pedals were rotated manually without adding power to get the cadence trace and pedal rotation was stopped during each gear change to clearly show gear changes in the plot. The cadence sensor for the motor is before the pedal clutch so it doesn't see the stops but the instrumentation for the cadence trace is driven from a magnet on the pedal, which does.

The one second sampling interval was insufficient to fully capture the dynamics during the load change. However, on the larger ratio changes there is an overshoot in power reduction followed by a small overshoot in power increase. This is characteristic of optimally adjusted PID control. The largest ratio change was a series of rapid changes up through the gears. Here the response looks overdamped, assuming PID control. There is a slight increase in power at the start of some changes. I'm unsure why, but the best guess is a reduced or variable cadence/judder as the chain moves from one cog to the next under load.
Aushiker said:
DA=10

Is this correct as I thought there was only 9 levels of assist.
It starts at 1 in the file rather than 0, so the display shows 0-9 and the file shows 1-10.
 
Excellent thread - thanks to all for the info. I've recently fitted a BBS02 to my Yuba Mundo, and at first didn't have the speed sensor working, till I got a cable extension. Without the sensor the controls went to error 21, but first let you select a PAS setting. There was no speed limit, obviously, and the motor carried on at the set power up to my max cadence (110-120) - I found a low PAS suited me, and a little higher for uphill.

Then I fitted the speed sensor, and it's all gone wrong! Now the RPM limits for each PAS setting are activated, so for my normal pedalling speed I need setting 4 or 5 out of 9, which is more watts than I want, but otherwise I find the motor powering on and off as I hit the wall of its RPM restriction. This just seems an odd way to arrange things.

So...I've ordered a programming cable and look forward to tweaking the settings.
 
Then I fitted the speed sensor, and it's all gone wrong! Now the RPM limits for each PAS setting are activated, so for my normal pedalling speed I need setting 4 or 5 out of 9, which is more watts than I want, but otherwise I find the motor powering on and off as I hit the wall of its RPM restriction. This just seems an odd way to arrange things.

Interesting. The stock settings for LimitCurrent% and Speed% on mine were:

PAS0 0% 44%
PAS1 52% 44%
PAS2 58% 51%
PAS3 64% 58%
PAS4 70% 65%
PAS5 76% 72%
PAS6 82% 79%
PAS7 88% 86%
PAS8 94% 93%
PAS9 100% 100%

Which i found not particularly useful. To much power cutting off too early with odd differences between the levels to be ridable for me.

Since following this thread and seeing what is working for other people, taking into account Paul from EM3ev comments on durability, and getting a bit more experience of how i, personally, like to ride i think i have a scheme that suits me and my particular use for now.

I now use:

PAS0 0% 100%
PAS1 10% 63%
PAS2 20% 63%
PAS3 30% 63%
PAS4 40% 63%
PAS5 50% 63%
PAS6 60% 63%
PAS7 70% 63%
PAS8 85% 63%
PAS9 100% 100%

With the gearing on my bike that gives me a cadence of 75 and a road speed of about 28km/hr (in mid range 5th gear) before the motor assist cuts out on PAS1-8.

Mostly on my commute i'm using PAS2 or 3, with 4/5 for headwinds and above that for hooning or uphills when im knackered. All my other settings are as for
Keplers tried and proven ones earlier in the thread. I may well revisit that programming later, particularly in terms of the exact value for Speed% but its working ok for me at the moment. I like a spread of lower level assists.

All that said, how people ride a cargo bike like yours would i think be way different from how they use and ride an MTB / Commuter.

Seems that for the purposes of NOT fwarking up the controller and blowing FET's, you need to try and keep the cadence up to a reasonable level most of the time, not bog it down (correct gear selection) and not run big startup current from standstill.

Will be interesting to see what works best for you in your application. Have fun. :)
 
Back
Top