Constant potential rectifier fuzzy control method based on network
Technical Field
The invention relates to the field of anti-corrosion control of oil and gas pipelines, in particular to a network-based potentiostat fuzzy control method.
Background
Aiming at the anti-corrosion control of an oil and gas pipeline, in the face of stray current interference caused by complex geographical environment and manual equipment facilities, how to provide a potentiostat control method capable of effectively dealing with high-frequency nonlinear stray current interference is a problem to be solved urgently by technical personnel. Chemical treatment of metal materials, application of corrosion protection materials and cathodic protection techniques are some of the commonly used techniques for preventing corrosion. Among them, cathodic protection technology is one of the most effective methods for preventing corrosion of metal structures (such as underground pipelines, oil storage tanks, water storage tanks, ships, etc.). The method is divided into sacrificial anode cathodic protection and impressed current cathodic protection. The sacrificial anode cathodic protection is that the metal structure is protected by externally connecting a metal with stronger activity to the protected metal structure and by corroding the externally connected metal and sacrificing the replaceable externally connected metal; impressed current cathodic protection means that cathodic current is applied to metal to make the cathodic polarization of the protected metal reach the oxidation-reduction equilibrium state, and stop corrosion. The cathode protection effective metal polarization potential specified by the industry standard is in the range of-0.85V-1.20V. In the traditional potentiostat control mode, the potentiostat simultaneously executes the functions of a controller, an actuator and a detection transmitter in a control system, the potentiostat has highly integrated functions, and the potentiostat and a pipeline form a finished control system. And by using the network control structure, the potentiostat is only used as an actuator, the controller function is placed at the server end, the algorithm adopted by the potentiostat can be conveniently programmed and modified as required, and the potentiostat control algorithm can be upgraded through the internet at any time and any place.
The invention discloses a cathode protection system of an oil and gas pipeline, which is disclosed in Chinese patent literature and has a publication number of CN 112941521A. The system comprises: the acquisition module is used for acquiring the operating parameters of the switching power supply and the output module at the current moment and sending the operating parameters to the microprocessor; the microprocessor is used for sending the operation parameters to the abnormity diagnosis module; the abnormality diagnosis module is used for diagnosing whether the first subsystem has abnormal operation or not according to the operation parameters and sending a diagnosis result to the microprocessor; the first communication control module is used for switching the first subsystem from a working state to a non-working state and switching the second subsystem from the non-working state to the working state when the first subsystem operates abnormally, so that the oil-gas pipeline is not corroded. But the control precision of the cathode protection potential of the pipeline of the invention is not enough.
Disclosure of Invention
The invention provides a network-based potentiostat fuzzy control method for overcoming the defects of insufficient control precision of the cathodic protection potential of a pipeline and complex equipment maintenance, and realizes the technical effects of higher control precision of the cathodic protection potential of the pipeline and better corrosion resistance of the pipeline.
In order to achieve the purpose, the invention adopts the following technical scheme: a network-based potentiostat fuzzy control method comprises
S1, establishing a detection transmitter and actuator and fuzzy controller information connection network;
s2, electrically connecting the detection transmitter and the actuator with a pipeline to be protected;
s3, detecting the potential uploaded by the transmitter and sampling the potential in the fuzzy controller;
s4, the fuzzy controller determines the monitoring point with the highest potential of each detection transmitter, and the potential of the point is used as the input of the fuzzy controller;
s5, judging the protection level of the input sample of the selected monitoring point by the fuzzy controller, and outputting an instruction to the actuator by the fuzzy controller;
s6, outputting current by the actuator according to the change stage instruction output by the fuzzy controller;
s7, the output current of the actuator acts on the pipeline to change the potential of the pipeline, the potential of the pipeline is detected by the detection transmitter to be fed back, and the fuzzy controller changes the control output, so that a protection-monitoring cycle is formed.
The invention disperses the functions of detection, control and execution by using a network control structure, is beneficial to improving the safety of a cathode protection system, the control algorithm is placed at a server end, can conveniently carry out algorithm upgrading and improvement, the detection transmitter can be selected as a cathode protection pile local to a potentiostat or distributed on a pipeline according to the requirement, can pertinently control the pipeline potential, and the problem of low control precision caused by low detection frequency and transmission delay can be solved by using a fuzzy control method.
Preferably, the information connection network in S1 is: the actuator can respond according to a remote fuzzy controller control instruction received through the Ethernet, and correspondingly changes the magnitude of current output to the pipeline, the detection transmitters are divided into two types, one of the two types of detection transmitters is in information intercommunication with the fuzzy controller through 4G network wireless communication, and the fuzzy controller is a server loaded with a fuzzy control algorithm.
The constant potential rectifier and the server are communicated by adopting an Ethernet communication mode; the communication between the negative security stub and the server adopts 4G network wireless communication. The protocol adopted by data transmission is MQTT communication protocol, the MQTT protocol is a lightweight publishing and subscribing message transfer protocol published by IBM based on TCP and IP, and the data transmission mode of subscription and push is unique, so that the requirements of low broadband, unreliable communication, low energy consumption and low memory consumption are met.
Preferably, the actuator in S1 is a potentiostat, and the detection transmitter includes a potentiostat and a Yin environmental protection pile.
The potentiostat has a detection function, can emit protective current, and has real-time detection function by using the cathode protective piles with automatic potential detection and data transmission functions distributed on the pipeline as a detection link in a control system.
Preferably, the fuzzy control algorithm is as follows:
S1O1 fuzzifies information transmitted by a detection transmitter;
s102, selecting a corresponding fuzzification grade from a rule base;
s103, fuzzification reasoning: calculating a potential regulation and control level according to the fuzzification level;
s104, defuzzification: and converting the potential regulation level into a control quantity to be output.
The fuzzy logic control adopted by the invention is a computer digital control technology based on fuzzy set theory, fuzzy linguistic variables and fuzzy logic reasoning, can solve the problem of low control precision caused by low detection frequency and transmission delay, and the rule base is a database established by field measurement and experts aiming at the relationship between the corrosion degree of the pipeline and the current.
Preferably, S101 further includes:
s1011 carries out processing for meeting the fuzzy control requirement on the input quantity;
s1012, carrying out analog quantity conversion from data to protection level on the input quantity;
s1013, analog quantity values of the protection levels of the input quantities and corresponding membership functions are determined.
When the information transmitted by the detection transmitter is fuzzified, the analog quantity conversion from data to protection level is carried out on the input quantity, so that the fuzzy logic control can determine the analog quantity value of the protection level of each input quantity and the corresponding membership function, and the information fuzzification is achieved.
Preferably, the detection transmitters in S2 are distributed into a plurality of groups of cathode protective piles and a group of potentiostat to form a detection transmitter unit, the potentiostat is connected with the pipeline through a lead, the cathode protective piles are connected with the pipeline through leads, and the detection transmitters are spaced from each other by equal distances.
The invention distributes each detection transmitter unit to the pipeline to be protected, and feeds back the real-time data of the pipeline with protection to the fuzzy controller through the detection transmitter, so that the fuzzy controller can make corresponding judgment by using the data.
Preferably, the fuzzy controller inputs in S4 are the potential moving average value of ten samples before the selected monitoring point and the number of samples with the potential higher than-0.85V in each 60 samples, and the fuzzy controller inputs are the potential moving average value (MA) of ten samples before the selected monitoring point and the number of unprotected samples with the potential higher than-0.85V in each 60 samples (N).
The invention adopts the highest potential point as the sampling point, which is beneficial to finding out the most protected pipeline at the high-frequency nonlinear stray current interference point, and the unprotected sampling number (N) with the potential higher than-0.85V in each 60 times of sampling is beneficial to finding out the secondary point to be protected in the corrosion of the pipeline.
Preferably, the output instruction of the fuzzy controller in S6 is the output change stage number of the potentiostat, the fuzzy controller blurs the potential moving average value (MA) into three sections of high, middle and low, blurs the unprotected sampling number (N) into four sections of zero, low, middle and high, establishes a fuzzy word table, generates fuzzy quantity output, and divides the output of the fuzzy controller into-2, -1, 0, 1 and 2 through the fuzzification to serve as the output increment value of the potentiostat, wherein the output of the potentiostat is 0V at the lowest and 3V at the highest, and is divided into 256 stages by an 8-bit D/A conversion circuit.
The potentiostat in the invention finds out the corresponding current value output of 256 levels in a D/A conversion circuit according to the output instruction of the fuzzy controller to carry out pipeline protection, wherein the output instruction of the fuzzy controller is obtained according to real-time data fuzzification, which is favorable for cathode protection potential control of whole section fixed point precision.
The invention has the beneficial effects that:
by using the network control structure, the potentiostat is only used as an actuator, the controller is placed at the server end, except for the detection function of the potentiostat, the cathode protective piles with automatic potential detection and data transmission functions distributed on the pipeline are also used as a detection link in the control system to play a role, so that the functions of detection, control and execution are dispersed, the safety of the cathode protective system is improved, a control algorithm is placed at the server end, the algorithm can be conveniently upgraded and improved, the detection transmitter can be selected as the cathode protective piles local to the potentiostat or distributed on the pipeline as required, the pipeline potential can be controlled in a targeted manner, and the problem of low control precision caused by low detection frequency and transmission delay can be solved by using a fuzzy control method.
Drawings
FIG. 1 is a flow chart of the present invention;
FIG. 2 is a control block diagram of the present invention;
FIG. 3 is a system framework diagram of the present invention;
FIG. 4 is a fuzzy word graph in accordance with the present invention.
Detailed Description
The invention will be further explained by combining the practical case of the optimized configuration and the attached drawings.
A potentiostat fuzzy control method based on network, according to figure 1, comprises
S1, establishing a detection transmitter and actuator and fuzzy controller information connection network;
the information connection network in S1 is: the actuator can respond according to a remote fuzzy controller control instruction received through the Ethernet, and correspondingly changes the magnitude of current output to the pipeline, the detection transmitters are divided into two types, one of the two types of detection transmitters is in information intercommunication with the fuzzy controller through 4G network wireless communication, and the fuzzy controller is a server loaded with a fuzzy control algorithm;
the actuator in the S1 is a potentiostat, and the detection transmitter comprises the potentiostat and a cathode protection pile;
the fuzzy control algorithm is as follows:
S1O1 fuzzifies information transmitted by a detection transmitter;
s1011 carries out processing for meeting the fuzzy control requirement on the input quantity;
s1012, carrying out analog quantity conversion from data to protection level on the input quantity;
s1013, determining analog quantity values of the protection levels of the input quantities and corresponding membership functions;
s102, selecting a corresponding fuzzification grade from a rule base;
s103, fuzzification reasoning: calculating a potential regulation and control level according to the fuzzification level;
s104 defuzzification: converting the potential regulation level into a control quantity to be output;
according to fig. 3;
s2, electrically connecting the measuring transducer and the actuator with a pipeline to be protected;
the detection transmitters in the S2 are distributed into a plurality of groups of cathode protective piles and a group of potentiostat to form a detection transmitter unit, the potentiostat is connected with the pipeline through a lead, the cathode protective piles are connected with the pipeline through leads, and the detection transmitters are spaced from each other by equal distances;
s3, detecting the potential uploaded by the transmitter and sampling the potential in the fuzzy controller;
s4, the fuzzy controller determines the monitoring point with the highest potential of each detection transmitter, and the potential of the point is used as the input of the fuzzy controller;
s4, inputting a potential moving average value of ten times of previous sampling of a selected monitoring point and a sampling number of which the potential is higher than-0.85V in each 60 times of sampling by a fuzzy controller, and inputting a potential moving average value (MA) of ten times of previous sampling of the selected monitoring point and an unprotected sampling number (N) of which the potential is higher than-0.85V in each 60 times of sampling by the fuzzy controller;
s5, judging the protection level of the input sample of the selected monitoring point by the fuzzy controller, and outputting an instruction to the actuator by the fuzzy controller;
s6, outputting current by the actuator according to the change stage instruction output by the fuzzy controller;
s6, the output instruction of the fuzzy controller is the output change progression of the potentiostat, the fuzzy controller fuzzes the potential moving average value (MA) into a high section, a middle section and a low section, fuzzes the unprotected sampling number (N) into a zero section, a low section, a middle section and a high section, establishes a fuzzy word table, generates fuzzy quantity output according to a graph 4, and divides the output of the fuzzy controller into-2, -1, 0, 1 and 2 through the fuzziness to serve as the output increment value of the potentiostat, wherein the output of the potentiostat is at least 0V and at most-3V, and is divided into 256 levels by an 8-bit D/A conversion circuit;
according to fig. 2;
s7, the output current of the actuator acts on the pipeline to change the potential of the pipeline, the potential of the pipeline is detected by the detection transmitter to be fed back, and the fuzzy controller changes the control output, so that the network-based potentiostat fuzzy control pipeline protection method is formed.
The embodiment of the invention comprises the following steps:
establishing a detection transmitter and actuator and fuzzy controller information connection network; electrically connecting the measuring transducer and the actuator with a pipeline to be protected; detecting the uploading potential of the transmitter and sampling the uploading potential in a fuzzy controller; the fuzzy controller determines the monitoring point with the highest potential of each detection transmitter, and the potential of the point is used as the input of the fuzzy controller; the fuzzy controller judges the protection level of the input sample of the selected monitoring point, and outputs an instruction to the actuator; the actuator outputs current according to the change stage instruction output by the fuzzy controller; the output current of the actuator acts on the pipeline to change the potential of the pipeline, the potential of the pipeline is detected by the detection transmitter to be fed back, and the fuzzy controller changes the control output, so that the network-based potentiostat fuzzy control pipeline protection method is formed.
The invention disperses the functions of detection, control and execution by using a network control structure, is favorable for improving the safety of a cathodic protection system, the control algorithm is placed at a server end, and can be conveniently upgraded and improved, the detection transmitter can be selected as a cathodic protection pile of a potentiostat locally or distributed on a pipeline according to the requirement, and can control the potential of the pipeline in a targeted manner, and the problem of low control precision caused by low detection frequency and transmission delay can be solved by using a fuzzy control method.
The constant potential rectifier and the server communicate with each other in an Ethernet communication mode; the communication between the negative security stub and the server adopts 4G network wireless communication. The protocol adopted by data transmission is MQTT communication protocol, the MQTT protocol is a lightweight publishing and subscribing message transfer protocol published by IBM based on TCP and IP, and the data transmission mode of subscription and push is unique, so that the requirements of low broadband, unreliable communication, low energy consumption and low memory consumption are met.
The potentiostat has a detection function, can emit protective current, and has real-time detection function by using the cathode protective piles with automatic potential detection and data transmission functions distributed on the pipeline as a detection link in a control system.
The fuzzy logic control adopted by the invention is a computer digital control technology based on fuzzy set theory, fuzzy linguistic variables and fuzzy logic reasoning, and can solve the problem of low control precision caused by low detection frequency and transmission delay.
When the information transmitted by the detection transmitter is fuzzified, the analog quantity conversion from data to protection level is carried out on the input quantity, so that the fuzzy logic control can determine the analog quantity value of the protection level of each input quantity and the corresponding membership function, and the information fuzzification is achieved.
The invention distributes each detection transmitter unit to the pipeline to be protected, and feeds back the real-time data of the pipeline with protection to the fuzzy controller through the detection transmitter, so that the fuzzy controller can make corresponding judgment by using the data.
The method adopts the highest potential point as the sampling point, is favorable for finding out the most protected pipeline at the high-frequency nonlinear stray current interference point, and is favorable for finding out the secondary protection point in the corrosion of the pipeline, wherein the potential is higher than the unprotected sampling number (N) of-0.85V in each 60 times of sampling.
The potentiostat in the invention finds out the corresponding current value output of 256 stages in the D/A conversion circuit according to the output instruction of the fuzzy controller to carry out pipeline protection, wherein the output instruction of the fuzzy controller is fuzzified according to real-time data, which is favorable for the cathode protection potential control of the whole section of fixed point precision.