Network-based constant potential rectifier fuzzy control method
Technical Field
The invention relates to the field of corrosion prevention control of oil and gas pipelines, in particular to a network-based potentiostat fuzzy control method.
Background
Aiming at corrosion prevention control of oil and gas pipelines, how to provide a potentiostat control method capable of effectively dealing with high-frequency nonlinear stray current interference is a problem which needs to be solved by technicians in the face of complicated geographical environment and stray current interference caused by manual equipment facilities. The techniques of chemical treatment of metallic materials, coating with corrosion-resistant materials and cathodic protection are some of the common techniques used to prevent 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 to connect the metal with stronger activity through the protected metal structure, and the metal structure is protected by corroding the external metal and sacrificing the replaceable external metal; cathodic protection by external current is to apply cathodic current to the metal to make the cathodic polarization of the protected metal reach oxidation-reduction equilibrium state and stop corrosion. The effective metal polarization potential for cathodic protection specified by industry standard is within the range of-0.85V to-1.20V. The conventional potentiostat control mode is that the potentiostat itself simultaneously executes the functions of a controller, an actuator and detection and transmission in a control system, the potentiostat functions are highly integrated, and a finished control system is formed by the potentiostat and a pipeline. The network control structure is used, the potentiostat is used as an executor, the controller function is arranged at the server end, the algorithm adopted by the potentiostat can be conveniently programmed and modified according to the requirement, and the potentiostat can be upgraded at any time and any place through the Internet.
The invention discloses a cathode protection system of an oil and gas pipeline, which is disclosed in Chinese patent literature, and the invention discloses a cathode protection system of the oil and gas pipeline, wherein the publication number of the cathode protection system is CN 112941521A. The system comprises: the acquisition module is used for acquiring the operation parameters of the switching power supply and the output module at the current time and sending the operation parameters to the microprocessor; the microprocessor is used for sending the operation parameters to an abnormality diagnosis module; the abnormality diagnosis module is used for diagnosing whether the first subsystem has abnormal operation according to the operation parameters and sending a diagnosis result to the microprocessor; and the first communication control module is used for switching the first subsystem from the working state to the non-working state and switching the second subsystem from the non-working state to the working state when the first subsystem is abnormal in operation, so that the oil and gas pipeline is not corroded. However, the control accuracy of the cathodic protection potential of the pipeline is insufficient.
Disclosure of Invention
The invention provides a network-based constant potential meter fuzzy control method for overcoming the defect 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 above purpose, the present invention adopts the following technical scheme: a network-based potentiostat fuzzy control method comprises the following steps of
S1, establishing an information connection network of a detection transmitter, an actuator and a fuzzy controller;
s2, electrically connecting the detection transmitter and the actuator with a pipeline to be protected;
S3, detecting potential sampling of the uploading of the transmitter to the fuzzy controller;
S4, determining the monitoring point with the highest potential of each detection transmitter by the fuzzy controller, and inputting the potential of the monitoring point as the input of the fuzzy controller;
S5, the fuzzy controller judges the protection level of the input sample of the selected monitoring point, and the fuzzy controller outputs an instruction to the executor;
s6, the executor outputs current according to the change series instruction output by the fuzzy controller;
and S7, the output current of the actuator acts on the pipeline to change the pipeline potential, the pipeline potential is detected by the detection transmitter to carry out feedback, 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 the negative protection system, the control algorithm is placed at the server end, the algorithm can be conveniently upgraded and improved, the detection transmitter can be selected as a constant potential rectifier local or negative protection piles distributed on a pipeline according to the requirement, the pipeline potential can be controlled in a targeted way, 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 executor can respond according to a remote fuzzy controller control instruction received through the Ethernet, the current output to the pipeline is correspondingly changed, the detection transmitter is divided into two types, one type of the detection transmitter is in communication with the fuzzy controller through 4G network wireless communication, and the fuzzy controller is a server carrying a fuzzy control algorithm.
The communication between the potentiostat and the server adopts an Ethernet communication mode; the communication between the female security pile and the server adopts 4G network wireless communication. The protocol adopted by the data transmission is an MQTT communication protocol, and the MQTT protocol is a lightweight publishing and subscribing message transfer protocol based on TCP and IP issued by IBM, and has the data transmission modes of subscribing and pushing, thereby meeting the requirements of low broadband, unreliable communication, low energy consumption and low memory consumption.
Preferably, the actuator in S1 is a potentiostat, and the detection transmitter includes a potentiostat and a female protection pile.
The potentiostat has a detection function, can send out protection current, and the negative protection piles distributed on the pipeline and provided with automatic potential detection and data transmission functions play a role in real-time detection as a detection link in a control system.
Preferably, the fuzzy control algorithm is as follows:
S1O1 obscures information transmitted by a detection transmitter;
s102, selecting a corresponding fuzzification level from a rule base;
s103, fuzzy reasoning: calculating a potential regulation level according to the blurring level;
s104, defuzzification: and converting the potential regulation level into control quantity output.
The fuzzy logic control adopted by the invention is a computer digital control technology based on fuzzy set theory, fuzzy language variable and fuzzy logic reasoning, and 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 expert aiming at the relation between the corrosion degree of the pipeline and the current.
Preferably, S101 further includes:
s1011, processing the input quantity to meet the fuzzy control requirement;
S1012, carrying out analog quantity conversion from data to protection level on the input quantity;
S1013, determining the analog value of the protection level of each input quantity and the corresponding membership function.
When the information transmitted by the detection transmitter is fuzzified, the invention carries out analog quantity conversion from data to the protection level 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, thereby achieving the information fuzzification.
Preferably, the detecting transmitters in the step S2 are distributed into a plurality of groups of female protection piles and a group of potentiostats to form a detecting transmitter unit, the potentiostats are connected with the pipeline through wires, the female protection piles are connected with the pipeline through wires, and each detecting transmitter is in equal-length distance with each other.
According to the invention, each detection transmitter unit is distributed to the pipeline to be protected, and real-time data of the pipeline with protection is fed back to the fuzzy controller through the detection transmitter, so that the fuzzy controller can make corresponding judgment by utilizing the data.
Preferably, the fuzzy controller inputs in S4 are the potential moving average of the last ten samples of the selected monitoring point and the number of samples with the potential higher than-0.85V in every 60 samples, and the fuzzy controller inputs are the potential Moving Average (MA) of the last ten samples of the selected monitoring point and the unprotected number of samples with the potential higher than-0.85V in every 60 samples.
The invention adopts the highest potential point as the sampling point, which is favorable for finding out the pipeline to be protected at the high-frequency nonlinear stray current interference point, and the unprotected sampling number (N) with the potential higher than-0.85V in every 60 samples is favorable for finding out the secondary point to be protected in the corrosion of the pipeline.
Preferably, the output instruction of the fuzzy controller is a constant potential rectifier output change level number in S6, the fuzzy controller is used for blurring a potential moving average value (MA) into three sections of high, medium and low, an unprotected sampling number (N) into four sections of zero, low, medium and high, a fuzzy word table is established, fuzzy quantity output is generated, the fuzzy controller output is divided into-2, -1, 0,1 and 2 through the definition, and the fuzzy quantity output is used as a constant potential rectifier output increment value, wherein the constant potential rectifier output is at least 0V and at most-3V, and the 8-bit D/A conversion circuit is divided into 256 levels.
According to the invention, the constant potential rectifier finds 256-level corresponding current value output in the D/A conversion circuit according to the output instruction of the fuzzy controller to perform pipeline protection, wherein the output instruction of the fuzzy controller is the cathodic protection potential control which is obtained according to real-time data blurring and is beneficial to full-segment fixed point accuracy.
The invention has the beneficial effects that:
the constant potential instrument is used only as an executor by using a network control structure, the controller function is placed at the server end, besides the detection function of the constant potential instrument, the negative protection piles distributed on the pipeline and provided with automatic potential detection and data transmission functions also play a role as detection links in a control system, so that the three functions of detection, control and execution are dispersed, the safety of the negative protection system is improved, the control algorithm is placed at the server end, the algorithm can be conveniently upgraded and improved, the detection transmitter can be selected as the negative protection piles locally of the constant potential instrument 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 frame diagram of the present invention;
FIG. 4 is a diagram of a fuzzy word table of the present invention.
Detailed Description
The invention will be further explained with reference to the practical case of optimal configuration and the accompanying drawings.
A network-based potentiostat fuzzy control method, according to FIG. 1, comprises
S1, establishing an information connection network of a detection transmitter, an actuator and a fuzzy controller;
The information connection network in S1 is: the executor can respond according to a remote fuzzy controller control instruction received through the Ethernet, the current output to the pipeline is correspondingly changed, the detection transmitter is divided into two types, one type of the detection transmitter is communicated with the fuzzy controller through 4G network wireless communication, and the fuzzy controller is a server with a fuzzy control algorithm;
The actuator in the S1 is a potentiostat, and the detection transmitter comprises the potentiostat and a female protection pile;
The fuzzy control algorithm is as follows:
S1O1 obscures information transmitted by a detection transmitter;
s1011, processing the input quantity to meet the fuzzy control requirement;
S1012, carrying out analog quantity conversion from data to protection level on the input quantity;
S1013, determining an analog measurement value of the protection level of each input quantity and a corresponding membership function;
s102, selecting a corresponding fuzzification level from a rule base;
s103, fuzzy reasoning: calculating a potential regulation level according to the blurring level;
s104, defuzzification: converting the potential regulation level into control quantity output;
According to fig. 3;
S2, electrically connecting a measuring transmitter and an actuator with a pipeline to be protected;
The detection transmitters in the S2 are distributed into a plurality of groups of female protection piles and a group of potentiostats to form a detection transmitter unit, the potentiostats are connected with a pipeline through wires, the female protection piles are connected with the pipeline through wires, and each detection transmitter is separated from each other by a distance equal to the length;
S3, detecting potential sampling of the uploading of the transmitter to the fuzzy controller;
S4, determining the monitoring point with the highest potential of each detection transmitter by the fuzzy controller, and inputting the potential of the monitoring point as the input of the fuzzy controller;
S4, inputting a potential moving average value of ten samples before a selected monitoring point and the sampling number of which the potential is higher than-0.85V in every 60 samples by using a fuzzy controller, and inputting a potential moving average value (MA) of ten samples before the selected monitoring point and the unprotected sampling number (N) of which the potential is higher than-0.85V in every 60 samples by using the fuzzy controller;
S5, the fuzzy controller judges the protection level of the input sample of the selected monitoring point, and the fuzzy controller outputs an instruction to the executor;
S6, the executor outputs current according to the change series instruction output by the fuzzy controller;
S6, blurring the output instruction of the controller into a constant potential rectifier output change level, blurring the potential moving average value (MA) into three sections of high, medium and low by the fuzzy controller, blurring the unprotected sampling number (N) into four sections of zero, low, medium and high, establishing a fuzzy word table, generating fuzzy quantity output according to FIG. 4, and dividing the fuzzy controller output into-2, -1, 0,1 and 2 through the definition to serve as a constant potential rectifier output increment value, wherein the minimum potential rectifier output is 0V, the maximum potential rectifier output is-3V, and the 8-bit D/A conversion circuit is divided into 256 levels;
according to fig. 2;
and S7, the output current of the actuator acts on the pipeline to change the potential of the pipeline, the detection transmitter detects the potential of the pipeline to feed back, and the fuzzy controller changes the control output, so that the network-based method for protecting the pipeline by fuzzy control of the potentiostat is formed.
Embodiments of the invention:
Establishing an information connection network of the detection transmitter, the executor and the fuzzy controller; electrically connecting the measuring transmitter and the actuator with a pipeline to be protected; detecting potential sampling of the uploading of the transmitter to the fuzzy controller; the fuzzy controller determines the monitoring point with the highest potential of each detection transmitter, and takes the potential of the monitoring point as the input of the fuzzy controller; the fuzzy controller judges the protection level of the input sample of the selected monitoring point, and the fuzzy controller outputs an instruction to the executor; the executor outputs current according to the change series order output by the fuzzy controller; the output current of the actuator acts on the pipeline to change the potential of the pipeline, the detection transmitter detects the potential of the pipeline to feed back, and the fuzzy controller changes the control output, so that the network-based method for protecting the pipeline by fuzzy control of the potentiostat 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 the negative protection system, the control algorithm is placed at the server end, the algorithm can be conveniently upgraded and improved, the detection transmitter can be selected as a constant potential rectifier local or negative protection piles distributed on a pipeline according to the requirement, the pipeline potential can be controlled in a targeted way, 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 communication between the potentiostat and the server adopts an Ethernet communication mode; the communication between the female security pile and the server adopts 4G network wireless communication. The protocol adopted by the data transmission is an MQTT communication protocol, and the MQTT protocol is a lightweight publishing and subscribing message transfer protocol based on TCP and IP issued by IBM, and has the data transmission modes of subscribing and pushing, thereby meeting the requirements of low broadband, unreliable communication, low energy consumption and low memory consumption.
The potentiostat has a detection function, can send out protection current, and the negative protection piles distributed on the pipeline and provided with automatic potential detection and data transmission functions play a role in real-time detection 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 language variable 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 invention carries out analog quantity conversion from data to the protection level 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, thereby achieving the information fuzzification.
According to the invention, each detection transmitter unit is distributed to the pipeline to be protected, and real-time data of the pipeline with protection is fed back to the fuzzy controller through the detection transmitter, so that the fuzzy controller can make corresponding judgment by utilizing the data.
The invention adopts the highest potential point as the sampling point, which is favorable for finding out the pipeline to be protected at the high-frequency nonlinear stray current interference point, and the unprotected sampling number (N) with the potential higher than-0.85V in every 60 samples is favorable for finding out the secondary point to be protected in the corrosion of the pipeline.
According to the invention, the constant potential rectifier finds 256-level corresponding current value output in the D/A conversion circuit according to the output instruction of the fuzzy controller to perform pipeline protection, wherein the output instruction of the fuzzy controller is the cathodic protection potential control which is obtained according to real-time data blurring and is beneficial to full-segment fixed point accuracy.