FOC Reference 04 Sensing

The converter

The current measurement page decides where to put a sensor and when to look. This one is about what comes back when you do.

Not amps. Integers. Somewhere between the shunt and the Clarke transform sits a converter with a finite number of codes, and the choice of how much current those codes have to span decides how finely the drive can see anything at all.

The division is the easy part. The interesting part is what happens to the rounding once three phases are combined into two axes, because the answer is not the one the per-phase figure suggests — in two different directions at once.

One code, in amps

A bipolar chain centred on zero spans twice the full-scale current, so

For a 12-bit converter set up for ±10 A that is 4.88 mA per code. The rounding error is uniform across a code, so its RMS is — 1.41 mA on each phase.

ResolutionOne codePer-phase noise
10-bit19.5 mA5.64 mA
12-bit4.88 mA1.41 mA
14-bit1.22 mA0.352 mA
16-bit0.305 mA0.088 mA

Zero sits on a code rather than between two. A drive spends much of its life near zero current, and a converter that dithered around it instead of reading it would put that dither straight into the torque.

What arrives in dq is not what left the phases

Three phases are rounded independently and then combined into two axes. Both things that happen next are worth knowing, and they pull opposite ways.

The RMS noise gets smaller. Amplitude-invariant Clarke maps three independent errors onto two axes with a variance gain of on each, and Park is a rotation, which changes nothing. So each dq axis carries

At 12 bits over ±10 A that is 1.15 mA on and , against 1.41 mA per phase. Combining three measurements into two axes averages some of the rounding away.

The worst case gets bigger. The peak deviation on a dq axis is not half a code. The transform is a weighted combination, so the three errors can conspire:

With each at most half a code, the worst case is half a code times the sum of those coefficients’ magnitudes — and that sum reaches exactly , at 60°, where the second and third terms stop opposing each other. The bound is two thirds of a code, a third larger than the per-phase one.

The converter
The drive
The deviation between the current the machine is carrying and the current the controller is told about, over one electrical revolution, with the machine holding a steady q-axis current. A held current is reported as one that is never quite still. The dashed band is ⅔ of a code — the real bound, which the trace reaches for and never crosses. Drag Resolution down to 8 bits and watch it fill the band; drag Full scale up and watch the same thing happen without the converter changing at all.

On the bench Half a code is the intuitive bound and it is wrong here. Drawing a figure with a half-code band around a dq trace draws a limit the trace crosses — at 8 bits the sweep reaches 0.565 of a code, comfortably past it.

That was a real defect in the figure above before the test caught it, which is why core/adc carries the bound as a derived constant with the algebra beside it rather than as a number somebody remembered.

Range you never use is resolution you do not have

Rounding is absolute, not proportional. A converter sized for a current you hope never to draw spends its codes on nothing:

Operating peak, on a ±10 A rangeBits actually working
10 A12.0
6 A11.3
1 A8.7

Every halving of the current you actually use costs exactly one bit. Sizing the front end for a 10 A fault when the machine runs at 1 A throws away 3.3 of the 12 bits you paid for — and the noise on is the same 1.15 mA whether you are pushing 10 A or 100 mA.

That is the argument for setting full scale from the operating current and letting a hardware comparator catch the fault, which is exactly what the peripherals page puts the comparator there for.

Does any of it matter?

On the reference machine the torque constant is = 0.051 N·m/A, so 1.15 mA of noise is 56 µN·m — against roughly 0.31 N·m at 6 A. Under two parts in ten thousand.

So for torque, no. Twelve bits is ample and sixteen is a waste of money.

Where it does matter is everything downstream that integrates. A current-loop integrator, a flux observer, a speed estimate built from position differences — each accumulates what the converter rounded off, and a bias in that rounding does not average away the way the noise does. That is why the offset calibration on the previous page is not optional while the last bit of resolution usually is.

What to take away

  • One code is ; the rounding noise is that over .
  • The RMS noise in dq is of the per-phase figure — smaller, because three measurements are being combined into two axes.
  • The peak deviation in dq is two thirds of a code, not half. The intuitive bound is the per-phase one and does not survive the transform.
  • Rounding is absolute. Every halving of the current you actually use costs a bit, so size the range for the operating point and let hardware catch faults.
  • Quantisation noise is negligible for torque and is not negligible for anything that integrates.