Link
On this page

Arduino SimpleFOClibrary

License: MIT arduino-library-badge PlatformIO Registry status

AVR build STM32 build ESP32 build RP2040 build SAMD build Teensy build

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

This Arduino library implements Field Oriented Control (FOC) algorithm for BLDC and Stepper motors. FOC algorithm produces incomparably smooth operation and high degree of torque, velocity and position control. The library is intended both for:

  • Beginners searching for a simple and user-friendly way to learn how to control BLDC and Stepper motors
  • Advanced users ready to dig deeper into the FOC algorithm and optimize the code for their particular application/hardware.

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 ….
      • STM32
      • ESP32
      • Teensy
      • many more …

YouTube demonstration videos

This video demonstrates SimpleFOClibrary basic usage, electronic connections and shows its basic capabilities.

The video hardware setup consists of:

This video demonstrates SimpleFOClibrary support for high-performance BLDC drivers such as DRV8302 and the support for Arudino and STM32 MCU architectures.

The video hardware setup consists of:

This video demonstrates SimpleFOClibrary support for Arduino SimpleFOCShield and using multiple motors with Arduino UNO. The project examples are based on bidirectional haptic control.

The video hardware setup consists of:

Installation

There are multiple ways of installing this Arduino library, depending on your plans with the code and your particular application. Check our installation guide for more information.

Find out more

Supported hardware

Arduino SimpleFOClibrary is made modular and will support most of the motor + sensor combinations out there, as well as many low-cost bldc driver boards.

Find out more

Writing the Code

This library code is written in a way to be as simple sa possible to use and to leave a lot of space for configuration and fine tuning for specific applications.

Find out more

Project Examples

We are very happy to provide you with several projects multiple hardware configurations and fully documented and explained code! Go see the examples!