Code is available here.

This is a project I did in October 2022. I documented the design & build process mainly for myself, but when I saw the Gearing Up contest I figured it was time to upload my first project to Hackaday. I've kept the documentation mostly unaltered, so you can see how the project developed, with all the trials and tribulations that such projects have. I've added some logs about things I remember but apparently didn't write down at the time.

Requirements

Inspiration

Parts

(The parts I ended up using are in bold)

Motor + ESC

Brushless motors and ESCs for drones or RC cars are cheap (€10-20 each). Most drone motors spin much faster than we need, so we should pick a slow (<2000 Kv) motor to reach the minimum RPM we're aiming for.

It would be nice if the motor had tapped holes in the rotor, then we could bolt a simple 3D printed or laser-cut piece directly to it as a chuck. A threaded shaft would also work but would probably need an adapter. A D-shaft (AKA shaft with drive flat) would be a last resort

Motor options:

ESC options:

Motor + ESC options:

Speed control

There’s lots of approaches to this with varying hardware complexity and software complexity.

The old BLHeli ESC firmware had something called governor mode or closed-loop mode, where the throttle input was interpreted as a desired RPM and an internal PID kept it at that RPM. However, this firmware is quite old now and the newer versions don’t support it.

The newer BLHeli_32 supports something called bi-directional Dshost, which is a protocol that allows the ESC and the flight controller (which in our case is a microcontroller) to communicate over a single wire. When the ESC receives a (digital) throttle signal, it sends back an eRPM signal that would allow closed-loop RPM control. This is supported in newer flight controller firmware like Betaflight. But to use this on a bare microcontroller, we’d have to implement the protocol ourselves. The protocol is described nicely here, and it may be possible to use the ESP32’s RMT to implement it, but it’d have to be implemented in C because the ESP32 MicroPython firmware doesn’t support receiving signals using RMT.

There’s also some ESCs that support sending telemetry over a separate wire. The protocol seems simpler and it could maybe be implemented using UART.

Note that all BLHeli firmware also supports the old, simple 1-2ms pulse width protocol. Which protocol is used is automatically detected on power up.

Options for RPM sensors:

Power supply

Drone motors are designed to work with LiPo batteries, typically 2~4S (7.4~14.8V). The other electronics like the microcontroller and the display need 5V and don’t draw much current (<500mA). Perhaps it’s better to first run the motor with a bench power supply to see what the current draw is.

Some ESCs come with a built-in 5V regulator (called a BEC or UBEC). Otherwise, these are the options:

We’ll also need a power plug:

Microcontroller

Any modern microcontroller like an ESP8266, ESP32, or Arduino Nano will probably work fine. There’s lots of examples floating around on how to run a brushless motor ESC with an Arduino.

Options:

Display

Options:

Buttons

I’d like one rotary encoder with an integrated push button to control it, an emergency stop button, and a power switch.

Enclosure

This can be designed and 3D printed or laser-cut.

Chuck

Fancy spin coaters have a vacuum chuck, but this means getting a vacuum pump with all the associated air hoses. We’d also need to find a motor with a hole through the shaft to attach the vacuum hose to and ensure an air-tight seal with the part that has to be spin-coated. I don’t think this is affordable or necessary.

A piece of laser-cut acrylic or plywood (if it’s not warped) bolted to the motor rotor is much simpler. You can put any shape part on it by drilling holes and putting in screws in the right places to keep it centered.

Wire & connectors

You'll need some thick wire (at least 12AWG) to connect the ESC to the motor, as well as three female banana plug connectors (the brushless motor comes with 3 male banana plugs already attached). To connect everything to the ESP32, I used header pins and DuPont connectors on the ESP32 dev board and the display. The remaining wire connections I soldered on directly.