Tracking errors are caused by the amplitude attenuation and phase lag of the servo system to the command. Based on the mechanism, this study proposes the method of command correction which magnifies the amplitude and advances the phase of the command according to the amplitude attenuation and phase lag of the servo system. Firstly, the command is decomposed into stable components and unstable components using Fourier series fitting and Hilbert-Huang transform. Then, the frequency-domain characteristics of the servo system are used to calculate the amplitude attenuation and phase lag of each component. Finally, the stable components and unstable components of the command are corrected by amplifying the amplitude and advancing the phase to compensate for the attenuation and lag caused by the servo system. The experimental results show that the corrected command reduced the average tracking error of the X-axis of the butterfly-shaped trajectory by 66.58 % and the maximum tracking error by 72.28 %. Moreover, the contour error of the butterfly-shaped trajectory was reduced significantly. The proposed method is suitable for the tracking errors and contour error controlling of a trajectory with a drastic curvature change.