Connect throttle to 8Fun/Bafang controller - BTWin bike

sweeneys

1 µW
Joined
Nov 3, 2016
Messages
3
Hi everyone,

I purchased a turn-key electric bike from BTwin/Decathlon which can be seen here:
http://www.decathlon.ie/original-700-36v-electric-bike-en-s152571.html

The 250W motor, controller, connectors etc. are all stamped with "8FUN" logos, but based on research 8FUN and Bafang seem to be the same company so I guess their controllers are the same, the controller looks like any of these, except mine is in a black box:
8Fun:
http://shop.8fun-motor.com/controller/12-cr-s106350sn.html
Bafang:
http://www.szbaf.com/en/components/component/controller/cr-s105250sq.html
http://www.szbaf.com/en/components/component/controller/cr-s105250sn.html
With the difference between the Bafang ones being the 'control type' -one is a square wave and the other says sine wave...I'm not sure what this means / which type I have or how to find out.

My problem is that I want to connect a throttle input to the bike, the websites above say that a throttle can be connected ("Throttle Voltage Input DC 1.0-3.9 V") but I am not sure how to do so. The wiring loom that came with the bike only has 3 connectors at the front (2 for the brakes, 1 for the display, and a little cable for the lights, NO throttle input connector). I purchased a new wiring loom from Green Bike Kit which can be seen here that does have 4 connectors:
http://www.greenbikekit.com/bafang-bbs01-bbs02-central-driven-kit-eb-bus-cable.html

There are 8 wires from the main connector from the front of the bike to the controller with the following colours and detective work to figure out what they are:
White (brake signal), rests @ 5V, 0V when brake is depressed
Black (GND)
Orangey pink (VCC) - 40V when display is turned on
Brown (Power for display) - 40V even when display is turned off
Green (TX) - digital signal from display (+ and - levels of assist selected by rider pushing buttons etc. )
Yellow (RX) - digital signal from display (+ and - levels of assist selected by rider pushing buttons etc.)
Blue - wire for front lights that goes to small blue circuitboard separate from main board
Red - Most interesting, at 3.3V when connector for both brakes are disconnected at front, at 0V when either brake connector is connected

The red wire of interest is the one pictured here beside my thumb: (hopefully attaches at the end of this post...)
14914500_10210733364961090_1083777464_n.jpg

So basically my new 4 connector wiring loom arrived today (linked above), which has a dedicated connector for a throttle input, I connected the normal 3 connectors to it as before (front display unit and both brakes) and everything worked with the bike as before (except the now disconnected front light!)

I also was brave and decided to connect a throttle to the 4th connector:
http://www.greenbikekit.com/wuxing-left-half-twist-throttle-for-bafang-bbs01-bbs02.html

Nothing happened when I turned the throttle (motor didn't start) - the bike also has a PAS sensor so normally you have to spin the pedals for it to do anything, so I turned the pedals (and motor gave assistance as expected), and then turned the throttle, but again nothing (noticeable) happened.

So right now I'm pretty confused about what to do - based on my reasoning above the only wire that could actually be a throttle input is the red wire (I didn't get a chance to check the voltage at this wire as I turned the throttle (didn't have a multimeter handy and was running to a lecture..., but I'll check this later), or else it's possible that the throttle wire is not connected at all on the board and a throttle wire has to be soldered on somewhere on the board....there are also a number of unconnected inputs on the board near the red wire, most resting at 0, one at 4.7V.

So basically now I am a bit lost as to how I should proceed:
1) If I should focus on trying to find a point on the circuitboard to solder a throttle signal wire to (not sure what I'm looking for to do this...)
2) If I should dig more into the red wire

The added complication is that I purchased the bike from BTwin/Decathlon so who knows if they have also made any modifications to the controller/somehow disabled the possibility of adding a throttle, I tried to contact both BTwin/Decathlon but they would not send me a circuit diagram for the controller (or tell me anything at all..) for "confidentiality" reasons.

If there's anyone that thinks they know a good way to proceed, either with the red wire, or where to solder a throttle wire onto the board, or if I should buy a new controller, I would be so eager to hear it! (Or ideally a circuit schematic for the controller!!!!).

I'm doing this project as part of my masters thesis in engineering in Dublin, Ireland so I can't even say how much I would appreciate any help you can give me with this!

Would it be helpful if I post more photos?

Shaun
 
You bought an 8 pin cable for a BBS02 mid drive controller, and it has the same connector as your bike controller. Plugged in, everything works except the throttle!

I am surprised but maybe it is a Bafang standard to use the same connector for the front harness and standardize many of the pins. The only Bafang controller I own is the one in the BBS02.

You might just take that harness you bought, and do a continuity test on the three pin throttle connector to see which pins correspond on the 8 pin connector at the other end. The throttle signals are +5, output, and gnd. Then determine how the 8 pins on the controller harness correspond to the 8 wires you described.

You didn't identify a 5 volt power on your list, and there should be one that comes up when the LCD is turned on. You should also see if the throttle output matches up to the red wire.
 
Thank you for your reply @docw009! We got back to doing a bit more detective work and learning today and we are now unsure how to proceed so some more advice would be hugely appreciated.

We think some modifications have been made to the controller (by BTwin/Decathlon) and the throttle input signal is not connected to the board.

The three pins on the throttle connector map to these wires on the controller:
1) Ground -> Ground
2) 5V power supply -> red wire on controller
3) Output signal -> Blue wire on controller

As mentioned in the first post, the red wire on the controller is shorted to ground when the brake connector is connected at the front, and rests at 3.3V when the brake connector is not connected. Since the red wire is shared between the throttle and the brakes at the front we presumed this would be a 5V power supply, but it does not seem to be the case - we are a bit confused what the purpose of this wire is (conceptually what the purpose of a wire that is shared between the throttle and the brakes would be), since the brakes short this to ground, this means there is no 5V supply for the throttle, also once again when the brake connector (red wire) is disconnected, no assistance is given by the motor - so we thought maybe it has been repurposed as a safety feature....(do not give assistance when brakes are disconnected...)

The "throttle output signal" is currently connected to a small blue circuitboard that is used to power the lights (you'll be able to see this in one of the photos below), so we are confident that some modification has been made here and that we now need to figure out where this blue wire should be connected to on the board to be a throttle input signal, there are 4 unconnected pins on the board - I will post photos of each below

Trying to find where on board throttle input should be connected:
There are 2 unconnected pins on the front of the controller beside the red wire - these both rest at 0V and we don't really have any more information about them, also shown is the blue "throttle output" wire which is the wire that we need to connect to somewhere on the board




Here there are 2 unconnected inputs
15045813_10210785685749077_670089536_n.jpg
1 is labelled "SH", it is beside the white brake signal and it rests at 0V
1 is labelled as "4." (hard to read, this could be wrong) and rests at 4.6V

The other unconnected pins you can maybe see in the photo are labelled as either GND or 5V so we are not worried about those.



So some questions arising from those 4 unconnected inputs:
- What does an unconnected throttle input voltage usually rest at? Is this a definitive way of telling where a throttle input should connect to? (does its resting voltage sometimes vary)
- Are there any inputs that we can definitely rule out as being throttle input voltages? e.g. if the purposes of "SH" or "4." are known....
- If we connect a throttle input signal, will the controller even listen to it? (Or could it be told to ignore this in the serial protocol even if one is connected...)


The other problem is that the controller might not actually have a pin to take a throttle input voltage, my assumption that it can is based on the website from 8Fun here where it says that it can, but who knows:
http://shop.8fun-motor.com/controller/12-cr-s106350sn.html



So as I see it what we need to do to get the throttle to work is: (based on the assumption we can actually do this with our controller)
1) Get a 5V power supply for the throttle (easy - cycle analyst does this)
2) Find out where on the board to connect the throttle to (we think there are 4 possibilities)
3) Find out if the controller will even listen to a throttle input signal if it is connected (maybe the microcontroller has been programmed to ignore a throttle input even if it is connected).... (harder to find out)


We also did some testing with the cycle analyst to verify that the Bafang throttle works and it does.


So we are left with a few options:

1) Try connecting a voltage of around 2V to some of the 4 unconnected pins on the board and see what happens
Maybe dangerous....maybe

2) Buy a new controller:
Does anyone know where we could buy a new controller that would work with an 8Fun/Bafang 250W motor? Would this work even though it is for a 350W motor?
http://shop.8fun-motor.com/controller/12-cr-s106350sn.html
Would we have to reprogram the serial protocol if we buy a new controller and if so is this difficult?
Would a new controller come with documentation like a circuit schematic?

3) Try to control the motor using digital commands
Either learn the commands being sent from the display at the front of the bike and try to duplicate these in some way (this could be hard...)

Again, any advice anyone could offer with this would be sincerely appreciated!
Or even if anyone knows anyone who would be a good person to talk to about this I'd be really eager to hear.

Thank you,
Shaun
 
I took a look at the cable on my BBS02, which should be the same as the one you linked.
Bafang BBS02 Harness

My cable uses 3 wire brake levers, which are VCC, GND, and the brake output. Both brake levers are in parallel. I didn't check my brake levers, but I assume they must be hall sensor switches for water resistance. Check if VCC is there on your cable, but it's also possible they just run a two wire lever into that connector. Then they wouldn't need VCC, and they just switch the output to ground.
View attachment 1

The throttle connector is 3 pins. Here is what I believe is the throttle signal, and where it appears on the cable, first pin in the circle.


Ought to be easy to find VCC on the controller. Disconnect red wire from current spot. Reconnect it to VCC.. Make sure it matches the relevant pins on the throttle connector.

Disconnect the blue wire from the light circuit. Connect throttle and verify it gets power and dribes the blue wire betwen 1 and 4 volst. Then jumper it on those unused inputs til you get throttle response. Maybe put a 1K resistor in series to protect circuit when testing.

By the way, with my bike powered up, the throttle signal sits at 0 volts when throttle is not plugged in. My controller must not use pull-ups.
 
Thanks a lot @docw009

We tried connecting 2V to the unconnected pins today but without luck. We think it might be something to do with the serial commands received from the front unit that are saying to ignore a throttle input if it is connected.

So due to time constraints, we are now going to start the process of looking for a new controller to use with the bike that can accept a throttle input. I've only really looked at the controllers from Grin technologies:
http://www.ebikes.ca/shop/electric-bicycle-parts/controllers.html

And I'm just trying to scope out if they would work with my 250W Bafang motor and 36V battery, can you think of a reason for why one of the grin controllers wouldn't work?

Thanks again, seriously appreciate all the help!!
Shaun
 
Hooking up my new controller yesterday, I accidentally got +5V on the throttle input and the motor started, Luckily, I had the rear wheels off the ground on a stand.

So while researching controllers, if I was in the experimenting mood, I would just poke around with a 5 volts in series with a 1K resistor on those various input pins to see if I can get the motor to spin.

Buying a new controller is easy, but it can be a PITA to get the right connectors to your brakes, LCD, PAS, and throttle. Otherwise, you're soldering, never desireable on on a cable that flops around. Sometimes less work, but bigger money to buy the whole turn key kit, especially if an LCD is involved, as some of them do have different protocols. I looked at the Grin Infenons. They don't use the round Bafang quick connect to the motor. No waterproof connectors either. All JST. That's going to require some fixing, but it appears you need a CA, and they do have that connector.

Do you have red two pin connectors on those brakes or are they yellow three pin connectors? If so, you'll have to get two pin brakes.
 
Back
Top