Real Time Implementation of Incremental Fuzzy Logic Controller for Gas Pipeline Corrosion Control
A robust virtual instrumentation based fuzzy incremental corrosion controller is presented to protect metallic gas pipelines. Controller output depends on error and change in error of the controlled variable. For corrosion control purpose pipe to soil potential is considered as process variable. The proposed fuzzy incremental controller is designed using a very simple control rule base and the most natural and unbiased membership functions. The proposed scheme is tested for a wide range of pipe to soil potential control. Performance comparison between the conventional proportional integral type and proposed fuzzy incremental controller is made in terms of several performance criteria such as peak overshoot, settling time, and rise time. Result shows that the proposed controller outperforms its conventional counterpart in each case. Designed controller can be taken in automode without waiting for initial polarization to stabilize. Initial startup curve of proportional integral controller and fuzzy incremental controller is reported. This controller can be used to protect any metallic structures such as pipelines, tanks, concrete structures, ship, and offshore structures.
Natural gas (NG) transportation pipeline network systems are similar to national power transmission networks and are used for transporting natural gas (NG) across a country for thousands of miles from different source stations to multiple destinations. This underground insulation coated iron pipeline network is operating at a high pressure of 90 bars. Corrosion is a phenomenon by which metal is oxidized and etched away naturally contributing to material loss. Corrosion of this pipeline leads to reduction of wall thickness and the design life of the pipelines, gas leakages, environmental pollution, fire hazards, and gas supply disruption. This may lead to major manmade disasters like gas transportation pipeline explosions. Corrosion reduces the life of metal structures, oil and gas transmission underground and undersea pipelines, storage tanks, offshore platforms, and so forth.
Corrosion is an electrochemical process. It can be controlled by impressing current in gas pipeline (which acts as cathode of corrosion cell). Basics on pipe to soil potential measurement (PSP) and design details on pipeline corrosion control by impressed current cathodic protection (ICCP) method are available in . Conventional transformer rectifier (TR) units which are used in cathodic protection (CP) system uses multitapped secondary transformer . Precision regulation at output is not possible with this conventional system and normally it demands more human intervention. ICCP Anode bed design details are explained in . Pipe to soil potential (PSP) is the corrosion healthiness indicator of the pipeline. To measure PSP, half-cell  is required. Criteria for cathodic protection are given in [5, 6]. Experimental setup for corrosion studies with liquid electrolyte is illustrated in . Pipeline corrosion control can be represented as electrical equivalent circuit . ICCP can be applied for gas insulated cables as well . There will be wide variation in pipeline coating resistance, soil pH value, soil resistance , and so forth, along the pipeline. Accurate modeling of pipeline corrosion process is difficult with these many affecting factors . ICCP prolongs the life of pipelines .
Proportional integral (PI) controller based corrosion control is reported in . Autotuning  can be implemented in PI controlled ICCP systems. PI controller works well once initial polarization process is completed. In pipeline CP corrosion control system, for initial polarization it takes 24–72 hours. A Corrosion controller is required to be put in automode even during the initial polarization period. Transformer rectifier (TR) tap changing process is automated using computer  unit; due to inherent characteristic of tap change, it does not deliver smooth output change.
Corrosion prevention decreases environmental pollution and improves economics . Underground metallic pipelines are primarily protected by coatings. Even in good quality coatings, coating defects may exist. Impressed current cathodic protection is used to protect pipelines from coating defects . When pipeline is laid underground, soil acts as electrolyte in a corrosion cell and corrosion occurs in metal pipeline primarily due to differential corrosion cell. By impressing current to the pipeline, the entire structure is made to become a cathode of the corrosion cell . Impressed current corrosion controller should be dynamic enough to protect pipelines from variation in coating defects . The main objectives and requirements of cathodic protection (CP) systems are to prevent external corrosion throughout the design life  of the pipeline by impressing sufficient current to the pipeline. Optimum impressed current has to be maintained. Under current will result in corrosion and over current will affect coating bonding .
Fuzzy incremental controller is reported here to control the corrosion in underground metallic pipelines and its performance is compared with conventional proportional-integral (PI) controller. This controller can be taken in automode from zero hours of initial polarization process. For corrosion process control, when the set point and process value (PSP) become equal, output should not become zero and it should be in its previous value in a stay put condition. Fuzzy incremental controller output varies the single phase AC. Varied AC is rectified, filtered, and fed to pipeline for corrosion control purpose.
2. Impressed Current Cathodic Protection
Corrosion of most common engineering materials at near-ambient temperatures occurs in aqueous environments (electrolyte). A galvanic series  is a list of metals and alloys arranged according to their relative corrosion potentials in a given environment. When two metals are electrically coupled in an environment, the more negative (active) member of the couple will become the anode in the differential corrosion cell, and the other one becomes the cathode. Figure 1 shows the simple corrosion control using impressed current cathodic protection method.
The electrochemical nature of the corrosion process provides opportunities to detect and mitigate corrosion of underground structures. When a piece of metal is placed in an electrolyte, a voltage will develop across the metal electrolyte interface. Voltage difference between a metal and a reference electrode is called pipe to soil potential (PSP). This pipe to soil potential measurements can be used to estimate the relative resistance of different metals to corrosion, in a given environment. For soil environments copper-copper Sulfate reference electrode (CSE) is widely used to measure PSP.
Cathodic protection is a technique to reduce the corrosion rate of a metal surface by making it the cathode of an electrochemical cell . This is accomplished by shifting the potential of the metal in the negative direction by the use of an external power source (referred to as impressed current CP). Protection current density of 0.03 mA/M2  is applied in the three layer polyethylene coated pipelines. An impressed current cathodic protection (ICCP) system applies a negative (conventional current flow) potential to the metal structure to be protected and a positive potential to the anode to be sacrificed as shown in Figure 2. When protection current () just equals or exceeds corrosion current (), then the corrosion rate becomes negligible; that is, corrosion process stops.
Impressed current system use semi-inert (semi soluble) anodes to supply protective current. Since these anodes are relatively inert, they exhibit relatively noble electrochemical potentials. To produce charge flow in the direction to cathodically polarize a steel structure, it is necessary to connect an external power supply in series between the semi-inert anode and steel structure. Cathodic protection criteria [5, 6] are as mentioned below:(i)metal-to-electrolyte potential chosen for a corrosion rate less than 0.01 mm/year (0.39 mils/year),(ii)polarized potential more negative than −850 mV CSE,(iii)limiting critical potential not more negative than −1,200 mV CSE.
Natural PSP of steel pipe is around −0.55 Volts (when Cu-CuSO4 reference electrode is used). If PSP is less than −1.5 Volts (say −1.6 Volts), then the pipeline enters into over protection zone and it leads to coatings disbandment. If the PSP is more than −0.85 Volts (say −0.8 Volts) then it will enter into under protection zone, which will lead to corrosion.
3. Fuzzy Incremental Controller
Fuzzy logic deals with reasoning that is approximate rather than fixed and exact . Compared to traditional binary sets (where variables may take on true or false values), fuzzy logic variables may have a truth value that ranges in degree between 0 and 1. To implement fuzzy logic technique to a real application, it requires the following three steps.
Fuzzification: convert classical data or crisp data into fuzzy data or Membership Functions (MFs). All machines can process crisp or classical data such as either “0” or “1.” In order to enable machines to handle vague language input such as “SLIGHT,” “MEDIUM,” and “BIG,” the crisp input and output must be converted to linguistic variables with fuzzy components. To control corrosion in pipeline, error, change in error, and the output control variables must be converted to the associated linguistic variables.
Fuzzy inference process: combine membership functions with the control rules to derive the fuzzy output. To begin the fuzzy inference process, one needs to combine the membership functions with the control rules to derive the control output and arrange those outputs into a table called the lookup table. Table 1 shows the fuzzy rule designed for corrosion control. The control rule is the core of the fuzzy inference process, and those rules are directly related to a human being’s intuition and feeling.
Fuzzy rule may be read as given below:
“if error is Positive Big and Change in Error is Positive Big then Output is Positive Big.”
Mamdani type of inference and centroid type of defuzzification is used in this work. Here error (difference between set point and actual process value) and change in error (difference between current error and past error) are the inputs to the fuzzy system. In fuzzy rule case, the conditions can be also partially satisfied to some degree (opposed to crisp rules), which has the nice effect to be able to interpolate between two rule conditions and there to achieve smooth transition from one state to the other in the induced fuzzy control surface.
Pipe to soil potential is the process variable. Input and output signal range is moderated to ±1 in Figure 3. If the error is say positive small (PS) (for instance set point is −1.2 Volts and actual process value is −0.9 Volts, then the error is 0.3) and change in error is positive small (PS), the output should increase to small extent, that is, positive small. Error shows the magnitude of the difference between set value and process value, whereas change in error shows the error direction. Method of improving performance of PI type fuzzy controller is given in . Fuzzy logic controller with resetting action is discussed in . Fuzzy logic controller basic is discussed in . Theoretical analysis of a fuzzy controller with unequally spaced triangular membership function is available in . PID controller using a simplified Takagi-Sugeno rule scheme is tried in . Here fuzzy incremental controller is developed and implemented to control underground metallic gas pipeline. Performance of fuzzy incremental controller is compared with conventional PI controller. Various types of PID controllers available are reported in . Defuzzification criteria and classification are discussed in . Theoretical aspects and fuzzy modeling is discussed in [21, 29–32].
The error signal is defined as . The change in error is defined as . The operation of PI type fuzzy logic controller (FLC) can be described by , where is the sampling instant and is the incremental change in controller output. Each of the rules of fuzzy logic controller is characterized with an “IF” part called antecedent and “THEN” part called consequent. If the conditions of antecedents are satisfied, then consequents are applied. Error “” and its change “” are the inputs or antecedents and change of control “” as the output or consequent of rule base. Scaling factors in fuzzy controller are very similar to controller gain in a conventional controller which describes the particular input normalization and output denormalization. Hence, these scaling factors are very important with respect to controller stability and performance. A set of rules are defined using the available expertise for input and output relationship of fuzzy controller. These rules are defined using the linguistic variables. If there is a sustained error in steady state, integral action is necessary for a conventional control system. The integral action will increase the control signal if there is a small positive error, no matter how small the error is; the integral action will decrease it if the error is negative. A controller with integral action will always return to zero error in the steady state.
Problems with integrator windup have to be dealt with. Integral windup occurs when final control element saturates in a close loop control system, the control action stays constant, but the error will continue to be integrated, and the integrator winds up. The integral term may become very large and it will take a long time to wind it down when the error changes sign. Large overshoots may be the consequence.
It is often a better solution to configure the controller as an incremental controller . An incremental controller adds a change in control signal to the current control signal
The controller output is an increment to the control signal. It is an advantage that the controller output is driven directly from the integrator, and then it is easy to deal with windup and noise. A disadvantage is that it cannot include differential action well. The output from the rule base is therefore called change in output and the gain on the output has changed name accordingly to GCU. The control signal is the sum of all previous increments: In ideal continuous PI controller, where is controller output, is proportional gain, is integral time, and is the error between the reference and the process output.
In digital control, and for small sampling periods , the equation may be approximated by a discrete approximation. Replacing the integral by a sum using rectangular integration, an approximation is Index refers to the time constant.
Signals are written in lower case before gains and upper case after gains. The gains are mainly for tuning the response, but since there are two gains, they can also be used for scaling the input signal. The controller output is an increment to the control signal. It is an advantage that the controller output is driven directly from an integrator, and then it is easy to deal with windup and noise. The block diagram of fuzzy incremental (FInc) controller is shown in Figure 4. The output from the rule base is called change in output and the gain on the output has changed name to GCU.
The control signal is the sum of all previous increments: where is the sampling period.
The linear approximation to this controller is
By comparing equations it is clear that the gains are related in the following way:
Fuzzy incremental controller removes steady state error and gives smooth control signal.
3.1. Realization of Fuzzy Incremental Controller through Virtual Instrumentation
Modern virtual instrument (VI) requires the most sophisticated hardware and software solutions to fulfill the requirements of the industrial, educational, and scientific applications . Virtual instrument (VI) is technique with which user designs and test function to meet their requirements through software . Fault diagnosis is easy with VI . What the Virtual Instrument emphasizes is not that every module is a piece of instrument, but through transferring the different software it can expand or constitute all kinds of instrument or systems with dissimilar systems. Monitoring of corrosion stray current using VI is reported in .
PSP of structure under protection is measured using half cell. It is fed as input signal to analog input module of the data acquisition card (DAQ). Desired set point (normally between −0.85 and −1.5 Volts) is entered manually. Controller module gives output based on the set point (SP), measured value (PV), and the fuzzy logic rules written. This controller operates in direct acting mode, that is, increase in error increases the controller output.
Fuzzy Controller module output is assigned to analog output module of DAQ. Output of the controller dynamically varies the triggering angle of TRIAC. Single phase AC power supply is fed to the TRIAC. Step down transformer (230/24 Volts) is connected as load to the Thyristor. Step down transformer output is rectified, filtered, and then fed to the pipeline. Purpose of the step down transformer is to reduce the voltage to nonobjectionable level and to meet the load side current requirement.
A newly designed and developed virtual instrumentation based fuzzy incremental controller front panel is presented in Figure 5(a). Block diagram (program written in LabVIEW) is shown in Figure 5(b). Over protection window will become red in color when PSP is less than −1.5 Volts (say −1.6 volts); under protection window will become red if the PSP is greater than −0.85 Volts (say −0.8 Volts). When the controller is set in Manual mode, set point will directly go as output. In manual mode if the set point is 1.5 then controller output will also be 1.5 Volts. Under the Auto PSP mode, it will try to maintain the PSP as per the Set Point.
In the block diagram, cp8.fs is the controller fuzzy logic link in which fuzzification and defuzzification  membership functions are assigned as shown in Figure 3. Here two fuzzy inputs (error and change in error) are used and one single output (controller output) is used. For corrosion control purpose, PSP is used as process value. Here formula blocks are used to convert the sign. In this design, PSP, controller output voltage, and controller output current are measured through DAQ input channels. Controller output is sent through DAQ output channel.
Experimental setup developed is shown in Figure 6. In this prototype, five-meter length, 10 mm diameter iron rod is used as specimen. It is coated with polyvinyl chloride (to make it similar to coated gas pipelines). It is buried in soil at a depth of one meter. Anode bed is placed five meters away from the specimen under protection. PSP is measured using copper copper sulphate electrode. Negative side of rectified and filtered DC is connected to the specimen under protection and positive side is connected to the anode bed.
4. Results and Discussions
Fuzzy incremental controller response is shown in Figure 7. When the set point is changed, process value tracks the set point without any error. From the figure it can be observed that when the set point is changed from −1.5 V to −1.7 Volts, it took much fewer seconds to reach the set point. Moreover there is no major overshoot or undershoot observed. Once the set point and process value matche, there is no oscillation or steady state error. Controller output is used to vary the firing angle of the thyrister (AC phase control). If the error is more, conduction angle will be more and vice versa. In the case of simple fuzzy controller, if the set point and process value (PSP) matche, it will give zero output. If it is the case here then it would have firing angle near to 180° in the phase control unit, which result in zero output. Then process value (PSP) will enter into under protection zone. By this time error will increase drastically which will give high value output to the phase control unit, which will result in over protection. Process value would be oscillating and never settle, whereas in fuzzy incremental controller, fuzzy controller output is added to the current output. In this case when the process value matches with the set point, output will not become zero.
Startup curve of the PI controller is given as Figure 8(a) and fuzzy controller is given as Figure 8(b). With the conventional controller, it has to be kept in manual mode during initial polarization period and it can be taken on automode only after two days of complete polarization, whereas it is not the case with fuzzy incremental controller. It can be put in automode from day one. This fact is substantiated with the initial startup curve (Figures 8(a) and 8(b)) of PI controller and fuzzy controller. Oscillation is observed in the output of PI controller during initial polarization process. When PI controller is used, it requires different set of proportional and integral constants during initial polarization and after polarization , but it is not the case with fuzzy incremental controller. Performance of fuzzy incremental controller and PI controller for step change input is shown in Figures 9(a) and 9(b), respectively. Time domain performance comparison between fuzzy and PI controller is given in Table 2.
Designing of PI virtual instrumentation corrosion controller is reported in . It requires the expertise to select the “” and “” constants. It is possible to select “” and “” constants using autorelay tuning . However, tuning process has to be started manually. Virtual Instrument based fuzzy controller for gas pipelines simulation is reported in . A closed loop control system incorporating fuzzy logic has been developed for Iraq-Turkey crude oil pipeline ; output of this controller is varying in steps. Design optimization of cathodic protection system is reported in ; controller performance optimization part is not touched. In computer controlled cathodic protection transformer rectifier , tap changing is controlled remotely using computer. Inherent disadvantages available with transformer rectifier unit are not eliminated. ICCP logic can be implemented in distributed control system (DCS) or programmable logic controller (PLC) .
Designed controller outperformed in all aspects of time domain specifications such as settling time and under/overshoots transient behavior. Designed fuzzy incremental controller reaches the set point earlier than conventional PI controller. In the designed controller no oscillation is observed. Moreover startup (during initial polarization) curve of fuzzy incremental controller outperforms the conventional PI controller. Designed fuzzy incremental controller can be put in automode without waiting for initial polarization whereas it is not the case with PI controller.
Fuzzy logic controllers seem to be the most suitable controllers over the other conventional controllers for gas pipeline corrosion control system because of quick response to achieve steady state condition for any kind of disturbances; it is very flexible and easy to operate. Design and development of virtual instrumentation based fuzzy incremental corrosion controller has been implemented for underground gas pipeline. It prevents the pipeline corrosion by precisely controlling the pipe to soil potential at the desired level. In this paper, conventional PI and fuzzy logic incremental controller are compared; better time domain response is obtained when compared to conventional PI controller. Initial startup response is dramatically improved and amount of overshoot for the output response is successfully decreased using the fuzzy logic controller; moreover, smooth transient response is observed. In the conventional controllers, human intervention is required during startup. In the designed controller, human intervention is not required till the time of initial polarization, whereas the fuzzy incremental controller can be taken on automode from zero hours.
Conflict of Interests
The authors declare that there is no conflict of interests regarding the publication of this paper.
The authors thank Mr. D. Selvakumar, Senior Manager, and Mr. N. Nandagopal, Senior Manager of GAIL (India) Limited, Nagappattinam, Tamil Nadu, India for their valuable help while conducting this research work.
A. W. Peabody, Control of Pipeline Corrosion, NACE, Houston, Tex, USA, 2nd edition, 2001.
Canadian Association of Petroleum Producers, “Impressed Current Cathodic Protection Rectifier Design-for-Safety Guideline,” publication no. 2009-0019, 2009.View at: Google Scholar
W. von Baekmann, W. Schwenk, and W. Prinz, Handbook of Cathodic Corrosion Protection, Gulf Professional Publishing, Houston, Tex, USA, 3rd edition, 1997.
R. Baboian, NACE Corrosion Engineer’s Reference Book, NACE, Houston, Tex, USA, 3rd edition, 2002.
NACE Standard RP0169, “Control of external corrosion on underground or submerged metallic piping systems,” NACE International, 2007.View at: Google Scholar
ISO 15589-1, “Petroleum and Natural Gas Industries—Cathodic Protection of Pipeline Transportation Systems; Part 1 On-land Pipelines”.View at: Google Scholar
S. M. Bashi, N. F. Mailah, and M. A. Mohd Radzi, “Cathodic protection system,” in Proceedings of the National Power and Energy Conference, pp. 366–370, Bengi, Malaysia, 2003.View at: Google Scholar
R. J. Sarfi, M. M. A. Salama, C. Gebotys, and A. Y. Chikhani, “Optimal design of cathodic protection schemes: a power engineering applications,” in Canadian Conference on Electrical and Computer Engineering (IEEE CCECE/CCGEI ’93), pp. 664–667, Vancouver, Canada, September 1993.View at: Publisher Site | Google Scholar
J. Gopalakrishnan, G. Agnihotri, and D. M. Deshpande, “Fuzzy corrosion controller,” in Proceedings of the International Conference on Advanced Computing and Communication Technologies (ICACCT ’13), pp. 204–209, November 2013.View at: Google Scholar
J. Gopalakrishnan, G. Agnihotri, and D. M. Deshpande, “Virtual instrumentation corrosion controller for natural gas pipelines,” Journal of the Institution of Engineers B, vol. 93, no. 4, pp. 259–265, 2012.View at: Google Scholar
J. Gopalakrishnan, G. Agnihotri, and D. M. Deshpande, “Auto tuned virtual instrumentation corrosion controller for natural gas pipelines,” in Proceedings of the National Conference on Electronic Technologies (NCET ’12), pp. 327–330, Goa College of Engineering, Goa, India, April 2012.View at: Google Scholar
M. A. Akcayol, “Computer controlled cathodic protection transformer—rectifier unit design & application,” G.U. Journal of Science, vol. 16, no. 13, pp. 493–502, 2003.View at: Google Scholar
A. A. El-Meligi, “Corrosion preventive strategies as a crucial need for decreasing environmental pollution and saving economics,” Recent Patents on Corrosion Science 2, 2010.View at: Google Scholar
M. Purcar and L. Bortels, “Design and optimization of pipeline cathodic protection systems,” Analele Universităţii din Oradea, Fascicula de Energetică, vol. 15, pp. 289–294, 2009.View at: Google Scholar
E. Kurgan and A. Wantuch, “Impressed cathodic protection of underground structures,” Przeglad Elektrotechniczny, vol. 87, no. 5, pp. 96–99, 2011.View at: Google Scholar
S. A. Ajeel and G. A. Ali, “Variable conditions effect on polarization of impressed current cathodic protection of low carbon steel pipes,” Journal of Engineering & Technology, vol. 26, no. 6, p. 636, 2008.View at: Google Scholar
F. F. Al-Himdani, W. I. Mahdi, and A. H. Khuder, “Corrosion protection of coated steel pipeline structures using CP technique,” Journal of Engineering and Development, vol. 9, no. 3, pp. 23–29, 2005.View at: Google Scholar
H. Ying, Theory and Application of a Novel Fuzzy PID Controller Using a Simplified Takagi-Sugeno Rule Scheme, vol. 123, Elsevier Information Sciences, New York, NY, USA, 2000.View at: MathSciNet
J. Abonyi, Fuzzy Model Identification for Control, Birkhäauser, Boston, Mass, USA, 2003.
A. Piegat, Fuzzy Modeling and Control, Physica, Springer, Heidelberg, Germany, 2001.
T. Hung, M. Sugeno, R. Tong, and R. R. Yager, Theoretical Aspects of Fuzzy Control, John Wiley & Sons, New York, NY, USA, 1995.
H. Zhang and D. Liu, Fuzzy Modeling and Fuzzy Control, Control Engineering, Birkhäuser, Boston, Mass, USA, 2006.View at: MathSciNet
J. Jantzen, “A robustness study of fuzzy control rules,” in Proceedings ot the 5th European Congress on Fuzzy and Intelligent Technologies, pp. 1222–1227, ELITE Foundation, Aachen, Germany, 1997.View at: Google Scholar
D. Wisell, P. Stenvard, A. Hansebacke, and N. Keskital, “Considerations when designing and using virtual Instruments as building blocks in flexible measurement system solutions,” in Proceedings of the IEEE Instrumentation and Measurement Technology Conference, pp. 382–386, 2007.View at: Google Scholar
L. Shijun, Z. Minghu, L. Youfeng, and Y. Xiaojuan, “Design on the fault diagnostic system based on virtual instrument technique,” in Proceedings of the 2nd International Workshop on Knowledge Discovery and Data Mining (WKKD ’09), pp. 304–307, IEEE, January 2009.View at: Publisher Site | Google Scholar
Z.-G. Chen, C.-K. Qin, Y.-J. Zhang, and X.C. Yang, “Application of a stray current monitoring system base upon virtual instrument,” in Proceeding of the IEEE International Conference on Automation and Logistics (ICAL ’10), pp. 341–344, Hong Kong, China, August 2010.View at: Publisher Site | Google Scholar