SPICE modeling of a resolver-to-digital converter for closed loop simulations of brushless dc motors