Lab · Exploration
How a brushless motor spins
From magnets and coils to a quadcopter in the air: how a brushless motor is wound, how an ESC switches it in six steps, how it finds the rotor without sensors, what field-oriented control does better, and what happens when you bolt four of them to a frame — with the simulators running alongside.
Part 2 of 7 in How things work
UsesBrushless motors — inside and how they are drivenRC power setup — motor, prop and batteryFPV quad: build, rates, CLI diff and blackboxPID loop simulator
Pick up the motor from a racing drone and turn it with your fingers. It is not smooth: it clicks gently from one resting place to the next, as if it had little detents. Spin it hard and it hums. There are no brushes, no commutator, nothing touching anything except the bearings. Three wires come out of it, and on its own it will do absolutely nothing — connect it straight to a battery and you get a twitch, a lot of current and a warm motor.
Everything interesting about a brushless motor lives in the gap between that inert lump of copper and magnets and the controller that drives it. This exploration walks through both, from the windings to the switching pattern to the trick that lets the controller find the rotor without any sensors, and ends with four of these motors holding a quadcopter in the air. The simulators are embedded as we go. They all run in your browser, and nothing you do in them can burn anything out, which is more than I can say for my first ESC.
Magnets go round, coils stay still
An ordinary brushed DC motor has its coils on the spinning part and its magnets in the case. To get current into coils that are turning, it uses brushes rubbing on a segmented copper ring, the commutator. As the rotor turns, the brushes slide from segment to segment and the current is switched into whichever coils are in the right place to keep pulling. It is clever, mechanical and self-timing, and it is also the thing that wears out, sparks and limits speed.
A brushless motor turns this inside out. The coils sit still, wound around the teeth of a laminated iron stator, and the magnets are on the rotor. In a drone motor the rotor is the bell on the outside — an outrunner — with a ring of curved magnets glued inside it. Nothing that carries current moves, so there is nothing to wear. The price is that the commutator has gone: something else now has to switch the current between coils at exactly the right moments. That something is the electronic speed controller, the ESC.
Before we get to the switching, look at the copper. Here is a typical 5-inch quad motor, a "2207" (a 22 mm stator, 7 mm tall) wound for 1,950 Kv:
The drawing shows twelve teeth (slots) and fourteen magnets (poles): this is 12N14P, the
combination on almost every multirotor motor. Each tooth carries a coil, coloured by the phase
it belongs to — red, amber and blue for A, B and C — and the pattern written above the picture,
AabBCcaABbcC, reads round the stator from the top. A capital letter is a coil wound one way
round its tooth, a small one is wound the other way.
Try this:
-
The rotor is already turning, with the coils lit as an ESC would switch them (Pause stops it). Watch how far the bell moves during one full cycle of the lighting pattern: one pole pair, two magnets' worth, about 51°. Fourteen magnets is seven pole pairs, so the electrical cycle runs seven times for every turn of the shaft. That is why the panel says 25,000 rpm is 175,000 eRPM — electrical revolutions per minute — a number you will meet again in a moment.
-
Read the cogging steps per turn: 84, the lowest common multiple of 12 and 14. Those are the little detents you felt with your fingers. Many small steps make for smooth running; a combination like 12N8P has only 24, and they are much stronger.
-
Change Poles to 8, then 10, then back to 14. The winding factor — how much of each coil’s effort actually adds up in the phase, the designer’s efficiency of copper — is 0.866 for 12N8P and 0.933 for both 12N10P and 12N14P. The cogging steps go from 24 to 60 to 84: same copper, smoother motor.
-
Switch Layout to "alternate teeth". Half the teeth go bare. This is the LRK winding: easier to wind by hand, slightly different character.
The important idea to carry forward is that the stator can make a magnetic field that points in any of several directions, depending on which phases carry current and which way. If you can make that field point a little ahead of the rotor’s magnets, the magnets chase it. Keep moving the field and the rotor keeps chasing. That is the whole motor.
Six steps round the circle
Three phases, each of which can be pulled up to the battery, pulled down to ground, or left floating. The ESC does this with six MOSFETs, a high and a low switch per phase — a three-phase bridge. The simplest way to drive it is to always have exactly one phase high, one phase low and one floating. There are six ways to choose that, and stepping through them in order rotates the field round the stator in six 60° jumps. This is six-step or trapezoidal commutation, and it is what nearly every hobby ESC did for twenty years.
The simulator reduces the motor to the simplest possible picture — two poles, three coils — so that one electrical cycle is one turn of the drawing:
The magnet is the red and grey bar. The arrow is the stator field. The three dots around the edge are Hall-effect sensors, each filling in when it sees a north pole, and the table on the right lists the six steps: which Hall code is showing, which phase is switched high, which low, and which is left floating.
Try this:
-
Pause the animation and step through it by eye. The field arrow always sits somewhere between 60° and 120° ahead of the magnet’s north pole — 90° on average — and jumps 60° at every commutation. Torque is greatest when the field is at right angles to the magnet, so six-step spends its whole life a little either side of ideal.
-
Look at the three Hall bits. Of the eight codes three bits can make, only six ever appear: 000 and 111 mean a sensor has failed. Three cheap sensors, 120° apart, are enough to know which sixth of a cycle the rotor is in, and that is all six-step needs.
-
Scroll down to One electrical cycle. The phase currents are blocks — positive for 120°, off, negative for 120°, off — with their corners rounded by the coil’s inductance. Now look at the torque trace: it dips at every commutation. The summary above it puts a number on it, about 30% torque ripple for this motor. You hear that ripple as part of the motor’s whine.
-
Change Back-EMF shape from sinusoidal to trapezoidal. The ripple drops: block currents suit a motor whose back-EMF is flat-topped. Most drone motors are closer to sinusoidal, which is a hint of where we are going.
Hearing the rotor without sensors
Drone motors have no Hall sensors. They spin at tens of thousands of rpm in a cloud of dust, next to a lot of switching noise, and every gram matters. So how does the ESC know when to commutate?
The motor tells it. A magnet sweeping past a coil induces a voltage in it — the motor is also a generator — and this back-EMF rises with speed. Kv is just that relationship turned round: a 1,950 Kv motor generates one volt for every 1,950 rpm, and on a 22.2 V battery it would spin up to a little over 43,000 rpm with no load, the speed at which its own back-EMF cancels the supply. In six-step there is always one phase floating, not driven by the ESC, and the voltage on a floating phase is its back-EMF (plus the star point it sits on). When that back-EMF crosses the midpoint — a zero crossing — the rotor is exactly halfway through the step. The ESC waits another 30° electrical, judged from the time between the last two crossings, and switches.
Go back to the six-step view above and scroll to the terminal voltage plot. The sloping lines are the floating phases' back-EMF, rising or falling across the gap between the flat driven levels. The dotted verticals mark where each crosses the star-point voltage; the dashed ones, 30° later, are the commutations the ESC schedules from them.
Try this:
-
Notice the short vertical spike just after each commutation, where the phase that was switched off is clamped to 0 V or the full bus by a diode until its current dies away. A real ESC’s comparator has to ignore that window, or it sees a false zero crossing and stumbles. Desyncs — the motor suddenly stuttering in a hard punch — are often exactly this.
-
Type a ZC filter delay of 10 µs. The commutations slide late, the field falls behind the ideal angle, and torque and efficiency drop. At 175,000 eRPM one electrical cycle lasts only about 340 µs, so 10 µs is already several degrees.
-
Now set a Timing advance of 15°. The ESC commutates early to make up for delays and for the inductance that slows the current’s rise. The Timing advance chart at the bottom sweeps it for you: at this speed, more advance buys torque. BLHeli and Bluejay’s "timing" setting is this number.
-
Lower the Speed to 2,000 rpm. The back-EMF shrinks to a few volts and the crossings get hard to see — which is why a sensorless motor has to be started open-loop, kicked round blind until it is fast enough to hear itself. It is also why sensorless motors are rough at very low speed, and why an RC car, which has to crawl away from a standstill under load, often has sensors.
Field-oriented control: steering the field smoothly
Six-step is cheap and effective, but it chops a smooth rotating field into six lurches. The better answer is to make the stator field rotate continuously, always exactly at right angles to the rotor’s magnets, with just enough current to make the torque you want. That is field-oriented control, FOC, and it is what VESC, ODrive, most e-bike controllers and a growing number of drone ESCs (AM32 among them) do.
The difficulty is that three sinusoidal phase currents are awkward things to control — they never sit still. FOC’s trick is two changes of point of view. The Clarke transform adds the three currents (which always sum to zero) into a single vector on two fixed axes, α and β. The Park transform then looks at that vector from the rotor itself, on axes d (along the magnet) and q (at right angles to it). In the rotor’s frame, a perfectly driven motor’s currents stop rotating and become two constant numbers.
Try this:
-
Watch the vector diagram. The three coloured arrows — each phase’s contribution — change length all the time, but they always add up to the same black vector, which turns with the rotor. In the table,
ia,ibandicchange continuously;idstays at 0 andiqstays at 10 A. Those two steady numbers are what the controller actually regulates. -
Set the id reference to −5. The current vector leans back towards the magnet’s south pole and starts to weaken the magnet’s field. That is field weakening: it costs current but lets the motor run above the speed its back-EMF would otherwise allow.
-
Scroll to Six-step, sine and FOC at the same speed and torque. All three are asked for the same torque at 25,000 rpm. FOC makes it with the least current and no ripple at all; six-step gets there with about 30% ripple and slightly more current; and plain sinusoidal voltage drive, with no current feedback, cannot make the torque at all at this speed, because the coil’s inductance makes the current lag the voltage and nobody corrects for it. That one row is the whole case for measuring the currents.
-
At the bottom, The d and q current loops are two ordinary PI controllers, one for each axis. Untick Decoupling feed-forward and step again: the d current now kicks when q moves, because at speed the two axes leak into each other. Then try a loop bandwidth of 200 Hz and of 5,000 Hz and see how quickly iq reaches its target.
FOC is more arithmetic — a sine, a cosine and two multiplications per axis, twenty thousand times a second — and it needs current sensors. A modern 32-bit microcontroller shrugs at both, which is why it is slowly taking over.
How the flight controller speaks to the ESC
A multirotor’s flight controller decides, thousands of times a second, how hard each motor should push. It used to say so with a servo pulse — 1,000 to 2,000 µs wide, fifty times a second — which the ESC had to measure and calibrate. Then came OneShot and MultiShot, the same idea with shorter pulses. Now almost everything uses DShot: the number itself, sent as bits.
A DShot frame is sixteen bits: an 11-bit throttle value (48 to 2,047; the values below 48 are commands such as "beep" or "reverse direction"), one bit asking for telemetry, and a 4-bit checksum. At DShot600 each bit takes 1.67 µs, so a whole frame is under 27 µs — no calibration, no jitter, and a corrupt frame is simply ignored.
Try this:
-
Move Throttle (%) and watch the blue value bits and the green checksum. Switch Send to a command and send "1: Beep 1" — this is how your quad beeps when you have lost it in long grass.
-
Untick Bidirectional. The checksum flips. With bidirectional DShot the line is inverted and, after each frame, the ESC talks back on the same wire.
-
Scroll to eRPM telemetry. What the ESC sends back is the electrical period — from its zero-crossing timing, the same thing it measures to commutate — and the flight controller divides by the pole pairs to get shaft speed. 140,000 eRPM on a 14-pole motor is about 20,000 rpm. Set Motor poles to 12 and the same reply reads as a different speed: this is why Betaflight’s
motor_polesmust match your motor, or its RPM filter notches the wrong frequencies.
Four motors and a battery
A motor alone is only half an answer. What it does depends on the propeller it turns and the battery that feeds it, and the three pull against each other: a bigger prop makes more thrust and draws more current; the current makes the battery sag; the sag slows the motor. The RC power solver finds the point where they agree.
It opens on a 5-inch freestyle quad: four 2306 2,450 Kv motors, 5.1 × 4.3 × 3 props, a 4S 1,500 mAh pack, 650 g all up. Four kilograms of static thrust for a 650 g machine, a thrust-to-weight of about 6, hovering at a little over a quarter throttle. Then the warnings: at full throttle each motor is just over its current rating, and the pack is asked for more than 170 A, beyond what its C rating promises, sagging to around 3 V a cell.
Try this:
-
Change Cells in series to 6 without touching anything else. The motors spin half as fast again and the current goes through the roof. This is why 6S quads use lower-Kv motors — the 1,950 Kv motor we started with is a 6S motor, and 2,450 Kv is a 4S one. Set Kv to 1,700 and see things calm down.
-
Back on 4S, raise the prop pitch from 4.3 to 5. More thrust at speed, more current everywhere. Look at g per W in the hover column: that is your flight time.
-
Switch the sweep chart to Efficiency. A motor is most efficient well below full throttle, which is happy news for a quad that spends most of its life hovering at 30%.
Putting it in a frame
The last step is the whole aircraft. A quad is the motors, props, frame, flight controller, ESCs, camera, video transmitter and battery, and every gram of those has to be lifted.
The template is a 5-inch freestyle build on 6S. Scroll below the parts list to Frame, power and battery, where the full-throttle thrust per motor goes in — from a maker’s thrust table or from the solver above — and the tool works out all-up weight, thrust-to-weight, hover throttle and flight time, and checks the props clear each other on the frame.
Try this:
-
Set the Action camera quantity to 1. Seventy-five grams is a lot on a quad whose parts add up to 535 g: watch the hover throttle rise and the flight time fall.
-
Swap the 1,300 mAh battery for a heavier 1,800 mAh one (about 270 g). Flight time goes up, but by less than the capacity would suggest, because you are now carrying the extra cells too.
-
Make the Wheelbase 200 mm with 5-inch props and look at the prop clearance: the discs nearly touch.
One more loop
There is a control loop at the heart of FOC, and another wrapped around the whole quad: the flight controller compares the rotation rate the gyro measures with the rate your sticks ask for, and adjusts the four motors' throttle to close the gap. Both are PID controllers, and the same few ideas govern both.
The plant here is generic — a gain, a time constant and a delay — but the behaviour is the one you tune on a quad.
Try this:
-
Raise Kp from 1.5 to 3. The response overshoots and rings. On a quad, that is the oscillation you hear and see in the footage when the P term is too high.
-
Set Dead time to 0. With no delay, the same high gain settles cleanly. Delay is what makes control hard — which is exactly why ESC latency, gyro filtering and the speed of DShot all matter to how a quad flies.
-
Set Ti blank (no integral) and look at the load disturbance at 50 s: the output never quite comes back. On a quad, I is what holds the attitude against a steady gust or an off-centre battery.
What to take away
A brushless motor is a ring of magnets chasing a rotating magnetic field. The windings decide how smooth and strong that chase is; the ESC decides where the field points. Six-step jumps the field round in 60° steps, timed by Hall sensors or by listening for zero crossings in the back-EMF of the floating phase. FOC measures the currents and rotates the field smoothly, exactly ahead of the magnets. And once you have the motor, the propeller and the battery decide what it can actually do, and a PID loop decides how well it is used.
Where to go next
-
Brushless motors — the full tool, with the Motor tab’s torque–speed and efficiency maps, Measure it for finding your own motor’s Kv and resistance with a drill and a meter, and the ESC tab’s MOSFET losses and bus capacitor ripple.
-
RC power setup — compare three motor, prop and battery setups side by side, for planes as well as multirotors.
-
FPV quad — the build planner, Betaflight rates, a CLI diff and a blackbox log viewer that plots the motor traces this page explained.
-
PID loop simulator — tuning rules and the controller as C code.
-
H-bridge — the brushed motor and single-phase bridge that the three-phase inverter grows out of; LiPo — the batteries on the other end of the wires; motion and drive — gearing a motor for a robot joint.