| At present, many oilfields have entered into the last period of oil exploitation in our country, and the crude oil gets into poor quality, high moisture content and serious situation of oil-water emulsion. In this circumstance, The traditional electrical dehydration power supply has been exposed to some troubles like electric instability, low efficiency of dehydration, and the electric dehydration of crude oil is getting more and more difficult.In order to solve the above problems faced by the oilfield, this paper analyzed the present situation of crude oil electric dehydration, and designed a power supply with rectangular wave which is controlled by DSP chip, according to the fundamental mechanism of electric dehydration. The main circuit of the power supply is designed based on inverter technology, the power supply output pulsed electric field with voltage amplitude, frequency and duty cycle adjusted through full-bridge inverter circuit which is constituted by several IGBT. This kind of pulsed electric field has greater impact force emulsion film, and the result of dehydration is obviously better than the traditional equipment.In order to enhance the automatic control ability of the whole system of crude oil electric dehydration, I designed a system control module, using TMS320LF2407 DSP chip, which has functions of data acquisition, data processing, outputting analog signal and so on. The DSP control module can collect the current signal from the main circuit, and then adjust voltage control signal in program according to the current to keep the dehydration system running in the best status. The control system can also automatically adjust oil-water interface that the DSP chip will pick up the setting values and actual values of oil-water interface, and then figure out the new shutter of valve on PID control principle, enabling the whole system of crude oil electric dehydration working at the dynamic balancing. The content of this paper mainly focused on the hardware and software of the DSP control module. The hardware consists of DSP minimum system circuit, data sampling circuit, analog signal output circuit, data display and RS232 serial interface circuit. In the part of DSP software, the integrated development environment CCS3.1 was introduced first, then introduced DSP application program such as main program, subroutines of voltage regulation and oil-water interface PID controlling.Finally, the paper analyzes some problems that we should pay attention to during the process of equipment assembly, and offered solutions, and then finished testing experiment with a good result. |