Permanent-magnet synchronous motors (PMSMs) are widely used as high-performance variable-speed drives. Ripple in the electric torque of such motors is often a source of vibration and tracking errors, especially at low speeds. We study the torque characteristics of PMSMs and propose a method to minimize the torque ripple. First, we establish a detailed model for the motor and present a Fourier analysis of the torque ripple, caused by the non-sinusoidal back electro-motive force (BEMF) and the cogging torque, where the main conclusion is that the frequencies present in the torque disturbance are integer multiples of six times the electric frequency. The resulting model is highly nonlinear. We propose an adaptive controller based on the internal model principle, where the resonant frequencies of the controller and the associated gains change according to the motor speed. This is achieved by replacing the time variable by the motor angle, which simplifies the nonlinear model. Our approach is passivity based and will work also for complex mechanical loads and several resonant frequencies. Simulation and experimental results are given to verify the new controller. We compare the performance of our adaptive algorithm with the well-known one from [Canudas de Wit, C., & Praly, L. (2000). Adaptive eccentricity compensation. IEEE Trans. Control Syst. Technol. 8,[757][758][759][760][761][762][763][764][765][766]. We find that it performs similarly in simple configurations, and it works also when the motor is part of a more complex system, for example, when the motor is connected to a load via a very flexible shaft.