grblHAL/core is an embedded firmware for real-time CNC motion control, derived from the original grbl 1.1f project. It interprets G-code (RS274/NGC) and executes motion planning with acceleration/jerk profiles, driving stepper motors via a hardware abstraction layer (HAL) that supports many 32-bit MCUs (ESP32, STM32, RP2040, i.MX RT, etc.). The architecture is modular: a plugin system allows adding spindles, I/O expanders, kinematics (CoreXY, delta, polar, wall plotter), networking, and custom M-codes. Key subsystems include a G-code parser, motion planner with look-ahead, stepper ISR with Bresenham and AMASS, state machine, settings registry with NVS persistence, virtual file system, and cooperative task scheduler. Communication streams (serial, TCP, WebSocket, Modbus) are multiplexed. The codebase is highly optimized for real-time constraints, uses extensive conditional compilation for configurability, and provides reusable patterns such as function-pointer-based HAL, callback chaining, and abstracted I/O. While some internal coupling exists, many modules (crc, regex, utf8, string utilities, PID, expression evaluator, task scheduler) are self-contained and extractable.
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.