How To, 50A BBSHD Controller Mod

General Discussion about electric bicycles.
BotoXbz   10 W

10 W
Posts: 91
Joined: May 20 2018 7:00am

Re: How To, 50A BBSHD Controller Mod

Post by BotoXbz » Aug 31 2019 8:13pm

casainho wrote:
Aug 31 2019 5:07pm
Hi.

Can you guys please tell me what is the microcontroller on the motor controller board?? I saw that there are connections for 3 halls sensors from the motor + the connections of the 3 phases.
The controller on the BBSHD is garbage, it's using a Chinese STC15W4K32S4 series MCU
There is a second MCU, I think that one does the motor control and the STC probably only tells it how much current it wants
Original firmware is here: viewtopic.php?t=100064
A much better idea would be to design a good VESC controller that'd fit into the original enclosure.
And then you could do whatever you want.

casainho   10 GW

10 GW
Posts: 4457
Joined: Feb 14 2011 2:43pm

Re: How To, 50A BBSHD Controller Mod

Post by casainho » Aug 31 2019 9:39pm

BotoXbz wrote:
Aug 31 2019 8:13pm
casainho wrote:
Aug 31 2019 5:07pm
Hi.

Can you guys please tell me what is the microcontroller on the motor controller board?? I saw that there are connections for 3 halls sensors from the motor + the connections of the 3 phases.
The controller on the BBSHD is garbage, it's using a Chinese STC15W4K32S4 series MCU
There is a second MCU, I think that one does the motor control and the STC probably only tells it how much current it wants
Original firmware is here: viewtopic.php?t=100064
A much better idea would be to design a good VESC controller that'd fit into the original enclosure.
And then you could do whatever you want.
Thanks for the information.

That STC15W4K32S4 is from ST, there is an English datasheet available as also a c compiler and some examples projects on github.

The c compiler is SDCC, the same we use for the TSDZ2 motor controller, which is also a microcontroller from ST.

So, even if there is other IC that specifically do the motor controller, than should be easy to understand the schematic of the motor controller and then develop the firmware, probably even more easy than the TSDZ2 or the KT Kunteng motor controllers firmware that we also developed.

Can you please tell me the me reference of the motor controller IC??
- TSDZ2 FAQ: issues and repairs, etc
- TSDZ2 OpenSource firmware

Developer of OpenSource knowledge and technology for ebikes: Wireless Ebike boar ANT+ and Bluetooth, Flexible OpenSource firmware for EBikes: TSDZ2 mid drive motor, KT motor controllers and displays: Bafang 850C color, SW102 Bluetooth and KT-LCD3.

If you like my work, please consider making a donation to help my developments: paypal.me/jorgecasa

User avatar
fechter   100 GW

100 GW
Posts: 14802
Joined: Dec 31 2006 3:23pm
Location: California Bay Area, USA

Re: How To, 50A BBSHD Controller Mod

Post by fechter » Aug 31 2019 10:16pm

Here is the datasheet for the MCU:
Attachments
STC15W4K32S4-en.pdf
(5.4 MiB) Downloaded 54 times
"One test is worth a thousand opinions"

casainho   10 GW

10 GW
Posts: 4457
Joined: Feb 14 2011 2:43pm

Re: How To, 50A BBSHD Controller Mod

Post by casainho » Aug 31 2019 11:07pm

fechter wrote:
Aug 31 2019 10:16pm
Here is the datasheet for the MCU:
Thanks. I found on AliExpress cheap development boards with that microcontroller, which would be need at start as the motor controller is very expensive!!

There are OpenSource firmware on github for this microcontroller, to take as a first example.

Please tell me the reference of the other big IC on the board.

My guess is that it is an IC for enable/disable the power mosfets as the 3 hall sensors signals from the motor goes to the microcontroller and this is capable to drive 6 PWM channels typically used for motor controllers.
- TSDZ2 FAQ: issues and repairs, etc
- TSDZ2 OpenSource firmware

Developer of OpenSource knowledge and technology for ebikes: Wireless Ebike boar ANT+ and Bluetooth, Flexible OpenSource firmware for EBikes: TSDZ2 mid drive motor, KT motor controllers and displays: Bafang 850C color, SW102 Bluetooth and KT-LCD3.

If you like my work, please consider making a donation to help my developments: paypal.me/jorgecasa

casainho   10 GW

10 GW
Posts: 4457
Joined: Feb 14 2011 2:43pm

Re: How To, 50A BBSHD Controller Mod

Post by casainho » Aug 31 2019 11:16pm

This microcontroller has 32 kbytes of flash memory.

I would say the hardware of motor controller is about the same as TSDZ2 except that it uses better power mosfets hardware and so handles maybe 3x more current than TSDZ2.

Since TSDZ2 microcontroller has also 32 kbytes flash memory, I would say we could develop the same firmware and with FOC as we did for TSDZ2.
- TSDZ2 FAQ: issues and repairs, etc
- TSDZ2 OpenSource firmware

Developer of OpenSource knowledge and technology for ebikes: Wireless Ebike boar ANT+ and Bluetooth, Flexible OpenSource firmware for EBikes: TSDZ2 mid drive motor, KT motor controllers and displays: Bafang 850C color, SW102 Bluetooth and KT-LCD3.

If you like my work, please consider making a donation to help my developments: paypal.me/jorgecasa

casainho   10 GW

10 GW
Posts: 4457
Joined: Feb 14 2011 2:43pm

Re: How To, 50A BBSHD Controller Mod

Post by casainho » Sep 01 2019 7:00am

I started a thread specifically for firmware development:

Bafang BBSHD BBS02 mid drive -- Flexible OpenSource firmware
- TSDZ2 FAQ: issues and repairs, etc
- TSDZ2 OpenSource firmware

Developer of OpenSource knowledge and technology for ebikes: Wireless Ebike boar ANT+ and Bluetooth, Flexible OpenSource firmware for EBikes: TSDZ2 mid drive motor, KT motor controllers and displays: Bafang 850C color, SW102 Bluetooth and KT-LCD3.

If you like my work, please consider making a donation to help my developments: paypal.me/jorgecasa

Cbisbaf   10 mW

10 mW
Posts: 24
Joined: May 04 2019 3:26pm

Re: How To, 50A BBSHD Controller Mod

Post by Cbisbaf » Sep 06 2019 11:35am

quick one could anyone reference old photos and tell me the orientation and value of these 2 components please. the board was already broken so rushed unpotting it but i am going to try save it as a spare. thankyou in advance
Attachments
Inkedim1_LI.jpg
Inkedim1_LI.jpg (469.41 KiB) Viewed 2056 times
Inkedim2_LI.jpg
Inkedim2_LI.jpg (489.87 KiB) Viewed 2056 times

casainho   10 GW

10 GW
Posts: 4457
Joined: Feb 14 2011 2:43pm

Re: How To, 50A BBSHD Controller Mod

Post by casainho » Sep 06 2019 12:33pm

Sorry I can't help you. Could you please take pictures of the chips so we can know their references??

I am writing a wiki page to resume the motor controller and I need that information to put there:

https://github.com/OpenSource-EBike-fir ... BBSHB/wiki

Thank you.
- TSDZ2 FAQ: issues and repairs, etc
- TSDZ2 OpenSource firmware

Developer of OpenSource knowledge and technology for ebikes: Wireless Ebike boar ANT+ and Bluetooth, Flexible OpenSource firmware for EBikes: TSDZ2 mid drive motor, KT motor controllers and displays: Bafang 850C color, SW102 Bluetooth and KT-LCD3.

If you like my work, please consider making a donation to help my developments: paypal.me/jorgecasa

Cbisbaf   10 mW

10 mW
Posts: 24
Joined: May 04 2019 3:26pm

Re: How To, 50A BBSHD Controller Mod

Post by Cbisbaf » Sep 06 2019 1:52pm

hope these are ok no filter for my scope
Attachments
WIN_20190906_19_47_34_Pro.jpg
WIN_20190906_19_47_34_Pro.jpg (331.63 KiB) Viewed 2047 times
WIN_20190906_19_48_25_Pro.jpg
WIN_20190906_19_48_25_Pro.jpg (219.88 KiB) Viewed 2047 times
WIN_20190906_19_48_39_Pro.jpg
WIN_20190906_19_48_39_Pro.jpg (290.72 KiB) Viewed 2047 times
WIN_20190906_19_48_54_Pro.jpg
WIN_20190906_19_48_54_Pro.jpg (302.74 KiB) Viewed 2047 times
WIN_20190906_19_49_35_Pro.jpg
WIN_20190906_19_49_35_Pro.jpg (269.27 KiB) Viewed 2047 times

User avatar
fechter   100 GW

100 GW
Posts: 14802
Joined: Dec 31 2006 3:23pm
Location: California Bay Area, USA

Re: How To, 50A BBSHD Controller Mod

Post by fechter » Sep 06 2019 2:04pm

Cbisbaf wrote:
Sep 06 2019 11:35am
quick one could anyone reference old photos and tell me the orientation and value of these 2 components please. the board was already broken so rushed unpotting it but i am going to try save it as a spare. thankyou in advance
The diode in the top picture is the same as the one on the next FET bank. All those parts are duplicated 3x on the banks.

The bottom pic I don't know what that is. I won't have access to a board for a while, but if you wait, I can probably see what it is.
"One test is worth a thousand opinions"

casainho   10 GW

10 GW
Posts: 4457
Joined: Feb 14 2011 2:43pm

Re: How To, 50A BBSHD Controller Mod

Post by casainho » Sep 06 2019 3:25pm

Cbisbaf wrote:
Sep 06 2019 1:52pm
hope these are ok no filter for my scope
So one is the STC15W4K32S4,

The other is the FAN7388.

The last one is the 79F9211 ?? Can you please confirm this one?
On Google I find reference to something "79F9211 180 ebike". Seems it is a microcontroller used on ebike motor controllers.
- TSDZ2 FAQ: issues and repairs, etc
- TSDZ2 OpenSource firmware

Developer of OpenSource knowledge and technology for ebikes: Wireless Ebike boar ANT+ and Bluetooth, Flexible OpenSource firmware for EBikes: TSDZ2 mid drive motor, KT motor controllers and displays: Bafang 850C color, SW102 Bluetooth and KT-LCD3.

If you like my work, please consider making a donation to help my developments: paypal.me/jorgecasa

Cbisbaf   10 mW

10 mW
Posts: 24
Joined: May 04 2019 3:26pm

Re: How To, 50A BBSHD Controller Mod

Post by Cbisbaf » Sep 06 2019 4:06pm

i think its an nec chip i know they make micro controllers

casainho   10 GW

10 GW
Posts: 4457
Joined: Feb 14 2011 2:43pm

Re: How To, 50A BBSHD Controller Mod

Post by casainho » Sep 06 2019 4:11pm

Cbisbaf wrote:
Sep 06 2019 4:06pm
i think its an nec chip i know they make micro controllers
You are correct!! It is the D79F9211:
stancecoke wrote:
Dec 13 2017 4:50am
I think this is a chinese clone of the Renesas (formerly NEC) D79F9211, sometimes branded as a X8M06, well known from the old KU63 controllers. 44 Pin LQFP package.
https://de.aliexpress.com/item/Electric ... 50022.html

https://github.com/stancecoke/Parameter ... 11-NEC.pdf

There is no cheap programmer available for this processor. I tried to build one on my own some month ago, but I stopped that project.
https://github.com/stancecoke/Parameter ... Controller

regards
stancecoke
- TSDZ2 FAQ: issues and repairs, etc
- TSDZ2 OpenSource firmware

Developer of OpenSource knowledge and technology for ebikes: Wireless Ebike boar ANT+ and Bluetooth, Flexible OpenSource firmware for EBikes: TSDZ2 mid drive motor, KT motor controllers and displays: Bafang 850C color, SW102 Bluetooth and KT-LCD3.

If you like my work, please consider making a donation to help my developments: paypal.me/jorgecasa

User avatar
jpacadd   10 mW

10 mW
Posts: 33
Joined: Dec 27 2019 7:10pm

Re: How To, 50A BBSHD Controller Mod

Post by jpacadd » Jan 20 2020 12:15am

furcifer wrote:
Aug 28 2019 2:33pm
I upped one of my controllers to 45A using the shunt mod and I've been running it for a month now with no issues. Pulled board, soldered another 5 MOHM resistor and added some thermal paste between the mosfets and the cover plate.

The controller does seem to run a bit hotter but nothing crazy. The motor as well but even less so. This seems like a very stable modification.
Hello furcifer,

I'm looking to do the shunt mod on my stock BBSHD controller. Is yours still running? Any advice?

I have bought a spare parts controller for investigation and have picked out the potting. I also have a 2nd bike and intend to build a 2nd BBSHD, so will have a few controllers to mess with total.

I ordered a pack of sample shunt resistors including R005 which looks to be correct, to solder on, and it looks easy to get at that with minimal potting removal.

Is yours working fine and you recommend or not?

Also I suspect my BMS to be my next bottleneck, what do you have for a battery and BMS? I'm leaning toward disconnecting my BMS and just using the wires for balancing. Do you think this makes sense? It does to me, but I'm pretty new to this (not so advanced) level of electrical engineering.

Any else about your build would be interesting too.

Thank you,

Jay
July 2019 first build: 2009 Giant Trance X3 with stock BBSHD 52V
Next build: Just bought used 2009 Giant Trance X4, likely BBSHD also, maybe hotter controller/battery, undecided
Lots of other fun toys: Wildcat X, Xtrainer, 1978 KE100, Hypermotard 1100

Cobain Windsurfer   1 mW

1 mW
Posts: 13
Joined: Feb 28 2018 6:41pm

Re: How To, 50A BBSHD Controller Mod

Post by Cobain Windsurfer » Feb 16 2020 3:51pm

Until U get an answer from furcifer..... I did the shunt mod on the BBSHD a long time ago by soldering a R005 (5 mOhm shunt) on top of the two R005 shunts on the board. It works a charm! I have the EM3ev 52V (14S7P) hard case battery pack, with ~33A burstlimit and ~43A continious limit. (Beside BMS it has a 40A fuse built in) Only thing that has happend is that if I go full trottle up a hill for 100 meters or so, the fuse get hot and blow, and I have to replace it. This was the old stock bbshd controller that let trottle overriding pas without any modding. On another bike I aslo tried to switch out the two R005 shunts with two WSLF
3 mOhm shunts instead to get 50A, but it didn't work out well, jerky trottle like on or off, but superpower...wheelies or nothing..... Never got pas and trottle to work together either. Has someone used this shunts with luck? https://www.mouser.se/ProductDetail/Vis ... 252bxy7w==

User avatar
jpacadd   10 mW

10 mW
Posts: 33
Joined: Dec 27 2019 7:10pm

Re: How To, 50A BBSHD Controller Mod

Post by jpacadd » Feb 16 2020 4:12pm

Cobain Windsurfer wrote:
Feb 16 2020 3:51pm
Until U get an answer from furcifer..... I did the shunt mod...
Thanks for the encouragement. I did order a junk controller off of ebay to dissect and it looks fairly simple, so I ordered some long lead time shunts a while back, should arrive any day now.

I suspect I may have to remove my bms, and maybe I'll add a fuse if not already one there.
July 2019 first build: 2009 Giant Trance X3 with stock BBSHD 52V
Next build: Just bought used 2009 Giant Trance X4, likely BBSHD also, maybe hotter controller/battery, undecided
Lots of other fun toys: Wildcat X, Xtrainer, 1978 KE100, Hypermotard 1100

furcifer   10 kW

10 kW
Posts: 617
Joined: Dec 21 2018 12:36pm

Re: How To, 50A BBSHD Controller Mod

Post by furcifer » Apr 19 2020 12:59pm

My apologies for not getting back to you. My bike was stolen from campus and I haven't been on here for a while. Too depressing. Hope the mod is going well for you. I didn't experience any problems with this mod. Full disclosure I live in Southern Ontario so it's very flat, but we get our fair share of wind.

fja2   100 µW

100 µW
Posts: 7
Joined: Nov 07 2019 3:06pm

Re: How To, 50A BBSHD Controller Mod

Post by fja2 » Apr 23 2020 5:23pm

I did this mod and kindof broke my controller, you can read about how I fixed it here: viewtopic.php?f=2&t=105837&p=1548984#p1548984

Anyway! I now got two 2mOhm shunts, crazy small I know! But my motor still won't go over what would be about 30 amps. Anyone got any clues why that might be? I have replaced the BMS on my battery pack to a quite beefy one, that shouldn't be the issue... I do use a Eggrider.
During the modding I did manage to drill into the temperature sensor, could the lack of a temperature sensor be the issue? Could anyone measure theirs so we know what kind of resistance they have at different temperatures?

Post Reply