Setting a speed limit on bafang mid drive

ebikeuser772021

Just Joined
Jan 4, 2025
1
0
I have a bafang mid-drive motor but was surprised to see it arrived without a speed restriction. I need to make it speed restricted so it is street legal to use.
I used a programming cable and this site (https://devnotes.kymatica.com/BafangWebConfig) to set a speed limit at 25 km/h.

Issue: The controller seems to think this is a dynamic speed limit to 'roughly' maintain, while cycling it doesn’t appear to go over but when I spin the wheel without a loud it goes well above 25 km/h.
In my country, the police can stop and speed test bikes, so I need the motor to cut out immediately when it hits 25 km/h.
Is there a firmware I can use to enforce a strict speed limit on the controller so that it cuts out immediately at 25 km/h instead of doing whatever it does currently which is roughly maintain the limit.

Thanks.
 

matthewslack

Esteemed Pedelecer
Nov 26, 2021
2,085
1,473
I don't know specifically either that tool or Bafang settings, but the principles are very simple.

1. The controller needs to know how fast the bike is going. With a mid-drive this is done using a speed sensor on usually the rear wheel. A magnet on a spoke and a sensor. Have you got one of these?

2. The controller needs to know the wheel size, so that rpm can be converted to km/h. Have you set the wheel size correctly?

3. You need to set the maximum speed.

If all the above are in place, then the motor should cutoff at the correct speed.
 
  • Like
Reactions: Peter.Bridge

guerney

Esteemed Pedelecer
Sep 7, 2021
11,652
3,299
In my country, the police can stop and speed test bikes, so I need the motor to cut out immediately when it hits 25 km/h.
What are your firmware settings? Copy/paste or upload screenshots? Are you saying the police in your country do no-load rear wheel off the ground pedal assist speed limit tests, spinning the pedals by hand? If so, please could you state which country. My firmware is set for quite brutal cease of assist at 25kph. Heavy on the old knees if I'm pedalling hard and assist stops abruptly at 25kph.

See "Stop Delay" and "Stop Decay":

61647
 
Last edited:

Ghost1951

Esteemed Pedelecer
Jun 2, 2024
1,852
786
From memory, I think you can set the speed limit in the configuration tool to 'By Display Command' or you can set it as an absolute value in the configuration tool.

Mine came set 'By Display Command' and you could edit that on the fly as you were using the bike. All you had to do was stop and press the buttons on the handle bar gadget.

Mine is now set as a max speed in the controller by the USB cable and whatever you do with the display has no impact. It stops powering at 25KPH for sure. I disconnected the throttle and put it in a box, because a throttle which takes you along without pedalling is also illegal here.

If you have it set right, I wonder if the issue is that when you lift the rear wheel and run it on the throttle there may be some carry over of momentum in the wheel as it spins up that might take the speedo a wee bit over 25kph - but it is not being powered above that. The issue isn't that the wheel goes faster than 25, but whether the bike is POWERED over that.
 

saneagle

Esteemed Pedelecer
Oct 10, 2010
7,297
3,369
Telford
I have a bafang mid-drive motor but was surprised to see it arrived without a speed restriction. I need to make it speed restricted so it is street legal to use.
I used a programming cable and this site (https://devnotes.kymatica.com/BafangWebConfig) to set a speed limit at 25 km/h.

Issue: The controller seems to think this is a dynamic speed limit to 'roughly' maintain, while cycling it doesn’t appear to go over but when I spin the wheel without a loud it goes well above 25 km/h.
In my country, the police can stop and speed test bikes, so I need the motor to cut out immediately when it hits 25 km/h.
Is there a firmware I can use to enforce a strict speed limit on the controller so that it cuts out immediately at 25 km/h instead of doing whatever it does currently which is roughly maintain the limit.

Thanks.
That's fairly normal for most bikes because there is a reaction time for the controller. Without load, the wheel accelerates very fast and goes over the speed limit before it can shut it off. The solution is to supply a slight load by dragging the brake a bit when you do the test. The police will then see the motor switching on and off at 25km/hr.
 

jimriley

Esteemed Pedelecer
Jun 17, 2020
607
405
The speed limit is set on the display on my bike. Immsmr press + and - together when display is on, scroll through the settings by brief press of I/O button. When speed is displayed go up or down with + or -. Can be done while you are moving, if your quick enough, before the plod look at your bike;)
 

guerney

Esteemed Pedelecer
Sep 7, 2021
11,652
3,299
That's fairly normal for most bikes because there is a reaction time for the controller. Without load, the wheel accelerates very fast and goes over the speed limit before it can shut it off. The solution is to supply a slight load by dragging the brake a bit when you do the test. The police will then see the motor switching on and off at 25km/hr.
If the police tested by ebike's speed limit like that, it would demonstrate cease of pedal assist at any speed either of the ebrakes are pressed.
 

guerney

Esteemed Pedelecer
Sep 7, 2021
11,652
3,299
The speed limit is set on the display on my bike. Immsmr press + and - together when display is on, scroll through the settings by brief press of I/O button. When speed is displayed go up or down with + or -. Can be done while you are moving, if your quick enough, before the plod look at your bike;)

I can't balance well enough on my BBS01B 20" wheeler to make any changes while riding. I sometimes forget to reset trip info, but to get to the settings, I have to keep the "i" button pressed for 2 seconds, then lean forward to squint at the tiny text on the small screen, navigate the menu with the "+" and "-" buttons, toggle the "Trip" secition to "Reset", then scroll down again to save and exit. Did it once and almost toppled over, and it was a slooow processwhile cycling slow, during which time I paid little mind to the road and associated persons and objects. Could possibly be possible via GooGle Glasshole, taking the place of the DPC18 display? Otherwise showing a view of the road behind would be nice. Switch between the two as required, watch a bit of telly...





 
Last edited:

guerney

Esteemed Pedelecer
Sep 7, 2021
11,652
3,299
The speed limit is set on the display on my bike. Immsmr press + and - together when display is on, scroll through the settings by brief press of I/O button. When speed is displayed go up or down with + or -. Can be done while you are moving, if your quick enough, before the plod look at your bike;)
Oh and the other thing is I've locked speed limit in firmware, in case some clever cloggs cop or insurance company investigator decides to try increasing the speed limit via the display. As you know, changing that would require switching off the bike, disconnecting the display, connecting the programming cable with an Android phone/tablet or Windows computer to program. All very difficult to do while riding. However, I can still go faster by changing wheel size, which can't be locked at firmware level. Not unless the firmware is completely replaced, which at this moment in time doesn't appear available - there's an Open Source project detailed on Endless Spehere, but because it's been cooked up by USA residents, there's little interest in developing for 250W BBSXX(X) motors. I don't think there's any way to lock the displays of KT kits from speed limit changes, but I could be wong about that, because I don't know much about those mysterious collections of objects with their WTF PLC settings and all.
 
Last edited:

harrys

Esteemed Pedelecer
Dec 1, 2016
367
101
74
Chicago, USA
I have the really old monochrome Bafang C951 display on my BBS02B. I thought that the speed limit set in the display did work. Set it down to 16 mph once, when I was riding in an area where (a) eikes were rare and (b) they had a posted limit,

With the programming cable, you can opt to let the display or the firmware set the limit. You probably want to have it in the display.

I would find it really hard to change while riding with my display,
 

Ghost1951

Esteemed Pedelecer
Jun 2, 2024
1,852
786
I have the really old monochrome Bafang C951 display on my BBS02B. I thought that the speed limit set in the display did work. Set it down to 16 mph once, when I was riding in an area where (a) eikes were rare and (b) they had a posted limit,

With the programming cable, you can opt to let the display or the firmware set the limit. You probably want to have it in the display.

I would find it really hard to change while riding with my display,
I have mine set in the firmware done via the usb cable. That way, nobody can argue that it can be adjusted on the fly. It just won't go above 25kph still supplying power. I had to disconnect the throttle and remove it though, because I could not find a way to set the values so the throttle wouldn't operate without pedal input and also would stop supplying power at the required level for legality.

The reason I thought the 'set speed in display' way was problematic, was that the rules specifically forbid arrangements which allow the rider to switch from road legal to unrestricted. so I thought what will they make of the display method of changing the bike to be unrestricted in speed on the handlebar. So my BBS01 bike has no means of speed adjustment other than pulling out cable joints and bringing a laptop to it to reprogram the speed rules.

It works fine for me. My other electric bike a cheap little Argos folder, can barely achieve 15mph on the flat anyway, because it only has an 8 amp max controller. That suits me too.
 

guerney

Esteemed Pedelecer
Sep 7, 2021
11,652
3,299
So my BBS01 bike has no means of speed adjustment other than pulling out cable joints and bringing a laptop to it to reprogram the speed rules.
Can't you change wheel size via the display?
 

Ghost1951

Esteemed Pedelecer
Jun 2, 2024
1,852
786

guerney

Esteemed Pedelecer
Sep 7, 2021
11,652
3,299
Yes indeed, butit does not have a readily available de-restrictor.
Run 'em headless/sans display and they'd have to be inspected by GCHQ or whatever to determine cutoff speed, or the fuzz will have to ride them around - whichever's easiest. Defaults to Level 0 after switching on, which can be anything you like. I hardly ever use any level other than max, so headless would suit me fine. Less to be vandalised if left locked.

https://www.pedelecs.co.uk/forum/threads/running-bbs01-without-display.31146/#post-435412
 
Last edited:

saneagle

Esteemed Pedelecer
Oct 10, 2010
7,297
3,369
Telford
Run 'em headless/sans display and they'd have to be inspected by GCHQ or whatever to determine cutoff speed, or the fuzz will have to ride them around - whichever's easiest. Defaults to Level 0 after switching on, which can be anything you like. I hardly ever use any level other than max, so headless would suit me fine. Less to be vandalised if left locked.

https://www.pedelecs.co.uk/forum/threads/running-bbs01-without-display.31146/#post-435412
Most default to permanent level 1 if you remove the control panel. Some, like the KT, have bluetooth versions, where you do all the settings in your phone.

Incidentally, with the KT and probably many others, the system starts up with whatever you set. If, after switching on, you change something, like the way the throttle works or the speed limit, but don't save the setting, it'll operate under those settings until you switch off, then it'll revert back to the normal settings.

One of the Bosch dongles worked something like that too, where the speed limit was released while the light switch was on.
 

guerney

Esteemed Pedelecer
Sep 7, 2021
11,652
3,299
Hmmm, interesting... I could set all levels to max, just in case. Not for the 20" Dahon folder, but for the as yet to re-asssembled 26" folding Dahon Esperesso, which if I made headless, I'd be more inclined to leave out locked. I could omit ebrakes/brake motor cutoffs for simplicity and ever so slightly lower cost.
 
Last edited: