DIY Controller w/ Android Integration

velorider562

1 µW
Joined
Oct 28, 2019
Messages
2
My buddy owns a bike shop and he recently gifted me a Faraday for my wife. My wife loves it because it looks like a bike and most importantly can now keep up on evening rides. From different reviews the Faraday has its share of problems but the implementation is really well executed. I spent the last few weeks reading posts here on Endless Sphere about others DIY eBike projects. Now that the eBike bug has bitten me I think it would be cool to convert on of our beach cruisers into a very simple eBike for errands and when friends come over. Since my other hobby is electronics I think it would be fun to create an open source controller. I was intrigued by the lack of a community supported controller. I found posts regarding reverse engineering controllers, and wire hacking with Cycle Analyst. So I ordered a few parts from Alibaba and while I waited, started designing a controller. By profession I’m a software developer in the electronic space and an avid cyclist, so this is the perfect project for my skills.

I’ve read many posts regarding driving brushless DC motors with different wave forums. Doing some google’ing I found a post on Digikey.com about driving brushless motor and details on some dedicated brushless dc driver chips. I figured regardless of how much time I put into trapezoidal, sinusoidal and field-oriented control software it would not perform better than a dedicated chip from Texas Instruments, Microchip, Allegro, or any of the other multi-billion dollar semiconductor companies. This also allows me to focus on the awesomeness aspect. So my design separates the main logic from the brushless DC driver. There are many advantages to this design, first being the volt and amp requirements can be beefed up for larger system while the control interface remains the same. The brushless driver board is a daughter board to the main control board. Currently, I’m using the commonly available JYQD DC Brushless Motor Controller commonly available on eBay and Amazon for about $15. The board is rated up to 500W when using a heat sink. If in the future more power is required, I or anyone, can design a different daughter board with more amp and heat dissipation capacity.

Using the daughter board allows me to focus on the aspects I think are lacking in the currently available controllers. First being the “bike” computer. I haven’t seen many eBikes that don’t already have mounts for smart phones and “bike” computer. I thought it would be much cooler to have bluetooth connection between the controller and phone so all the stuff currently displayed on the “bike” computer can be integrated into a smart phone app, plus a lot more. All important data is streamed to the phone using a messaging protocol, analogous to CANBus message, the system used by modern cars to connect all the different computer modules. This allows information like bike speed, hub speed, brake on/off, battery level, etc be streamed and displayed on your phone. Additionally the phone can send messages back to the controller for configuration settings and for features like disabling the motor, equivalent to a digital lock.

The current status is I completed the design of the board and am sending the design to OshPark to get 3 copies made. General turnaround time is a couple weeks so hopefully in a couple weeks I’ll have a working and functional controller. I posted some additional design details on the github page, https://github.com/jpetrocik/EloController . I have not posted any firmware yet since I have only tested the different circuit modules separately on prototype boards. Once the board arrives I’ll be able to stitch the firmware together and post on github.



My plan is to post updates here in hope others find it interesting and a place to contribute ideas. I’m sure there are some thinking why reinvent the wheel, but I don’t think I am. I moving things forward. Cycle Analyst is a great product but without true integration into the controller it’s limited, and with controller features coming out of factories overseas they aren’t very attentive to the DIY community needs. This is the first post and my immediate goals are to convert a beach cruiser to a simple eBike with a DIY controller with Android integration.
 
velorider562 said:
I was intrigued by the lack of a community supported controller.
There are some; this doesn't find them all, but it finds threads that might find others:
https://endless-sphere.com/forums/search.php?keywords=open+source+controller*&terms=all&author=&sc=1&sf=titleonly&sr=topics&sk=t&sd=d&st=0&ch=300&t=0&submit=Search

VESC is OS and has many variations including several ebike versions in progress here on ES, probably others elsewhere.
https://endless-sphere.com/forums/search.php?keywords=vesc&terms=all&author=&sc=1&sf=titleonly&sr=topics&sk=t&sd=d&st=0&ch=300&t=0&submit=Search

There is also the Lebowski controller brain (and several powerstage projects), which while not OS has many people working on variations of it.
https://endless-sphere.com/forums/search.php?keywords=Lebowski&terms=all&author=&sc=1&sf=titleonly&sr=topics&sk=t&sd=d&st=0&ch=300&t=0&submit=Search

I haven’t seen many eBikes that don’t already have mounts for smart phones and “bike” computer.
? Most ebikes have no mounts for such things. Some have a display of sorts, but it's not a computer or controller (That's all in the actual controller box)--it's just a display that reads serial data from the controller's output, and sometimes can also send data from button presses on the display to the controller to change settings. (see the KT KunTeng Kun Teng / LCDx open source firmware threads by Casainho, Stancecoke, et al.)

There are a few that have such mounts, I'm sure, though I cant think of any by name ATM.



I thought it would be much cooler to have bluetooth connection between the controller and phone so all the stuff currently displayed on the “bike” computer can be integrated into a smart phone app, plus a lot more. All important data is streamed to the phone using a messaging protocol, analogous to CANBus message, the system used by modern cars to connect all the different computer modules. This allows information like bike speed, hub speed, brake on/off, battery level, etc be streamed and displayed on your phone. Additionally the phone can send messages back to the controller for configuration settings and for features like disabling the motor, equivalent to a digital lock.
There are a few controllers (powervelocity, etc) that can do some of that, with threads here on ES about them. Some BMS's can also do this, for battery monitoring/etc. I don't know if any of them are OS, but you might poke around to see if any of the stuffa bout them will help you.






My plan is to post updates here in hope others find it interesting and a place to contribute ideas. I’m sure there are some thinking why reinvent the wheel, but I don’t think I am.
Never hurts to have more variations; everyone has different needs, so this one will fill that for some that nothing else does now.

Hopefully some of the stuff I mentioned will help you out. I'm not an engineer or programmer; I'm just good at information gathering and processing, and I've read or at least glanced thru quite a lot of ES.

(At one time I was trying to get people to help out creating an Android / Windows / whatever GUI for Incememed's SFOC5 controller, but it went nowhere (I can't do it myself; I just know what it needs to be able to do); ended up giving up on it. There's a thread somewhere if you're curious.)
 
Thanks for all the information. There is so much information to catch up on. I've been in Singapore so I wasn't able to respond earlier. I sent the board off to OshPark just before I left so I'll have an update in a few weeks.
 
Ebikes are not only the motor controller but also the display.

We had being developing OpenSource knowledge and firmware for popular, cheap, widely available ebike motor controllers and displays. There is the SW102 display that includes Bluetooth.

My suggestion is for you to pickup the TSDZ2 motor controller and do your version based on it, then, you will have our OpenSource firmware ready working including the displays.
Or pick up the KT motor controller with also our OpenSource firmware.

See our wiki on github: https://github.com/OpenSource-EBike-firmware/TSDZ2_wiki/wiki

[youtube]IrWn6e8bIuQ[/youtube]

Bafang_850C_color_LCD_TSDZ2-wheel_speed-66.jpg


Bafang_850C_color_LCD_TSDZ2-configurations-66.jpg


SW102-01.jpg


SW102-02.jpg
 
Back
Top