SguanFOC
- Software
- Microcontrollers and firmware tools
- Library
A pure C library of field-oriented control (FOC) algorithms for brushless motors, meant to run on any C-capable microcontroller, from sensored to sensorless control.
Source on GitHub: github.com/Sguan-ZhouQing/SguanFOC_Library (opens in a new tab). Facts read at commit 0c1a8d2 (opens in a new tab).
Licenses
- Code
- MIT (opens in a new tab)
Read by Robotheca from LICENSE (opens in a new tab) (MIT) at commit 0c1a8d2 (opens in a new tab), on 22 Oct 2026.
- Commercial use
- Yes
What it does
- Covers 19 control modes, from open-loop V/F and I/F through encoder, Hall-sensor and sensorless operation.
- Sensorless estimation uses HFI high-frequency injection plus SMO and NLFO flux observers, with switching between them.
- Includes PID, LADRC, SMC and STA controllers, plus MTPA, field weakening, dead-time compensation and cogging compensation.
- Offers motor parameter identification, pole polarity identification and a JustFloat serial protocol for debugging.
- Configuration is done through user header files such as UserData_Config.h, with the run mode selected by a macro.
Written by Robotheca from the project's README (opens in a new tab) at commit 0c1a8d2.
Getting started
- Difficulty
- Advanced
- How to start
- The project's README (opens in a new tab)
Maintenance
- Status
- Active: a commit in the last 90 days
- Newest commit
- 20 Oct 2026 on main
- Latest release
- SguanFOC通用“有感定点”库 (2 Apr 2026)
Checked on GitHub on 22 Oct 2026.
Links
Robots that can run it
No robot on Robotheca is linked to it yet. Links come from a robot's robot.yaml, from its dependency files read as text, or from Robotheca's editors.
Robotheca lists software as a reference: nothing is hosted or run here, and every fact links to where it was read.