Library / SDK
simplefoc/Arduino-FOC avatar
simplefoc/Arduino-FOC

Arduino-FOC can now estimate current instead of measuring it, and a patch release quietly narrowed ESP32 support first

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

3,107 stars773 forksC++MIT

At a glance

What is it?
Arduino-FOC is a field-oriented control library for brushless and stepper motors that aims to be portable across motor, sensor, driver and microcontroller combinations, and it has the hardware matrix to back that up: seven separate build workflows in its badge row. The release notes for its newest version are where the interesting detail sits, including a torque mode that works with no current sensor at all and a regression on one board that a patch release introduced and the next one fixed.
Who is it for?
Fit this if you are driving a motor from a microcontroller you already know and want field-oriented control without writing the maths, and read the current-sense alignment example before trusting any of the measured-current modes, because the project itself added it for that reason. Decide deliberately whether the estimated-current torque mode is acceptable for your load, since it trades a sensor for a model.
Can I use it commercially?
Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 39 days ago.
What is it written in?
Mainly C++, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on November 15, 2026, and from our analysis. They are not legal advice.

From daily snapshots

Star history

  • simplefoc/Arduino-FOC3,107 ★ · +69
Star history
Repository2026-09-242026-11-15
simplefoc/Arduino-FOC3k3.1k

69 Stars in the last 52 days, measured from the daily GitHub snapshot. Compare with other projects

Editorial analysis

A torque mode that estimates current instead of measuring it

The newest release adds a torque control mode described as model-based current estimation without current sensing. In practice that means a motor can be driven in current-controlled torque with no current sensor in the build at all, on the strength of a model of the motor rather than a measurement of the phase current. That is the single most consequential line in the release notes, because current sensing is normally the part of the bill of materials people cut first when cost matters. Alongside it, the motor classes gain current and voltage feed-forward terms, which is the other half of making a model-based estimate usable. The counterweight is that the project also added an example whose stated purpose is to verify the alignment between the driver phases and the current-sense phases, which is what you would run before trusting any measured-current path.

One patch release lost current-sense sync on a board and the next restored it

The release notes are unusually candid about a regression. For one STM32-related board, low-side current-sense synchronisation was lost in version 2.3.5 and is fixed in 2.4.0. The same version also added reading the analog converter alongside low-side current sensing, and support for running multiple motors with one low-side channel each. On the ESP32 side the notes say the library now compiles for all version 3 releases of that board's core, and then explain what it replaced: version 2.3.5 was compatible only with one 3.2.x release. So a patch release first narrowed platform compatibility to a single core version and a later one widened it to all of them, which is worth knowing if you are pinning a release for reproducibility.

Seven build workflows for seven target families

The badge row of the file is seven continuous-integration workflows, one each for the general Arduino target, an STM32 target, an ESP32 target, a single-board computer target, an ARM Cortex M target, a Teensy target, and an Arduino variant using the Mbed core. That is the portability claim made concrete: the library is compiled in CI against every architecture it claims to support, rather than being ported by hand and hoped for. The tree supports the same story. Two library manifests sit at the root, one for each of the two build systems the subtitle names, plus a separate keyword list that those manifests consume. So a new target is added by adding a workflow rather than by editing one shared configuration, which is a slower way to grow but a much safer one.

The PlatformIO badge points at an individual's namespace

One badge links a library registry page for this project under a single contributor's namespace rather than the organisation that hosts the source. Anyone installing through that build system is installing a package published by one person, while the repository, the documentation domain and the community forum all sit under the shared organisation name. Nothing in the file explains the arrangement or whether the organisation's own namespace is also published, so a reader has to check the registry before knowing who they are trusting with a build. Set beside it is a badge for a peer-reviewed software paper, and the root carries matching citation metadata, which is the sort of detail a motor-control library published through a hobby community rarely bothers with.

The changelog announces one version and links a milestone for an older one

The release-notes block opens by announcing version 2.4.0 as the new release and then runs for forty lines of per-platform detail. Its final section is the changelog, which points at the release notes for more detail and then, on the very next line, points at a milestone for version 2.3.6 labelled unreleased. That is a lower version than the one announced at the top of the same block, and it is the forward-looking link a reader would follow to see what is coming. So the one pointer that tells you what happens next is stale, while the pointer that tells you what just happened is current.

The release notes are a roll-call of contributors

Reading the notes as a list rather than a changelog, the work clusters tightly. One contributor is credited twice with the substantial motor maths: the rework of velocity calculation and the addition of current and voltage feed-forward terms to the motor classes. Another is credited with a run of five merged pull requests described as safety optimisations for the ESP32 target. Two more are each credited with a single board addition, phase-state setting for one Teensy variant and support for a newer Arduino board. The motion-control section then records a capability change that is worth separating from the rest: every closed-loop and open-loop motion mode can now be combined with either torque control mode, with the example given being an open-loop velocity command running under current torque control.

Two documentation systems and a custom domain

The root carries a documentation generator configuration and a custom domain file, which is how a static documentation site is bound to a repository through the hosting pages feature. That is consistent with the documentation domain recorded as the project's homepage. Yet every documentation link in the release notes points to a hosted site built from prose pages, seven of which are named individually, including a write-the-code page, step-by-step setup guides, a theory section, a source-code section, and practical guides containing both a motor parameter measurement guide and PID tuning guides. So there are two documentation systems in play, one configured in the repository and one published elsewhere, and the release notes only ever link the second.

The premise is that existing motor code is too specific to reuse

The rationale section sets out the problem the library exists to solve. Brushless motors have clear advantages over plain DC motors and one large disadvantage, the complexity of control, and while designing boards and driving hardware has become comparatively easy, low-cost solutions have remained hard to develop. The specific gap claimed is that solutions found online are almost exclusively tied to one hardware configuration and one microcontroller architecture, and that for stepper motors, which benefit from the same control approach even more, the available solutions are scarcer still. The two stated aims follow directly: support as many motor, sensor, driver and microcontroller combinations as exist, and make moving between one combination and another as unobtrusive as possible. The cost of that aim is configuration, which is what the parameter measurement and tuning guides are for.

Editorial conclusion

Fit this if you are driving a motor from a microcontroller you already know and want field-oriented control without writing the maths, and read the current-sense alignment example before trusting any of the measured-current modes, because the project itself added it for that reason. Decide deliberately whether the estimated-current torque mode is acceptable for your load, since it trades a sensor for a model. Build for the platform you actually target rather than the one that is easiest to flash, since a recent patch release changed which ESP32 core versions compile at all. And if you depend on the previous release for a board whose low-side sensing regressed, check that you are on the fixed version.

Frequently asked questions

Is SimpleFOC suitable for beginners?

The project's stated aim is to demystify the control algorithm and make a simple library, and to support as many motor, sensor, driver and microcontroller combinations as possible so that moving between combinations is unobtrusive. The repository ships setup guides and practical guides covering motor parameter measurement and controller tuning.

What hardware is compatible with SimpleFOC?

The library is built in continuous integration against seven target families, covering general Arduino, STM32, ESP32, a single-board computer, an ARM Cortex M target, Teensy, and an Arduino Mbed variant. It also has official driver boards and a community forum listing boards developed by users.

Does Arduino-FOC need a current sensor?

Not for every mode. The newest release adds a torque control mode that performs model-based current estimation without current sensing, alongside current and voltage feed-forward terms in the motor classes. The project also added an example for verifying the alignment between driver phases and current-sense phases.

What changed between the two most recent SimpleFOC releases?

The newest release fixed low-side current-sense synchronisation on one STM32-related board that was lost in the previous patch release, added analog reads alongside low-side current sensing and one low-side channel per motor, and made the ESP32 target compile against all version 3 releases of its core where the previous patch supported only one.

Which SimpleFOC version should I use?

The newest release is the one that carries the current-sense synchronisation fix and the full core-version support for the ESP32 target. Note that the release notes in the file announce that version but link a milestone for an older unreleased one as the place to see what comes next.

Official sources

  1. License: MIT
  2. Project website
  3. README
  4. Releases
  5. simplefoc/Arduino-FOC on GitHub
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/simplefoc-arduino-foc.svg)](https://hysenlabs.com/projects/simplefoc-arduino-foc)

Star history chart for your README

markdown
[![Star history](https://hysenlabs.com/chart/simplefoc-arduino-foc.svg)](https://hysenlabs.com/projects/simplefoc-arduino-foc)

Was this useful?