Abstract: Some embodiments provide a system that generates a coil switching signal for a brushless DC motor. During operation, the system determines a magnetic field of the brushless DC motor at a first time and a magnetic field of the brushless DC motor at a second time. Then, the coil switching signal is generated based on a relationship between the magnetic field determined at the first time and a first predetermined threshold, and the magnetic field determined at the second time and a second predetermined threshold.