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
Tom L   1 kW

1 kW
Posts: 361
Joined: Jan 15 2012 1:09pm
Location: Tasmania, Australia

Re: Programming the Bafang Middrive BBS01+BBS02

Post by Tom L » Apr 22 2014 5:35pm

Try connecting to the USB-serial bridge with a terminal program like Putty before you order another one.

User avatar
Somebodystopme!!   10 W

10 W
Posts: 72
Joined: Dec 25 2013 12:39am

Re: Programming the Bafang Middrive BBS01+BBS02

Post by Somebodystopme!! » Apr 22 2014 8:32pm

SO I downloaded the software and I happened to have a USB to Serial converter. So I ran over to Radio Shack and bought a few jumper wires.

I can get it to connect just fine.

However it will not read the current settings correctly. or write.

When I ask it to read it fills all fields in with 0's. when I put my wanted fields in it doesn't save them.

So, I'm thinking we do not have the correct software. (for the BBS02 750W C961 unit anyway)

Here are some screenshots of the software listed.
Attachments
Screenshot (5).png
Screenshot (5).png (123.42 KiB) Viewed 3776 times
Screenshot (6).png
Screenshot (6).png (147.58 KiB) Viewed 3776 times
Screenshot (7).png
Screenshot (7).png (151.84 KiB) Viewed 3776 times

User avatar
Somebodystopme!!   10 W

10 W
Posts: 72
Joined: Dec 25 2013 12:39am

Re: Programming the Bafang Middrive BBS01+BBS02

Post by Somebodystopme!! » Apr 22 2014 9:17pm

crossbreak wrote:I'd like to start a new thread about this... I had a hard time to find all of the info i need in the other thread.. so here is a start.

all i know is that: we need':

-A TTL converter (cheap off ebay)
-A special cable
-A computer and a software


any more? hope this is a start..

Don't forget to cross rx and tx such that tx (transmit) of your USB to serial go to rx (receive) on the controller.

programming software from BAFANG http://ulozto.cz/x1zej9PD/software8fun-zipp rename to *.zip


from http://endless-sphere.com/forums/viewto ... 25#p876033
ben--b wrote: I bought a similar USB to serial cheap (1.5$) converter and made my programing cable with a jst-xh 5pin plug.
Image
I had to install a driver for the converter to work properly. You just have to know the chipset ref and it is easy to find online.
Rather than trying to find the same 5pin connector as on bafang wiring harness, I installed another plug (common jst-xh 5pin) in serial between the connector and the display.
Image
I opened the display case (which is welded so the result isn't very clean ...). You can see on the pic the wire's color and function.
Image
You need to connect GND, RX and TX of the controller to the converter (TX display = RX controller = TX converter) AND to connect the red and white wires (named D+ and Ds in the display) together.
D+ is the battery positive, Ds is the wire that awaken the controller when connected to +batt.
This way, the programming software is working fine.
All the controller parameters are not so easy to understand, so the more people will be able to have this software working, the sooner we'll be able to master it for fine tuning of this great litttle product.

Here is a cheap converter most anyone can buy locally.
http://www.staples.com/usb+to+serial/di ... =1&sr=true

User avatar
Tom L   1 kW

1 kW
Posts: 361
Joined: Jan 15 2012 1:09pm
Location: Tasmania, Australia

Re: Programming the Bafang Middrive BBS01+BBS02

Post by Tom L » Apr 22 2014 9:38pm

Somebodystopme!! wrote: I can get it to connect just fine.

However it will not read the current settings correctly. or write.

When I ask it to read it fills all fields in with 0's. when I put my wanted fields in it doesn't save them.

So, I'm thinking we do not have the correct software. (for the BBS02 750W C961 unit anyway)
Are you using a 5V or 3V USB converter?

When you say "connect just fine" what do you mean? I don't see any evidence of a connection in your screen shots. Also you have not defined the com port for the connection.

User avatar
Tom L   1 kW

1 kW
Posts: 361
Joined: Jan 15 2012 1:09pm
Location: Tasmania, Australia

Re: Programming the Bafang Middrive BBS01+BBS02

Post by Tom L » Apr 22 2014 9:40pm

Somebodystopme!! wrote: Here is a cheap converter most anyone can buy locally.
http://www.staples.com/usb+to+serial/di ... =1&sr=true
No! This is an RS232 serial device (up to +/-15V). You need a 5V TTL level device.

User avatar
Somebodystopme!!   10 W

10 W
Posts: 72
Joined: Dec 25 2013 12:39am

Re: Programming the Bafang Middrive BBS01+BBS02

Post by Somebodystopme!! » Apr 22 2014 10:21pm

Tom L wrote:
Somebodystopme!! wrote: Here is a cheap converter most anyone can buy locally.
http://www.staples.com/usb+to+serial/di ... =1&sr=true
No! This is an RS232 serial device (up to +/-15V). You need a 5V TTL level device.
I didn't realize that would be an issue.
I will go buy one of these tomorrow and try it out.

http://www.frys.com/product/6997547

Once I get it done, I plan on making a YouTube video tutorial.

User avatar
Somebodystopme!!   10 W

10 W
Posts: 72
Joined: Dec 25 2013 12:39am

Re: Programming the Bafang Middrive BBS01+BBS02

Post by Somebodystopme!! » Apr 23 2014 1:12am

Tom L wrote:
Somebodystopme!! wrote: I can get it to connect just fine.

However it will not read the current settings correctly. or write.

When I ask it to read it fills all fields in with 0's. when I put my wanted fields in it doesn't save them.

So, I'm thinking we do not have the correct software. (for the BBS02 750W C961 unit anyway)
Are you using a 5V or 3V USB converter?

When you say "connect just fine" what do you mean? I don't see any evidence of a connection in your screen shots. Also you have not defined the com port for the connection.
So I bought my TTL converter and it's doing the same thing that the standard USB-Serial adapter did. When it connects to the controller it states at the bottom that it see's 24V. I assume that's the voltage the controller runs on.

No Comm errors. serial port works fine.

Will not read my controller or write to it. I have set it to 3.3 & 5V and I have crossed the TX/RX cables.

I am wondering if the BBS02 needs to have jumper wires to the display as well as the controller so everything will be powered for it to work.

I have seen someone mention that the BBS01 has been successfully tapped into. Can anyone confirm this is possible with the BBS02?

I have hooked everything back up and powered it on and everything works as it did when stock. no error messages on the display module since I have been fiddling with it.

amigafan2003   1 kW

1 kW
Posts: 459
Joined: Jul 14 2011 10:05am
Location: UK

Re: Programming the Bafang Middrive BBS01+BBS02

Post by amigafan2003 » Apr 23 2014 5:42am

Somebodystopme!! wrote:
Tom L wrote:
Somebodystopme!! wrote: I can get it to connect just fine.

However it will not read the current settings correctly. or write.

When I ask it to read it fills all fields in with 0's. when I put my wanted fields in it doesn't save them.

So, I'm thinking we do not have the correct software. (for the BBS02 750W C961 unit anyway)
Are you using a 5V or 3V USB converter?

When you say "connect just fine" what do you mean? I don't see any evidence of a connection in your screen shots. Also you have not defined the com port for the connection.
So I bought my TTL converter and it's doing the same thing that the standard USB-Serial adapter did. When it connects to the controller it states at the bottom that it see's 24V. I assume that's the voltage the controller runs on.

No Comm errors. serial port works fine.

Will not read my controller or write to it. I have set it to 3.3 & 5V and I have crossed the TX/RX cables.

I am wondering if the BBS02 needs to have jumper wires to the display as well as the controller so everything will be powered for it to work.

I have seen someone mention that the BBS01 has been successfully tapped into. Can anyone confirm this is possible with the BBS02?

I have hooked everything back up and powered it on and everything works as it did when stock. no error messages on the display module since I have been fiddling with it.
That's what mine did when I connected it to the cable that goes to the display.

Have you connected it to the cable to the controller? I haven't tried yet as I don't have a plug/cable to use.

User avatar
Tom L   1 kW

1 kW
Posts: 361
Joined: Jan 15 2012 1:09pm
Location: Tasmania, Australia

Re: Programming the Bafang Middrive BBS01+BBS02

Post by Tom L » Apr 23 2014 7:18am

Yeah you should definitely be trying to talk to the controller not the display.

User avatar
Somebodystopme!!   10 W

10 W
Posts: 72
Joined: Dec 25 2013 12:39am

Re: Programming the Bafang Middrive BBS01+BBS02

Post by Somebodystopme!! » Apr 23 2014 8:42am

Tom L wrote:Yeah you should definitely be trying to talk to the controller not the display.
I tried both. I got nothing from the display but could get 24v from the controller.

User avatar
Tom L   1 kW

1 kW
Posts: 361
Joined: Jan 15 2012 1:09pm
Location: Tasmania, Australia

Re: Programming the Bafang Middrive BBS01+BBS02

Post by Tom L » Apr 23 2014 9:05am

Well the only thing left I can think of; did you have P+ and PL shorted together?

If so then it really looks like this software is not compatible with the BBS02.

User avatar
Somebodystopme!!   10 W

10 W
Posts: 72
Joined: Dec 25 2013 12:39am

Re: Programming the Bafang Middrive BBS01+BBS02

Post by Somebodystopme!! » Apr 23 2014 9:13am

Tom L wrote:Well the only thing left I can think of; did you have P+ and PL shorted together?

If so then it really looks like this software is not compatible with the BBS02.
Yes, they are shorted together. I'm going to try making a jumper harness that will in effect join the connector together but give me the GRD/RX/TX connections I need just in case the display needs to be part of the system for programming.

User avatar
Somebodystopme!!   10 W

10 W
Posts: 72
Joined: Dec 25 2013 12:39am

Re: Programming the Bafang Middrive BBS01+BBS02

Post by Somebodystopme!! » Apr 23 2014 10:34am

I can confirm that this does indeed work on the BBS02 w/ C961 Display.

I used these two items from Fry's Electronics:
USB to TTL converter
http://www.frys.com/product/6997547


Jumper Wires
http://www.frys.com/product/6250820?sit ... IN_RSLT_PG

The problems I had earlier with only 24V showing up was because one of the jumper wires was not connected to the pins inside the connector. (the power pins were in effect not shorted together like they should've been, hence only half the voltage) (it is extremely tight in there. Grab a flashlight to confirm your jumper wire is indeed on the right wire!)

Below are the screenshots of my current configuration.
Only changes from Stock are:
Changed Pass Level 0 to 100% current & 100% Limit instead of 0 & 0.
Wheel Diameter from 26" to 29". (I had this changed from the controller but apparently it didn't take.)


Now I have full throttle when Pass is set to zero and the Speed sensor states 41.5 MPH with no load and rear wheel off the ground. :mrgreen: :mrgreen: :mrgreen:

Below are some screenshots
Attachments
Screenshot 2014-04-23 07.40.38.png
Screenshot 2014-04-23 07.40.38.png (59.83 KiB) Viewed 32665 times
Screenshot 2014-04-23 07.40.54.png
Screenshot 2014-04-23 07.40.54.png (62.22 KiB) Viewed 32665 times
Screenshot 2014-04-23 07.41.14.png
Screenshot 2014-04-23 07.41.14.png (53.67 KiB) Viewed 32665 times
Photo Apr 23, 7 44 26 AM.jpg
Photo Apr 23, 7 44 26 AM.jpg (49.44 KiB) Viewed 32665 times
Photo Apr 23, 7 45 02 AM.jpg
Photo Apr 23, 7 45 02 AM.jpg (50.05 KiB) Viewed 32665 times
Photo Apr 23, 7 45 07 AM.jpg
Photo Apr 23, 7 45 07 AM.jpg (60.84 KiB) Viewed 32665 times

User avatar
Tom L   1 kW

1 kW
Posts: 361
Joined: Jan 15 2012 1:09pm
Location: Tasmania, Australia

Re: Programming the Bafang Middrive BBS01+BBS02

Post by Tom L » Apr 23 2014 10:40am

Great work! Can you confirm it works when the interface is using 3V logic?

There are some extremely cheap 3V serial interfaces on ebay.

User avatar
Somebodystopme!!   10 W

10 W
Posts: 72
Joined: Dec 25 2013 12:39am

Re: Programming the Bafang Middrive BBS01+BBS02

Post by Somebodystopme!! » Apr 23 2014 10:50am

Tom L wrote:Great work! Can you confirm it works when the interface is using 3V logic?

There are some extremely cheap 3V serial interfaces on ebay.
Ugg, I wish I would've known that while I had it hooked up.

I would have to guess maybe not. Since the throttle is basically a 0-5 volt variable resistor or rheostat.

The vast majority of electronic boards are powered by 5v.

Next time I have it hooked up I'll check it.

Now it's time to get a thread posted with what all the other settings will do! Let's unlock this bad boy now that the programming is out of the bag!

User avatar
teslanv   100 MW

100 MW
Posts: 2675
Joined: Nov 03 2013 8:42pm
Location: Bellevue, WA - USA
Contact:

Re: Programming the Bafang Middrive BBS01+BBS02

Post by teslanv » Apr 23 2014 10:51am

Great news SSM!

Let the modding begin!
DD Hubs, Batteries, Controllers & Custom Ebikes.
http://westcoastelectrics.com
West Coast Electric Cycles
Bellevue, WA
USA

User avatar
tomjasz   10 GW

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

Re: Programming the Bafang Middrive BBS01+BBS02

Post by tomjasz » Apr 23 2014 1:32pm

OK, great, but for the dead electronic brains, is someone going to put out a clear road map? Or perhaps make and sell? Is the cable made by Bafang for vendors?

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

ErikDK   1 W

1 W
Posts: 50
Joined: Jun 16 2013 4:14pm

Re: Programming the Bafang Middrive BBS01+BBS02

Post by ErikDK » Apr 23 2014 3:51pm

Where's the "THANK YOU !" button?

I can hardly wait to fry my son's motor.

User avatar
mushymelon   1 kW

1 kW
Posts: 300
Joined: Mar 28 2010 3:46am
Location: Southern Ontario, Canada

Re: Programming the Bafang Middrive BBS01+BBS02

Post by mushymelon » Apr 23 2014 4:51pm

Ok sweet thanks

So just to clarify the steps

Step 1 Disconnect power to your bbs01/2 controller

Step 2 Get the TTL adapter working and assigned a com port on your windows machine.

Step 3 Connect your TTL adapter to the Male connector (controller side not the display) in the following configuration using insulated jumper wires to prevent shorting of the pins.

USB-TTL. motor Controller plug
Ground -------------------Ground
TX --------------------------RX
RX --------------------------TX
Short PL and P+ together

Like this
CONNTR.jpg
CONNTR.jpg (34.56 KiB) Viewed 33780 times
Step 4 reconnect the power to the bbs01/2

Step 5 run the software and read your current configuration and back it up

Step 6 change and reprogram the controller


Mushy
Last edited by mushymelon on Apr 23 2014 6:13pm, edited 1 time in total.

User avatar
Somebodystopme!!   10 W

10 W
Posts: 72
Joined: Dec 25 2013 12:39am

Re: Programming the Bafang Middrive BBS01+BBS02

Post by Somebodystopme!! » Apr 23 2014 5:44pm

mushymelon wrote:Ok sweet thanks

So just to clarify the steps

Step 1 Disconnect power to your bbs01/2 controller

Step 2 Get the TTL adapter working and assigned a com port on your windows machine.

Step 3 Connect your TTL adapter to the Male connector (controller side not the display) in the following configuration

USB-TTL. motor Controller plug
Ground -------------------Ground
TX --------------------------RX
RX --------------------------TX
Short PL and P+ together

Like this
CONNTR.jpg
Step 4 reconnect the power to the bbs01/2

Step 5 run the software and read your current configuration and back it up

Step 6 change and reprogram the controller


Is this correct?

Thanks

Mushy
Great recap. You nailed it. The only thing I would add would be to make sure to utilize jumper wires that are insulated. That way you won't accidentally short any pins.

User avatar
mushymelon   1 kW

1 kW
Posts: 300
Joined: Mar 28 2010 3:46am
Location: Southern Ontario, Canada

Re: Programming the Bafang Middrive BBS01+BBS02

Post by mushymelon » Apr 23 2014 6:17pm

Done

pjgold   100 W

100 W
Posts: 108
Joined: Mar 16 2013 8:54pm
Location: Brisbane, Australia

Re: Programming the Bafang Middrive BBS01+BBS02

Post by pjgold » Apr 23 2014 9:59pm

Had a little bit of luck today, I went to my local Jaycar store to get some jumper leads and found this plug that is almost the same as the green plug on the BBS02. It has a 7mm diameter but with a bit of careful filing it fits. So I now have a programming cable the works perfectly.

http://www.jaycar.com.au/productView.asp?ID=PS0545 The bag it came in says the manufacturer is LTW Technology http://www.ltw-tech.com

Image

No problems with getting connection as detailed above and I was able to change the basic settings, however it looks like the pedal assist and throttle handle setting tabs are not working. I confirmed this by changing some settings and then reading the controller the settings on these 2 tabs do not change.

ErikDK   1 W

1 W
Posts: 50
Joined: Jun 16 2013 4:14pm

Re: Programming the Bafang Middrive BBS01+BBS02

Post by ErikDK » Apr 23 2014 11:04pm

I think using the term "male, motor side of the plug" will reduce the risk of confusion.

The controller is in the motor, but many call the display "controller"

User avatar
teslanv   100 MW

100 MW
Posts: 2675
Joined: Nov 03 2013 8:42pm
Location: Bellevue, WA - USA
Contact:

Re: Programming the Bafang Middrive BBS01+BBS02

Post by teslanv » Apr 24 2014 12:01am

Somebodystopme!! wrote:I can confirm that this does indeed work on the BBS02 w/ C961 Display.

I used these two items from Fry's Electronics:
USB to TTL converter
http://www.frys.com/product/6997547


Jumper Wires
http://www.frys.com/product/6250820?sit ... IN_RSLT_PG
Purchased the same connectors from Fry's. The Local Fry's had both in stock. :D I was able to get the USB-TTL breakout board connected and talking to the software.
It's getting late, So I'll tinker with connecting to the Kit tomorrow hopefully.

We may need to take a survey now:
What is the manufacture date of your unit and what version of firmware is on your controller?

I suspect Firmware is not something we are yet able to update???
DD Hubs, Batteries, Controllers & Custom Ebikes.
http://westcoastelectrics.com
West Coast Electric Cycles
Bellevue, WA
USA

User avatar
Somebodystopme!!   10 W

10 W
Posts: 72
Joined: Dec 25 2013 12:39am

Re: Programming the Bafang Middrive BBS01+BBS02

Post by Somebodystopme!! » Apr 24 2014 12:55am

teslanv wrote:
Somebodystopme!! wrote:I can confirm that this does indeed work on the BBS02 w/ C961 Display.

I used these two items from Fry's Electronics:
USB to TTL converter
http://www.frys.com/product/6997547


Jumper Wires
http://www.frys.com/product/6250820?sit ... IN_RSLT_PG
Purchased the same connectors from Fry's. The Local Fry's had both in stock. :D I was able to get the USB-TTL breakout board connected and talking to the software.
It's getting late, So I'll tinker with connecting to the Kit tomorrow hopefully.

We may need to take a survey now:
What is the manufacture date of your unit and what version of firmware is on your controller?

I suspect Firmware is not something we are yet able to update???
Something tells me this is going to be a hundred page thread before too long!

Here are the details of my BBS02:
S/N is 1401160248
Produced on (Jan 16 2014) Unit # 0248 (from beginning of production year)
Below info taken from firmware read
MFG - HZXT
Model - SZZ6
Hardware Version - V2.2
Firmware Version - V2.0.1.1
Voltage - 48v
Max Current - 20A

Firmware is one of those MFG things. We will have to wait and see what comes out next, but it may be a dealer only item.

Here are my current settings from the backup file after I changed my PAS 0 Values:
It will be interesting to decipher what each value means, What range each value has, and how it correlates with the operation of the drive.

[Basic]
LBP=41
LC=20
ALC0=100
ALC1=28
ALC2=37
ALC3=46
ALC4=55
ALC5=64
ALC6=73
ALC7=82
ALC8=91
ALC9=100
ALBP0=100
ALBP1=44
ALBP2=51
ALBP3=58
ALBP4=65
ALBP5=72
ALBP6=79
ALBP7=86
ALBP8=93
ALBP9=100
WD=14
SMM=0
SMS=1
[Pedal Assist]
PT=3
DA=0
SL=0
SSM=3
WM=1
SC=20
SDN=4
TS=25
CD=4
SD=0
KC=20
[Throttle Handle]
SV=11
EV=35
MODE=0
DA=0
SL=26
SC=10

Post Reply