In DPSK communication system, the traditional way for bias voltage is loading a fixed bias voltage on the electro-optic modulator. For the influence of the temperature changes, the half-wave voltage of the electro-optic modulator may change and the DC bias supply voltage will have a certain degree of random fluctuations at the meantime which will cause the DC bias point of the modulator drift and consequently the communication systems are affected. To enhance the stability of the DPSK optical communication system and control the bias of Mach-Zehnder electro-optic modulators automatically, a PID control method has been proposed in this paper. After the actual operation, a DPSK signal transmission with transfer rate of 5Gb/s is built. Using the complex spectrum analyzer, stable signal and the constellation can be received. The automatic control system basically meets the needs of the DPSK transmission system of high stability, high accuracy and capacity of resisting disturbance.