Arduino Simple Field Oriented Control (FOC) project
We live in very exciting times π! BLDC motors are entering the hobby community more and more and many great projects have already emerged leveraging their far superior dynamics and power capabilities. BLDC motors have numerous advantages over regular DC motors but they have one big disadvantage, the complexity of control. Even though it has become relatively easy to design and manufacture PCBs and create our own hardware solutions for driving BLDC motors the proper low-cost solutions are yet to come. One of the reasons for this is the apparent complexity of writing the BLDC driving algorithms, Field oriented control (FOC) being an example of one of the most efficient ones. The solutions that can be found on-line are almost exclusively very specific for certain hardware configuration and the microcontroller architecture used. Additionally, most of the efforts at this moment are still channeled towards the high-power applications of the BLDC motors and proper low-cost and low-power FOC supporting boards are very hard to find today and even may not exist.
Therefore this is an attempt to:
- π― Demystify FOC algorithm and make a robust but simple Arduino library: Arduino SimpleFOClibrary
- Support as many motor + sensor + driver + mcu combinations out there
- π― Develop modular and easy to use FOC supporting BLDC driver boards
- For official driver boards see SimpleFOCBoards
- Many many more boards developed by the community members, see SimpleFOC Community
NEW RELEASE π’: SimpleFOClibrary v2.3.3 see release
- STM32 MCUs
- Teensy4 MCUs
- KV rating calculation fix #347
- Much more performant Park/Clarke calculation #340
- And much more - see the complete list of bugfixes and new features of v2.3.3 fixes and PRs
- Docs
- Added a practical guides section - see the docs
- Added a guide to choosing PWM pins for your application - see the docs
- Added docs on stm32 PWM and ADC pinouts - stm32 pinouts
Arduino SimpleFOClibrary
This video demonstrates the Simple FOC library basic usage, electronic connections and shows its capabilities.
Features
- Easy install:
- Arduino IDE: Arduino Library Manager integration
- PlatformIO
- Open-Source: Full code and documentation available on github
- Goal:
- Support as many sensor + motor + driver + current sense combination as possible.
- Provide the up-to-date and in-depth documentation with API references and the examples
- Easy to setup and configure:
- Easy hardware configuration
- Each hardware component is a C++ object (easy to understand)
- Easy tuning the control loops
- SimpleFOCStudio configuration GUI tool
- Built-in communication and monitoring
- Cross-platform:
- Seamless code transfer from one microcontroller family to another
- Supports multiple MCU architectures:
- Arduino: UNO, MEGA, DUE, Leonardo, Nano, UNO R4, MKR β¦.
- STM32
- ESP32
- Teensy
- many more β¦
Arduino SimpleFOCShield v2.0.4
Features
- Plug & play: In combination with Arduino SimpleFOClibrary - github
- Low-cost: Price of β¬15 - Check the pricing
- In-line current sensing: Up to 3Amps/5Amps bidirectional
- configurable: 3.3Amps - 3.3V adc, 5Amps - 5V adc
- Integrated 8V regulator:
- Enable/disable by soldering pads
- Max power 120W - max current 5A, power-supply 12-35V
- Designed for Gimbal motors with the internal resistance >10 Ξ©s.
- Stackable: running 2 motors in the same time
- Encoder/Hall sensors interface: Integrated 3.3kΞ© pullups (configurable)
- I2C interface: Integrated 4.7kΞ© pullups (configurable)
- Configurable pinout: Hardware configuration - soldering connections
- Arduino headers: Arduino UNO, Arduino MEGA, STM32 Nucleo boardsβ¦
- Open Source: Fully available fabrication files - how to make it yourself
If you are interested in this board as a product, find more information on this link: Arduino SimpleFOCShield
Alternative FOC supporting projects
Over the period of the past few years several cool FOC supporting projects which provide hardware and software solutions have emerged, here are some of them. None of the projects listed uses SimpleFOC.
Project | Open Source Hardware | Open source firmware | Simple to use | Low cost | Power rating | Stepper Support |
---|---|---|---|---|---|---|
Odrive | βοΈ/(β from recently) | βοΈ/(β from recently) | βοΈ | β (>200$) | High >50A | β |
Vesc | βοΈ | βοΈ | βοΈ | β (>100$) | Vey High >100A | β |
Trinamic | β | β | βοΈ | β (>200$) | Low ~10A | βοΈ |
Infineon | βοΈ | β | βοΈ | βοΈ (50$) | Low ~10A | β |
FOC-Arduino-Brushless | βοΈ | βοΈ | β | βοΈ (Price ?) | Low ~10A | β |
Tinymovr R5.2 | β | βοΈ | βοΈ | β (~90$) | High (~30A) | β |
Tinymovr M5.2 | β | βοΈ | βοΈ | β (~90$) | Low (~6Amps) | β |
Mjbots moteus | β | βοΈ | βοΈ | β (80-160$) | Mid (9-22Amps) | β |
Open robotics initiative MicroDriver | βοΈ | βοΈ | β | βοΈ(~50$) | Mid (-20Amps) | β |
SOLO | β | β | βοΈ | β(70$-600$) | Mid (-16Amps) to Very high (-120Amps) | β |
β οΈ This list is certainly not exhaustive, feel free to contribute to extending/completing/correcting it!