In order to inhibit the harmful chaos of permanent magnet synchronous motor (PMSM),the model of PMSM was transformed to a generalized Hamilton model with some nonlinear disturbance.Then a disturbance compensator and a tracking controller were designed from its Hamilton model.Next a disturbance compensator with adjustable gain matrix was designed for the nonlinear disturbance in the generalized Hamilton model,and the system with the disturbance compensator was proved to have the asymptotic stability by Lyapunov stability theorem.After fixing the Hamilton energy function with freely choosing the desired equilibrium,the tracking controller with undetermined coefficient matrix was designed with the method of modified interconnect and damping control,and the undetermined coefficient matrix was a modified matrix with an expected structure.To improve the adaptive ability of the system,grey wolf optimizer (GWO) was applied to find the best adjustable gains of the disturbance compensator and the optimal coefficients of expecting correction matrix for the tracking controller.The wolf position vector was composed of adjustable gain parameters and the undetermined coefficients of the correction matrix,and the iterative process of GWO was a purposeful optimization one.To verify the validity of the above-controlled method,several contrast experiments were designed from the change of desired output,the load disturbance,as well as the a-axis and d-axis voltage disturbance.The experimental results showed that the chaotic phenomena of the system are suppressed,the system could follow the expected output well and have better capacity in resisting load disturbances and voltage disturbances.The validity of grey wolf optimizer algorithm in assisting the controllers' parameters on the basis of the optimized objective function,which improves the adaptive ability of the system,was also proved by the experimental results.