FPGA Based Motor Controller Idea

FPGAs have a sort of cool factor that microcontrollers just don’t have. Now that we have fairly inexpensive FPGAs like the iCE40 series from lattice, they don’t break the bank either. On top of that, open source FPGA development tools like yosys and nextpnr remove the need for clumsy proprietary tools. Recently I’ve been thinking about building an open-source, ethernet connected, FPGA based, brushed DC motor controller.

The rest of this post is will be me hashing out my current thoughts, if you have any critiques/ideas just shoot me an email at jonbuildsrobots@gmail.com.

Rough Block Diagram

Communication

My current idea for communicating with the motor controller is UART (either over USB using a converter chip or directly) for small projects/debugging and ethernet for larger projects. Many existing motor controllers use CAN for communication, which is pretty simple to set up and use but doesn’t have the same sort of ecosystem as either UART, USB or ethernet have. Usually you need some extra hardware to connect over CAN, for example a CAN-BUS arduino shield or a USB to CAN converter dongle.

Connecting to peripherals over UART is common and pretty easy to set up. Whether it be an arduino connected directly to the TX/RX pins on the motor controller (with some level shifting if needed), a raspberry Pi connected to it over USB or something else. There are also libraries on most platforms that make serial communication easy to do on the programming side.

Ethernet is a bit more complicated to set up and use from code, but lends itself much better to large systems than USB or serial. You could imagine building a robot where all the motor controllers and the computer that's controlling it are all hooked up to an ethernet switch. That way you don’t need to run a direct connection from your main controller to each motor controller. You could even hook a motor controller up to a wifi access point and have wirelessly controllable motors. There's a ton of possibility for coolness here.

Why Brushed DC instead of Brushless?

Honestly it mostly comes down to familiarity, I have a lot more experience messing around with brushed DC motors than I have with BLDCs. They also tend to be simpler to control in my experience. Maybe in the future this motor controller design can be extended to BLDCs, but that’s not my target for now.

If you’re looking for an open source BLDC motor controller take a look at the ODrive or the VESC.

Estimated Cost

Purpose Example Part Est. Cost (USD)
FPGA iCE40HX8K $20
USB to UART FT232RL $10
4x MOSFET IRLS3034 $40
Ethernet PHY DP83822I $10
PCB N/A $10
Gate Driver DRV8701 $10
Current Measuring IC INA233 $10
$110 Total

Above is a rough bill of materials for one motor controller. I’m leaving out quite a few parts here, but also rounded up all of the estimated costs so hopefully it balances out.

The rough estimate shows that we’re not too far off from other motor controllers, which are in the $90 to $150 price range. (ODrive is $149, found a VESC based controller for $113, Talon SRX from VEX is $89.99)

I’ll be working on this whenever I have some free time (which can be rare these days) and I’ll post updates when I make significant progress. Until then, happy making.