This study deals with a novel control strategy for permanent magnet synchronous machines (PMSMs) to incorporate harmonics compensation features within the current controller, maintaining the integrity of the reference tracking performances. The authors' application in this context is devoted to the improvement of the torque produced by a PMSM, in particular, it is proposed the effective reduction of the undesired harmonic content of the torque due to the non-sinusoidal spatial distribution of the flux density in the air-gap. With the knowledge of the back electromagnetic force shape, the determination of the current waveforms necessary to produce a smooth torque is enabled and via model-based considerations, the corresponding required voltage waveforms are computed. Subsequently, the reasoning is extended to the flux weakening operation of the machine. Finally, it is applied to the more common case of interior PMSMs, which additionally exhibit a reluctance torque component. The analytical solutions found are used in place of the classical αβ/dq Park-transformation, thus impressing the appropriate current waveforms to the machine without modifying any functionality within the main current controller. The effectiveness of the proposed strategy is verified by experimental results.