Comparison of control algorithms for a PMSM electrical machine