A brushless dc motor and PMSM motor consists of a permanent magnet, which rotates (the rotor), surrounded by three equally spaced windings, which are fixed (the stator). Current flow in each winding produces a magnetic field vector, which sums with the fields from the other windings. By controlling currents in the three windings, a magnetic field of arbitrary direction and magnitude can be produced by the stator. Torque is then produced by the attraction or repulsion between this net stator field and the magnetic field of the rotor.