Learn · Interactive series

Field-Oriented Control, from scratch

An interactive, build-in-public series that takes you from spinning magnets to a self-tuning motor drive — the ideas behind the open Modular Motor Controller.

3interactive parts live
0→∞no motor-control background assumed
100%runs in your browser, nothing to install
Why this series

Motor control feels like a wall of Greek letters. It isn't.

Field-oriented control is how nearly every drone, robot arm, EV, and CNC axis makes a motor produce smooth, precise torque. The math looks intimidating — Clarke, Park, space vectors, observers — but every piece maps onto something you can see spinning.

So instead of derivations, each part gives you something interactive to work with. Drag a slider, watch the field turn, break the controller and fix it. The same ideas — the same code, even — run on Rhobic's open Modular Motor Controller, a simulation-first FOC drive that goes from a virtual motor in CI to a real STM32. You're working with the actual thing, not a simplified stand-in.

The path

Six parts, from spinning magnets to a self-tuning drive.

Read them in order or jump to what you need. New parts land as the controller itself hits each milestone.

1

What field-oriented control actually does

Live

Three phase currents, one spinning magnetic field. Play with the waveforms and watch the stator vector FOC exists to aim.

6 min read▶ Rotating-field playgroundStart reading →
2

Clarke & Park: turning AC into DC

Live

The two transforms at the heart of every FOC drive. Spin the rotor and watch three wild AC currents collapse into two steady knobs: torque and flux.

8 min read▶ dq-frame visualizerStart reading →
3

The loop that runs the motor

Live

A PI controller, an R–L winding, and a step response. Tune the exact current loop that runs at 20 kHz on real silicon — and see why bandwidth is the only knob that matters.

9 min read▶ Step-response tunerStart reading →
4

Finding the rotor without a sensor

Coming soon

A flux observer and a PLL estimate rotor angle from nothing but voltage and current — the trick that lets a drive spin a motor it has never seen.

10 min read
5

From simulation to silicon

Coming soon

The same control core runs in CI against a virtual motor and, unchanged, on an STM32G474 driving a real inverter. How the sim-first workflow catches bugs before the smoke does.

10 min read
6

Position control & robotics

Coming soon

Stack a position loop on top of torque and speed, add an encoder, and put a motor exactly where you want it — the foundation for every robot joint.

9 min read
Documentation index

Every part maps to real code.

The series doubles as working documentation for the Modular Motor Controller. Each part points back at the milestone it explains, the modules that implement it, and a command to run it. MS1–MS5 have shipped; MS6 is in progress and MS7 is planned. For the real traces behind these claims — sim and hardware alike — see Results.

PartMilestoneIn the codeStatus
1What field-oriented control actually doesMS2
mmc-core::svpwm::svpwmmmc-core::transformsmmc-sim::motor
Live
2Clarke & Park: turning AC into DCMS2
mmc-core::transforms::clarkemmc-core::transforms::parkmmc-core::transforms::inverse_park
Live
3The loop that runs the motorMS2
mmc-core::tuning::current_pi_gainsmmc-core::pi::Pi::updatemmc-core::current_loop::CurrentLoop::update
Live
4Finding the rotor without a sensorMS4MS5
mmc-core::observermmc-core::sensorlessmmc-core::angle::AngleEstimator
Coming soon
5From simulation to siliconMS3MS5
mmc-core::foc::Foc::stepmmc-protommc-fw-g474
Coming soon
6Position control & roboticsMS6MS7
mmc-core::tuning::speed_pi_gainsmmc-core::anglemmc-host::profile + tools/profile.py
Coming soon