# simplefoc/Arduino-FOC

Arduino FOC for BLDC and Stepper motors - Arduino Based Field Oriented Control Algorithm Library

Repository: https://github.com/simplefoc/Arduino-FOC
Canonical: https://ross.abutalabs.com/products/arduino-foc
Homepage: https://docs.simplefoc.com
Language: C++
License: MIT
License Family: permissive
Topics: foc, motor, encoder, arduino, bldc-motor, low-cost, vector-control, arduino-library, bldc-motor-controller, arduino-foc, bldc-motors, stepper-motor, stepper-motor-control, stepper-library, foc-algorithm, arduino-simplefoc
Last push: 2026-08-05T14:05:20+00:00

## Health v2 (maintenance only)
Score: 77/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 96, release rhythm 39, longevity 100
- inputs: {"age_days": 2739, "days_push": 28, "days_rel": 195, "gap_med": 206, "n_releases_24m": 2}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 2986, forks 741 (observed 2026-08-28T04:07:34.047952+00:00)

## What it is
SimpleFOC is an Arduino/PlatformIO C++ library implementing Field Oriented Control (FOC) for BLDC and stepper motors. It supports many motor, sensor, driver, and MCU combinations (Arduino, STM32, ESP32, Teensy, RP2040, SAMD) with multiple motion control modes and current sensing.

## Use cases
- control a bldc motor with field oriented control on arduino
- drive a stepper motor with foc for smooth quiet motion
- build a low-cost brushless motor controller
- implement closed-loop position and velocity control of a gimbal motor
- run open-loop control of a stepper without an encoder
- port motor control code between esp32 stm32 and teensy
- read encoder feedback for motor commutation

## When to choose
- you want a well-documented, cross-platform FOC library for hobby or prototyping BLDC/stepper projects
- you use Arduino IDE or PlatformIO with supported MCUs like ESP32, STM32, or Teensy
- you need flexible motor + sensor + driver combinations with motion control modes out of the box

## When to avoid
- you need certified, high-power industrial motor control with safety certifications
- your MCU is not supported by the library's hardware-specific backends
- you need hard real-time guarantees beyond what an Arduino-based loop can provide

## Facets
- artifact type: library
- maturity: active
- function: embedded, simulation, developer-tools
- domain: robotics, embedded-systems, hardware
- platform: iot, cpp, embedded, cross-platform
- tags: field-oriented-control, bldc-motor, stepper-motor, motor-control, encoder, current-sensing, arduino-library, platformio, automation, stm32

## Member repositories
- simplefoc/Arduino-FOC (main) score 77

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:07:34.047952+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T07:31:26.138452+00:00, confidence not recorded.
  - readme: https://github.com/simplefoc/Arduino-FOC (fetched 2026-08-28T04:07:34.047952+00:00, sha d23ef709a591)
  - homepage: https://docs.simplefoc.com (fetched 2026-08-29T09:46:34.389931+00:00, sha 0f4f8abfd658)
  - site_page: https://docs.simplefoc.com/arduino_simplefoc_shield_installation (fetched 2026-08-29T09:46:34.399389+00:00, sha 0156fe3880dd)
  - site_page: https://docs.simplefoc.com/installation (fetched 2026-08-29T09:46:34.402360+00:00, sha 00afd7467462)
  - site_page: https://docs.simplefoc.com/library_download (fetched 2026-08-29T09:46:34.404047+00:00, sha 9c5e05482cfd)
  - site_page: http://olddocs.simplefoc.com (fetched 2026-08-29T09:46:34.405872+00:00, sha 0965df8be9fd)
  - site_page: https://docs.simplefoc.com/docs_chinese (fetched 2026-08-29T09:46:34.407480+00:00, sha bbb561b3a616)
  - site_page: https://docs.simplefoc.com/regular_adc_read (fetched 2026-08-29T09:46:34.409792+00:00, sha f40c48463a11)
  - site_page: https://docs.simplefoc.com/motion_control (fetched 2026-08-29T09:46:34.411404+00:00, sha 3133d3c0d05d)
  - site_page: https://docs.simplefoc.com/custom_control (fetched 2026-08-29T09:46:34.413169+00:00, sha 86f5f2592ad4)
- Data as of 2026-08-30T08:39:29.467469+00:00.
