In this paper, a method to control the harmonic content of the magnetic flux density in the airgap of a synchronous machine is presented. Voltage harmonics in one phase as well as the exciting magnetic forces can be affected. Switched power electronics were used to provide the field current to a synchronous machine, the control added specific current harmonics to the DC field current in order to minimize either voltage harmonics or magnetic forces. The method is verified and compared with simulations and experiments on an existing electrical machine.