With the development of science and technology, Atomic Force Microscope is widely applied to the field of machining process in nanometer scale. Due to the limitation of the inventive purpose of AFM, only height mode and deflection mode can be applied in AFM-tip micromachining. It can’t control the machining depth during the micromachining process at present. In this paper, a new micromachining system is set up, which composed of a high precision three-dimensional stage, an AFM, a diamond probe and a special control device. By utilizing variation parameters PID algorithm and controlling the machining depth directly, the micromachining system can resolve the problem mentioned above.