In this paper, a stable optical frequency comb generation scheme based on Mach-Zehnder modulator (MZM) is designed. The key to this scheme is to determine the type of modulator, and then through the analysis of modulation characteristics and theoretical calculation, the driving condition of the flattest optical frequency comb can be achieved. This scheme finally generates 35 stable optical frequency lines with flatness less than 1.1 dB and tone to noise ratio (TNR) more than 37 dB. Compared with other research on the modulation of optical cascade number of frequency lines and the flatness have an excellent improvement in performance. Moreover, the experimental scheme has the advantages of simple structure, low hardware and driving voltage requirements, and can be referenced by more researches and applications. At the same time, the designed 12.5 GHz frequency interval provides a stable frequency source for wavelength division multiplexing. At the same time, the frequency lines generated by the same light source have good correlation, which provides a basis for coherent communication research for generating stable microwave and terahertz carrier. Therefore, the stable multi-light source generated by the optical frequency comb provides more possibilities for future terahertz generation and communication.