AlkaM's blog View Details
Posted by AlkaM | Sep 15, 2021 @ 01:11 PM | 12,429 Views
First off thanks to Bob for the idea and the testing.

A while back I was approached with the idea of making a brushless speed controller that would work on a standard slot car track. There were a number of challenges that we had to solve in order to make this possible. We needed an esc that would turn on and run at a very low voltage, self start and run as soon as current was sufficient. The goal was to make the brushless motor work and feel much like a brushed system where the speed is controlled by varying the input voltage.

The hardware for sub 2v ESC
The stm32g071gbu6 MCU was used
No gate drivers, We are not worried about switching speed as the esc will be in 100 percent duty cycle operation at all times.
Texas Instruments low gate threshold voltage P and N mosfets are used,
Attached you will find a PDF of the schematic. Also the kicad project files. with layout and gerbers

The Software
The firmware is a modified version of AM32 with the signal detection, arming and throttle removed.. replaced by starting at 100 percent immediately. Please physically mark any esc's that have this version of the firmware on, it's not safe for other applications!
The auto startup can be halted by applying a solid high signal to the input. This will make the ESC enter the bootloader mode where it can be re-programmed or settings altered.
A built binary for the board is also attached.
There firmware and github project can be found here: ( will be added soon)

please feel free to use the chat for any questions about the ESC or brushless slot car control in general. If there are any other slot car drivers out there let me know what you think.

Brushless2 (0 min 44 sec)

Slot car ESC, operation from 2 to 17V. 100k Rpm. (0 min 32 sec)

Posted by AlkaM | May 28, 2020 @ 08:56 PM | 13,773 Views
Many of you will be familiar with some of this already. I skip a lot of things about switching losses and current circulation in the motors. This is about how these two electrical variables affect real world performance. This is to hopefully give an idea of what PWM even is to those unfamiliar.. feel free to post your comments experience down below.
Motors are driven by voltage. In order to control the voltage that a motor coils "pulse width modulation" (PWM) is the process by which this happens. If you have a 12 volt battery and want to run the motor at half speed (6 volts ) you would use pwm with a 50 percent "duty cycle". This means half the time the switches are ON that drive the motors coils and half the time they are OFF.
Pwm frequency ( 24khz, 48khz etc) is the number of times per second that these switches are turned on or off. You could do pwm yourself and probably manage a few switches per second. So picture a toggle switch, when the switch is turned on the current starts to rise in the motor coils and the motor begins to move. When its off the motor will coast and begin to slow down. At a very low frequency like this you can see that it might be hard on a motor as the current goes through large swings with each turn on turn/ off phase. This current ripple creates heat in the motor coils and is a major power loss. To make it smoother you need to increase the frequency. Ideally, to switch fast enought that the current has not enough time to...Continue Reading
Posted by AlkaM | Oct 09, 2019 @ 03:43 PM | 12,564 Views
If you want to have a f4 board that has no features.. look no further!

It's not a bad project to hand solder.. I just used a lighter from the bottom for the gyro ( probably not the best method and the bottom of the pcb gets a little black, but it works) . One of these days I am going to get myself a hot air station.

I made this to try out bi-dir dshot, very basic, just an stm32f405 mcu and a handful of linear regulators, the gyro is nice and stable. It uses the mpu-6000 ( which is discontinued so you will have to find on ebay, but they are out there). Not sure what invensense has out to replace it ?

In the files below you will find a pdf schematic, and a zip file with diptrace files and gerbers. If you want to get a board made the gerbers are in the normal format board places take. You can get 10 of the boards made for 5 dollars since its two layers. I used the Furyf4 pinout for firmware.

Good luck and happy flying!
Posted by AlkaM | May 29, 2019 @ 03:19 PM | 33,629 Views
Its been a while since I have put out any new hardware. The main reason is writing the firmware was much more time consuming than I first thought. Here is another very simple esc schematic. This would be very similar to the "typical" 32 bit esc using the stm32f051 processor and the fortior fd6288 chip. This one has no current sensing or anything fancy. Just a real basic design.
It is a two layer board.. can be printed cheaply at any pcb fab.
The total cost for the parts is about 5-6 dollars using the nexperia psmn2r4 mosfets. It can handle a decent current.. not sure yet what the limit is but I have used the mosfets for many designs now and they work well for the typical load a 3 or 4 inch quad puts on them anyway.

The firmware to use for the esc current can be found here..

Another version of the firmware done by a talented individual with added commercial board support and structure clean up can be found here :
The pinout is a little different but his can more easily support additional targets so should be fairly easy to set up.
(proshot only for this version for now).

There is no configuration tool yet so settings can be changed using dshot commands for rotation direction or 3d mode.

Attached will be a zip file, there are gerbers and driptrace design files inside that can be opened with the freeware version of diptrace. I have a few more simple designs coming as they get tested. I have been using this one for a little while and have a few test flights on a 4 inch quad with 1806 motors.

Edit 2020 : I finally have a patreon account, anyone who wants to help support the project can donate here.

early testing of the esc and firmware..
2 layer ESC test flight (0 min 58 sec)

and some reversing testing.
Reversing in 3d mode. 1806 motor 5 inch prop. (0 min 36 sec)

Posted by AlkaM | Mar 23, 2018 @ 09:29 PM | 25,269 Views
Everything is working as it should, I had one little glitch and blew up one motor in testing but the end result is a custom esc that behaves like an esc should. Responsive and fast. Next step is to make an interface to connect to the pc and change settings.
I am still playing around with different PWM techniques. One PWM pulse per commutation might be a good way to drive motors to very high rpms and avoid any phase locking. This means that pwm frequency will change as motor frequency increases. I am lacking very high rpms motors to test properly with though. Anyway that's for future posts.
It looks a little ridiculous strapping such a big esc on but, I couldn't wait to finalize the firmware or make a normal sized esc. I had to try it out on a quad. I forgot to change the throttle min to a normal range so it starts long before the other motors but that's a minor fix.
First flight with open 32 bit ESC on a quadcopter (0 min 58 sec)

First blog post without a schematic attached but i'll dig one up to put on tomorrow. The schematic for this speed controller is in my last blog post.
Posted by AlkaM | Mar 12, 2018 @ 08:01 PM | 33,035 Views
Well, the last couple weeks of my life disapeared. I decided to try and write my own firmware for a 32 bit speed controller. I used the same processor as the KISS esc and BL_HELI32 because it makes a whole lot of sense. It was a toss up between that and the NXP Kinetis MCU as they both have the right peripherals and about the same price but I figured I would at least make hardware / software compatible with what's out there now. About a year ago I made a schematic for a firmware written by another user, DrDisorder, that was somewhere on here and faded into forum obscurity. Unfortunately it got delayed for a year. I never did get to try it. I also wanted to have regular 1000-2000us servo PWM input and tachometer output and stuff like that.
Stm32f051 firmware progress. 32 bit esc (2 min 49 sec)

Lately I got some MP6531 pre drivers in the mail. I wanted a problem for my solution and made a couple of motor drivers. One using the bb2 silabs chip and the other using the STM32F051. I decided to write firmware from the ground up, one , because I could not understand any of the other firmwares that were out there. ASM looks just bizarre to me. I had never worked with an stm32 processor before so it was a bit of a learning curve just figureing out how to initialize this and that and get things running. After the first few days of mucking around i had an open loop six step motor control going. Thats when the trouble started. I would get the motor going in a stable open...Continue Reading
Posted by AlkaM | Mar 10, 2018 @ 01:06 PM | 25,796 Views
Last year i put up a post with a silabs based blheli_s speed controller using the FAN7888. It can handle a high voltage and is quite a robust driver. After making a few designs with it i realized that it was really quite huge when trying to make smaller speed controllers. When I put together a controller using 3.3mm MOSFETS the driver was actually larger than the mosfets themselves ( see pic)! It was time for a change.
A popular option is the fd6288 from fortior. I couldn't actually find a place to buy one of these at the time, so that was out. Although it does look like a nice chip, I thought there has to be something better.
This is what I settled on.
The MP6531a, it was a fairly new product at the time but it has a few nice little features -- 3 big ones are.
1) An on board voltage regulator with a 5-60v( this is huge, takes away a number of components on the board, only need one reg for the MCU).
2) An on chip overcurrent shutdown and fault indicator. This reacts much faster in the event of a short than relying on the mcu.
3)Built in charge pump diodes ( 3 more components not needed).

So here are some pics of the same basic board with the FAN7888 pre driver and the MP6531 pre driver.
Uses blheli_s "i" firmware.
Schematics and Gerber files and Diptrace source all included in the zip file below.
Posted by AlkaM | Dec 13, 2017 @ 08:10 PM | 35,766 Views

Its been a while since I put up a DIY electonics blog post. I live in Canada so I try to spend my summer outdoors. This next one took me a little while to get right, I made the first revision around June of this year and made a mistake with my original schematic. I built the board and programmed it and everything seemed to work but I could not get a motor to spin up. Thinking this was a software problem I then devoted the next two months adjusting and tinkering with startup parameters and motor profile settings.. It was not a software problem. I had completely screwed up the op amp gain resistors circuit and no amount of changing settings would fix that. A sharp knife and some small wire did fix my problem and after that i was able to get a motor spinning.
I haven't tested much yet but this is a stripped down simplified version of the "steval-stspin32" demonstration board. It has the same pinout for the user keys and potentiometer and the firmware example will run on my board without much modification. I did have to play around with dead time and pwm and foc rates to make my board run and start up stable.
I used the bull running 1700 kv motor that came in another nucleo kit because the motor was already profiled. If using an unknown motor you will have to create a new profile for that motor and recompile the firmware. That's the problem with FOC. You can't just hook up an unknown motor.. and profiling a motor is not a simple thing.

I will include the gerber and diptrace files again like my other posts also a working firmware binary for the bull running 1700kv motor. There is a lot of potential for this little chip as it contains the gate drivers, voltage regulators and mcu all in one. The stspin32f0A is probably a better choice for rc as it has a wider voltage range ( down to 2s lipo).

Simple FOC speed control board using stspin32f0 (1 min 13 sec)

Posted by AlkaM | Jun 01, 2017 @ 12:38 PM | 29,070 Views
This is a very simple esc to build. It actually uses P-fets for the upper switch and switches them through a voltage divider. The bottom n-fet is driven directly from the MCU. I have tested it in a quad on 2s and 3s and on the bench with 1s ( don't have a 1s flight controller to test with). It didn't even explode on 4s with a racerstar 1306 motor !( but most likely would in the air or the motor would smoke). It can't give a current rating but it will be fine for the smaller motors up to 15 amp burst. In practice the motor got much hotter than the esc's for the 1306's.
It's tricky to get the bridge to switch fast enough so the resistor and component choices are critical. There are only a handful mosfets that I know of that would work on the pcb at that switching speed with such poor drive current. Also the pinout for the p-mosfet is different from the norm so look at the parts notes on the schematic carefully if you want to build this. The layout is a for a four layer board but the schematic is pretty basic to make a two layer version.
Uses firmware F_H_90.

Gerber files and schematics and layout in the zip.

Upper mosfet p-channel : CSD25402Q3
Lower mosfet n_channel: CSD17304Q3
Posted by AlkaM | Apr 19, 2017 @ 07:51 PM | 29,996 Views
First off thanks to Steffen , B. Konze, SimonK and everyone who contributed to any of the open source firmwares. I can code a little but having access to well written, up to date firmware has allowed me to make these hardware abominations possible.
I know these escs in my blog aren't revolutionary, the schematics are usual modifications of reference designs datasheet schematics. I make them fast so I can use them for a project then go on to the next one. So they are crude and probably break MANY "best practice" guidelines for pcb design. They do all work and they are all tested but proceed at your own risk if you decide to make one. I hope they are of some educational use to someone out there.

This next esc was a board I was using to play around with BLHeli_S. Its uses a silabs EFM8BB21F16G (bb2) chip but the QSOP version so its really easy to solder by hand. Also the driver is the fan 7888 again. I like the combination as long as space is not a problem. They are not expensive chips. The two switching regulators I used were the same as in the last post the aoz1282 and the ap3012. (Really its the same parts with a silabs chip tossed in there! Remember to set the vreg at 3.3 though). It uses a more typical ESC layout though with the power input on one end and the motor on the other. Since it was a test board there are pin headers for the C2 connections, input signal and ground. Gerber files and diptrace originals in the zip again.

The specs are really...Continue Reading
Posted by AlkaM | Apr 11, 2017 @ 07:02 PM | 28,697 Views
I mean total failure, I plug in wires backward, had countless mosfets blow up in my face, I have vaporized wires , connectors, batteries, pcbs and drivers! I have left scorch marks on my dining room table from things gone awry. I have burnt myself, shocked myself, cut my fingers on props and pretty much failed spectacularly in every single way you can.

When you build circuits failure can be a good thing. My first circuit I built when I was young was from a kit, fm radio I believe.. I followed instructions and it worked , probably good because it got me interested but I didn't learn all that much about electronics. Many years later I decided to make a circuit off of some h-bridge or other from the internet. It seemed very simple.. how hard could it be? It blew up.. not once but multiple times before I learned what I needed to know. I'll never forget the lesson that h-bridge taught me, probably still have scars.

I still do a lot of stupid things.. check out the gallery below for some of my recent blunders.. The point is this.. don't get discouraged by mistakes no matter how much time or effort or money you think you have wasted in doing so. The things you learn from failure far outweigh the things you remember from succeeding.

Here is another speed controller anyway.. this is for more of a tinkerer. I wanted to do something with the FAN7888 as it was relatively cheap. There are a number of different options for the switching regulators and the boards I tried to...Continue Reading
Posted by AlkaM | Apr 10, 2017 @ 04:10 PM | 30,264 Views
A couple more nfet designs. I had a friend who had a hw30a esc die on him. It was a yellow covered knockoff HW/ XXD30A esc. One of the mosfets failed, upon closer inpection there were three different variation of the nikos p0603 mosfets. These were clearly not from the same batch or maybe even the same manufacturer. They still sell these things by the thousands today on ebay ! The other thing they do is use two transistors to switch the top gate, not arranged to increase switching times but it only seems to invert the signal from the atmega8. Something that can be done through software.
Anyway I got to thinking about how I can make a HW30A dpak type design with the following criteria
1) Has to be cheaper than the cheapest ebay esc.
2) Has to handle more current than the xd30a and be more reliable.
3) Must be solderable by hand.
4) Uses minimal component count and repeating values where possible.

In the end I ended up with a couple different designs, one uses all 805 sized parts but is a 4 layer board, the other is a two layer board that was made for a specific enclosure but is quite slim and very long.

The parts list went like this

regulator 1117 5.0v
10k resistors x10
33k resistors x 3
2.2k resistor x 8
100r resistor x 6
Atmega8 processor
LED 805 size
irlr7843 mosfets x 6 (3.3mOhm vs 6.5 for the nikos)
1 uf caps x 3
0.1 uf caps x 2
10 uf cap x 1
10uf tantalum x 1
3 sot-23 transistors 2222a?
470uf rubycon cap

That put...Continue Reading
Posted by AlkaM | Apr 10, 2017 @ 03:10 PM | 29,247 Views
The next few boards are variations of the charge pump, driverless all nfet design.

I really liked the simplicity of this type of esc. I was searching for a mosfet that was cheap to buy and had a good current capability but was still hand solderable. The mosfet that stuck out was the psmn2r4 . This is a 3.3 mm design that still has legs and costs about 30-50 cents to buy. The 2.4 mOhm RdsOn was pretty decent and i have not had one blow up on me yet.

There are two layouts here, one for a two layer board. I have been flying with these ones on my larger quad for over a year.
The smaller of the two is a four layer board, a little harder to do yourself but does shrink the size down to something thats in the realm of possibility for a mini quad. I am using these esc's on two of my quads ( 6 inch and 4 inch ) with up to 4s battery.

They handle damped light and blheli just fine. The firmware for blueseries n-fet 30amp will work.
The schematic is the same as the last board. There are a number of different configurations that I played around with based around that general circuit design. Different mosfets and package options. I will put all of them up here eventually.

All source files and gerbers are included in the zip.

EDIT : BIG thanks to Hiidtubakas for taking my terrible schematics and making some sense of them.. his cleaned up schematic added to the pics.
Posted by AlkaM | Mar 29, 2017 @ 07:46 PM | 28,898 Views
This esc is an all nfet design similar to what you find in the blueseries escs or afro esc's or many others. How this design works is by using a simple charge pump arrangement to drive the gate of the upper nfet. Slow to turn on because the gate has to be turned on through a resistor that also limits the current while the gate is off. Fast to turn off.
Because the gate is in the off state more than on, current is flowing through that resistor most of the time and because of the thermal limits of the resistor.. This will be the limiting factor for this type of esc high side turn on time. Knowing this you can play around with the value depending on the voltage you intend to use. If you only need it to run on 2s then you can lower the value of this resistor and have a higher current to turn the gate on.
This goes for all ESC's using this type of nfet charge pump drive. R29 in this picture below.

The common value chosen is 2200Ohms by most manufacturers, this allows safe running at 16 volts. 16V / 2200 = 0.0072, i^2 * r = P = 0.11 Watts. This is even still slightly over the package 1/10 watt limit for 603 sized but under for 805 sized resistors. There is also a diode drop and the fact that its only conducting 2/3 of the time so its fine. If you only use it for 8 volts then you can lower the resistor. You cant just bypass the resistor out because then you would have a short from V to ground though the diode that charges the cap.

The low side switching time will be...Continue Reading
Posted by AlkaM | Mar 27, 2017 @ 07:43 PM | 28,834 Views
Another budget diy Board, A step up from the 8mhz multiWii. All the files and diptrace originals are included below again.

In keeping with the dirt cheap diy theme, this one uses all 805 sized parts that can be sourced cheaply from ebay. It still uses a i2c gyroscope the mpu-6050 because you can buy them anywhere. If you can't buy a bare chip you can desolder one from a breakout that costs a dollar.

There is a usb port and a ch340g usb chip on the backside. Its an enormous chip but.. hey you can buy a bag of them (literally.. they came in a baggy) for a few dollars. There is also a spot to solder a small memory chip and decoupling caps for blackbox use, I have never tried it. It should work. If anyone actually builds one let me know!

Its not fancy and nothing special, simply an F3 board and can run at 4k/4k that you can build yourself for 5-10 dollars.
Posted by AlkaM | Mar 27, 2017 @ 07:22 PM | 28,734 Views
Here's another flight controller,

I think this is just about the absolute minimum you can fly with. Its the slowest cheapest processor with the fewest number of components running at half the speed on an internal clock , a cheap mpu 6050 breakout sits on top. You can stack a bmp180 and a hcl5883 on top if you want more sensors.
I fly with this on a quad with 10 inch slowfly props and it fly's pretty well considering. There are a few of these flying about.

Here are the gerber files and the 8mhz multiwii sketch for it. I can't remember what I changed to make it run at 8mhz so I included all the files.
Costs between 2-3 dollars to make including the mpu-6050.
There is no point to this flight controller..
Posted by AlkaM | Mar 23, 2017 @ 11:59 AM | 28,867 Views
I wanted to make a flight controller without all the bells and whistles so I could make a bunch of cheapo quads.

I realize that I really don't care about most things flight controllers are offering. I just want something that can thrown together with few parts put into a quad and fly.
There are two versions a 36x36mm board with an integrated PDB and a 27x27 ultra basic board. There is a header on the 27x27 board that takes those cheap ebay modules ( 5883 mag, bmp 180/280 ) if you want to add a sensor or two.
The cost to build these is about the 5-10 dollar mark. They are all a two layer board with 805 sized parts so soldering by hand it easy.

Here are a couple of the boards I am using, I use an ftdi adapter to program them and talk to the fc software. I have a version with a built in usb port but in reality I just don't need to fly around with it all the time. They are the same pinout as a SPracing f3 board. Please don't think that this is a "clone" I simple needed to use a pinout so you don't need to build a custom firmware. His board, I am sure is much better than this.

I will attach gerber files and schematics, also the diptrace files are included in case someone wants to customize or build their own.
BOM to follow if anyone is actually going to build one.

I will try and keep adding home built electronics to this blog. To me, building your own is the only way to go, that is the hobby for me.