FOC, Current Sensing & Thermals
Riding the Rotor so AC Looks Like DC
A robot finger has to close on an egg without cracking it and on a wrench without slipping. That is a torque problem, and torque in a brushless motor is just current in the right winding at the right instant. But the windings are three phases of sliding sine waves, each one zero-crossing sixty times a turn, so the “right current” is a moving target that never holds still long enough for a simple controller to grab it. Chase those sine waves directly and you will always be a beat behind the rotor.
The trick is to stop chasing. Climb onto the rotor and ride along, and the spinning AC currents freeze into steady DC you can control like a battery.
Field-oriented control (FOC) is the change of viewpoint that makes that ride possible. It is two coordinate transforms stacked back to back: one that flattens three phases into two, and one that spins those two to follow the rotor. The whole method rests on an ordering rule. You measure currents in the messy spinning frame, transform into the calm rotor frame to think and control, then transform back out to drive the inverter. Get the order right and an intimidating time-varying machine becomes two DC knobs.
By the end, you can
- Explain how the Clarke and Park transforms turn three AC phase currents into steady DC Id and Iq
- Justify holding Id ≈ 0 and using Iq to set torque on a surface-PM motor
- Choose a current-sense topology (low-side shunt, in-line shunt, or Hall) for a given drive
- Calculate the temperature-rise budget that separates a motor's continuous torque from its peak torque
Intuition first
Picture a carousel with three horses spaced evenly around the ring, and you are standing on the ground watching one particular horse. From where you stand it rises and falls, swings left, swings right, never sits still. Trying to describe its motion from the ground takes a fistful of time-varying equations, because the horse is doing two things at once: going around, and bobbing up and down.
Now step onto the carousel and walk to stand right next to that horse. The going-around part vanishes, because you are going around with it. All that is left is the gentle bob, and that you can describe with a single number that barely changes. You did not slow the carousel down. You changed your reference frame so the fast, confusing motion became invisible and the slow, useful part stood out.
That is exactly what FOC does to motor currents. From the stationary stator, the three phase currents are spinning sinusoids. Ride along with the rotor and they collapse into two steady values: one that points along the rotor’s magnet (the d, or direct, axis) and one that points ninety degrees ahead of it (the q, or quadrature, axis). On the q axis, current pushes the rotor forward, so is torque. On the d axis, current just fights or reinforces the magnet’s own flux and makes no torque at all, so for a plain magnet motor you want to be zero. Two DC knobs: one for torque, one you leave parked at zero.
Two transforms, three phases to two DC values
The phase currents you actually measure, , , , are three sine waves spaced by a third of a turn. In a balanced motor they sum to zero at every instant, which is the quiet secret that lets the whole scheme work with only two sensors: if , then knowing any two gives you the third for free.
The Clarke transform is the first step. It projects the three phase currents onto two fixed axes, called and , that sit in the plane of the motor and do not rotate. Three numbers become two, with no information lost as long as the currents are balanced:
The currents are still AC. They trace a circle as the rotor turns, because the axes themselves are bolted to the stationary stator. You have flattened three phases into two, but you have not yet stopped the spinning.
The Park transform is the second step, and it is the one that does the riding. It takes the stationary vector and rotates it by the rotor’s electrical angle , into a frame that turns with the rotor. That frame’s two axes are and :
Because the frame spins at exactly the same rate as the current vector, the rotation cancels the spin. What was a circling AC vector becomes a stationary point. and stop oscillating and hold steady as DC, and now an ordinary proportional-integral loop, the same humble controller you would point at a heater or a battery charger, can regulate them. That is the entire payoff: the Park transform converts the machine from a time-varying problem into a linear time-invariant one you already know how to control.
Once you have computed the voltages you want in the frame, you run the whole chain backward (inverse Park, then inverse Clarke, usually folded into space-vector PWM) to get the three duty cycles the inverter drives onto the phases. Forward to think, backward to act.
The one ingredient both Park transforms need, forward and inverse, is the rotor angle . There is no riding the rotor if you do not know where the rotor is. That angle comes from an encoder or Hall sensors bolted to the shaft, or from a sensorless estimator that infers position from the back-EMF the spinning magnets induce in the undriven windings. Feed FOC the wrong angle and the Park rotation lands in the wrong frame: torque you meant for leaks into , the motor wastes current making heat instead of force, and in the limit it stalls or runs backward.
Sensing the current you mean to control
FOC controls current, so FOC is only as good as your current measurement. Three topologies dominate, and each trades cost against where in the circuit it can listen.
A low-side shunt is a small precise resistor between each phase’s bottom switch and ground. It is cheap and its measurement node sits near ground, which keeps the amplifier simple, but you can only read a phase’s current while that phase’s low-side switch is on. At high duty cycle the conduction window shrinks and you have to sample in a narrow slice of each PWM period, sometimes too narrow to trust.
An in-line shunt sits in series with the phase wire itself, so it reads that phase’s current continuously regardless of switch state. The catch is that the shunt now floats at the phase voltage, which swings up to the full bus rail and back many thousands of times a second. Reading a few millivolts across the shunt while its whole reference is slamming between zero and the rail is exactly the job of a differential amplifier with strong common-mode rejection (the current-sense amp you met in lesson 27): it subtracts away the giant common-mode swing and keeps only the tiny differential signal you care about.
A Hall-effect current sensor takes a different path entirely: it measures the magnetic field the phase current creates rather than a voltage across a resistor. That gives you galvanic isolation (the sensor never touches the high-voltage node) and no ohmic loss in the path, at the cost of more drift and noise and a higher price. It is the natural choice when the bus voltage is dangerous to probe directly or when the phase current is too large to dump into a shunt without cooking it.
Whichever you pick, the sensed voltage is tiny and the measurement window is short, so the front end matters: an amplifier with enough bandwidth to settle inside the sample window, and an ADC (lesson 10) triggered in lockstep with the PWM so you sample the current at the same point in every cycle. A current loop fed by a noisy or mistimed sample will hunt and buzz no matter how elegant the transforms upstream are.
Heat sets the real torque limit
The transforms tell you what current to push. Thermals tell you how much current you are allowed to push, and for how long. Every amp you send into a winding does two jobs: it makes torque, and it makes heat. The heat is unavoidable, and it is what ultimately caps the motor.
The dominant loss is copper loss, the power burned in the winding resistance, which grows as the square of current:
That square is the whole story of continuous versus peak torque. Double the current and you double the torque, but you quadruple the heat. On top of copper loss sit iron loss (hysteresis and eddy currents in the core, which grow with speed and flux) and switching loss in the inverter MOSFETs (energy lost every time a switch turns on or off, which grows with PWM frequency). Total loss is roughly
All of that power has nowhere to go but into the motor’s mass, raising its temperature until heat flows out to the surroundings as fast as it is generated. In steady state the rise above ambient is the loss times the thermal resistance from winding to air:
The winding insulation and the magnets have a temperature they must not exceed (too hot and the insulation breaks down or the magnets lose strength permanently). That ceiling, divided back through , sets the continuous current the motor can sustain forever. Above it, the motor is still happy for a while, because its thermal mass takes time to heat up. That window is the peak torque: a robot finger can slam shut with a current it could never hold, as long as it backs off before the winding cooks. Continuous torque is what you can do all day; peak torque is what you can do for a second. The gap between them is entirely a thermal story, written by the term and the clock.
See it / Try it
The widget below runs the Clarke and Park transforms on three balanced phase currents in real time. The left side shows the spinning currents; the right side shows what and look like once you ride into the rotor frame. The speed slider sets how fast the rotor turns. The theta offset slider deliberately misaligns the Park rotation, the way a miscalibrated encoder or a bad sensorless estimate would, so you can watch the control frame drift away from the rotor.
Aligned (offset 0): id sits near zero and iq rides flat
as DC. Add an offset and the rotor estimate is wrong, so torque current bleeds
out of iq and into id.
Start with the offset at zero. Notice that rides flat as a clean DC line and sits near zero: that is FOC working, all the current going into torque and none wasted fighting the magnet. Now drag the theta offset away from zero. Watch torque current bleed out of and into , and both pick up a wobble. You did not change the motor or the currents at all, only your estimate of where the rotor is. That is why FOC lives or dies on rotor position: the entire benefit of the rotating frame evaporates the moment the frame stops tracking the rotor.
In FOC of a surface-PM motor, which current sets torque, and what is the target for the other axis?
-
Reversed. The d (direct) axis is aligned with the rotor's own magnet flux; current there makes no torque, it only fights or reinforces the magnet.
-
Correct. The q (quadrature) axis is ninety electrical degrees from the magnet, so q-axis current pushes the rotor forward and sets torque. A surface-PM motor has no reluctance term to exploit, so you hold Id ≈ 0 and put all current into Iq.
-
Only the q-axis current produces torque on a surface-PM motor; d-axis current does not, so they are not equal.
-
Iα and Iβ are the stationary-frame currents before the Park transform; they are still AC and do not separate torque from flux. That separation only appears in the rotating dq frame.
Why does a current-sense amp need strong common-mode rejection for an in-line phase shunt?
-
Tempco matters for accuracy, but it is not why common-mode rejection is required; that is about the shunt's floating reference, not its drift.
-
Correct. An in-line shunt sits in the phase wire, so both its terminals ride the phase voltage, which slams between zero and the bus rail thousands of times a second. The few-millivolt drop you want is a differential signal sitting on top of that huge common-mode swing, and only a high-CMRR diff amp can subtract the swing away and keep the signal.
-
ADC speed is a real constraint, but it is a separate issue from common-mode rejection, which is about the amplifier's ability to ignore the shared voltage swing.
-
A shunt measures voltage, not magnetic field; there is no Hall sensor in this topology to interfere with anything.
Lab: from sensed current to a torque limit
On a bench FOC drive, prove the loop end to end before you trust it. First, with the motor held still and a known DC current forced through one phase, read the current-sense amp’s output on a scope and confirm the volts-per-amp scale matches the datasheet, so your in software means real amps. Second, spin the motor open-loop at a slow fixed speed and capture , , , then compute and offline: a correctly aligned encoder gives you a flat and a near-zero , and any wobble points straight at an angle-offset error to trim. Finally, run the motor at a fixed and log winding temperature versus time with a thermocouple. The plateau temperature at a given current, read against the insulation’s rated ceiling, is your continuous-torque limit. Everything above that plateau is peak torque you can borrow only for as long as the thermal mass lets you.
The full Clarke and Park matrices, and why the power-invariant scaling carries that √(2/3)
The two-step, three-numbers-to-two reduction has a clean linear-algebra story. The power-invariant Clarke transform, the form Edith Clarke’s later work settled on, is the matrix that projects the three phase currents onto two stationary axes plus a common-mode (zero-sequence) component:
The leading makes the matrix orthonormal, so it rotates the current vector without rescaling it and the power you compute in equals the power in . The bottom row is the (zero-sequence) component; in a balanced motor with it is identically zero, which is precisely why FOC throws it away and works in two axes. Drop the row and you get the simplified two-by-two form your firmware actually runs.
The Park transform is then just a planar rotation by the rotor angle applied to the pair:
The deep point Park proved in 1929 is what this rotation does to the machine’s equations, not just its currents. A synchronous machine’s inductances, seen from the stator, vary with rotor position, which makes the governing differential equations time-varying and miserable. Park’s rotation transfers them into the rotor frame where those inductances become constant, turning the whole machine into a linear time-invariant system. That is the property that lets a fixed-gain PI controller work at every speed, and it is why the transform, not any particular controller, is the real invention.
A note where the authoritative course statement and the encyclopedia meet: FOC controls for torque and holds for a surface-PM motor specifically. Interior-PM and reluctance machines have a position-dependent reluctance torque term, so their optimal strategy commands a deliberately nonzero (usually negative) to exploit it and, at high speed, to weaken the field. The rule in this lesson is the correct default for the surface-PM case the course targets; it is a sensible starting point, not a universal law, and the more general machines bend it on purpose.
Grounded in Wikipedia: “Field-oriented control”, “Direct-quadrature-zero transformation”, “Alpha-beta transformation”, “Brushless DC electric motor” (CC BY-SA).
Key takeaways
- FOC rides the rotor: Clarke flattens three phases to a stationary two-axis frame, Park rotates that frame onto the rotor so AC currents become steady DC.
- In the rotor frame, Iq sets torque and Id is held near zero on a surface-PM motor, so a simple PI loop can control each.
- FOC needs rotor position from an encoder, Hall sensors, or a sensorless estimator; a wrong angle bleeds torque current from Iq into Id.
- Current sensing picks among low-side shunt, in-line shunt + diff amp, or Hall sensor, trading cost, conduction window, and isolation.
- Heat, dominated by I²R copper loss, sets the continuous-vs-peak torque limit: ΔT = P·Rθ against the insulation's ceiling.
A balanced three-phase motor is sensed with two shunts that read A and A at one instant. What is , and why do you only need two sensors?
Show worked solution
In a balanced (ungrounded, three-wire) motor the phase currents sum to zero at every instant: . So
The third current is fully determined by the other two, which is why FOC needs only two current sensors. That same constraint, , is what makes the zero-sequence () component vanish and lets the Clarke transform reduce three numbers to two with no loss of information.
A motor winding has resistance per phase and a winding-to-ambient thermal resistance . Ignoring iron and switching loss, and treating the copper loss as in one phase, the insulation is rated for a 80 °C rise above ambient. What continuous phase current does that thermal ceiling allow?
Show worked solution
Set the steady-state rise equal to the ceiling and solve back to power, then to current. The rise is , so the allowed loss is
That loss is copper loss , so
About 8.9 A is the continuous limit. Because heat goes as , pushing twice this current (17.8 A) would dump four times the loss (80 W) and four times the rise (320 °C), which is why that level of current is only ever a brief peak, never continuous.
You are designing a 48 V, 30 A continuous robot-joint drive. Phase current is large, the bus voltage is hazardous to probe directly, and the joint must keep running even if one sensor path develops a fault to the high-voltage rail. Which current-sense topology fits best, and what is the main trade-off you accept?
Show worked solution
A Hall-effect current sensor is the best fit here, for three reasons that all point the same way. First, it gives galvanic isolation: the sensing element measures the magnetic field around the conductor and never makes electrical contact with the hazardous 48 V node, which directly answers the safety requirement. Second, it adds no ohmic loss in the phase path, so at 30 A continuous you are not burning watts and heating a shunt that would itself need cooling. Third, it reads the phase current continuously, unlike a low-side shunt whose window shrinks at high duty.
The trade-off you accept is accuracy and cost: Hall sensors drift more with temperature and time, are noisier, and are more expensive than a precise shunt plus a diff amp. For a precision torque loop you would calibrate the offset and gain and may add filtering. (An in-line shunt with a high-CMRR diff amp could also read continuously, but it leaves the measurement node floating on the 48 V rail, which fails the isolation requirement; a low-side shunt is cheapest but loses its conduction window at high duty and offers no isolation at all.)
The egg and the wrench feel like opposite problems, but to a brushless motor they are the same problem solved at two settings of one knob. Climb onto the rotor, where the spinning blur of three phases stands still and resolves into two honest DC numbers, and the whole machine opens up: for how hard, parked at zero, and heat quietly deciding how long you may hold the squeeze. Ride the rotor, and the AC was never the hard part.