Share this

Fuzzy PLC Control System for Oilfield Wastewater Treatment

2026-04-06 04:50:28 · · #1

1 Introduction

In industrial process control, PID control is suitable for deterministic control systems where mathematical models can be established. However, many real-world industrial process control systems are nonlinear or time-varying and uncertain, making PID controller parameter tuning cumbersome and resulting in less than ideal control performance. In recent years, with the development of intelligent control technology, many new control methods have emerged, one of which is fuzzy control. Fuzzy control does not require a mathematical model of the controlled object; instead, it determines the magnitude of the control quantity based on control rules. This control method exhibits good control performance for systems with hysteresis or random disturbances. PLCs have high reliability, strong anti-interference capabilities, and can easily implement fuzzy controllers in software. Therefore, using a PLC to construct a fuzzy controller for wastewater treatment in oil fields is a novel approach, not only making the control system more reliable but also achieving better control results.

2. Introduction to Wastewater Treatment Process

Currently, many oilfields in my country are in the secondary oil recovery period, i.e., the water injection production period, and the extracted oil contains a large amount of wastewater. The purpose of oilfield wastewater treatment is to reinject the treated water into the formation to replenish and balance formation pressure, prevent corrosion of the injection pipes and oil pipes by the injected and returned water, and avoid scaling of the injection pipes, oil pipes, and formation by the injected water. The treatment method uses three agents: A, B, and C. Agent A is a pH adjuster, agent B is a flocculant, and agent C is a scale inhibitor. The process flow is shown in Figure 2-1. According to the process requirements, the key is to add agent A to the wastewater in the mixing tank to increase the pH value of the wastewater (i.e., control the pH to 2) to reduce corrosion. Adding agent B can accelerate the sedimentation of flocculent matter in the wastewater. Adding agent C can slow down scaling of the wastewater in the injection pipes and oil pipes. This system is a nonlinear system with a large time lag, and its mathematical model is difficult to obtain. The effect of using PID feedback control is not ideal, and the oilfield joint stations are located in remote areas with harsh environments. Therefore, this wastewater treatment system adopts PLC-based fuzzy control to improve the system's control accuracy and reliability, thereby meeting the process requirements.

3. Fuzzy Control Principle

The control system adopts a "dual-input single-output" fuzzy controller [1]. The input is the deviation e between the given pH value and the measured value and the deviation change rate ec, and the output is the input control voltage u of the frequency converter that supplies power to the dosing pump. Figure 3-1 is a block diagram of the fuzzy control system [2]. The control process is that the controller samples the pH value and the pH change rate at regular intervals and compares them with the given value to obtain the pH value deviation e and the deviation change rate ec. This is used as the input variable of the PLC controller, and the output of the fuzzy controller controls the output frequency n of the frequency converter, thereby changing the dosing amount to keep the pH value stable.

The fuzzy controller consists of three parts: input fuzzification, fuzzy inference, and defuzzification. E and Ec are the fuzzy quantities after e and ec are fuzzified, respectively, U is the fuzzy control quantity, and u is the quantity after U is defuzzified.

3.1 Input fuzzification

In the design of the fuzzy controller, let the vocabulary of E be [NB, NM, NS, N0, P0, PS, PM, PB][3], and the universe of discourse be [-6, -5, -4, -3, -2, -1, 0, +1, +2, +3, +4, +5, +6]; and let the vocabulary of Ec and U be [NB, NS, NM, 0, PS, PM, PB], and the universe of discourse be [-6, -5, -4, -3, -2, -1, 0, +1, +2, +3, +4, +5, +6]. Let -1), and pH0 represent the desired value. Then, e, ec, and u are fuzzified, and based on the experience of pH value control, the fuzzification quantization table of variables E, Ec, and U can be obtained. Table 3-1 is the assignment table for variable E.

3.2 Fuzzy Decision Making and Fuzzy Control Rules

Based on the experience gained in pH control during wastewater treatment, control rules were derived, as shown in Table 3-2. The principle for selecting control variables is: when the error is large or relatively large, the control variable should be chosen primarily to eliminate the error. However, when the error is small, care should be taken to prevent overshoot when selecting the control variable.

The system's stability is paramount. For example, when the pH value is significantly low and shows a further rapid downward trend, the dosage of the reagent should be increased. This rule can be implemented using fuzzy logic (IFE=NBANDEc=NBTHENU=PB). When the error is large and the error change is large or moderate, the control variable should not be increased further; the change in the control variable should be set to 0 to avoid overshoot. There are a total of 56 rules. The relationship Rk of each rule can be represented as:

7) Based on the fuzzy relation Rk (k=1, 2, ..., 56) determined by each fuzzy statement, the total fuzzy relation R of the entire system control rules can be obtained.

3.3 Output Deblurring

For each fuzzy condition statement determined by the fuzzy rule table, the corresponding fuzzy control quantity U is calculated. From the fuzzy inference synthesis rule, the following relationship can be obtained:

The fuzzy control quantity is thus obtained, as shown in Table 3-3. Then, based on the maximum membership method, the actual control quantity u can be obtained. This is then converted to an analog voltage via a D/A converter to change the output frequency n of the frequency converter. This, in turn, controls the dosage of the chemical dosing pump to adjust the pH value, thereby completing the control task.

4. PLC Implementation of Fuzzy Control Algorithm

The OMRON CQM1 PLC was selected for the control system. First, the quantization factor for the fuzzification process was input into the PLC's holding relay. Then, the input quantity was acquired by the A/D module and sent to the PLC's DM area. After amplitude limiting quantization, the fuzzy output quantity was calculated by looking up the corresponding element in the corresponding input fuzzy domain in the fuzzy control table. Multiplying this by the output quantization factor yielded the actual output value, which was then output by the D/A module to control the pH value.

4.1 Fuzzy Control Algorithm Flow

(1) Input deviation quantization factor Ke, deviation change rate quantization factor Kec, and output quantization factor Ku are placed into HR10~HR12. (2) Sample and calculate e and ec, and place them into DM0000 and DM0001.

(3) Determine whether e and ec exceed the limits. If they do, set them to the upper or lower limit values. Otherwise, quantize the input quantities into the corresponding elements E and Ec in the fuzzy domain of the input variables and put them into DM0002 and DM0003 respectively.

(4) Find the fuzzy control scale to obtain U.

(5) Multiply U by the quantization factor Ku to obtain the actual control quantity u.

(6) Output control quantity u.

(7) End.

4.2 Ladder Diagram Programming for Table Lookup

In fuzzy control algorithms, querying the fuzzy control table is crucial for program design. To simplify the program, the elements [-6, -5, -4, -3, -2, -1, 0, +1, +2, +3, +4, +5, +6] of the input fuzzy universe are transformed into [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]. The control results of U in the fuzzy control table are then sequentially placed into DM0100 to DM0268 in a top-to-bottom, left-to-right order. The base address of the control quantity is 100, and its offset address is Ec×13+E. Therefore, the address of the control quantity can be obtained from E and Ec as 100+Ec×13+E. The ladder diagram program is shown in Figure 4-1. DM0002 and DM0003 are the elements corresponding to E and Ec in the fuzzy universe, respectively, and MOV*DM0031DM1000 is an indirect addressing instruction. It uses the content of DM0031 (i.e., the control address 100+Ec×13+E) as the address of the unit to be transmitted, and passes the content of the unit specified by this address (i.e., the control U) to the intermediate unit DM1000. Then, it obtains u through defuzzification operation, and then transmits it to the D/A converter through the analog output channel.

5. Conclusion

Combining fuzzy control with a PLC, and implementing fuzzy control using the PLC, retains the reliability, flexibility, and adaptability of PLC control systems while improving the overall intelligence of the control system. Results show that for control systems with large time delays, nonlinearity, difficult mathematical modeling, and relatively low requirements for control accuracy and speed, PLC-based fuzzy control is a suitable solution. By selecting appropriate sampling periods and quantization factors, the system can achieve good performance indicators, thus meeting control performance requirements.


Disclaimer: This article is a reprint. If it involves copyright issues, please contact us promptly for deletion (QQ: 2737591964). We apologize for any inconvenience.

Read next

CATDOLL Maruko 109CM TPE (Soft Silicone Head)

Height: 109cm Weight: 15.6kg Shoulder Width: 26cm Bust/Waist/Hip: 52/50/57cm Oral Depth: 3-5cm Vaginal Depth: 3-13cm An...

Articles 2026-02-22
CATDOLL 146CM Jing TPE

CATDOLL 146CM Jing TPE

Articles
2026-02-22
CATDOLL 136CM Mila

CATDOLL 136CM Mila

Articles
2026-02-22