A novel speed controller for permanent-magnet synchronous motor (PMSM) is proposed. With the usage of an analytical two-degree-of-freedom (2DOF) proportional integral (PI) controller design method in speed control, good speed-reference tracking and good load-torque rejection can be achieved simultaneously. A "back calculation and tracking" anti-windup (AW) method is used to deal with the "windup" problems. In both simulation and experiment, the proposed designs are shown to exhibit satisfactory performance.