Ctrl-FOC-Lite
A stripped-down, STM32-based motor control system rebuilt from SimpleFOC to give precise, efficient brushless motor control beyond what Arduino boards allow.
Ctrl-FOC-Lite
This project is a stripped-down motor control system built from scratch on low-level hardware. It lets you control brushless motors with high precision and efficiency, using an STM32 microcontroller instead of the simpler Arduino boards that most similar projects rely on.
The core idea is to take SimpleFOC—a popular open-source motor control library—and rewrite it to work directly with STM32 hardware features, rather than going through Arduino's abstraction layer. This matters because Arduino libraries waste the microcontroller's capabilities. By cutting out the middleman, the project gains access to things like hardware encoder interfaces, DMA (direct memory access for fast data transfers), and CAN bus communication. It also adds FreeRTOS, a real-time operating system, so multiple tasks can run reliably at the same time.
The hardware is built around an STM32F1 series chip and has been tested in physical prototypes. The design is modular enough to scale up: you can add more motor channels if you have extra hardware timers, jump to more powerful STM32 variants (like F4), or plug in beefier motor drivers for higher power applications. All the input/output pins are exposed on the evaluation board, documented in a configuration file that comes with the code.
The project is meant for developers and makers who want precise motor control without the overhead of Arduino, or who are building systems that need real-time multitasking. Examples might include robotics projects, drone builds, or industrial automation where response time and hardware efficiency matter. The code is developed in CLion, a professional IDE, so it's aimed at people comfortable with deeper embedded systems work rather than beginners patching together Arduino sketches.
Where it fits
- Build precise brushless motor control for a robotics or drone project using STM32 hardware directly.
- Add real-time multitasking to a motor control system with FreeRTOS instead of Arduino's simple loop.
- Scale up to more motor channels or a more powerful STM32 chip for higher-power applications.
- Use hardware encoder and CAN bus features that Arduino abstractions normally hide.