Microstepping with PI feedback and feedforward for permanent magnet stepper motors