Programming the Bafang Middrive BBS01+BBS02

Discussions related to motors other than hub motors.
This includes R/C motors, botttom bracket, roller and geared drives.
User avatar
waynebergman   10 kW

10 kW
Posts: 926
Joined: May 07 2011 4:20pm
Location: Pender Harbour British Columbia Canada

Re: Programming the Bafang Middrive BBS01+BBS02

Post by waynebergman » Jan 10 2016 10:35am

Tom I think liketoride is saying he killed a computor not his controller?

LikeToRideMyBike   100 W

100 W
Posts: 151
Joined: Jan 09 2016 9:00pm

Re: Programming the Bafang Middrive BBS01+BBS02

Post by LikeToRideMyBike » Jan 10 2016 3:18pm

Shortly after that I killed another computer and my controller. I don't know what's happening.

tommie   10 W

10 W
Posts: 93
Joined: Jun 21 2015 10:54am
Location: N. Ireland

Re: Programming the Bafang Middrive BBS01+BBS02

Post by tommie » Jan 10 2016 5:09pm

No way programming your controller will have `killed` your PC,

maybe crashed it but certainly not killed it.

LikeToRideMyBike   100 W

100 W
Posts: 151
Joined: Jan 09 2016 9:00pm

Re: Programming the Bafang Middrive BBS01+BBS02

Post by LikeToRideMyBike » Jan 11 2016 2:09am

tommie wrote:No way programming your controller will have `killed` your PC,

maybe crashed it but certainly not killed it.
I can't turn them back on. I'm no computer expert... Maybe they're not dead, but they're like dead to me. Any idea what might have caused this phenomena?

opperpanter   100 W

100 W
Posts: 289
Joined: Sep 20 2014 6:36am
Location: The Netherlands

Re: Programming the Bafang Middrive BBS01+BBS02

Post by opperpanter » Jan 11 2016 3:57am

tommie wrote:No way programming your controller will have `killed` your PC,

maybe crashed it but certainly not killed it.
Not sure if that could happen indeed, although one of the wires has the full battery voltage on it. Not sure how an USB port would react to that.

LikeToRideMyBike   100 W

100 W
Posts: 151
Joined: Jan 09 2016 9:00pm

Re: Programming the Bafang Middrive BBS01+BBS02

Post by LikeToRideMyBike » Jan 11 2016 12:05pm

opperpanter wrote:
tommie wrote:No way programming your controller will have `killed` your PC,

maybe crashed it but certainly not killed it.
Not sure if that could happen indeed, although one of the wires has the full battery voltage on it. Not sure how an USB port would react to that.
I haven't taken them to a computer doctor, but it would probably be cheaper to buy a used pc with a later version of Windows on it than to repair those. Both of those PC's had windows 7. But my main concern is my controller. I fried it too. In this video, this man makes his own cable and warns that if you get your wires crossed, "things could go terribly wrong. Do you think my problem would be a faulty cable :?:

At about 3 minutes 30 seconds he says you could fry something:
https://www.youtube.com/watch?v=BYMdcSWnbBo

avess   10 µW

10 µW
Posts: 5
Joined: Jan 07 2016 2:35pm

Re: Programming the Bafang Middrive BBS01+BBS02

Post by avess » Jan 11 2016 1:35pm

Hi, I have tried different USB to serial converter and now it read something, but motor version etc. is really wrong and after downloading current parameters, zeros are displayed in all fields. See picture. Does anyone have any clue what is wrong? Is the flashing application useful for all controller versions?

Printscreen:

Thanks
Attachments
bafangfailure.png
Printscreen
bafangfailure.png (130.63 KiB) Viewed 667 times

User avatar
tomjasz   10 GW

10 GW
Posts: 4100
Joined: Mar 29 2014 1:45pm
Location: Out riding, MN USA
Contact:

Re: Programming the Bafang Middrive BBS01+BBS02

Post by tomjasz » Jan 12 2016 12:30pm

Has there ever been an update to the program software?

Which version is the latest?
Thanks Justin_le we're here thanks to you. All the best to the mods for their tireless work keeping it on an even keel.

Penoff   1 µW

1 µW
Posts: 4
Joined: Jan 13 2016 8:38am
Contact:

Re: Programming the Bafang Middrive BBS01+BBS02

Post by Penoff » Jan 13 2016 11:13am

Hi everyone! I just registered on the forum but I've been reading it since I decided to convert my bicycle to electric.

I see many people reporting about damaged controllers, USB to serial adapters and even PCs. I have some experience as well. I burned my USB to serial adapter on the second connection. Good it was original FTDI chip and it had good protection so my laptop was intact. My first thought was I killed my controller but I started thinking there is some protection in the newly produced controllers. So why does it happen and how to avoid it? If you are using USB adapter with original connector you won't get in trouble. Unfortunately those are sold as "programmers" and are quite overpriced. Therefore people use cheap adapters and some wires. That's where the issue lies. Using wires (even with some tiny connectors at the end) might lead to short circuit between neighboring wires. If the short circuit is to one of the high voltage pins you will kill your USB to serial adapter and possibly your PC and even the controller. There is one pin at the connector which is directly connected to the battery meaning you can have above 50V there (from a fully charged 13S battery). This is more than enough to kill the 5V USB to serial adapter and your PC as both are sate up to 6V and anything above that can be lethal for the device. The same applies for the controller itself. When I killed my adapter I thought the controller is also dead but it wasn't. There is no way of that happening if it didn't have some protection so I suppose something was changed or I was impossibly lucky. So when I changed the FTDI chip on my USB adapter I measured with multimeter for short circuit every time before connecting the battery to avoid further damage. I hope this will help someone else save his equipment.

I also saw the programming software is packed with the full source code so I decided to rewrite it because it was just terrible. I fixed numerous bugs, improved the interface and the English :) and added small help file. If you are interested you can find it here https://penoff.wordpress.com/2016/01/13 ... -software/

tommie   10 W

10 W
Posts: 93
Joined: Jun 21 2015 10:54am
Location: N. Ireland

Re: Programming the Bafang Middrive BBS01+BBS02

Post by tommie » Jan 13 2016 11:22am

Do yourselves a favor and buy the proper item and have done with all the messin` -->http://www.empoweredcycles.com/collecti ... rive-motor

no more burnt out controllers, crashed laptops etc etc..

User avatar
waynebergman   10 kW

10 kW
Posts: 926
Joined: May 07 2011 4:20pm
Location: Pender Harbour British Columbia Canada

Re: Programming the Bafang Middrive BBS01+BBS02

Post by waynebergman » Jan 13 2016 12:01pm

Thanks Penoff.Your "Help" file cuts through the previous translations that I have found very hard to understand. I look forward to studying it closer. AWESOME!

User avatar
tomjasz   10 GW

10 GW
Posts: 4100
Joined: Mar 29 2014 1:45pm
Location: Out riding, MN USA
Contact:

Re: Programming the Bafang Middrive BBS01+BBS02

Post by tomjasz » Jan 13 2016 2:27pm

What you are missing is that some changes can fry the controller. I have controllers programmed by Cell_Man. Lectricycles, and now luna. There's nothing to improve. Most armchair programmers ought to leave well enough alone. Even the most astute here don't have a clue as to how Bafang has programmed. Show me a screwed up controller and I'll show you either a bad programming job, OR a crappy home made cable. Jeez! A 93 cents TTL to USB and you have a problem? DOH!!

electric fat bike has one of the best compilations. Karl like myself stays mostly with the EM3ev and reseller programing. It's conservative but will always work. Same with Luna. Over two years I've read dozens of fails. Please don't over simplify and encourage "playing" at programing.

As always YMMV
Thanks Justin_le we're here thanks to you. All the best to the mods for their tireless work keeping it on an even keel.

User avatar
waynebergman   10 kW

10 kW
Posts: 926
Joined: May 07 2011 4:20pm
Location: Pender Harbour British Columbia Canada

Re: Programming the Bafang Middrive BBS01+BBS02

Post by waynebergman » Jan 13 2016 7:19pm

Penoff........below here is pasted from your help document. Which is awesome by the way and thanks for this. My question for you is The STOP DELAY & STOP DECAY sounds like they do one and the same thing. Can you add some more detail to how these two settings work differently from each other.......thanks wayne

Stop Delay [x10ms] – This is the delay after you stop pedaling before the motor stops.
Keep in mind the x10. If you set it to 100 this will lead to 1 second delay. Value of 25
(250ms) works well.
Current Decay (1-8) – This parameter sets how fast the current drops when you are
pedaling fasted and are reaching the maximum speed at the selected assist level. Lower
value means the current will start to drop at lower speed.
Stop Decay [x10ms] – The amount of time between the moment you stop pedaling and the
moment the motor stops.

WoodlandHills   10 kW

10 kW
Posts: 748
Joined: Nov 11 2015 12:27pm
Location: Ortega River, JAX, FL

Re: Programming the Bafang Middrive BBS01+BBS02

Post by WoodlandHills » Jan 13 2016 8:43pm

I don't have a PC so I cannot open this file easily. Is it possible to increase the maximum speed associated with each level of PAS? I don't want to change any of the power settings, just the speed at which it dials back a given level of power. If it is going to function as a sort of cruise control via current settings, it would be nice to raise the speeds at the various settings. Now that I have the gearing dialed in I find I am riding around at PAS 1 most of the time, but it pulls out the power just as I get rolling in a given gear and then oscillates between power and coasting. It feels like surging and it would be nice if this could be alleviated or at least have the initiation speed raised.

User avatar
Leebolectric   1 kW

1 kW
Posts: 302
Joined: Dec 01 2015 12:30pm
Location: Me Tarzan, Eugene

Re: Programming the Bafang Middrive BBS01+BBS02

Post by Leebolectric » Jan 13 2016 9:05pm

I'm guess I'm going to need to buy a cheap PC Laptop just to program this thing...
...unless someone has a simple way to make it work on my Mac...?

Anything I need specifically for the laptop? ...just any with a usb port?
What kind of laptop would you buy, if it was pretty much for this purpose only?
I'm looking at options costing less than $50 if possible...
...it doesn't have to be awesome, just get the job done and not kill me with frustration.

Which operating system works best with the programing?
windows 7? ...or 8?
I have the cable coming and will be following the ElectricFatbike guide.
2015 Intense Tracer275 with Tangent Ascent inside triangle https://endless-sphere.com/forums/viewt ... 28&t=75045
2010 Turner 5Spot with BaffangHD https://endless-sphere.com/forums/viewt ... 28&t=75569
2009 KHS Velvet 6" with BafangHD (see above thread^)
2015 SantaCruz Bantam with TEMPORARY Cyclone https://endless-sphere.com/forums/viewt ... 28&t=76131

User avatar
waynebergman   10 kW

10 kW
Posts: 926
Joined: May 07 2011 4:20pm
Location: Pender Harbour British Columbia Canada

Re: Programming the Bafang Middrive BBS01+BBS02

Post by waynebergman » Jan 14 2016 12:16am

"Penoff" I am reading through the help file you created and it explains clearly a lot of things I was not sure about. Thanks again for that. I am looking at the text in red here from that Help file......

Start Voltage [x100mV] – This is the throttle handle output voltage at which the motor
will start. The minimum at which the controller responds is 1.1V so you should set this
parameter to 11 (11x100mV=1.1V).


I am not sure if this statement above in red is really correct but I may be wrong. You mention "The minimum at which the controller responds is 1.1V", are you sure about this? I was assuming it would be like the settings on the Version 3 ca from Grin tech where the start voltage setting is where you can ask the controller to kick in earlier or later depending on different throttle output voltages. Kind of a way to fine tune a dead spot in a throttle that uses up too much of its travel before it gets to the place of moving the motor.

One thing I have found and others also have reported , is if this setting is set too for throttle start voltage it will somehow effect your pas and make it super jerky. Weird but it does.

Penoff   1 µW

1 µW
Posts: 4
Joined: Jan 13 2016 8:38am
Contact:

Re: Programming the Bafang Middrive BBS01+BBS02

Post by Penoff » Jan 14 2016 11:07am

Wow! I didn't expect that much interest in what I did. I will try to answer all questions.

First the "original programmer" is nothing more than a cheap USB to serial adapter with a proper connector for the controller. You can see the heatshrink on the photos. I am sure my adapter is a lot better because I designed it (also it costs around 10 EUR). That's why I didn't kill my laptop like other people did. I am electronics engineer by the way. The expensive thing in this "programmer" is the connector. I found it for 5 EUR per piece which is insane.

It is true that you can kill your controller by programming wrong values that make it work in extreme modes. I started reprogramming my controller because the throttle wasn't set to work at PAS0 which I find useful for small uphill parts of the road when I don't use the motor on flat road. I did tune some other settings a little but tried to keep it on the safe side.

Now on the questions.
1) Stop Delay is a time parameter. If you set it to 100 your motor will stop rotating exactly 1 second after you stop pedaling.
Stop Decay is a little different parameter. It tells the controller when to start the stopping of the motor in the way set by Current Decay. So when you stop pedaling if you have set Stop delay to 25 and the Stop Decay to 20 like me, the controller will start to decrease the current through the motor after 50ms in the way set by Current Decay and will completely stop it after 250ms taking exactly 200ms. So if you set Decay > Delay it won't work properly but won't cause any damage.
I see I described this wrong and I should fix it.
P.S. Fixed that to say Stop Decay is the amount of time it takes the motor to stop. The link on my site from dropbox is updated and I am not sure if it's the same if someone saved it as a bookmark.
2) Maximum speed for each PAS level can be set on the Basic settings tab. It is configured as a percentage of the speed limit set in your LCD. The power shouldn't be reduced too much if you slow down the pedaling. This looks like the Keep Current parameter is set too low. I have experienced another firmware issue related to slow response also. When I am pedaling at PAS0 and switch to PAS1 the motor ramps up its speed very slowly in steps I can feel and hear when my speed was above the limit for PAS1. I do this when uphill section of the road comes. When the speed drops down the motor need some time to kick-in.
3) Any PC or laptop can be used. My version of the program was built under Windows 10 64bit (by a 32bit compiler) and will work fine on any Windows from XP to 10.
4) My throttle doesn't have a big dead spot. I tried setting this to 0 or 1 to see how it will respond. It was the same as setting it to 11 (1.1V). That dead spot is because the throttle can't start from 0V. It is basically a hall sensor and a long round magnet inside. This magnet is close even when the throttle is at lowest position so the sensor has some voltage at the output. That's why the controller starts working with voltage of 1.1V to avoid this effect. When the magnet gets close to the sensor and starts moving next to it the magnetic field is a lot stronger. You can play with that parameter and see how it works. If your throttle has higher starting voltage you should of course set this parameter higher than 11. Have in mind that in Current Control mode you will see no difference if you are not on the bike. If you lift the rear wheel in the air you will get maximum speed right away because there is no load and the current is very low.

User avatar
tomjasz   10 GW

10 GW
Posts: 4100
Joined: Mar 29 2014 1:45pm
Location: Out riding, MN USA
Contact:

Re: Programming the Bafang Middrive BBS01+BBS02

Post by tomjasz » Jan 14 2016 8:06pm

Leebolectric wrote:I'm guess I'm going to need to buy a cheap PC Laptop just to program this thing...
...unless someone has a simple way to make it work on my Mac...?

Anything I need specifically for the laptop? ...just any with a usb port?
What kind of laptop would you buy, if it was pretty much for this purpose only?
I'm looking at options costing less than $50 if possible...
...it doesn't have to be awesome, just get the job done and not kill me with frustration.

Which operating system works best with the programing?
windows 7? ...or 8?
I have the cable coming and will be following the ElectricFatbike guide.
works great on Mac with Virtual Box. I use and old XP disk I had. But if you're going to get into battery building and battery testing, a Windoze laptop make sit much easier. The only folks catering to Mac are Grin
Thanks Justin_le we're here thanks to you. All the best to the mods for their tireless work keeping it on an even keel.

User avatar
Leebolectric   1 kW

1 kW
Posts: 302
Joined: Dec 01 2015 12:30pm
Location: Me Tarzan, Eugene

Re: Programming the Bafang Middrive BBS01+BBS02

Post by Leebolectric » Jan 15 2016 1:11am

That was quite painless.
For a Mac user like myself, trying a PC for the FIRST time ever...I expected much worse.
Thanks for all the tips everyone, you rock! \m/ :D \m/
2015 Intense Tracer275 with Tangent Ascent inside triangle https://endless-sphere.com/forums/viewt ... 28&t=75045
2010 Turner 5Spot with BaffangHD https://endless-sphere.com/forums/viewt ... 28&t=75569
2009 KHS Velvet 6" with BafangHD (see above thread^)
2015 SantaCruz Bantam with TEMPORARY Cyclone https://endless-sphere.com/forums/viewt ... 28&t=76131

User avatar
tomjasz   10 GW

10 GW
Posts: 4100
Joined: Mar 29 2014 1:45pm
Location: Out riding, MN USA
Contact:

Re: Programming the Bafang Middrive BBS01+BBS02

Post by tomjasz » Jan 15 2016 1:47am

Leebolectric wrote:That was quite painless.
For a Mac user like myself, trying a PC for the FIRST time ever...I expected much worse.
Thanks for all the tips everyone, you rock! \m/ :D \m/
What did you end up doing?
Thanks Justin_le we're here thanks to you. All the best to the mods for their tireless work keeping it on an even keel.

User avatar
Leebolectric   1 kW

1 kW
Posts: 302
Joined: Dec 01 2015 12:30pm
Location: Me Tarzan, Eugene

Re: Programming the Bafang Middrive BBS01+BBS02

Post by Leebolectric » Jan 15 2016 2:04am

I followed the em3ev settings mostly.
Full throttle in all PAS levels.
Slow ramp to go easy on the hub.
Nothing experimental on my end, just following instructions.
Seems to work perfect, lotta power now.
2015 Intense Tracer275 with Tangent Ascent inside triangle https://endless-sphere.com/forums/viewt ... 28&t=75045
2010 Turner 5Spot with BaffangHD https://endless-sphere.com/forums/viewt ... 28&t=75569
2009 KHS Velvet 6" with BafangHD (see above thread^)
2015 SantaCruz Bantam with TEMPORARY Cyclone https://endless-sphere.com/forums/viewt ... 28&t=76131

User avatar
tomjasz   10 GW

10 GW
Posts: 4100
Joined: Mar 29 2014 1:45pm
Location: Out riding, MN USA
Contact:

Re: Programming the Bafang Middrive BBS01+BBS02

Post by tomjasz » Jan 15 2016 2:09am

Leebolectric wrote:I followed the em3ev settings mostly.
Full throttle in all PAS levels.
Slow ramp to go easy on the hub.
Nothing experimental on my end, just following instructions.
Seems to work perfect, lotta power now.
Which computer?
Exactly how I program.
Thanks Justin_le we're here thanks to you. All the best to the mods for their tireless work keeping it on an even keel.

User avatar
Leebolectric   1 kW

1 kW
Posts: 302
Joined: Dec 01 2015 12:30pm
Location: Me Tarzan, Eugene

Re: Programming the Bafang Middrive BBS01+BBS02

Post by Leebolectric » Jan 15 2016 3:03am

Cheapass Walmart HP, nuthin special, cheapest I could find locally...and can return easily.
2015 Intense Tracer275 with Tangent Ascent inside triangle https://endless-sphere.com/forums/viewt ... 28&t=75045
2010 Turner 5Spot with BaffangHD https://endless-sphere.com/forums/viewt ... 28&t=75569
2009 KHS Velvet 6" with BafangHD (see above thread^)
2015 SantaCruz Bantam with TEMPORARY Cyclone https://endless-sphere.com/forums/viewt ... 28&t=76131

User avatar
tomjasz   10 GW

10 GW
Posts: 4100
Joined: Mar 29 2014 1:45pm
Location: Out riding, MN USA
Contact:

Re: Programming the Bafang Middrive BBS01+BBS02

Post by tomjasz » Jan 15 2016 10:07am

I thought of doing the same thing. And because everyone but Grin is Windoze I may give up. Someone gave me a windoze 8 all in one machine. I'll dedicate to my build area. I'm glad I made my cable out of 1 42" Bafang extended along with a Grin TTL/USB. more than 6" long.
Thanks Justin_le we're here thanks to you. All the best to the mods for their tireless work keeping it on an even keel.

mbackc@gmail.com   10 mW

10 mW
Posts: 31
Joined: Nov 18 2015 1:20am

Re: Programming the Bafang Middrive BBS01+BBS02

Post by mbackc@gmail.com » Jan 17 2016 6:49am

Hello all ...

Thanks for this useful thread.

I just started programming my BBS-HD and there is one thing I don't understand.

I want to be able to use the throttle at all times - without pedal assist. On the basic page I can adjust the "limit current" and "limit speed" at PAS 0.

Sorry for asking but what exactly does these parameters define ? Some have set them both to 1 and others 0 and 100.

What setting do I use if I want 100% throttle at PAS 0?

Thanks in advance.

Michael, Copenhagen

Post Reply