# Arduino-FOC
**Repository Path**: robot-lib/Arduino-FOC
## Basic Information
- **Project Name**: Arduino-FOC
- **Description**: Arduino FOC for BLDC and Stepper motors - Arduino Based Field Oriented Control Algorithm Library
- **Primary Language**: Unknown
- **License**: MIT
- **Default Branch**: master
- **Homepage**: https://github.com/simplefoc/Arduino-FOC
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 0
- **Created**: 2025-09-25
- **Last Updated**: 2025-09-25
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
# SimpleFOClibrary - **Simple** Field Oriented Control (FOC) **library**
### A Cross-Platform FOC implementation for BLDC and Stepper motors
based on the Arduino IDE and PlatformIO
[](https://github.com/simplefoc/Arduino-FOC/actions/workflows/arduino.yml)
[](https://github.com/simplefoc/Arduino-FOC/actions/workflows/stm32.yml)
[](https://github.com/simplefoc/Arduino-FOC/actions/workflows/esp32.yml)
[](https://github.com/simplefoc/Arduino-FOC/actions/workflows/rpi.yml)
[](https://github.com/simplefoc/Arduino-FOC/actions/workflows/samd.yml)
[](https://github.com/simplefoc/Arduino-FOC/actions/workflows/teensy.yml)
[](https://github.com/simplefoc/Arduino-FOC/actions/workflows/arduino_mbed.yml)




[](https://www.ardu-badge.com/badge/Simple%20FOC.svg)
[](https://registry.platformio.org/libraries/askuric/Simple%20FOC)
[](https://opensource.org/licenses/MIT)
[](https://joss.theoj.org/papers/4382445f249e064e9f0a7f6c1bb06b1d)
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*](https://docs.simplefoc.com/arduino_simplefoc_library_showcase)
- Support as many motor + sensor + driver + mcu combinations out there
- 🎯 Develop modular and easy to use FOC supporting BLDC driver boards
- For official driver boards see [SimpleFOCBoards](https://docs.simplefoc.com/boards)
- Many many more boards developed by the community members, see [SimpleFOCCommunity](https://community.simplefoc.com/)
> NEXT RELEASE 📢 : SimpleFOClibrary v2.3.5
>
> - ESP32 bugfix
> - after the low-level API changes in the Arduino-ESP32 core [PR447](https://github.com/simplefoc/Arduino-FOC/pull/447)
> - Pin is not configured [PR458](https://github.com/simplefoc/Arduino-FOC/pull/458)
> - C6 MCPWM bugfix [PR440](https://github.com/simplefoc/Arduino-FOC/pull/440)
> - New fuctionality
> - HybridStepperMotor added to the main library [PR457](https://github.com/simplefoc/Arduino-FOC/pull/457) - [see in docs](https://docs.simplefoc.com/steppermotor)
> - Motor characterisation (phase resistance and inductance) [PR436](https://github.com/simplefoc/Arduino-FOC/pull/436) - [see in docs](https://docs.simplefoc.com/bldcmotor#how-can-i-measure-the-phase-resistance-and-inductance)
> - SAMD21 support for low-side current sensing [PR479](https://github.com/simplefoc/Arduino-FOC/pull/479)
> - RP2350 support [PR435](https://github.com/simplefoc/Arduino-FOC/pull/435) [PR468](https://github.com/simplefoc/Arduino-FOC/pull/468)
> - STM32
> - New driver code [PR442](https://github.com/simplefoc/Arduino-FOC/pull/442)
> - Low-side current sensing support for H7 family [PR460](https://github.com/simplefoc/Arduino-FOC/pull/460)
> - Docs
> - Hybrid stepper motor example [see in docs](https://docs.simplefoc.com/stepper_control_shield)
> - Sensorless FOC example [see in docs](https://docs.simplefoc.com/sensorless_foc_nucleo_example)
> - A short guide to synchronous loop - [see in docs](https://docs.simplefoc.com/real_time_loop)
> - See the complete list of bugfixes and new features of v2.3.5 [fixes and PRs](https://github.com/simplefoc/Arduino-FOC/milestone/12)
## Arduino *SimpleFOClibrary* v2.3.5

SimpleFOC: A Field Oriented Control (FOC) Library for Controlling Brushless Direct Current (BLDC) and Stepper Motors.
A. Skuric, HS. Bank, R. Unger, O. Williams, D. González-Reyes
Journal of Open Source Software, 7(74), 4232, https://doi.org/10.21105/joss.04232