Arduino SimpleFOClibrary v2.1.1

Open-Source user friendly FOC implementation

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.


Arduino IDE Compatible

The code of Arduino SimpleFOClibrary library is available as Arduino sketch or through Arduino Library Manager. Installation docs.

Easy configuration

SimpleFOClibrary makes it very simple to configure for different types of motors, position sensors and microcontrollers. Coding docs.

Open Source

The code and full documentation is available on Github.

Plug & play

Especially in combination with Arduino SimpleFOCShield.

Supported hardware

Arduino SimpleFOClibrary is made with a goal to enable using Field Oriented Control algorithm with hobby hardware.
With that in mind, the library is in constant development to support as many motor + sensor + driver + microcontroller combinations out there.


- BLDC motors
- Stepper motors
Read more

Drivers boards

- BLDC drivers
- Gimbal drivers
- Stepper drivers
Read more

Position Sensors

- Encoders
- Magnetic sensors
- Hall sensors
- Open-loop control
Read more


- Arduino
- STM32
- ESP32
- Teensy
Read more

Gimbal controller board example - HMBGCV 2.2

Project link

This is a short video showing the setup procedure and the capabilities of the SimpleFOClibrary.

The video setup consists of:

High-performance board example - DRV8302

Project link

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:

Arduino SimpleFOCShield v2.0.3

Low cost, modular, true FOC, gimbal motor driver board

This is an open-source low-cost Brushless DC (BLDC) motor driver board intended primarily for low-power FOC applications up to 5Amps. The board is fully compatible with the Arduino UNO and all the boards with the standard Arduino headers. Arduino SimpleFOCShield, in combination with the SimpleFOClibrary provides user-friendly way to control BLDC motors both in hardware and software.


Possibility of stacking 2 shields (2 BLDC motors + 2 position sensors)

Configurable pinout

Possible to choose all the pins used by the board.

Sensor Interfaces

Encoder/Hall senosor pull-ups (3kOhm), I2C pullups (4.7kOhm).

Current Sensing ( from version > v2.0 )

3A/5A in-line current sensing

On-board voltage regulator ( from version > v2.0 )

5V/8V linear voltage regulator

Open Source

The code and full documentation is available on Github.


Arduino FOC Inertia Wheel Inverted Pendulum - Arduino SimpleFOCShield

This is a project of designing and controlling the reaction wheel inverted pendulum based entirely on Arduino SimpleFOC library and SimpleFOC shield.
This is a very fun project in many ways, and it is intended:

  • Students in search for a good testing platform for their advanced algorithms
  • Everyone with a bit of free time and a motivation to create something cool :D

  • Arudino code

    Arduino UNO using SimpleFOClibrary and SimpleFOCShield
  • CAD designs

    All CAD designs available for modification and STL files provided
  • Control algorithm

    State-space LQR controller
  • Plug and Play

    Very simple to assemble, configure and setup.

Steer by wire example - Arduino SimpleFOCShield

Project link

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: