The rotor position sensors can be used as a tachometer. By differentiating the positive−going edges and then integrating them over time, a voltage proportional to speed can be generated. The error amp compares this voltage to that of the speed set to control the PWM.