Blog

Blog

Project details, notes and such

CPU cycles per control tick for the integer HFI step on the F302 and an emulated Cortex-M0+, against each one's budgetNovember 19, 2026

The low-speed drive without an FPU

The HFI sensorless drive rewritten in integer arithmetic, to see whether it fits a Cortex-M0+. On motor 3 it matched the floating-point drive, and the emulated M0+ step takes 29–57% of a 10 kHz control period at 64 MHz.

Angle error against speed for the flux observer and HFIOctober 9, 2026

Rotor position at zero speed: high-frequency injection

Sensorless FOC down to standstill on motor 3, using the rotor's small saliency instead of back-EMF. How the carrier, demodulation, tracker and polarity check work, what went wrong on the bench (a carrier that cancelled itself, polarity pulses that threw the rotor, an angle that moved with load current), and where the low-speed floor ended up.

Position-dependent torque around one turn, bench against twinOctober 7, 2026

A digital twin of the bench, and what it found in the FOC drive

A phase-domain model of motor 3, the L6230 bridge and the F302 board, running the unchanged firmware. Calibrating it against the bench found a misplaced hall sensor, a position-dependent torque behind low-speed hunting, and three flaws in an online R/ψ estimator, and each fix went back into the drive.

Phase current over one electrical revolution at 120 and 180 degree conductionOctober 6, 2026

Six-step at 120° and 180° conduction

A bench comparison of the two six-step conduction patterns on a sinusoidal motor. 180° gives 15% more voltage but drew up to 3.7× the phase current and tripped the overcurrent limit at half the speed 120° reached. The harmonic current follows a simple ψ/(n²L) rule.

Speed trace of FOC handing the rotor to six-stepOctober 2, 2026

Six-step, a second board, and position on halls

Sensorless six-step commutation from first forced steps to a live handover from FOC, a port to a second MCU and motor, and a first position loop running on hall sensors — with its limits measured.

The shield's clamped back-EMF divider and the half-wave signal it readsAugust 2, 2026

Going open, and letting AI take the Wheel

The Modular Motor Controller is now open source. Notes on the repository, a back-EMF sensing experiment that didn't work as intended, and the milestone reorder that came out of it.

Sensorless startup and speed step on the second motorJuly 20, 2026

A second motor changes the story

The auto-tune profiler was built around one bench motor. Handing it a completely different one broke exactly the assumptions worth breaking — and the probe found the first motor had been hiding a trick.

The mmc control panel streaming phase currents, dq currents and speedJuly 13, 2026

What's actually on the chip

A breakdown of the MMC firmware at milestone MS6 — feature set, drive modes, and where every kilobyte of flash and RAM actually goes.

Block diagram: one control core running against a virtual motor and an STM32G474, with host tools over mmc-protoJuly 12, 2026

How this started

The origin of the Modular Motor Controller project — asking Claude to build an FOC motor controller from scratch.