A new patterning method of an optical rotary encoder gratings is proposed and tested for higher precision and higher rotational speed more than 30000 min-1, which marks the grating patterns directly on the metallic shaft of an air spindle by using YAG laser marker. It is pointed that the second harmonic generated YAG laser wave is more effective for this application rather than the fundamental wave. The experimental patterning system applies a precise speed control system using a flywheel and the PLL (Phase Locked Loop) speed control system with the unique error compensation. The validity of this method is proved from a microscopic examination of the patterned gratings and the regeneration of the encoder signal with a standard optical detector.