Speed controllers and inverters for electric motors