A digital approach in a variable structure controlled permanent magnet synchronous motor drive