Ensuring torque smoothness is an essential requirement in a wide range of high performance applications based on permanent magnet synchronous machines (PMSM). The reported work proposes a novel technique for the compensation of the torque oscillations essentially caused by the spatial harmonics which can result from the machine design imperfectness or/and the operating uncertainties. The main idea of the proposed method is to modify a conventional PMSM controller by superposing an appropriate compensating signal in the inner current loop. The proposed approach allows minimizing torque ripple through a simple synthesis of the compensating signal and does not require a hard calculation cost. A theoretical analysis and some simulation results are presented to show the effectiveness of the proposed compensating method.