The invention relates to a method of operating a
synchronous motor (1) having a
stator comprising a set of electromagnets (7, 9) and having a
permanent magnet rotor (5), wherein the
synchronous motor (1) is controlled by calculating in a flux controller (f) a measure of a flux magnitude, which is the magnitude of the
stator flux of the motor (1), and is controlled by calculating in a
load angle controller (g) a measure of a
load angle. Information about a desired
motor torque or a reduced
motor torque, which is smaller than the desired
motor torque, is input to the
load angle controller (g) and the load angle controller (g) calculates the measure of the load angle depending on the input motor torque. The measure of the flux magnitude is combined with the measure of the load angle to obtain commands for controlling electric currents of electromagnets of the
stator, thereby directly controlling the stator flux. A flux
limit value which depends on a predetermined maximum value of the stator flux allowed for the motor (1), which depends on a maximum value of an electric
voltage, which is used to drive the currents through the stator electromagnets (7, 9), and which depends on the actual
rotor speed is repeatedly calculated. During acceleration of the rotor (5) while the stator flux is smaller than the
maximum flux allowed for the motor the measure of the flux magnitude is calculated depending on the output of a predetermined function, wherein the output of the predetermined function depends on the desired motor torque and corresponds to the magnitude of the stator flux, which results in the desired motor torque using the minimum possible stator current. The measure of the load angle is calculated depending on the desired motor torque.