SmartCtrl | Design of Control Loops for a Permanent Magnet Synchronous Machine (PMSM)