FastAccelStepper is a high-performance stepper motor control library for Arduino/ESP-IDF, supporting AVR, ESP32, SAM, SAMD51, and RP2040 platforms. It provides precise trapezoidal (optionally cubic) acceleration ramps with tick-exact step generation through a queue-based command execution model. The library abstracts hardware pulse generation behind a platform driver pattern (AVR timers, ESP32 RMT/MCPWM/PCNT/I2S, RP2040 PIO, SAM/SAMD51 timers) and avoids floating-point arithmetic by using a custom fixed-point log2 representation for speed calculations. It includes extensive automated testing (simulated AVR with VCD traces, PC-based unit tests, ESP32 hardware-in-the-loop) and CI matrices covering 50+ environment combinations. The library is production-ready, published on Arduino Library Manager and PlatformIO, with a detailed changelog from v0.8.0 to v1.3.3. It is used in real robotic and motion control systems, evidenced by issue reproductions for direction-change miscounts. Though the codebase is actively maintained, it suffers from conditional compilation proliferation across multiple ESP-IDF versions (4/5/6) and chip variants, and some platforms (SAM) have known bugs with no CI coverage. A major refactoring of direction-change handling is proposed but not yet merged. A companion web-based demo application (Esp32StepperDemo) is under design but incomplete. Highlights include the log2 fixed-point math component, a lock-free ring buffer queue, a portable platform abstraction layer, and an I2S mux driver capable of driving 32 steppers from one I2S transmitter. The extensive test harnesses and build-matrix generation scripts provide a solid foundation for regression testing across diverse hardware.
This repository provides a comprehensive, production-grade Field-Oriented Control (FOC) library for Permanent Magnet Synchronous Motors (PMSM) targeting embedded microcontrollers (STM32G4, CH32V3). It is written in C and organized into modular algorithm files covering coordinate transforms (Clarke, Park), PWM modulation (SVPWM, SPWM), multiple control strategies (PID, LADRC, SMC, STA), sensor feedback (encoder, Hall, sensorless observers like HFI, SMO, NLFO), and advanced features (MTPA, field weakening, harmonic suppression, cogging calibration, dead-time compensation, feedforward, disturbance observer, parameter identification). The architecture is driven by interrupt-based control loops (high-frequency current loop, low-frequency state machine, and serial communication loop) with compile-time configuration via macro switches and user-supplied hardware abstraction layers. The repository also includes open-source hardware designs (schematic and PCB for a robot-joint motor driver), a QT-based host computer application, Simulink simulation models, and a complete STM32G4 example project. Although the library contains multiple coexisting versions and v4.0.0 is partially incomplete, the core modules are well-crafted, independently reusable, and demonstrate advanced control theory implementation suitable for robotics, drones, industrial servos, and electric tools.