OpenSource bike "brain"

guancio

10 mW
Joined
Jun 4, 2019
Messages
31
Hi all, I'm quite new to this forum. After reading the forum I would like to share some design ideas for a new open source bike "brain" and ask for feedback. My goal is to develop a platform for a flexible central computer that controls several bike peripherals, provides several standard functionalities (including standard multiple PAS level, offroad mode, torque assistance, etc), but that also permits to experiment crazy ideas:
* auto light on/off
* GPS bike alarm
* regulation of assistance level using GPS and bike inclination
* anti wheelie
* automatic gear shift (if connected to shimano Di2)
* regulation of assistance level using heart rate
* etc

To my understanding, the most versatile existing solutions are:
* Cycle analyst
* The flexible opensource by casainho
* Open source controllers, like VESC

All these projects are amazing. Honestly, the their features make probably my effort pointless. My goal is to handle some of the existing limitations
* Cycle analyst
This seems to be the most advanced bike "brain". I define a bike brain a component that receives sensor inputs and is decoupled from the motor controller. I really like this design, since it allows to be compatible with multiple controllers and input sensors.
By a user perspective, these are the limitations of CA that I do not like. The display is coupled with CA and it is quite ugly. Buttons are on the CA. There is no companion Android app
By a developer perspective, the main limitation of CA is that it uses closed source SW and HW. We cannot experiment with new crazy functionalities. We cannot develop a bridge to control CA and to receive CA data from a Garmin head unit or from a smartphone app.

* The flexible opensource by casainho
This seems the most adopted open source controller. Even if it fulfills several of my requirements, it is built on closed source HW. I've nothing against closed source HW. However, this prevents me from extending the platform with new sensors and actuators. How can we connect a Bluetooth phone (actually there is a mechanism to connect a bluetooth module to the serial interface, but this prevents the usage of other handlebar display)? We cannot connect a front wheel speed sensor (i.e. to implement an anti wheelie mechanism) or a gyroscope. From a user perspective, doing HW modification to a controller is complicated and prevents the usage of other controllers.
By a developer point of view, developing new features is quite complicated since they should not interfere with resource requirements of the FOC controller.

* New opensource brain
My goal is to develop a new opensource brain. The idea is to decouple the brain from the controller (like CA) and the display. I'm planning to use a simple development board (probably Arduino zero or microbit). The board will be connected to all sensor inputs (PAS, throttle, additional buttons, gear sensors, break sensor, speed sensors, amp sensor) and will use the throttle signal (an the e-brake signal) to control the controller. If needed, the brain can also use a UART to initiate configuration of the controller. The brain will be connected to other devices like automatic shifter or display using UART interface and digital outputs. Finally, interaction with mobile phone can be provided by Bluetooth.
My feeling is that by decoupling controller, brain, display, phone, and other devices (i.e. shifter) we can simplify the development of new features.

Please feel free to comment.
 
Its a good idea and I don't think its pointless at all. People use their light EVs in so many different ways.

Check out the "forumscontroller" on the German ebike forum. https://www.pedelecforum.de/wiki/doku.php?id=elektrotechnik:forumscontroller

It has pretty similar features to the cycle analyst but is fully open source and uses Arduino.
 
Thank you. That project looks amazing. I'm definitely give it a try, maybe I'll start to document the process in English, since the current documentation is in German.
 
guancio said:
To my understanding, the most versatile existing solutions are:
* Cycle analyst
* The flexible opensource by casainho
* Open source controllers, like VESC
I ma very happy others mention to the projects I did start and that I think make a big difference.

There are very successful OpenSource projects/products, like VESC for eskates.

I think hardware projects are way harder, because hardware costs a lot of money for development. I really wish you good luck and please take advantage of all knowledge of our OpenSource projects. I did learn a lot and I use technology from other OpenSOurce project, that was the only possible way to be were we are.

A difficult is how to put cheap/accessible hardware in the hand of users. I decided to focus on cheap, wide available motor controllers/motors. Chinese are very goo on that and even because they use well know standard ICs, circuits, that is very important to easy development!!

About Bluetooth, we are adopting the Bafang SW102 Bluetooth LCD which is widely available and is kind of cheap: https://github.com/OpenSource-EBike-firmware/Color_LCD/wiki/Bafang-LCD-SW102
 
Thank you for your support. I think your firmware is an amazing product. I totally agree with the goal of supporting cheap HW. The main reason I plan to use an Arduino or similar board is to provide a platform that can be easily hacked, without requiring to modify controllers or display.

I've reasonable experience in developing high level and operating system code. However I've basically no experience on real-time and controllers. Another option I'm taking into consideration is to port the flexible opensource firmware to Arduino (removing the FOC part, since my plan is to implement a controller independent brain).
 
casainho said:
I think hardware projects are way harder, because hardware costs a lot of money for development. I really wish you good luck and please take advantage of all knowledge of our OpenSource projects. I did learn a lot and I use technology from other OpenSOurce project, that was the only possible way to be were we are.

For now I've decided to experiment porting your TSDZ2 firmware to Arduino (https://github.com/guancio/TSDZ2-Smart-EBike). In general I think the main part of the system (with exception of the FOC controller) can be used also as standalone brain. For now I'm just playing with some preprocessor statements, but my idea is to create a small HardwareAbstractionLayer that enable to firmware to run on Aeduino and STM8s

casainho said:
About Bluetooth, we are adopting the Bafang SW102 Bluetooth LCD which is widely available and is kind of cheap: https://github.com/OpenSource-EBike-firmware/Color_LCD/wiki/Bafang-LCD-SW102
Interestingly, one of the HW platform I would like to use for the "brain" is microbit, which shares the same HW
 
Back
Top