Skip to content

Latest commit

 

History

History
184 lines (147 loc) · 14.9 KB

index.md

File metadata and controls

184 lines (147 loc) · 14.9 KB
layout title nav_order description permalink
default
Home
1
Arduino Simple Field Oriented Control (FOC) project documentation.
/

Arduino Simple Field Oriented Control (FOC) project

License: MIT arduino-library-badge PlatformIO Registry status

GitHub release (latest by date) GitHub Release Date GitHub commits since tagged version GitHub commit activity (branch)

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

NEW RELEASE 📢: SimpleFOClibrary v2.3.4 see release

- ESP32 MCUs extended support [#414](simplefoc/Arduino-FOC#414) - Transition to the arduino-esp32 version v3.x (ESP-IDF v5.x) [#387](https://github.com/espressif/arduino-esp32/releases) - New support for MCPWM driver - New support for LEDC drivers - center-aligned PWM and 6PWM available - Rewritten and simplified the fast ADC driver code (`adcRead`) - for low-side and inline current sensing. - Stepper motors current sensing support [#421](simplefoc/Arduino-FOC#421) - Support for current sensing (low-side and inline) - [see in docs](current_sense) - Support for true FOC control - `foc_current` torque control - [see in docs](motion_control) - New current sense alignment procedure [#422](simplefoc/Arduino-FOC#422) - [see in docs](current_sense_align) - Support for steppers - Much more robust and reliable - More verbose and informative - Support for HallSensors without interrupts [#4224](simplefoc/Arduino-FOC#424) - [see in docs](hall_sensors) - Docs - A short guide to debugging of common issues - [see in docs](example_from_scratch) - A short guide to the units in the library - [see in docs](library_units) - See the complete list of bugfixes and new features of v2.3.4 [fixes and PRs](https://github.com/simplefoc/Arduino-FOC/milestone/11)

Arduino SimpleFOClibrary - Read more ...

License: MIT GitHub release (latest by date) GitHub Release Date

<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.

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 ...

SimpleFOCBoards - Read more ...

One of the goals of the SimpleFOCproject is to develop low-cost easy to use BLDC driver boards compatible with the SimpleFOClibraryand completely open source! Therefore, SimpleFOC team members have developed a set of boards, designed specifically for ease of use, to help you kickstart your FOC journey. In addition to being easy to use, the goal of these boards is serve as a reference design for the community to build upon. And finally, even though some of these boards are available in our shop, our docs provide a lot of documentation and step-by-step guides on how to fabricate the boards yourself.

In addition to the official boards, there are many other boards compatible with SimpleFOClibrary that you can explore, see the docs. Additionally, some other cool hardware designs have been proposed by the community. Check out our community forum for more info.

Here are some of the official boards developed by the SimpleFOC team:

SimpleFOCShield

License: MIT GitHub release (latest by date) GitHub Release Date

Features

  • DRV8313 based - datasheet
    • Power supply: 8-35V
    • Max current: 2A per phase (3Amp peak)
  • Absolute max ratings - Designed for Gimbal motors with the internal resistance >10 Ωs.
    • Max current: 3A,
    • Max input voltage: 35V
  • In-line current sensing: Up to 5Amps bidirectional
    • ACS712 hall current sensor
  • Integrated 8V regulator:
    • Enable/disable by soldering pads
  • 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:
  • Low-cost:
    • JLCPCB production cost ~10-15€
    • Available in the shop: 15-30€

SimpleFOCMini

License: MIT GitHub release (latest by date) GitHub Release Date

Features

  • DRV8313 based - datasheet
    • Power supply: 8-35V
    • Max current: 2A per phase (3Amp peak)
  • Absolute max ratings - Designed for Gimbal motors with the internal resistance >10 Ωs.
    • Max current: 3A,
    • Max input voltage: 35V
  • Small size: 26x21 mm
  • Open Source:
  • Low-cost:
    • JLCPCB production cost ~3-5€
    • Available in the shop: 7-15€

A short demo video for the SimpleFOCShield (its a bit outdated but still relevant)

<iframe class="youtube" src="https://www.youtube.com/embed/G5pbo0C6ujE" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>

Find out more about the boards and how to make them yourself in the boards section.

Alternative FOC supporting projects

The focus of SimpleFOC is making the FOC simple (:D) and supporting as many motor + sensor + driver + mcu combinations as possible. If you are a bit less concerned with the firmware simplicity and don't mind trading-off cross-platform flexibility for performance, there are several other projects out there that also use FOC and could provide a more compact, more prefromant or more robust solutions for your applications. Many of these projects are open-source and have been our inspiration from the start, especially VESC and Odrive. Make sure to check them out if you are starting your FOC journey!

P.S. None of these projects uses SimpleFOClibrary, but SimpleFOClibrary can be used as a firware for several driver boards developed in these projects.

Project Open Source Hardware Open source firmware Simple to use Low cost Power rating Stepper Support SimpleFOC 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 ? (not tested)

Tinymovr R5.2
✔️ ✔️ ❌ (~90$) High (~30A) ? (not tested)

Tinymovr M5.2
✔️ ✔️ ❌ (~90$) Low (~6Amps) ? (not tested)

Mjbots moteus
✔️ ✔️ ✔️ ❌ (70-160$) Mid (20Amps)
to
High (100Amps)
? (not tested)


Open robotics initiative
MicroDriver
✔️ ✔️ ✔️(~50$) Mid (~20Amps) ? (not tested)


SOLO
✔️ ❌(70$-600$) Mid (~16Amps)
to
Very high (~120Amps)
⚠️ This list is certainly not exhaustive, feel free to contribute to extending/completing/correcting it!