layout | title | nav_order | description | permalink |
---|---|---|---|---|
default |
Home |
1 |
Arduino Simple Field Oriented Control (FOC) project documentation. |
/ |
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 + current sense + driver + mcu combinations out there
- 🎯 Develop a modular FOC supporting BLDC driver boards:
- NEW 📢: Minimalistic BLDC driver (<3Amps) : SimpleFOCMini .
- Low-power gimbal driver (<5Amps) : Arduino SimpleFOCShield .
- Medium-power BLDC driver (<30Amps): Arduino SimpleFOCPowerShield .
<iframe class="youtube" src="https://www.youtube.com/embed/Y5kLeqTc6Zk" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe> This video demonstrates the Simple FOC library basic usage, electronic connections and shows its capabilities.NEW RELEASE 📢: SimpleFOClibrary v2.3.0 see release
- Arduino Mega 6pwm more timers supported - Arduino boards - frequency change support either 32kHz or 4kHz - Arduino Uno - synched timers in 3pwm and 6pwm mode [#71](simplefoc/Arduino-FOC#71) - Teensy 3.x initial support for 6pwm - Teensy 4.x initial support for 6pwm - Example for v3.1 SimpleFOCShield - RP2040 compatibility for earlehillpower core [#234](simplefoc/Arduino-FOC#234) [#236](simplefoc/Arduino-FOC#236) - More flexible monitoring API - start, end and separator characters - decimal places (settable through commander) - Added machine readable verbose mode in `Commander` [#233](simplefoc/Arduino-FOC#233) - *Simple**FOC**WebController* - Web based user interface for SimpleFOC by [@geekuillaume](https://github.com/geekuillaume) - [webcontroller.simplefoc.com](https://webcontroller.simplefoc.com) - bugfix - `MagneticSensorPWM` multiple occasions - [#258](simplefoc/Arduino-FOC#258) - bugfix - current sense align - added offset exchange when exchanging pins - bugfix - trapezoid 150 fixed - bugfix - 4pwm on ESP8266 [#224](simplefoc/Arduino-FOC#224) - Additional `InlineCurrentSense` and `LowsideCurrentSense` constructor using milliVolts per Amp [#253](simplefoc/Arduino-FOC#253) - STM32L4xx current sense support by [@Triple6](https://github.com/Triple6) (discord) [#257](simplefoc/Arduino-FOC#257) - phase disable in 6pwm mode - stm32 - software and hardware 6pwm - atmega328 - atmega2560 - Lag compensation using motor inductance [#246](simplefoc/Arduino-FOC#246) - current control through voltage torque mode enhancement - extended `BLDCMotor` and `StepperMotor` constructors to receive the inductance paramerer - can also be set using `motor.phase_inductance` or through `Commander`
- 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 ....
- STM32
- ESP32
- Teensy
- many more ...
- 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
These are just a few of the alternative FOC supporting projects which provide hardware and software solutions.
Odrive | Trinamic | Infineon | FOC-Arduino-Brushless |
---|---|---|---|
✔️ Open Source | ❌ Open Source | ✔️ Open Source(recently) | ✔️ Open Source |
✔️Simple to use | ✔️ Simple to use | ✔️Simple to use | ❌ Simple to use |
❌ Low cost ($100) | ❌ Low cost ($100) | ✔️Low cost ($40) | ✔️ Low cost |
❌ Low power (>50A) | ✔️ Low power | ✔️ Low power | ✔️ Low power |
❌ Stepper support | ❌ Stepper support | ❌ Stepper support | ❌ Stepper support |