A Portable Gas Pressure Control and Data Acquisition System using Regression Models


On this article

Xien Yin Yap, Kim Seng Chia* , and Kian Sek Tee

Faculty of Electrical and Electronic Engineering, Universiti Tun Hussein Onn Malaysia, Batu Pahat, Johor, Malaysia * kschia@uthm.edu.my

Abstract: One conventional gas leakage testing procedure requires shutting down the whole plant to monitor gas pressure in continuous 24-hours. This leakage testing is subjected to human error and tedious. Hence, this study aims to propose a system that automates gas leakage testing. First, the mathematical model of a proposed gas pressure sensor would be determined with the different regression models. The measured gas pressure values would be recorded into a SD card and used to establish a predictive model to minimize the steady-state error of the predicted gas pressure. Results show that the optimal mathematical model for the gas pressure sensor was a quadratic model with the lowest root mean square error of cross-validation (RMSECV) of 0.067 kg/cm2 among the other regression models. Next, the quadratic model established the relationship of the actual and desired gas pressure with the lowest steady state root mean square error of 0.1249 kg/cm2 . These findings indicate that the proposed system coupled with a quadratic model outperforms that coupled with other regression models in automating the conventional gas leakage testing.

Keywords: Gas leakage testing; Gas pressure; Regression; Control; Data Acquisition;

1.Introduction

Gas pipelines are very important to transport natural gas from one place to another place. The current procedure for detecting the gas leakage of the gas pipelines might be unsecured. Gas leakage testing methods can be classified into two categories i.e. during and before the operation. For a gas leakage testing method that applied during the operation, MQ-2 [1] and MQ-5 [2, 3] sensors are used to detect the gas concentration in the environment. When liquefied petroleum gas (LPG) leaks, the surrounding gas concentration will increase. GSM module [1] or the buzzer [3] could be used to alert users if necessary. Some sensors can measure the gas pressure before and during the operation e.g. strain hoop sensors [4, 5, 6] and camera vision sensor [7]. The gas leakage in the pipeline generates the negative pressure wave (NPW) that can be detected using a lead zirconate titanate (PZT) sensor and fiber Bragg grating (FBG) strain sensor [4, 5, 6]. On the other hand, vision sensors detect the size of the marker on the sensor diaphragm. It is worth to highlight that the sensory leaking testing could detect low pressure at 3.4kg/cm2 but vision sensors are only applicable for higher pressurized gas pipeline [8]. A highly sensitive gas pressure sensor based on Fabry–Pérot interferometer could be an alternative. However, this highly sensitive gas pressure sensor is expensive [9].

The procedure of a conventional gas leakage testing method that applied before the operation is as follows. First, the whole plant is needed to be shut down for a continuous 24 hours gas pressure monitoring. After that, all piping would be pressurized by injecting Nitrogen to the piping system. To complete this task, operators need to completely close all valves so that the system can be pressurized to 5.5kg/cm2 . This pressure will be held for 24 hours. During this period, a mechanical pressure gauge is used to manually measure and monitor the pressure in the piping system according to the standard operating procedure to ensure there is no leakage. If there is no visible loss of pressure after 24 hours, the line will be deemed to be gas tight. If the pressure gauge indicates a pressure drop, the piping would be checked. This whole testing work will be witnessed by the representative(s) of a local safety agency. However, this leakage testing is subjected to human error and is very tedious because the desired pressure was

Received: November 01st, 2019. Accepted: March 23rd, 2021

DOI: 10.15676/ijeei.2021.13.1.14

manually controlled using a manual valve [4, 6], and manually monitored using a mechanical pressure gauge.

When a gas leakage occurs, the pressure of the piping cannot be maintained at the desired value. This leakage testing is highly dependent on the worker that authorized by a local related authority or agency. The worker will determine the gas leakage by reading the pressure gauge meter visually during the testing. Consequently, the testing process is highly subjected to human error. This testing needs more than one worker to continuously monitor the gas pressure for 24 hours. Furthermore, the existing method is challenging to record the pressure values continuously for the accreditation of the safety agency. Thus, this study aims to evaluate an alternative to automate this conventional gas pressure monitor work using a proposed portable gas pressure system.

2. Methodology

A. System Design

The proposed prototype had three main compartments, i.e. top, middle, and bottom compartments. The top compartment consisted of a user interface and a pressure valve. The middle part contains a circuit board, a microcontroller (Arduino Mega 2560), a DC-DC adjustable step-up converter power module, a SD card, and all other basic electronic components. Next, a gas pressure transducer (TPS20-G26F8-00) and a power source were located at the bottom.

Figure 1 illustrates the connection of the components in the system. The gas pressure sensor that was a combination of the gas pressure transducer and an external circuit was used to detect the pressure in the pipeline. The gas pressure transducer was activated by supplying a 24V DC source from the external circuit. The gas pressure sensor can detect the pressure range between 0 – 10 kg/cm2 that would adjust the current across the resistor R1 from 4mA to 20mA. So, the voltage drops at the resistor, R1 (220Ohm) will be 0.88V – 4.4V. The voltage drops on the R1 was calculated using Ohm's Law. The power supply of the system was 24V. A DC-DC booster was used to boost the supply voltage from 12V to 24V. The subtracting amplifier (LM358) was used to measure the voltage drop across the R1. Then, the LM358 operational amplifier amplified the signals to the microcontroller.

7

Figure 1. The circuit design of the proposed system.

The whole system was programmed using the Arduino IDE. The size of the proposed system was 20cm x 12.5cm x 8.5cm. An OLED display was used to display the setting for the user. The user can key in the desired pressure and monitoring duration using the joystick. The measured pressure would be saved using the SD card module. The data would be processed using Matlab (2015a) to model the relationship between the pressure and the measured voltage. Lastly, the estimated pressure value and the time would be displayed on the OLED display.

B. Gas Pressure Sensor Calibration

The linear, quadratic, and cubic models are widely used in different applications like design the shortwave Near Infrared (NIR) spectroscopy [10] and aero-material consumption prediction [11]. Besides, regression models could be used to evaluate the gas pressure and other factors [12]. Hence, the regression models were used for calibrating the gas pressure sensor.

Figure 2 illustrates the block diagram of the proposed gas pressure measurement system. The valve was automatically controlled according to the measured pressure in the pipeline. The gas pressure sensor was activated by a 24VDC supply. The gas pressure sensor would measure the changes of the gas pressure when it was mount on the pipeline. Generally, a pipeline needs to be held on 8kg/cm2 during the leakage testing. Next, a mechanical pressure gauge meter was used to determine the actual gas pressure before calibrating the gas pressure sensor. Data was recorded during the desired duration. The recorded data would be pre-processed using moving average to remove noises. The data would be recorded in every 135ms. This is the maximum speed that the microcontroller (i.e. Arduino Mega) can get the signal and convert it.

5

Figure 2. The block diagram of the proposed gas pressure measurement system.

In the calibration process, a compressor was used to supply pressure to the proposed system. The valve was controlled manually in the previous study [4, 6]. After the system and a compressor were switched on, the device would record the measured pressure. The compressor would be switched off manually when the desired pressure was reached. The measured signals and the actual pressure were recorded and stored in a SD card for the next step to establish the relationship using a suitable regression model.

C. Regression Model

The regression model shows promising result in [13] compared with other methods. The effect of the number of data used in calibration was evaluated. First, the data was divided into four sets. Three sets of data were used as training data (i.e. = 75% training data), the remainder one set of data was used as testing data (i.e. = 25% testing data). For the cross-validation, this step was repeated to change the other data set to become testing data once. After crossvalidation, the root mean square error of cross-validation (RMSECV) was calculated. Different regression models of linear, quadratic, cubic, 4th degree polynomial, 5th degree polynomial, and 6th degree polynomial were used to model the relationship between the measured signals and the actual pressure. The cross-validation process was repeated by reducing the number of calibration dataset to 66% and 50%, respectively.

Figure 4 illustrates the root mean square error of the cross-validation (RMSECV) value when the different number of calibration data and different regression models were used. To avoid over-fitting, the regression model that has the lowest of the RMSECV value would be chosen as the equation for the gas pressure sensor. When the gas pressure was 0kg/cm2 , the measured ADC value was 180. This is in-line with the minimum signal supplied to the microcontroller of 0.88V from the external circuit. The coefficient of all regression models would be computed using Matlab (2015a) by using a matrix to solve the simultaneous equations.

D. Evaluation of the Gas Pressure Data Acquisition System for Gas Leakage Detection

Figure 3 illustrates the procedure of the gas pressure data acquisition system to record the data and control the valve. For data collection, the proposed system was connected to a compressor and a bottle to store the gas. First, the proposed system was switched on. Then, the desired pressure and duration were set. After that, the valve would be switched on automatically. The valve would be switched off automatically when reaching the desired pressure. Then, the pressure would be held in the bottle and recorded. The device would be stopped the data collection when it reached the desired duration. All results were stored in a SD card for performance analysis and evaluation.

7

Figure 3. The procedures of the gas pressure data acquisition system.

Next, to evaluate the ability of the proposed system in detecting gas leakage, the gas pressure was purposely leaked from the stopper of the bottle after the gas pressure reached a steady state for a few seconds. Three LEDs were used as indicators, i.e. yellow indicated the pressure pump in, green indicated the pressure stay in the steady state at the desired pressure, and red indicated the gas pressure leakage. All results were stored in a SD card for further analysis.

3. Result and Analysis

A. Regression Model

Figure 4 illustrates the errors during testing ramps lower when increasing the order of the regression model initially, and then the errors raise. This suggests that the model will be over fitted if the complexity of the model is over. Hence, the regression model would be chosen according to the lowest root mean square error of the cross-validation (RMSECV). All regression models were tested with cross-validation so that the RMSECV value of the regression model can be compared with each other. The lowest RMSECV value of the regression model was 0.067 kg/cm2 that was a quadratic model with a 50% testing dataset. Thus, the quadratic model would be programmed into the microcontroller to convert the measured ADC value to the estimated pressure (kg/cm2 ). The formula of the quadratic model to calculate the estimated pressure as (1).

Estimated pressure = \[-3.1269e-06 \times (ADC)^2 + 0.01822 \times ADC - 3.0008\] (1)

where ADC is the measured analog-to-digital conversion value in the microcontroller.

7

Figure 4. The effects of different testing data amount (i.e. 25%, 33%, and 50%) during the RMSECV for different regression models – Quadratic model is the best because it achieved the lowest RMSECV.

Figure 5 illustrates the quadratic model that produced using the cross-validation with the lowest RMSECV has a good relationship between the predicted gas pressure and the actual gas pressure. The correlation coefficient value of the quadratic model is near to one, which means the model is able to fit the data with a strong correlation.

1

Figure 5. The regression plot of the best quadratic model that identified using RMSECV with a 50% testing dataset.

B. Evaluation the Gas Pressure Data Acquisition System for Gas Leakage Detection

The pressure is expected to drop after closing the valve [14]. This is because the high gas pressure near the valve will drop to the low gas pressure at the end of the pipelines. One method that can minimize the steady-state error is controlling the on/off valve accordingly [15]. Hence, this study adapts the method to close the valve at the higher pressure to minimize the steady state error. Figure 6(a) illustrates an obvious steady state error between the actual gas pressure and the desired gas pressure. When the desired gas pressure was set at 5kg/cm2 , the valve was closed when the actual gas pressure reached 5kg/cm2 . However, the gas pressure would drop after the valve was closed and then reached the steady state at 3.2kg/cm2 . This could be due to the fact that the gas pressure was not yet distributed evenly in the system immediately.

Figure 6(d) illustrates the relationship between the actual gas pressure and the desired gas pressure. The relationship between the actual gas pressure and the desired gas pressure is proportional, and the actual gas pressure can be predicted by using a quadratic regression model. So, the valve will be closed at the gas pressure that is higher than the desired pressure according to the actual gas pressure needed to improve the steady state performance. The actual pressure can be calculated using the formula as shown in Equation (2).

\[y = -0.36x^2 + 5.8x - 17 \tag{2}\]

where y is the actual pressure and x is the desired pressure.

1

Figure 6(b) illustrates the difference between the actual gas pressure and the desired gas pressure after the correction. When the user sets the desired gas pressure to 5kg/cm2 , the valve would close at 6.3kg/cm2 according to the correction estimation (Figure 6(d)). Hence, the steady state gas pressure would stay at the desired pressure of 5kg/cm2 . Figure 6(c) shows that the unwanted signal of the acquired data can be minimized after applying a simple moving average. After using the simple moving average, the gas pressure data was smoother and easier to be analysed. Table 1 summarises the performance of the proposed gas pressure monitoring system after the offset correction and the moving average. The results indicate that the proposed system can monitor the gas pressure with a steady-state root mean square error (RMSE) of 0.1249 kg/cm2 . This shows the gas pressure system can close the valve with the minimum difference between desired pressure and actual pressure. The absolute errors of the proposed system were relatively higher when the measured pressures were 4 and 7 kg/cm2 , compared to that were 5 and 6 kg/cm2 . This suggests that the performance of the proposed system tended to be degraded when the pressure that were beyond 5 and 6 kg/cm2 . Next, a positive error was observed when the desired pressure was either 4 or 5 kg/cm2 , while a negative error was observed when the desired pressure was either 6 or 7 kg/cm2 . This could be due to the absent of a control system that causes the proposed system to have larger steady-state when the desired values were beyond the range of 5 and 6 kg/cm2 . Nevertheless, statistically, the measurement would expect to achieve the mean and standard deviation of the steady-state error of 0.1025 and 0.0826 kg/cm2 , respectively.

Table 1. The steady state analysis of the proposed system after the offset correction and the moving average.

Desired GasActual GasSteady-state performance (kg/cm2
)
Pressure
(kg/cm2
)
Pressure
(kg/cm2
)
ErrorMeanStandard
deviation
RMSE
4.004.12+ 0.12
5.005.06+ 0.06
6.005.98-
0.02
0.10250.08260.1249
7.006.79-
0.21

4. Conclusion

Two calibrations were studied and conducted in this study for gas pressure sensor and data acquisition, respectively. The first calibration was conducted to ensure the proposed system can measure the gas pressure accurately. The analysis shows that the quadratic model was the best model that achieved the lowest RMSECV of 0.067kg/cm2 in modelling the relationship between the actual pressure and the measured ADC values. This relationship was presented in Equation (1). Next, the second calibration was conducted to evaluate the accuracy of the system that automatically switched off the valve to maintain the desired pressure. The comparison indicates that the quadratic model could minimize the steady state error to a root mean square error of 0.1249 kg/cm2 by modelling the relationship between the desired and the actual gas pressure of the proposed system after switching off the valve. This relationship was presented in Equation (2). This finding indicates that the proposed system is promising to automate the tedious yet important quality control in gas piping installation and maintenance, subsequently to avoid relying on human visual inspection on gas pressure gauge meter for the continuous manual pressure monitoring. For future works, a control system e.g. proportional–integral–derivative (PID) and fuzzy logic controller will be studied to enhance the steady-state response of the proposed system in gas pressure monitoring.

5. Acknowledgement

The authors would like to acknowledge Universiti Tun Hussein Onn Malaysia for providing facilities supports, and Tan Yit Peng and Mahmod for their assistant in this study. The authors

also would like to acknowledge Mybotic for providing the gas pressure transducer (TPS20- G26F8-00) that was used in this study.

6. References

  • [1]. Mujawar, T., et al., "Development of wireless sensor network system for LPG gas leakage detection system", International Journal of Scientific & Engineering Research, vol. 6(4), pp. 558-563, 2015.
  • [2]. Mahalingam, A., R. Naayagi, and N. Mastorakis, "Design and implementation of an economic gas leakage detector", Recent Researches in Applications of Electrical and Computer Engineering, pp. 20-24, 2012.
  • [3]. Fraiwan, L., et al., "A wireless home safety gas leakage detection system", 2011 1st Middle East Conference on Biomedical Engineering, pp. 11-14, 2011.
  • [4]. Zhu, J., et al., "Gas pipeline leakage detection based on PZT sensors", Smart Materials and Structures, vol. 26(2), pp. 025022, 2017.
  • [5]. Jiang, T., et al., "Application of FBG based sensor in pipeline safety monitoring", Applied Sciences, vol. 7(6), pp. 1-12, 2017.
  • [6]. Meiring, C., Allwood, G., Hinckley, S., and Wild, G., "Monitoring of pressure in pipelines using externally-mounted fiber bragg gratings", Photonics and Fiber Technology 2016, pp. BM5B.2, 2016.
  • [7]. Murawski, K., "New vision sensor to measure gas pressure", Measurement Science Review, vol. 15(3), pp. 132-138, 2015.
  • [8]. Boaz, L., S. Kaijage, and R. Sinde, "Wireless sensor node for gas pipeline leak detection and location", International Journal of Computer Applications, vol. 100(18), pp. 29-33, 2014.
  • [9]. Tang, J., et al., "High-sensitivity gas pressure sensor based on Fabry-Perot interferometer with a side-opened channel in hollow-core photonic bandgap fiber", IEEE Photonics Journal, vol. 7(6), pp. 1-7, 2015.
  • [10]. Chia, K. S. and Tan, Y. P., "Design and development of a shortwave near infrared spectroscopy using NIR LEDs and regression model", International Journal of Electrical and Computer Engineering (IJECE), vol. 7(6), pp. 3070-3075, 2017.
  • [11]. Yang, Y., Sun, L., and Guo, C., "Aero-material consumption prediction based on linear regression model", Procedia Computer Science, vol. 131, pp. 825-831, 2018.
  • [12]. Geng, J., Xu, J., Nie, W., et al., "Regression analysis of major parameters affecting the intensity of coal and gas outbursts in laboratory", International Journal of Mining Science and Technology, vol. 27(2), pp. 327-332, 2017
  • [13]. Saidi, R., Saidi, L., and Regai, Z. E. A., "Contribution to the performance of mobile radio systems by optimizing the Okumura Hata model by linear regression: application of the city of Annaba in Algeria", International Journal on Electrical Engineering and Informatics, vol. 9(4), pp. 677-689, 2017.
  • [14]. Nouri-Borujerdi, A., "Transient modelling of gas flow in pipelines following catastrophic failure", Mathematical and Computer Modelling, vol. 54(11-12), pp. 3037-3045, 2011.
  • [15]. Songlin, N., et al., "Development of a high-pressure pneumatic on/off valve with high transient performances direct-driven by Voice Coil Motor", Applied Sciences, vol. 8(4), pp. 611-623, 2018.

Xien Yin Yap was born in Lahad Datu, Sabah, Malaysia in 1994. He obtained the BEng in mechatronic and robotic engineering from Universiti Tun Hussein Onn Malaysia (UTHM) at Batu Pahat, Malaysia in June 2018. During his degree, he was a winner of Imagine Cup Asia Pacific Regional Finals and the project was related to machine learning and near infrared spectroscopic analysis. From 2018 – present, he currently pursuing his MEng in electrical engineering in Faculty of Electrical and Electronic Engineering, UTHM. His

research interests are machine learning, artificial intelligence and near infrared spectroscopic analysis. His email is xienyinyap@gmail.com.

Kim Seng Chia was born in Batu Pahat, Johor, Malaysia in 1986. He obtained his PhD (electrical engineering) and BEng (electronic engineering – control & instrumentation) from Universiti Teknologi Malaysia in Feb. 2014 and Sept. 2010, respectively. He was an assistant professor at Southern University College, Skudai, Malaysia from March 2014 to August 2014. He has served as a lecturer in the Faculty of Electrical and Electronic Engineering, Universiti Tun Hussein Onn Malaysia, 86400 Batu Pahat, Malaysia since September

2014. He is the principal investigator of 8 research projects since 2014. He is the author of more than 40 research articles. His research interests are machine learning, artificial intelligence, realtime embedded system, soft modeling, and near infrared spectroscopic analysis. He was a recipient of the International Invention, Innovation & Technology Exhibition, Malaysia (ITEX) and Seol International Invention Fair Silver awards in 2018. He have achieved CEng status through The Institution of Engineering and Technology (IET) in Nov. 2020.

Kian Sek Tee received the B.Eng. degree (Hons.) in Electrical and Electronics Engineering (Mechantronics) from Universiti Teknologi Malaysia, Malaysia in 1997, and the Ph.D. degree in Mechatronic Engineering from University Of Leeds, U.K., in 2012. He is currently an Associate Professor, as well as a researcher and a lecturer in Faculty of Electrical and Electronic Engineering, Universiti Tun Hussein Onn Malaysia. His current research interests are industrial automation system, mechatronic system in gait monitoring,

rehabilitation and exoskeleton. His email address is tee@uthm.edu.my.