Position sensors
Park needs the electrical angle of the rotor flux. No sensor measures that.
An incremental encoder measures change in mechanical position. A resolver measures mechanical position within one turn. Hall sensors report which sixth of an electrical revolution the rotor is in. Every one of them then needs the same two things done to it — multiplied by the pole pairs, and shifted by however far its zero sits from the rotor’s d-axis.
The multiplication is arithmetic. The shift is a calibration, and it is where drives go quietly wrong.
Resolution is rarely the problem
A 2000-pulse encoder decoded in quadrature gives 8000 counts per revolution — four edges per pulse cycle, since both channels change in both directions. Vendors quote whichever of those two numbers is larger, so it is worth being explicit.
That is 0.045° mechanical. On the reference machine’s four pole pairs it is 0.18° electrical, which is far finer than anything else in the drive.
Note that pole pairs multiply the angle, so they multiply the step with it. The same encoder on a twelve-pole-pair machine resolves three times less finely in the frame that actually matters.
The number worth carrying around is the other way up:
so one electrical degree is 5.56 counts. That converts a tolerance expressed the way people discuss angle error into one a calibration routine can check.
Hall sensors give you a sector, not an angle
Three sensors 120 electrical degrees apart produce six distinct states per electrical revolution. That is exactly enough to commutate a trapezoidal drive and coarse for a sinusoidal one: knowing only the sector leaves the angle uncertain by the whole 60°, so using the sector centre is ±30° electrical in the worst case.
The usual fix is to extrapolate between edges at the last known speed, and that works better than it sounds. One sector at 800 rpm lasts 3.1 ms, and even a brisk 5000 rpm/s ramp bends the angle by only 0.59° across it. The extrapolation is not the weak part — the sector coarseness is, and it is worst exactly where extrapolation has least to work with, at standstill and on the first edge after it.
The offset is the whole problem
An encoder count is not a rotor angle. It is a count of edges since power-up. An index pulse zeroes it once per turn, which bounds the drift but says nothing about where the rotor’s magnetic axis is — the index is wherever the encoder was glued.
So the offset has to be found, and the usual procedure is to push current along what the controller believes is the d-axis and let the rotor snap to it.
It does not snap exactly. Cogging, friction and any residual load all hold it away, and the rotor settles where the alignment torque balances them rather than where the alignment torque is zero. For small displacements the alignment torque is per radian, so
On the reference machine with 3 A of alignment current, that stiffness is 0.153 N·m/rad. Against a plausible 10 mN·m of cogging and stiction:
| Cogging + friction | Residual offset |
|---|---|
| 2 mN·m | 3.0° electrical |
| 10 mN·m | 15.0° electrical |
| 30 mN·m | 44.9° electrical |
Fifteen electrical degrees, from a procedure that looked like it worked.
On the bench Now read that number against the current-loop page’s angle-error table: on a salient machine, ten degrees of angle error produces 100.8% of the aligned torque. The reluctance term very nearly cancels the loss at small angles.
So a drive with fifteen degrees of alignment error starts, runs, makes very nearly the torque you expected, and gives you nothing to notice. It shows up later as efficiency that is worse than the datasheet, a field-weakening point in the wrong place, and a machine that behaves differently in the two directions.
The residual falls as , so doubling the alignment current halves it. Better still, align twice from opposite directions and average: the cogging torque reverses with the approach and the average lands on the true axis.
Latency is an angle error too
The angle you use is always older than the angle you measured. Between the capture and the voltage reaching the machine the rotor has moved by , and the timing page turns that into the prediction that removes it.
That correction is worth doing and it is a different problem from this one. Prediction removes a speed-dependent error. It does nothing at all about a constant offset, which is still there at standstill.
What to take away
- No sensor measures the electrical angle. Every one of them needs pole pairs and an offset applied.
- Quadrature is four counts per pulse. 2000 ppr is 8000 counts, 0.18° electrical on a four-pole-pair machine — one electrical degree is 5.56 counts.
- Pole pairs coarsen electrical resolution in proportion. The same encoder is worse on a machine with more poles.
- Halls resolve a 60° sector, so ±30° without extrapolation. Extrapolating between edges is accurate; the sector is what is coarse.
- The index bounds the count. It does not locate the rotor.
- Alignment leaves a residual set by cogging over alignment current — degrees, not arc-minutes. Raise the current, or align from both directions and average.
- Nothing in normal running reveals a constant offset, because torque barely moves for the first ten degrees.