Go Back   RCCrawler Forums > RCCrawler General Tech > Electronics
Loading

Notices

Thread: Open source ESC and firmware

Reply
 
LinkBack Thread Tools Display Modes
Old 03-10-2019, 08:55 AM   #1
Rock Stacker
 
Join Date: Mar 2019
Location: Canada
Posts: 60
Default Open source ESC and firmware

Hi ,

In case there are some people who like diy electronics. Here is a cheap brushless speed controller I made that works decently well at low rpms for crawlers. There is also firmware that is open source, also has car modes and quad modes. Here is a little video of it with a 17 dollar brushless 3650 inrunner on a hgp402. Cost of the ESC in parts is about 10 dollars.
I started it because good speed controllers cost too much for me but I still wanted drag brake and good low control for sensorless motors. Plus I can't stand speed controllers that put out audible pwm frequency. I like to just hear the gears clacking!
https://youtu.be/grsFjtRrNT4

EDIT added brushed mode : Will be pushed to GITHUB here https://github.com/conuthead/f051bld...rsion2Sept2019

Last edited by Alka; 09-30-2019 at 07:02 PM. Reason: adding github link
Alka is offline   Reply With Quote
Sponsored Links
Old 03-10-2019, 09:18 AM   #2
Moderator
 
JatoTheRipper's Avatar
 
Join Date: Sep 2008
Location: PA
Posts: 13,935
Default Re: Open source ESC and firmware

Awesome! Very cool project!
JatoTheRipper is offline   Reply With Quote
Old 03-10-2019, 11:41 AM   #3
RCC Addict
 
Join Date: Feb 2017
Location: Surprise
Posts: 1,762
Default Re: Open source ESC and firmware

I did not know esc's didn't have to make noise, I learn something new everyday. What a trip TO ME. Cool job.
Frank211 is offline   Reply With Quote
Old 03-10-2019, 07:15 PM   #4
Rock Stacker
 
Join Date: Mar 2019
Location: Canada
Posts: 60
Default Re: Open source ESC and firmware

Thanks, the firmware is still a little rough. I am still learning myself about stm32.. I want to try a nice motor on a good chassis. The hg p402 I have has really rough gears and the motor is probably not the best for crawling but it does ok. I can't really change pinions to a smaller size to get a better gear ratio so I ordered a tenshock 906 1250kv 6 pole motor to play with. I really want to try the Holmes revolver but the budget doesn't quite allow for it right now.
The idea is that this firmware will work on all sorts of cheap commercial quad esc's and just about any motor to give a decent experience.

This is the link for the firmware source..
https://github.com/conuthead/f051bldc
Alka is offline   Reply With Quote
Old 03-11-2019, 12:52 PM   #5
Rock Crawler
 
Join Date: May 2016
Location: SoWIs
Posts: 618
Default Re: Open source ESC and firmware

Alka this is some great work! I considered something similar but it's more than I want to tackle. I'm curious, would this be compatible with the cheap "blue pill" STM32's (STM32F103C?


Quote:
Originally Posted by Frank211 View Post
I did not know esc's didn't have to make noise, I learn something new everyday. What a trip TO ME. Cool job.
The noise is from the PWM frequency used, generally it's audible because a lower frequency aids slow mosfets (reduces heat). The issue is mostly because ESC producers use craptastic mosfets. There exists modern $2 mosfets that handle 175 amps - and are limited mostly by the case design! Even the p-channel style, which generally can't handle as much power, can be had for under $2 for 100A+. Most ESC's still use a linear regulator for 5v power that was cutting edge 40 years ago, to give an idea how un-evolved some designs are due to cost.
Hydrocarbon92 is offline   Reply With Quote
Old 03-11-2019, 01:37 PM   #6
Rock Stacker
 
Join Date: Mar 2019
Location: Canada
Posts: 60
Default Re: Open source ESC and firmware

Quote:
Originally Posted by Hydrocarbon92 View Post
Alka this is some great work! I considered something similar but it's more than I want to tackle. I'm curious, would this be compatible with the cheap "blue pill" STM32's (STM32F103C?

The noise is from the PWM frequency used, generally it's audible because a lower frequency aids slow mosfets (reduces heat). The issue is mostly because ESC producers use craptastic mosfets. There exists modern $2 mosfets that handle 175 amps - and are limited mostly by the case design! Even the p-channel style, which generally can't handle as much power, can be had for under $2 for 100A+. Most ESC's still use a linear regulator for 5v power that was cutting edge 40 years ago, to give an idea how un-evolved some designs are due to cost.
You could make it work on the cheap bluepill processors but would need a different sense method..
This is a back emf sensing firmware, there are a couple of different ways to do it.. you can use MCU's that have built in comparators, this is the way most atmega8 and stm32f051 and f3 esc's sense back emf ( comparing phase voltage to neutral voltage ). Without a comparator to do it efficiently you would have to use the ADC ( analog input) and read the voltage of the phases. This works just as well at low speeds but not as well at very high rpms as it takes much more time and overhead. The blue pill stm32f1 series does not have built in hardware comparators and so must use the adc. This is just fine for the e-rpms that most in-runners work at though.
When it comes to the f103 vs the f051 i would choose the f051 for speed controllers because its cheap and has comparators.

you are spot on about the mosfets.. every year they get better but some esc's are still using very old very slow mosfets. I have been using toshiba fets with less than 1mohm rdson. They don't even get warm enough to warrant a heatsink on a crawler.

Last edited by Alka; 03-11-2019 at 01:41 PM.
Alka is offline   Reply With Quote
Old 03-11-2019, 02:47 PM   #7
Rock Stacker
 
Join Date: Mar 2019
Location: Canada
Posts: 60
Default Re: Open source ESC and firmware

There are a couple of minor limitations but there is no reason hardware wise why you can't use one brushless ESC to control Two brushed motors. Could be useful for those moa rigs?
Alka is offline   Reply With Quote
Old 03-11-2019, 03:28 PM   #8
Moderator
 
JatoTheRipper's Avatar
 
Join Date: Sep 2008
Location: PA
Posts: 13,935
Default Re: Open source ESC and firmware

There should be way more excitement about this especially on a DIY site like this. Please, keep up the hard work!
JatoTheRipper is offline   Reply With Quote
Old 03-11-2019, 03:49 PM   #9
I wanna be Dave
 
Join Date: Jun 2017
Location: Humboldt county
Posts: 4,482
Default Re: Open source ESC and firmware

Very cool, a bit outside of my wheelhouse so I dont know what I would do with it.

I sent a link to my brother who should be very interested in this.
HumboldtEF is offline   Reply With Quote
Old 03-11-2019, 04:12 PM   #10
Rock Stacker
 
Join Date: Mar 2019
Location: Canada
Posts: 60
Default Re: Open source ESC and firmware

Quote:
Originally Posted by JatoTheRipper View Post
There should be way more excitement about this especially on a DIY site like this. Please, keep up the hard work!

Thanks, it not very accessible right now. since you have to make your own hardware too. I will work on getting it working on a cheap readily available ESC so you can just flash the crawler-oriented firmware to it.

Meanwhile i will just use this thread as a place to post updates and videos on it as it progresses.
Alka is offline   Reply With Quote
Old 03-11-2019, 04:45 PM   #11
I wanna be Dave
 
Natedog's Avatar
 
Join Date: Jan 2006
Location: Corruptifornia
Posts: 12,107
Default Re: Open source ESC and firmware

Great job, love it, watched your video too! Agree with the mosfet info too.

Last edited by Natedog; 03-11-2019 at 04:48 PM.
Natedog is offline   Reply With Quote
Old 03-30-2019, 07:22 AM   #12
Rock Stacker
 
Join Date: Mar 2019
Location: Canada
Posts: 60
Default Re: Open source ESC and firmware

A Tenshock 906 1250kv motor arrived in the mail yesterday ! I would still love to try the firmware on a Holmes revolver but this is the most i can afford for now. The 906 is much better suited for the tall gearing of the hgp401 than the cheap 2300kv 4 pole motor that was in there before.


I did a quick video this morning trying to climb a nice muddy hill.


https://youtu.be/m0jtybQw0z4

edit: how do you embed a video so you can see the video instead of just the link?
Alka is offline   Reply With Quote
Old 03-30-2019, 07:57 AM   #13
owner, Holmes Hobbies LLC
 
JohnRobHolmes's Avatar
 
Join Date: Nov 2004
Location: Volt up! Gear down!
Posts: 20,290
Default Re: Open source ESC and firmware

Nice work. I assume the hardware uses basic zero cross detection with comparators?
JohnRobHolmes is offline   Reply With Quote
Old 03-30-2019, 08:27 AM   #14
Rock Crawler
 
Join Date: Mar 2009
Location: West of Eugene, OR
Posts: 942
Default Re: Open source ESC and firmware

RC + RC Nerds = freakin rad. Nice work. Will be watching; would love to see the ESC up close, parts list, if you're willing to share.
JeepinOR is offline   Reply With Quote
Old 03-30-2019, 08:38 AM   #15
owner, Holmes Hobbies LLC
 
JohnRobHolmes's Avatar
 
Join Date: Nov 2004
Location: Volt up! Gear down!
Posts: 20,290
Default Re: Open source ESC and firmware

The github has all that, or will
JohnRobHolmes is offline   Reply With Quote
Old 03-30-2019, 08:55 AM   #16
Rock Stacker
 
Join Date: Mar 2019
Location: Canada
Posts: 60
Default Re: Open source ESC and firmware

Quote:
Originally Posted by JohnRobHolmes View Post
Nice work. I assume the hardware uses basic zero cross detection with comparators?
Yes this uses comparators, this was really designed to work on basic quadcopter esc's and the most common hardware. The adc works too for the same but there is no benefit without changing the bemf sense divider.

There were a number of things I was trying out. The bemf detection with comparators is pretty decent but needs a lot of filtering at the low end, once the speed gets very low some open loop driving is neccesary for smoothness.
I have tried a couple other methods that are more promising for the low end but more limited for very high erpm, I haven't really been focusing on them as the hardware is more specific.

.. slightly better is bemf detection during off time but not using a voltage divider ( just a diode to clamp bemf beyond the pin range). This is very sensitive but uses adc so its becomes tricky at high e-rpm, also you would not be able to obtain 100 percent duty cycle without switching the divider back on. I have an example with a prop on youtube but this is very raw.

The other promising methods of bemf detection is to use the embedded op-amps on the stspin32f0 chips kind of like comparators. The output of the op-amps is routed straight to an input pin and can then be read digitally. It seems to have the sensitivity of the adc but the high speed of the comparators.

Also tried foc but the cost goes up by a few dollars per board and the setup is more complicated.
The other two versions are available for testing but not open source yet.

Last edited by Alka; 03-30-2019 at 01:53 PM.
Alka is offline   Reply With Quote
Old 03-30-2019, 09:01 AM   #17
Rock Stacker
 
Join Date: Mar 2019
Location: Canada
Posts: 60
Default Re: Open source ESC and firmware

Quote:
Originally Posted by JeepinCA View Post
RC + RC Nerds = freakin rad. Nice work. Will be watching; would love to see the ESC up close, parts list, if you're willing to share.

The schematics and gerbers and all that for this esc are all in this post . You will need the freeware version of diptrace to open the files.
I made the esc at first for use in qudacopters but the test version was way to big so they got moved to crawlers and trucks.
If you get diptrace I can give you a number of different variants depending on the size, current voltage and features you want.

https://www.rcgroups.com/forums/show...051-and-MP6531

There a lot of other stuff there on my blog on rcgroups. If you click on my name from that page you'll see all the posts ( even a speed loop controlled foc version ) . I am really behind in putting stuff up there. I thought making the firmware would be a simpler task than it was !
The goal of the git page is to eventually have all the stuff there, with some instructions.

Last edited by Alka; 03-30-2019 at 09:12 AM.
Alka is offline   Reply With Quote
Old 03-30-2019, 01:58 PM   #18
Rock Stacker
 
Join Date: Mar 2019
Location: Canada
Posts: 60
Default Re: Open source ESC and firmware

Hey JohnRobHolmes! you just hit 20K posts! keep up the good work. Many a youtube search has landed me on your vids. Your technical advice has always been spot on!
Alka is offline   Reply With Quote
Old 03-30-2019, 09:06 PM   #19
I wanna be Dave
 
Join Date: Jun 2016
Location: Austin
Posts: 6,010
Default Re: Open source ESC and firmware

This thread is givin' me a semi...



(way over my head, but I can tell that something seriously cool and forward-thinking is going on)
durok is offline   Reply With Quote
Old 04-01-2019, 11:30 AM   #20
owner, Holmes Hobbies LLC
 
JohnRobHolmes's Avatar
 
Join Date: Nov 2004
Location: Volt up! Gear down!
Posts: 20,290
Default Re: Open source ESC and firmware

Quote:
Originally Posted by Alka View Post
A Tenshock 906 1250kv motor arrived in the mail yesterday ! I would still love to try the firmware on a Holmes revolver but this is the most i can afford for now. The 906 is much better suited for the tall gearing of the hgp401 than the cheap 2300kv 4 pole motor that was in there before.

I think your efforts are enough to trade you a revolver for some questions I have
JohnRobHolmes is offline   Reply With Quote
Reply



Open source ESC and firmware - Similar Threads
Thread Thread Starter Forum Replies Last Post
OEM Castle Esc reflash firmware Di_Spencer Electronics 9 12-06-2016 11:36 PM
Open source chassis Savagethrash Axial XR10 2 03-22-2015 06:12 AM
TorqueMaster ESC 1.08 firmware released JohnRobHolmes Electronics 13 03-04-2011 06:23 AM
Xcelorin ESC firmware download Del Monte Team Losi Comp Crawler 16 03-09-2010 12:07 PM
Open source or free sw to replace Autocad setecastronomy Tools, and Procedures 16 04-28-2009 06:24 AM

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -6. The time now is 09:29 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Content Relevant URLs by vBSEO ©2011, Crawlability, Inc.
Copyright 2004-2014 RCCrawler.com