This paper proposes a new algorithm of generating command pulses for numerical controller. Different from the presently used NC pulse generating method, pulse train with automatically changed frequency following reference displacement commands can be generated using the proposed algorithm, and the generated command pulses can be modified in real time according to the reference signal. Moreover, by adopting the proposed algorithm, the generated velocity and acceleration can be also controlled under the bounds of the motor system. Structure and parameters of the numerical controller which adopts the proposed algorithm are described in this paper, and method of adjusting the controller parameters to adapt to the servo system's torque-frequency characteristic is also introduced. At last, effectiveness of the proposed algorithm and methods for velocity and acceleration control are demonstrated by simulations.