shunt resistor) and rotor position (think: encoder). Implementing the algorithm, though, can get a bit tricky since it touches bits of linear algebra, motor physics, and control theory.