• Hello ES! We could use some help to get us past the finish line on building the new knowledgebase for the forum.
    Can you donate? Please see our fundraising page. Thank you!

Motor Controller with Customizable Electronics, easy DIY and repair OpenSource

Any updates on this project ? I think casainho has a point when moving to vesc platform, but so far there are no vesc controller available with good hw that are easy to repair.
 
Any updates on this project ? I think casainho has a point when moving to vesc platform, but so far there are no vesc controller available with good hw that are easy to repair.

After my last update, FOC (hall sensor based) was verified to work with blackpill (F401, fixed point as well as floating point math) also. Blackpill needed a few minor modifications (removing diode in 5V trace at the minumim), but not this power board.

I tested current controlled PAS (& assist level selection) and throttle w/ my custom firmware.

So hardware has been verfied to work with both bluepill & blackpill by me & @mxlemming on blackpill (per his earlier post). I used 0.5.x version of h/w, while mxlemming, IIUC, used 0.5.2, but both are same except for the round PCB edges.

Yes, I understand that w/o f/w, h/w is a kind of paper weight. My firmware is entangled w/ some code that I wanted to keep it to myself, so I need to separate out that portion & the remaining portion (FOC sensored, basic PAS & throttle support). And then I can publically release the f/w that would be needed to provide the functionalities one is expecting of this board.

Or, mxlemming's has run MESC w/ blackpill, and MESC f/w is available ATM in public, so probably MESC can be used, but you would need to check w/ mxlemming.

I plan to get back to this project after a month.

But if you are looking for a DIY VESC ATM, perhaps you can look at the MP2 ESC project. IIRC, w/ F405 pill, people have been trying to run VESC on MP2 ESC.
 
Clicked the reply button accidentally before completing the post, so to continue:

Making this board compatible with MP2 pinout is a to-do, in that case, work done for running VESC on MP2 can be exploited here ;)
 
i am making an esc for my project but i have a motor for 72V 3KW i want to know if i can use this scematic for my project and also i wanted to change the microcontroller to esp32 will it work if it dosent work i am thinking of lovering the voltage to 60V from 72V with a dc converter i thanke you for answer in advance
 
i am making an esc for my project but i have a motor for 72V 3KW i want to know if i can use this scematic for my project and also i wanted to change the microcontroller to esp32 will it work if it dosent work i am thinking of lovering the voltage to 60V from 72V with a dc converter i thanke you for answer in advance
Esp32 isn't a good choice for motor control. The ADC isn't much good which is critical. It has pwm and fast enough computation so it could be made to work but performance will never be great.

Adding a dcdc between power source and inverter is never a sensible option. You end up needing huge magnetic components to switch that amount of power and you suffer the losses and heat generation.
 
Firmware (v4.0) for Easy DIY ESC is available on Codeberg e.V., ede-fw

It has been verified to work on 0.5.x h/w version, tested w/ geared hub motors (the so called 250W ones) as well as on gearless.
The firmware released here has been tested only on cycle trainer*.

Features:
FOC, options - SVM, ZVM, PWM selectable at compile time
Position sensing - Hall, auto-detection (hold e-brake & turn-on w/ wheel in air)
Control - current based via throttle (J8:2)
Protection: overcurrent, FET temperature
E-brake (J5:6)
FOC algorithm in per unit, agnostic to bus voltage & compare registers
Math - floating point

PAS is not currently supported, planned for future.

Power board: Easy DIY ESC v0.5.x
Processor board: Black pill 401, need a few modifications, refer readme.txt
Host OS: Linux
License: GPL-3.0-or-later (refer sbom_crude.pdf/txt for more details)

Development started on STM32F103, then moved to STM32F401 fixed point & then to STM32F401 floating point along w/ fixed point (FOC isr duration on fixed point was only ~60% as compared to that of floating point and without any perceivable difference in performance). But then gradually started to concentrate only on floating point resulting in fixed point code rot & breakage. So ATM only STM32F401 floating point is supported, some of the code shared b/n fixed & floating point as well the broken fixed point code (F401 & F103) has been left as is to ease fixed point resurrection.

Code has been developed such that processor from any silicon vendor can be easily integrated, ATM only ST is supported.

FOC algorithm expressions has been written as is based on the understood math, no math optimizations has been done, that is a todo.

Code has been organized with an emphasis on readability, compile time selection inside functions has been avoided to a considerable extent. Coding style is K&R, except for the source files originated elsewhere (& not modified heavily) to not break the reading flow.

Burden off my shoulders!

[ The release has been considerably delayed due to personal & multiple health reasons.
* I haven't ridden (e)cycle on road for almost a year and the release here has been tested only on cycle trainer, will be doing road test in the near future. ]

Edit: release tag addition
 
Last edited:
Hello Y'all...
The best design to make a full-foc controller is this one I think, that's why I want to make one. One thing is not clear to me..
in the schematic we have to use PC13, 14 and 15 for the hall input. But the software tells us in main.h that we have to use GPIOB 4, 5 and 0. I also read that PC13, 14 and 15 of the STM32 are the 'weak' IO-pins... So I'd like to know: which way to go?? Can someone help me out?
Thanks.....
 
Hello Stancecoke!
Thanks for the quick answer to my question... The main.h is part of the Github EBICS_motor_foc files that I thought where part of the design? It's in the 'inc' map...
But your answer is clear to me! Thanks!
 
I thought where part of the design
I think this project is outdated. Perhaps you should take a look on this:

It works with various firmware projects, VESC, MESC, EBiCS....

What do you want to do with the controller?! Riding a bicycle? Riding a motorcycle?
 
What do you want to do with the controller?! Riding a bicycle? Riding a motorcycle?
I am going to build a recumbent bike as you can see in my photograph of my message. I have BionX motors. One of them was rebuilt by me to allow external control. That's the one i am going to use for my three-wheeled bike. The other one stays as it is to use for my Trek bike controlled by BionX Minimal Translator...
 
I have BionX motors. One of them was rebuilt by me to allow external control.
Why do you want to build your own controller? There are really good, cheap Chinese controllers available. I ran my BionX IGH3 on a Dutch Gazelle with a bottom bracket torquesensor and regen on a Lishui controller for years.:cool:

Btw, great to hear, that someone still uses the BMT! (y)
 
According to Google the INNOTRACE controllers take the lead withing the controllers with customizable electronics for electric bicycles! So maybe you better to stick with the INNOTRACE controllers.


1782106357440.png
 
Last edited:
Why do you want to build your own controller? Stancecoke said..
Well I am almost 76 years old now and still curious about a lot of things. Never build a full-FOC controller before.
And I like to be 'in control'.....!
I have a S06S controller lying around from BMSBattery with new programmed software, it works OK, but it has only semi-FOC control. Are these Chinese controllers to be trusted? Are they really sinedoïal and FOC controlled? I can't tell! I'm not good at making software not even in the Arduino-style. I was in to Atmel and assembly language. But that's not modern anymore. So I'm glad that I'm able to use your nice schematics and beautiful firmware to find here at endless-sphere!😃
 
Are these Chinese controllers to be trusted? Are they really sinedoïal and FOC controlled?
For the Lishui FOC controller, it is an open book. We have reverse engineered the pin functions of the processor and a working open source firmware for it. We even have the Gerber files for the reverse engineered circuit, but I see no sense in building a PCB myself, if I can buy it professonally produced in high quality for a reasonable price.
 
Last edited:
Well I am almost 76 years old now and still curious about a lot of things. Never build a full-FOC controller before.
And I like to be 'in control'.....!
I have a S06S controller lying around from BMSBattery with new programmed software, it works OK, but it has only semi-FOC control. Are these Chinese controllers to be trusted? Are they really sinedoïal and FOC controlled? I can't tell! I'm not good at making software not even in the Arduino-style. I was in to Atmel and assembly language. But that's not modern anymore. So I'm glad that I'm able to use your nice schematics and beautiful firmware to find here at endless-sphere!😃
That's so cool in your age
 
Back
Top