Smart EBike: Dashboard + Motor controller + Battery BMS

casainho

10 GW
Joined
Feb 14, 2011
Messages
6,043
Smart EBike: Dashboard/color display with touchscreen + Motor controller + Battery pack BMS. Wireless communications between each three systems.

A Smart system for electric bicycles and scooters with Smart capabilities and hackable/configurable options for advanced users. It will also communicate with Smartphones using Bluetooth.

Do you want to join the efforts to test and/or develop an OpenSource Smart EBike Controller?
Please join the efforts if you value such EBike Smart Controller. Please read more on project page.

Current status
Videos and fotos registered on 24.02.2013:

[youtube]I449L6JZkV0[/youtube]

[youtube]wrrfMGUwaAM[/youtube]

[youtube]M8jWLfEaA3E[/youtube]





Project page: http://www.smartebike.likesyou.org
On the project page you can find the project documentation, including videos, pictures and the source files for schematic/PCB, firmware and software.
 
I am now in contact with Olivier Evalet, the men behing "Bicycle Manager" project:

DSC03667.JPG


Links to the project:
- http://olivier.gelux.ch
- https://github.com/evaletolab/bicyclelab-manager

Who wants to join us?
 
bigmoose said:
"Open Source" is very vague. Please clarify if this work, and all derived works will fall under

Post licensed under the Creative Commons Attribution-Noncommercial-No Derivative Works 3.0 License

http://creativecommons.org/licenses/by-nc-nd/3.0/
It is to early to talk about licenses, there is nothing done yet by me. I would use GPL or something like that. Example of Bicycle Manager Project: https://github.com/evaletolab/bicyclelab-manager/blob/master/GPL

Arduino board and Makerbot as a kind of projects reference, which are OpenSource, commercial and professional.
 
OK, let's say I have knowledge of a controller that blows everything away, good, solid, simple, fast
etc etc, the thing we're all dreaming about. Why would I make it open source ? I'm a capitalist :mrgreen:
and open source doesn't sound like any money....
 
Open source is for the greater good. You can still make money, but your platform remains well documented, and remains open to changes, so the next guy who adds to the functionality can charge for his improved product, but must share the changes and keep them open. Really it's a win-win.
 
Lebowski said:
OK, let's say I have knowledge of a controller that blows everything away, good, solid, simple, fast
etc etc, the thing we're all dreaming about. Why would I make it open source ? I'm a capitalist :mrgreen:
and open source doesn't sound like any money....
The cost on a project like this is on development and after on production.

For development and testing, we are a community and we can work together in an "OpenSource way". The cost is low since the tools are really cheap or free and OpenSource: Arduino electronics are cheap and firmware is free, PCBs are cheap, software CADs are free and OpenSource for schematic and board, free and Opensource Android software IDE, etc.
We also have many free tools to work and communicate together like this forum and github for hosting the sources.

For production, again, the cost is cheap due to the use of OpenSource and cheap electronics like Arduino and China electronics. Most ICs today are really cheap and also the PCBs. I would say a board for a controller must not be over $50 in components for 10 units.
For production, we can get funding with Crowdfunding like others projects that got +$500K in KickStarter. There must be a project manager for this, can be someone to work in a professional way. Or a company can work on the production and selling of the controller.
 
Three phase BLDC motor driver IC
Olivier told me about TMC603 BLDC motor driver controller (link to Farnell online shop, 7,18€ unity price). Does anyone knows about other driver more DIY friendly??

tmc603_f11_0000small.png

"The TMC603 is a three phase BLDC motor driver IC for highly compact and energy efficient drive solutions. Control algorithms previously only found in much more complex servo drives can now be realized with a minimum of external components. The TMC603 directly drives 6 external N-channel MOSFETs for motor currents up to 30A and up to 50V. It integrates current measurement without the need for high current sense resistors, and the sensorless commutation circuitry hallFX™. Its integrated support for sine commutation as well as for back EMF sensing and commutation saves cost and allows for maximum drive efficiency. Depending on the desired commutation scheme and the bus interface requirements, the TMC603 forms a complete motor driver system in combination with an external 8 bit processor or with a more powerful 32 bit processor. Protection and diagnostic features as well as a step down switching regulator further reduce system cost and increase reliability."
 
Kingfish said:
We've been down this road before.

Project: Building the Best Controller

Why start all over when we can just pick up from where we left off?
~KF
Thank you Kingfish.

I will take much time to read all the messages :) -- could you please tell me why the project stopped? What did failed?

The project seems TO MUCH complex...
 
Interesting.
 
Well… we all have ideas to contribute and wish to be heard, plus we have our own goals. One could say there were too many cooks in the kitchen, or that the objectives are too broad, or that finding the talent to get us to the end-game is challenging, or that there are parallel & more mature endeavors with a tighter focus closer at hand… Any of these could be true, or none at all; it depends upon your point of view.

The tough nuts to resolve are how to manage more than one drive; do we have one mcu with lots of slaves for x-number of driven motors? The part that I did like was how we separate the p/s from the mcu from the drivers section: Make it modular so that any pioneering individual with modest ambition can cobble together a good solution far more quickly. But then this is all vaporware; we never finished because we – as a forum of kindred individuals – are also confederates, and it is really difficult to rally around common points for an initial prototype.

In other words, Chinese controllers are cheap, and this is suitably more complex, completely custom, and vastly difficult for one, or even many to pull off. In the hiatus there have been some great developments by other contributing members. I think in terms of hardware, we’re mostly in agreement; the challenge is around the mcu and programming tools.

I am happy to jump back in with what I know and keep notes up to date. For that matter, I need to anyway at some point because I suspect I will need a sino solution for the motors I am crafting.

Anyway – I’m glad this effort piques your interest!

Cheers! KF :wink:
 
I don't know what you do for a living Kingfish, but I take the opportunity to say that you seem very good at project management in, at least, most of its aspects :). I've never seen someone on a forum with such skills so well delineated.

And so that I won't be so off-topic, It seems to be that what's really driving you casainho is the smartphone control possibility. In that case, why not design the "wireless Cycle Analyst" with no screen and with throttle control. Seems enough to do everything you listed.
 
Njay said:
I don't know what you do for a living Kingfish, but I take the opportunity to say that you seem very good at project management in, at least, most of its aspects :). I've never seen someone on a forum with such skills so well delineated.
Thank you for the compliment: I thought it was a bit obvious that I am an engineering consultant :)


Prosit! KF
 
Kingfish said:
(...) or that the objectives are too broad, or that finding the talent to get us to the end-game is challenging, (...)
That project seems to be about a SUPER controller! I think is a bad strategy to start building such a BIG and DIFFICULT device.

I must say I don't have much free time and in past I were in projects to big that never concluded, so, now I try to do only "quick and dirty" projects, taken advantage of other OpenSource projects. My last project is an example of that, the Smart bathroom scale was quick to build and cheap. I used OpenSource software for Android, OpenSource firmware for the ARM and cheap and available electronic boards. The scale works perfectly!!

I also must say I would be frustrated if I work in a project and it don't conclude. I am happy to build system that are useful for me and other people, not the other way.
I have a problem of over weight, that's why I build the Smart Scale. The bicycle is also important for me because I am motivated to use it (I use all days a no electric bicycle to go to work, shop, etc) and it helps me to get fit, healthy. All these years using a bicycle gave me a lot of value, and I will continue to use bicycle, so, I can invest that I will continue to win.
This is my motivation.

Also, I am building my 3rd electric bicycle and I am having difficult to find a cheap controller with low current. I am using BMSBattery components and the controller I used last years was KU63 24V 12A and now the next one in line is KU93 22Ah. I need a controller were I can configure the current/power, for safety while I ride and to optimize the battery size/weight/cost since I need to do 66km with a battery charge.

Kingfish said:
I think in terms of hardware, we’re mostly in agreement; the challenge is around the mcu and programming tools.
I can help with:
- Arduino/AVR firmware. ARM7/9, ARM Cortex firmware. I prefer ARM Cortex because the OpenSource tools I use are more productive (GCC + GDB debugger + JTAG + Eclipse IDE). I am using this cheap board, 32bits ARM7 @ 50MHz $10.
I have a JTAG debugger for ARM7/9 and ARM Cortex.

- I can prototype a circuit, by soldering it on a PCB but I don't have experience in design of a PCB and buy it. But in past I used KiCAD for design of schematics and PCB.

- I have cheap Chinese 2 channels 50MHz oscilloscope. Solder iron an bench power supply of 30V 10A.

- I have a spare 24V 250W front hub motor (Cute-85), 24V 25Ah Lion battery and KU63 controller, throttle and brakes. I would use this system to test the Smart Controller.

- I buy components from Farnel online.

- I can do a little programming in Java, mainly on Android. I can adapt others applications and I know very well how to communicate with Bluetooth and Android and show data on the screen, also take input from the touchscreen/buttons.

- I use Github for collaborative working on projects. And I am a Linux and Android user.

- In past I worked on this OpenSource projects:
-- Pedal Power Meter -- a king of Cycle Analyst??
-- Bicycle LED POV
-- Smart bathroom scale
-- Rockbox / Lyre project, Open Source portable audio player
-- R2C2 RepRap 3D Printers and CNC controller -- from my company.

I will read the Open-BLDC project, looks like it is the only working project (even if not tailored for electric bicycles).
 
I were looking at Open-BLDC schematic and some Application Notes from Atmel and NXP. Seems that we need from the ucontroller:
- 6 PWM channels (2 for each phase) to drive mosfets --> drive each phase
- 4 ADC inputs
-- 3 for measure a voltage related to current of each phase
-- 1 for throttle signal input
- 4 Digital inputs
-- 3 for read each zero cross of each phase, for sensorless function
-- 1 for brake grip signal
- Serial RX/TX - for Bluetooth communications/debug

Seems that Arduino is enough for this. Would be great if we could produce a Arduino shield to make this project which I call "EBike Smart Controller".

Olivier prefers to use AVR/Arduino. Arduino seems to be a natural selection. I will go with Arduino and I am sure I can prototype by hand a shield for it.

Firmware may be a bit complex... I would love to get help and testing from others.
For Android smartphone I can make some simple application, to show the velocity, current and voltage of the motor. I want to be able to setup the controller maximum current on the Android application.

Hardware for this project is nothing complex (thanks also to Open-BLDC project), but as I see, I will need to setup a testing bench with the Cute-85 24V 250W motor, variable power supply 30V 10A and oscilloscope. Something like on this video:
[youtube]R1iujkJJAFw[/youtube]

For now I will build the testing bench and record with oscilloscope the actual wave signals of the motor using the original KU63 controller.
I will also buy 2 Arduinos and 2 Bluetooth serial modules from Dealextreme.
 
I found a link on Open-BLDC site to another OpenSource project: BLDC HV Controller (also OpenSource, sure). Looks like Open-BLDC project uses the same hardware (mosfets, current measure, etc) as this project. But BLDC HV Controller uses ATmega8 ucontroller, which is almost the same as the one on Arduino :)

BLDC HV Controller -- is very well documented!! Now this project is my reference and not the Open-BLDC.

I took some images with my cheap oscilloscope, of my Cute-85 24V 250W motor, controlled by KU63 and using 24V lab power supply. The motor didn't had any load:
7051310511_a33f92b503.jpg


7051312713_486b806530.jpg


6905223120_3933763b25.jpg


7051311487_44fe5e0697.jpg


6905221588_c1bbfe18de.jpg


Throttle at maximum/motor at full speed:
7051312153_37095668ef.jpg


Please see all the 32 images here.
 
My workbench:


While looking at LM339 (quad comparator) signals on my KU63 controller:


KU63 have one LM339 (quad comparator) and on 3 comparators there is a signal that I believe to be related to BEMF.
It also have 6 mosfets, 2 for each phase. Since each phase have one must have 2 switch/mosfet, one to connect the phase to GND and the other VCC, each mosfet holds the 12A.


HEY!! I just found a site with a schematic and much more info about KU63 controller!! :)

And here I video showing 1 phase and later 2 phases, on oscilloscope:
[youtube]lHSSEmfGem8[/youtube]

Images of the 3 BEMF signals of LM339:
6907844532_ffcb2c4e87.jpg


6907844902_9920e30f24.jpg


6907845280_920e0760ea.jpg
 
Hi Jorge,

The KU63 costs only about $15 and is not bad, it is small and light and gets hardly warm under load. Building a motor controller is pretty much work, it must have a lot of meaningful extra opportunities, otherwise it makes less sense.

-The following extras would be very welcome:
-Sine wave output (created by PWM) to increase motor efficiency, without adding significant weight and costs.
-Maybe a simple kind of sinus would be better, to overcome the extra motor losses due to the higher frequency that is required to create a sinus.
-Pedelec Legalisation Device built in.
-Anti-spark circuit built in.
-Speed switch input.
-SMPS for the internal supply voltages (12V and 5V).
-Output for speed, current, voltage, etc. has already been mentioned.
 
avandalen said:
Hi Jorge,

The KU63 costs only about $15 and is not bad, it is small and light and gets hardly warm under load. Building a motor controller is pretty much work, it must have a lot of meaningful extra opportunities, otherwise it makes less sense.
You are correct. From now on, I see 2 options: or hack the cheap KU63 or build my own.

avandalen said:
-The following extras would be very welcome:
-Sine wave output (created by PWM) to increase motor efficiency, without adding significant weight and costs.
-Maybe a simple kind of sinus would be better, to overcome the extra motor losses due to the higher frequency that is required to create a sinus.
What are the required hardware for that? is the same switchs/mosfets but high speed ucontroller?

avandalen said:
-Pedelec Legalisation Device built in.
Easy to implement, I think. Just firmware.

avandalen said:
-Anti-spark circuit built in.
I saw in your site, thank you for sharing.

avandalen said:
-Speed switch input.
-SMPS for the internal supply voltages (12V and 5V).
-Output for speed, current, voltage, etc. has already been mentioned.
Relative easy things.

avandalen, thank you for sharing KU63 schematic!! Could you please compare the BEMF with the Open-BLDC BEMF circuit? Which circuit have most advantages?

Don't you want to help to build this Smart Controller?
 
avandalen said:
What are the required hardware for that? is the same switchs/mosfets but high speed ucontroller?
Yes that is true.

avandalen said:
Could you please compare the BEMF with the Open-BLDC BEMF circuit? Which circuit have most advantages?
I dont see serious differents.
BEMF has a SMPS for the 12V, that is fine.
Open-BLDC BEMF has no 36V input?

It is easy to take the back emf detection from the KU63.


avandalen said:
Don't you want to help to build this Smart Controller?
I have no time now, the solar bike must be finished first.
 
avandalen said:
avandalen said:
What are the required hardware for that? is the same switchs/mosfets but high speed ucontroller?
Yes that is true.
I am using on a project the LPC175x ARM Cortex-M3 @ 100MHz. It should work, I believe. But for now, I wish I could do the same as KU63 and AVR/Arduino should be enough.

avandalen said:
avandalen said:
Could you please compare the BEMF with the Open-BLDC BEMF circuit? Which circuit have most advantages?
I dont see serious differents.
BEMF has a SMPS for the 12V, that is fine.
Open-BLDC BEMF has no 36V input?
Open-BLDC BEMF circuit (hardware V0.3) seems simple but I can't understand how it works. I need to read more about "star voltage" and maybe build the circuit and test it.

avandalen said:
avandalen said:
Don't you want to help to build this Smart Controller?
I have no time now, the solar bike must be finished first.
Ok, good luck with your solar bike project.
 
I bought 2 new KU63 controllers, so, I will have soon 3 KU63 controllers. I plan to exchange the microcontroller of the KU63 controller and use a small board with LPC2103 ARM 32bits @ 50MHz.

I can't yet understand how to put KU63 BEMF circuit working and so the first thing I would like to do is running the motor without feedback from BEMF, as on this video from Open-BLDC:
[youtube]Xigl9tx2mrc[/youtube]
 
I reviewed the Atmel AVR processors some time back, and the one most suitable for this type of application is the ATmega32M1. It has a Power Stage Controller in the chip that has the proper PWM setup and other hardware to support BLDC control, as well as some special hardware to facilitate rapid fault detection and shutdown. This CPU is very similar to the Arduino processor so it should be straightforward to make an Arduino loader for it.

If fancier controls are desired review the ARM processors and look for those that have BLDC motor hardware. However this raises the complexity (and the capability) a lot. Some of the PIC processors have good motor controls too, but the free tools are not as good.

Probably the best approach would be to make an Arduino MEGA shield that had the motor controller CPU, leave the Arduino MEGA to do the housekeeping and user interface (run a graphics display to handle CA type functions), and dedicate a shield with whatever processor to do the actual motor controls. Make it so two of them can be stacked on for dual drives (use I2C or similar for the communications).
 
Alan B said:
I reviewed the Atmel AVR processors some time back, and the one most suitable for this type of application is the ATmega32M1. It has a Power Stage Controller in the chip that has the proper PWM setup and other hardware to support BLDC control, as well as some special hardware to facilitate rapid fault detection and shutdown. This CPU is very similar to the Arduino processor so it should be straightforward to make an Arduino loader for it.
What I don't like on AVR is the lack of OpenSource debugger. I prefer ARM because I use the JTAG and GNU Debugger. Open-BLDC uses ARM STM32. Looking at the inputs and outputs of KU63 schematic, seems to me that any simple microcontrooler with (or even without) PWM and ADC will work.
 
Back
Top