This paper presented a detailed authentic simulation model of a permanent magnet synchronous motor control system based on the SimPowerSystems toolbox in Simulink library. We then focus on the periodic adaptive learning compensation (PALC) for cogging effect on PMSM position and velocity servo tasks. The cogging force is considered as a position-dependent disturbance that is periodic and not necessarily sinusoidal. The key idea of the implemented cogging disturbance compensation method is to use past information for one position period along the state axis to update the current adaptation law. Simulation results are presented to illustrate the effectiveness of the adaptive cogging compensation scheme. Furthermore, the advantage of the PALC is demonstrated. We also reported an initial result on high-order PALC.