Controlling harmonic issues in variable speed drives