eBike Electronics System Planning

General Discussion about electric bicycles.
Post Reply
User avatar
Alan B   100 GW

100 GW
Posts: 7493
Joined: Sep 11 2010 7:43am
Location: San Francisco Bay Area, USA
Contact:

eBike Electronics System Planning

Post by Alan B » May 16 2011 7:05pm

eBike Control System

(Note - this has evolved a bit, jump to near the end of this page for the 2013 version, or review the earlier version here)

I'm thinking about putting together the different things I'm building to make a somewhat unified "control system" on my eBike. I thought it might be interesting to discuss this and get input and comments.

I've partially designed a number of these items, and built a couple versions of the Battery interface, so things are starting to take shape. At this time the elements of my planned eBike control system are:

1) Battery Interface (one per bank), including:
a) cell balancing parallel connectors (done)
b) balancing charger connector (6S DB9) (done)
c) charge current connector (PowerPole15) (done)
d) cell monitoring microprocessor (features below are in design version, not yet built)
e) high current paralleling
f) LVC output (to communications bus)
g) HVC output (to communications bus)
h) communications bus

2) Keyswitch Interface, including:
a) keyswitch controlled FETs for precharge and operate, with off/remove, accessory, and operate modes
b) throttle spanning pots for Magura throttle
c) throttle clamping for LVC
d) HVC output (breakout from communications bus)
e) motor temperature electronics for K thermocouple
f) communications bus

3) Master Controller, including: (partially designed, partially commercial)
a) LCD display for readout of parameters such as cell voltages
b) pushbuttons
c) microprocessor with significant memory
d) buzzer
e) communications bus

4) Charge Controller, including: (this is not designed, so could be several versions from simple switch to micro controlled BOOST switcher...)
a) FET or relay switch to control external bulk charger/power supply from simple HVC line of communications bus (base design)
b) micro to monitor cell voltages from communications bus and control charging more intelligently (option)
c) charge voltage and current sensing
d) charge current control with switchmode FET and inductor, BUCK or possibly BOOST??? (options)
e) communications bus

5) Motor Controller, including: (partially designed)
a) six TO247 FETs (100V parts, 85V 20S LiPo / 32S LiFePO4 design) (approx 50A battery current, 100A phase current)
b) proper FET gate drive
c) BLDC controller (built into micro)
d) microprocessor
e) pre-regulator and 12V switcher
f) 5v regulator
g) voltage and current sense
h) Cycle Analyst connector
i) throttle, ebrake, the usual I/O such as phase wires and battery wires
j) communications bus

The communications bus is designed to be simple yet adequate (and similar to existing systems). It contains:
a) optically isolated LVC bus (really throttle cut, can be used for other purposes like motor or controller overheat)
b) optically isolated HVC bus (for controlling bulk chargers)
c) optically isolated serial in and out bus, master-slave type
d) 8 pin RJ-45 connectors. Two on most boards, so they can be easily daisy chained. The motor controller only has one RJ-45 due to space constraints.

In a simple system the LVC and HVC can be used without using the serial bus. These are similar to other existing designs and so should be compatible with them and their modules. The serial bus is only used if there is a higher level controller present that needs to use it and gain access to more information such as cell voltages and motor and controller temperatures. Just snap together short RJ cables between the modules to carry the busses to all the cards.

All boards are presently in some state of partial design, some more advanced than others. The new version of the Battery Interface is quite far along, probably 90%. The motor controller is partially laid out, about 40%. The keyswitch board is pretty far along, about 70%. But it is not too late to make changes. Much easier to rip up CAD than toss built electronics. Even built electronics are not too hard to toss if there are only a few made. This project is optimized for small incremental production.

These boards are all 2.5 by 3.8 inches to fit the expressPCB MiniBoard service, three boards cheap and quick. Makes it easy to try a different design. No huge commitment on pc boards.

I'm trying to keep the pieces simple but make their sum equal more than their parts. They can work with other designs, and they can combine into a greater system at different levels. For example the Master Controller is not needed. If present more features would be possible. A Cycle Analyst can be used with this system. Eventually the Master Controller might be able to do most of those functions, but initially the plan is to focus on doing things the CA does not do so the two displays are complementary. Having more display area can be better allowing the displays to be more fixed making it easier to find information by location on the display rather than pushing buttons to scroll it into view.

So a simple system could be just a couple of Battery interface boards to get to 12S LiPo (or LiFePO4), and a keyswitch board. This handles precharge, a Magura throttle if desired, motor temperature overheat shutdown, LVC to the throttle clamp, and the HVC signal is available. Basic and rugged, but protects against overdischarge and motor overheat. This is my "next step" in the progression.

Later I will add other modules such as the Master Controller, Charge Controller and Motor Controller. In the mean time other available modules are performing those roles (to some degree) so we don't have to wait for them to enjoy our eBike!

Interesting Components List:

100V TO264 FETs: IRFP4468
75V TO264 FETs: IRFP4368
100V TO220 FETs
FET drivers: IRS2186S SOIC8
Capacitors: 220uF 100V Rubycon, combined with smaller caps for low impedance over a wide freq range
motor control micro: ATMega32M1 in TQFP32 with BLDC motor support hardware on-chip, 32K code, etc
small micro: ATtiny84
12v TO220 switching reg
5v ultra low drain reg
optical isolators
K thermocouple interface
Terminal micro subsystem: Olimex ATmega128 (Sparkfun)
graphical LCD display
keyswitch

References:

Lipo Battery Interface http://endless-sphere.com/forums/viewto ... 14&t=27812
Commuter Controller: http://endless-sphere.com/forums/viewto ... =2&t=22630
Simple BLDC Controller: http://endless-sphere.com/forums/viewto ... =2&t=23350
Ricky's Hi Power Controller: http://endless-sphere.com/forums/viewto ... =2&t=23205
Quad Cell BMS Discussion http://endless-sphere.com/forums/viewto ... 14&t=21939
my eBike build testbed for this project: http://endless-sphere.com/forums/viewto ... =3&t=21390

Build something, and then make it better...

Thanks in advance for your comments,
Last edited by Alan B on Nov 04 2013 8:26am, edited 21 times in total.

User avatar
Alan B   100 GW

100 GW
Posts: 7493
Joined: Sep 11 2010 7:43am
Location: San Francisco Bay Area, USA
Contact:

Re: eBike Control System Planning

Post by Alan B » May 16 2011 11:32pm

Here is a version of the Battery Interface pc board.

Image

This one is pretty much complete, but I am working on some improvements before it goes to fabrication.

User avatar
Alan B   100 GW

100 GW
Posts: 7493
Joined: Sep 11 2010 7:43am
Location: San Francisco Bay Area, USA
Contact:

Re: eBike Control System Planning

Post by Alan B » May 16 2011 11:37pm

Here is the Keyswitch board. There is more to be done in the lower right.

Image
Last edited by Alan B on May 16 2011 11:53pm, edited 1 time in total.

User avatar
Alan B   100 GW

100 GW
Posts: 7493
Joined: Sep 11 2010 7:43am
Location: San Francisco Bay Area, USA
Contact:

Re: eBike Control System Planning

Post by Alan B » May 16 2011 11:46pm

Here is a partially complete Motor Controller:

Image

User avatar
auraslip   1.21 GW

1.21 GW
Posts: 3535
Joined: Mar 05 2010 5:19pm

Re: eBike Control System Planning

Post by auraslip » May 17 2011 1:08am

I just wanted to mention that google is making aurduino there official platform for android accessories. I have no clue about the difficulties in programming for android, but it seems like it wouldn't be hard to hack up a program that does some of the stuff you want. And the big benefit would be that anyone with an android phone could take part in the fun :)
THANKS TO EVERYONE HERE WHO TAUGHT ME ABOUT EBIKES. I'M IN YOUR DEBT.

I sell Ebike Brake levers and throttles with custom connectors crimped on! $10 shipped!

ES facebook group

r/ebikes ebikes on reddit

User avatar
mr.electric   10 kW

10 kW
Posts: 748
Joined: Jan 03 2007 12:12pm
Location: San Francisco
Contact:

Re: eBike Control System Planning

Post by mr.electric » May 17 2011 1:19am

Wow impressive work. Nice fat power traces.
-Fat Sand Bike with 9c and 29ah pack

-Giants mascot scooter

User avatar
Alan B   100 GW

100 GW
Posts: 7493
Joined: Sep 11 2010 7:43am
Location: San Francisco Bay Area, USA
Contact:

Re: eBike Control System Planning

Post by Alan B » May 17 2011 5:48am

auraslip wrote:I just wanted to mention that google is making aurduino there official platform for android accessories. I have no clue about the difficulties in programming for android, but it seems like it wouldn't be hard to hack up a program that does some of the stuff you want. And the big benefit would be that anyone with an android phone could take part in the fun :)
Interesting to know about the android and the arduino. I have an android phone, and the micro I am using is the same type as the arduino. Might be something useful there.

Thanks.

User avatar
Alan B   100 GW

100 GW
Posts: 7493
Joined: Sep 11 2010 7:43am
Location: San Francisco Bay Area, USA
Contact:

Re: eBike Control System Planning

Post by Alan B » May 17 2011 5:53am

mr.electric wrote:Wow impressive work. Nice fat power traces.
Thanks for the comment. Even as fat as they are, and on both sides, I suspect they are the performance limiter on the motor controller on the phase current side. Triple battery wires and double phase wires are there to help out. A machined copper overlay may be the ticket, at least for the phase wires.. They keyswitch is probably ok as it does not see phase current and was easy to flood copper on, though it may also need an overlay if it is not done with heavy copper.

User avatar
Alan B   100 GW

100 GW
Posts: 7493
Joined: Sep 11 2010 7:43am
Location: San Francisco Bay Area, USA
Contact:

Re: eBike Control System Planning

Post by Alan B » May 17 2011 8:44pm

So I beefed up the traces some more, added more, and added more surface mount capacitors close to the FETs. I also rightsized the electrolytics (220uF 100V Rubycons), and selected and rightsized the three shunts. This layout is set up with three shunts in parallel, each 4 milli ohms, each will dissipate 1 watt at 50/3 amps. The shunts are 4 watt devices so they should run fairly cool, especially considering that 50 amps is not the longterm current drain (in general).

User avatar
Alan B   100 GW

100 GW
Posts: 7493
Joined: Sep 11 2010 7:43am
Location: San Francisco Bay Area, USA
Contact:

Re: eBike Control System discussion

Post by Alan B » May 18 2011 7:16pm

I figured out a way to get three 150 mil wide traces to each FET power pin. Need to get more to each phase pin. We can go up to 6 oz copper. The 450 mil battery traces should carry 83 amps so they are fine. But there is not a lot of room to also provide phase traces on both directions.

OK. I have figured out a way to get four 250 mil traces to the phase pins. It may push this controller into two boards, but perhaps that is best. That is closer to the design we worked out before. That should handle 148 phase amps. Which is about what is needed for this six FET board.

User avatar
Alan B   100 GW

100 GW
Posts: 7493
Joined: Sep 11 2010 7:43am
Location: San Francisco Bay Area, USA
Contact:

Re: eBike Control System discussion

Post by Alan B » May 19 2011 8:14am

Comments on Capacitors:

From Ricky's thread (linked above):
Ricky_nz wrote:Hi Alan,
Alan B wrote: I am working on my six TO247 controller and I was wondering what your final capacitor arrangement was, and what you would recommend for a 6 FET similar board? I'm trying to pack it on a fairly small board so it would be nice to avoid having a lot more than needed.
Still working on the software. usual story too many things to do and not enough time :lol: .

My capacitor arrangement used:
680uF 100V 105degC Panasonic EEUFC2A681
1uF SMD AVX 18121C105KAT2A Digikey 478-1642-1-ND
1uF leaded EPCOS B32521C1105J000 Digikey 495-1167-ND

The 1uF SMD caps are rather expensive but seem to work nicely. A mate suggested there is an alternative part that will perform similar for less cost but I don't know the number. These caps can handle the high frequencies fine and really removed the need for any other smaller value caps.

I used one of the 1uF SMD caps across each highside/lowside FET pair as close as possible
I also used a 1uF leaded in parallel with that
I added 2 additional 1uF SMD caps across each electro although 1 seemed enough.
I mounted 2 680uF electros at each end of the board. for 4 total. Under these electros I fitted a pair of 1uF SMD caps although on the first board I used 1 per electro and it ran fine ( still experimenting to fitted the extra for comparison on board 2).

I have probably gone overboard with the caps.
I had left a 1206 SMD pad in parallel with the larger SMD caps but it was not necessary.

With my setup I have had it up to 100ARMS/Phase circulating so the motor was not fully loaded but I was controlling 100A in the motor phases.

It should scale down to a 6 Fet quite nicely.
The value of the electors was limited by physical size. I plan to use additional ones externally if a problem occurs.

Heres a few pics to show where they went:
This shows one of the leaded 1uF caps fitted and the footprints in the center of the board for the rest. A wider footprint would give a bigger range of possible caps at 100V. You can see the 4 circles representing the 680uF capacitors. For small size and low total ESR these could be replaced with a group of smaller capacitors to achieve a similar ESR as the caps I used are quite tall.
100_3167_crop_small.JPG
This one shows the bottom (poorly) sorry about the photo quality. You can just see the 1uF SMD capacitors. This is on the second board I'm building up and I decided to fit a few more 1uF SMD caps but from the first board they are probably unnecessary.
100_3162_crop_small.JPG

An interesting note is the caps in the internal cyclone controllers look very similar to the 1uF ceramic SMD caps I used.

My board ran fine without the leaded 1uF caps. I do think they have a benefit in lowering the overall esr but you can probably avoid them if space is a major issue. I had room and footprints so I fitted them. The 1uF leaded caps I used are probably a good compromise of size and performance.


Edit:
For a 6 FET board I would put the same per FET pair components as I used and then decide what electros you want to use. If you want low profile use a lot of smaller ones in parallel, those 680uF 100V caps are quite chunky. I have a larger design growing in my head but that will need to use multiple smaller electros to get the form factor I want.

ie put a 1uF MLC SMD cap as above and maybe a 1uF leaded cap across the bus at each FET pair and then just add bulk capacitance to bus with maybe a few more 1uF caps in parallel. This combination seems to keep the voltage across the FETs under control as far as my 100MHz scope can tell.

As I sad before I did not fit the leaded 1uF caps initially and the board still behaved ok but I think the additional 1uF leaded caps did reduce heating of the main electros when I purposely ran off a sagging supply with long leads. (My software actively prevent operation in this area now :) ).

I'm also interested in others comments on my capacitor choices as this is the highest powered device I have designed and build myself.
Great info, thanks Ricky!

User avatar
Alan B   100 GW

100 GW
Posts: 7493
Joined: Sep 11 2010 7:43am
Location: San Francisco Bay Area, USA
Contact:

Re: eBike Control System discussion

Post by Alan B » May 19 2011 12:30pm

Updated Motor Controller Power Board

I'm expecting there is not enough room on this board for the full controller since the traces have been beefed up, but here is the present (not completed) layout for comments. It may be adequate for 80 battery/150 phase amps when made in 6oz double sided copper. It is the standard miniboard size 2.5 by 3.8 inches for rapid inexpensive prototyping.

Image

I have not reworked the SMT capacitors yet. I will be changing to some of the units recommended by Ricky.

This motor controller was set aside to focus on more pressing basic needs. When I get back to it I'll split it off to a separate thread.

Time Warp Edit - jump to 11/2013:

Let's get this thread back to the high level infrastructure and update it.

But first a quick status update relative to 11/2013 - I have four eBikes -
1. GreyBorg Warp FS with Cromotor using my Magura adapter, Methods HVCLVC boards, CA V3, 18S 4P Turnigy Lipo, and 24 FET Lyen controller, soon to be 24S4P and 18 Fet controller.
2. eBikeE recumbent with BMC, 12S2P Zippy 16AH and Lyen 12 FET, using Methods HVCLVC boards and thumb throttle
3. Novara MTB with 9C, 18S2P 10AH Turnigy using my paralleling boards with DB9 and Anderson charging connector setup, CA V2, Lyen 12FET, my Magura adapter
4. the Son's Peugot MTB with 9C, 10S4P 20AH Turnigy, SMT LVC boards from Geoff, 12 FET from Cycle9 etc
Last edited by Alan B on Nov 04 2013 8:47am, edited 3 times in total.

User avatar
Alan B   100 GW

100 GW
Posts: 7493
Joined: Sep 11 2010 7:43am
Location: San Francisco Bay Area, USA
Contact:

Re: eBike Electronics System Planning

Post by Alan B » Nov 03 2013 11:28pm

It is fun to review the older articles. So similar and yet so different.

Things have evolved a bit since I started this thread 2.5 years ago. Many things were built, some were not completed. Many of the pieces are coming together now in newer versions, and in a slightly different way than the original plan. The scope has increased somewhat, and parts of the design are pushed off into the future while we concentrate on reworking the basic infrastructure.

I'm using different software and a different set of PC board vendors that has relaxed the size constraints that were driving the earlier design (due to cost). (DipTrace and OSH Park, among others). Costs are lower ($5 per square inch for three boards, features are better (solder mask and silkscreen both sides, gold plating, most any size boards), and turnaround is a bit longer (10-14 days). http://endless-sphere.com/forums/viewto ... 63#p804763

The overall goals have not changed much, but there is enhanced modular flexibility - to be able to use subsets of these modules and have them still work together. At least to the degree that makes sense.

In other words, the RFID Key, Master Switch and Throttle Adapter are independent and each work without the others. If, for example you have the RFID Key but not the Master Switch, then the switched +battery output of the RFID is fed into the Motor Controller logic supply input, and the RFID Key turns the Motor Controller on and off (rather than system power). The Throttle Adapter is independent of everything else. The Master Switch does not require the RFID Key, you can use a regular keyswitch or a hidden switch or whatever you want, including just have a regular switch to control the bike power.

Some things are dependent on others, for example the Battery Monitor and Control requires the Battery Interface modules and the Master Switch, and the Charger Control requires the BMAC. It wouldn't make much sense without it.

Here is the present vision:

Image

Status of these modules as of 11/2013:

Master Switch : board designed, prototypes made and in test
http://endless-sphere.com/forums/viewto ... 14&t=54225

(Magura) Throttle Adapter : early boards are in service, new board sent out for fab 11/4/2013
http://endless-sphere.com/forums/viewto ... =2&t=54876

RFID Keyswitch : prototype board out for fab
http://endless-sphere.com/forums/viewto ... =2&t=44502

Charge Control Switch : board is mostly designed but needs updating for charge current detection
The functionality has changed somewhat since the charger is now a voltage and current limited power supply.

Battery Interface : prototype boards are fabricated, waiting for assembly and test (fine pitch surface mount)
http://endless-sphere.com/forums/viewto ... 14&t=25706
Note that the DB9 pinout has changed slightly from the older standard. Now the two pins toward each end are parallel for better 6S charging current through that connector. The older connector had ground on both ends. Avoid mixing these. I plan to retire the old boards soon, and in any case avoid mixing them!

Battery Monitor and Control : partially designed, will be covered in above thread together with the interface

Controller Programmer : another item I forgot to add here is the Arduino Controller Programmer I built, allows setting controller parameters easily in the field. http://www.endless-sphere.com/forums/vi ... 80#p632704

Most of these items live in separate threads as linked.

Post Reply