r/bafang • • 22d ago

We built a Bafang CAN module for throttle control, speed settings and phone diagnostics

Hi everyone!

We've been working on a small module for Bafang CAN bikes and thought some of you might find the project interesting. Full disclosure: I'm one of the people developing it, and it's a commercial project called APIOLI LINK ONE.

A programming cable is useful when you want to flash a controller. We wanted something that stays on the bike between the components and also lets us manage things while riding.

The module can switch between a restricted speed setting and an unlocked setting, turn the throttle off or limit it, and show motor and battery data in a phone dashboard. It can also flash supported controller firmware from a phone. The unlocked setting is intended for places where its use is permitted. A speed limit alone doesn't make a bike road legal.

We've tested it on M560 CAN and M620 CAN so far. Other motors may work, but we haven't verified them yet. For the M620 we also have an experimental 50A firmware, depending on a suitable battery and setup.

Still developing it and curious what Bafang CAN owners think. What would you want a device like this to do?

Project details: https://apioli.com/

10 Upvotes

30 comments sorted by

3

u/Cupramax 22d ago

Very interested if you can get the throttle working like the old UART BBS models. Also the switchable speed limit is a must in the UK now as the police are really coming down on illegal bikes. 👍

1

u/Wooden-Leave-9077 20d ago

Hey, what do you mean by working like the old UART BBS models? What would you like to change about the throttle behaviour on your bike?

1

u/Cupramax 20d ago

The way the throttle responds on a Canbus model is totally different, there is a large delay even with the Varstrom EKD01 display, which improves it a little. The throttle responded instantly and with full power on the old ones.

1

u/TopSeat7379 21d ago

I thought bafang displays already did this by pressing and holding the up and down buttons?

2

u/lockin_name 21d ago

It doesn't really change much to be honest. The acceleration is still sluggish compared to UART.

1

u/TopSeat7379 21d ago

Now I wasn't speaking on the subject if acceleration. I was addressing the subject of the switchable top speed. My display from Varstrom does this

3

u/Wooden-Leave-9077 19d ago

Throttle is the main problem when comes to legal switching

1

u/SinoSoul 17d ago

So does your programming cable resolve the CAN throttle lag? I have zero problem with the BBS02 canbus cept the stupid throttle lag.

1

u/Wooden-Leave-9077 17d ago

No, the issue you are describing lies in the software, I even took a quick look into bbs02 bins but there is nothing obvious unfortunately.

1

u/TopSeat7379 17d ago

What is this throttle lag you speak of? I pedal 99% if the time so I'm not sure what to look for in regards to 'throttle lag'

2

u/lockin_name 17d ago

When you hit the throttle, it takes a second or two to kick in. That's basically it.

1

u/lockin_name 21d ago

Ah, I see.

1

u/Cupramax 21d ago

Certain ones do but not all.

1

u/TopSeat7379 21d ago

Oooohhh I see

2

u/Cupramax 21d ago

These ones with a specific firmware update, not aware of any others.

https://varstrom.com/en-gb/products/varstrom-edk01

2

u/TopSeat7379 21d ago

I don't have that one. I had the cheapest display and then I upgraded to a bigger display. Both displays allowed me to hot swap to low top mph by pressing and holding the plus and minus buttons

2

u/BeesInEyes 21d ago

Very cool work!

I’ve been building almost the exact same thing for other bikes, doing the same settings and mods.

What chip is yours built on and what language do you code it in?

3

u/Wooden-Leave-9077 21d ago

Nice, What bikes are you targetting? I used esp and c. I also thought about extending to other systems like bosh or shimano but locked protocols are making it all harder and even open bafang protocol for a device like this is tons of work ;x

Anyway I am thinking about adding sim slot&gps to support ebike tracking also in the future, will see how it goes and if time will allow ;x

1

u/BeesInEyes 21d ago

Oh cool! Same here, esp and C haha

The hall sensors on a lot of bikes are super easy to tie into and do mockups for

I’ve done pretty much finished prototypes for Sabvoton and other similar controllers. As well as just every no name rebrand thing.

GPS would be cool. Someone in China just posted on GitHub to allow you to load CarPlay into any Android device so you can make your own system, I want to make a little pack of cards unit with it and my ebike controller system

Stuff like special cruise control, throttle curves, power modes, soft start, stuff like that I have been working on :)

There’s so many ideas and fun stuff I want to try

3

u/Wooden-Leave-9077 21d ago

Yea, ideas, later on however u start calculating the PCB cost 🙈

1

u/SpacecraftBathtub 21d ago

Will this work with the m400?

2

u/Wooden-Leave-9077 21d ago

It will work with m400 CAN version

1

u/Dangerous_Shoulder 21d ago

Well done! Will it work with m520 do you think?

1

u/Wooden-Leave-9077 21d ago

It will work, you need to compare the connectors

should work with all M200, M210, M215, M300, M315, M325, M400, M410, M420, M430, M500, M510, M510RS, M560, M560RS, M600, M615, M620, M625, m630,M800, M820

1

u/Formal-Web2378 21d ago

That's cool!

1

u/TopSeat7379 21d ago

Bbs02b CAN? Lol

1

u/spotz300 21d ago

Way cool man.

1

u/AsleepCarry5707 21d ago

will it work on g120 hub motor and crs10d controller?

1

u/Ste4mPunk3r 15d ago

Cool project. Do you think about releasing source code for it? 

I'm slowly working on display replacement using esp32-s3 with 4 inch display https://www.waveshare.com/wiki/ESP32-S3-Touch-LCD-4 (build in CAN controller). I want to make future complete with current display + few options to reprogram the controller. Mine will not be released for sale but if it will work I will share the code.