Harmonic current injection for torque ripple reduction with optimum current trajectory for minimum induced voltage