In permanent magnet machines, the cogging torque caused by reluctance variations in the air gap may degrade the speed control performance in low speed and will undoubtedly limit its operational range. In order to reduce the cogging torque, this paper proposes a position-based repetitive control observer aiming at cogging torque estimation and further rejection. This new scheme of observer design possesses the capability of repeatedly learning the observed clogging torque in each rotation to achieve higher estimation accuracy. An online/offline feedforward compensation strategy that employs the forgetting factor principle and position-based average generates the cogging torque compensation lookup table learned from the position-based repetitive control observer. To verify the overall control performance of the proposed observed design technique, a hardware in the loop control device is employed, and then an experimental setup with a permanent magnet synchronous motor and its power drive was adopted.