An approach to generating flat optical frequency comb (OFC) is proposed and experimentally demonstrated using a single polarization division multiplexing Mach-Zehnder modulator (PDM-MZM). Experimental results show that the proposed OFC generator can produce nine lines with a spectral flatness of 0.63dB. The unwanted-mode suppression ratio of the OFC is 17.5dB. When cascading with another PDM-MZM, 81 comb lines with spectral power variation less than 1.6dB can be obtained. Based on the theoretical and experimental results, the proposed scheme has the advantages of good feasibility, tunability and flexibility, which can find the potential applications in various fields.