a system and method for controlling a rotating electromagnetic machine . the rotating machine , such as a permanent magnet motor or switched reluctance motor , includes a stator having a plurality of phase windings and a rotor that rotates relative to the stator . a drive is connected to the phase windings for energizing the windings . the control system includes an estimator connectable to the machine for receiving signals representing the phase winding voltage and rotor position . the estimator outputs parameter estimations for an electrical model of the machine based on the received voltage and rotor position . a torque model receives the parameter estimations from the estimator to estimate torque for associated rotor position - phase current combinations of the machine . a controller outputs a control signal to the drive in response to a torque demand and rotor position signals and the torque model . in certain embodiments , a solver uses the torque model to generate energization current profiles according to desired machine behavior , such as smooth torque and / or minimal sensitivity to errors in rotor position measurement .