Reducing Risk and Increasing Reliability and Safety of Compressed Air Systems by Detecting Patterns in Pressure Signals

This paper investigates the design of a classifier that effectively identifies undesired events by detecting patterns in the pressure signal of a compressed air system using a continuous wavelet transform. The pressure signal of a compressed air system carries useful information about operational events. These events form patterns that can be used as ‘signatures’ for event detection. Such patterns are not always apparent in the time domain and hence the signal was transformed to the time-frequency domain. Data was collected using an industrial compressed air system with load/unload control. Three different operating modes were considered: idle, tool activation , and faulty. The wavelet transforms of the pressure signal revealed unique features to identify events within each mode. A neural network classifier was created to detect faulty compressed air system behaviourbehaviour. Future work will investigate the detection of more faults and using other classification algorithms.


Introduction *
This paper presents a method to detect leaks in a compressed air system (CAS) using wavelet transforms and an artificial neural network.
Running a CAS has a high energy costs. Throughout the life of a CAS, energy accounts for around 75% of the overall cost of a compressor [1]. The efficiency of many CAS could be improved and potential energy savings are estimated to range between 20 and 50% of total energy consumption [2]. Measures and procedures to enhance system efficiency are well covered in the literature, however, due to several barriers, these measures are not always implemented [3]. One of the main barriers is the lack of easy to obtain information regarding which measures to apply and projected benefits [3].
Innovations in energy monitoring and management might help address this barrier. Such systems could automatically control energy consumption, identify malfunctions and recommend corrective actions [4]. The complexity of a CAS, in addition to a large number of variables influencing system performance, makes selflearning and automatic energy management systems an attractive area to investigate [4][5] [6]. * Corresponding Author Email: david.sanders@port.ac.uk Attempts to develop intelligent tools for energy management and fault detection in CAS have been investigated in [7], [8] and, [9]. Machine learning was investigated in [7] and [8] as a tool for detecting variations in energy usage patterns and it was concluded that these patterns could be associated with faults or irregular events.
In [9], a machine learning algorithm for leak detection in CAS was developed. A pressure signal obtained from an air accumulator was analysed and processed using a wavelet transform. The wavelet transform converted the signal from the time domain to the time-frequency domain. The suggested approach was particularly useful for detecting intermittent leaks (i.e.: leaks sensed only when a particular defective tool is activated).
The pressure signal of a CAS carries useful information about faults and abnormal performance. Compressor cycling, leaks in the system, faults ,and tool activation ,and deactivation are events that affect the pressure. Events such as a compressor switching on and off and tool activation and deactivation are regular and 'healthy' events, whereas leaks and faults are undesired and their early detection can reduce energy waste and avoid potential system shut down. The design of a classifier that effectively identifies undesired events is investigated in this paper.
Detection of patterns in a CAS pressure signal is investigated in this paper. Because valuable information regarding system performance was not always apparent in the time domain, the signal was transformed to the frequency-time domain using the wavelet transform. Features extracted from the signal after processing was used in a neural network classifier to detect system faults.
This paper is organised as follows. Section 2 considers the CAS pressure signal and its characteristics. Section 3 discusses the wavelet transform. In section 4, an intelligent monitoring and fault detection system based on a neural network and wavelet transform is suggested. In section 5, the experimental setup and results obtained are presented. Finally, future work and conclusion are discussed.

Compressed Air Pressure Signal
Data obtained from pressure sensors measuring the pressure of a compressed air network contains patterns that may be associated with operational events. For example, a compressor switching on will increase the mass of air in the system and therefore its pressure. On the other hand, the activation of an air-consuming tool will discharge compressed air, causing a decrease in network pressure.
Some operational events can be detected directly from the time domain pressure signal. For example, from the saw-tooth pattern of a pressure signal obtained from a start/stop compressed air system, intervals with the compressor switched on and off can easily be determined. However, detecting and differentiating between other events, such as a tool or filter activation, might not be as straightforward. In such cases, transforming the time domain pressure signal into the frequency domain reveals features that facilitate detection.
The pressure signal of a CAS is dynamic, and made up of components with different characteristics and operating schedules; the pressure signal is nonstationary. For non-stationary signals, the Fourier transform would provide information about the frequencies in the signal, but not about when in time those frequencies occurred. A time-frequency signal processing tool, such as the wavelet transform, may be more suitable for analysing a CAS pressure signal.
Each event has unique characteristics that produce a 'signature' that becomes apparent in a time-frequency domain, obtained using a wavelet transform [9]. The approach in this paper is to identify patterns in a pressure signal by studying the wavelet transform of the signal. These patterns can be used as 'signatures' of specific events (Idle, tool activation, fault, filter on) and implemented in a fault detection algorithm.

Wavelet Transform
Wavelet transforms are time-frequency signal processing tools used for transforming a signal from one form into another [10] to reveal characteristics that are not apparent in the original time-domain signal.
The wavelet transform uses small wavelike functions, known as wavelets, to analyse signals. These wavelets are generated through a process of scaling and shifting a base function called the mother wavelet ȥ(t) [11]. Scaling, which has an inversely proportional effect on frequency, determines the frequency of the wavelet, whereas shifting indicates the wavelet's location along a time axis [10].
The wavelet transform measures the similarity between a signal and a wavelet at a specific frequency and time. If the wavelet is similar in shape to the signal, a large transform value is obtained. On the other hand, if the signal and the wavelet are not similar, a low transform value is obtained. Each transform value, called a transform coefficient, fills a place in a twodimensional time-frequency plane [11].
Wavelet transforms may be interpreted as a convolution between a signal and a wavelet function. The wavelet transform of a signal x(t) is calculated using "Equation (1)".
Where "CWT" stands for continuous wavelet transform, "s" is the scaling parameter, "Ĳ" is the shifting parameter, "x(t)" is the time signal ,and "ȥ(t)" is the base wavelet function.
The process of computing the wavelet transform is illustrated in Figure 1 which shows a function x(t) whose wavelet transform is being computed. Initially, the base wavelet is shifted along the time axis to compute the wavelet transform at different locations within the signal for a specific scale value. Once the whole time axis is covered, the scale is increased and the shifting process is repeated. Scaling and shifting continue until the required range of scales have been covered. Several options for a base wavelet selection exist, such as Morse and Morlet wavelets [10]. The wavelet transform might extract different features from the same signal if different base wavelets were used [10]. Strategies for the selection of the optimal base wavelet are reported in the literature, however, they are not within the scope of this work. For simplicity, the Morlet wavelet is used as the base wavelet.
High-frequency wavelets extend over shorter periods, making them well localized in time. However, the frequency spectrum of such wavelets is spread. On the other hand, wavelets of low frequency extend over longer periods, but have a narrower frequency spectrum. These characteristics stem from the Heisenberg uncertainty principle [11]. To obtain the frequency content of a signal, a long period of the sample was required. If a small period was considered instead, determining the frequency content became difficult. On the other hand, the shorter the signal considered, the less ambiguity there was about when in time a spectral component existed, and the longer the signal, the more ambiguity there was about the distribution of spectral components in time [12].
For slowly oscillating components within a signal, a continuous wavelet transform results in good frequency but poor time localization. On the contrary, for high-frequency events that tend to be short lived, a continuous wavelet transform results in good time but poor frequency localization. Most signals available in nature, including the pressure signal of CAS, tend to be dominated by low-frequency components with occasional short-lived high-frequency events. This has made the continuous wavelet transform popular in signal processing.
The transform must be discretized to compute the continuous wavelet transform. One way of doing that is by discretizing scale and translation parameters [11]. Usually, a logarithmic discretization is selected for the scale. For the translation, it was convenient to select a discretisation equal to the sampling period. In this study, the continuous wavelet transform was computed using the Matlab function, which utilized a logarithmic discretization of scales and a time shift equal to one period, which in this case corresponded to 1 second.

Intelligent Monitoring and Fault Diagnosis
The main objective of machine performance monitoring was to analyse relevant information and make a judgement regarding operational conditions [13]. Traditionally, fault diagnosis had to be conducted manually. Experts had to analyse and compare available data against data corresponding to the machine's healthy conditions. Such a process was time-consuming and relied on the expert's ability to pinpoint faults.
As data collection and processing has become faster and cheaper, intelligent monitoring and diagnosis methods, based on artificial intelligence techniques, started to replace traditional methods [13]. Artificial intelligence techniques are capable of rapidly and efficiently processing recorded data and giving the accurate diagnoses. The framework for developing diagnosis algorithms has four main phases: data collection, signal processing, feature extraction and selection ,and finally classification. In the previous section, processing the pressure signal of a compressed air system using a wavelet transform was discussed. In this section, the creation of a supervised neural network algorithm that used wavelet coefficient magnitudes is presented. The objective of this algorithm was to classify a signal as idle or faulty.
final two-column camera-ready version; the author(s) must follow these instructions strictly to maintain the high standard of the journal. Neural Network Algorithm Artificial Neural Networks are inspired by aspects of the architecture and operation of networks of biological neurons. The basic element of a neural network is the neuron, also called a node. As shown in Figure 2, inputs (x i ), known as features, are associated with weight parameters (w i ) and together represent the information arriving inthe node. This information is processed and an output 'y' is generated. Depending on node's locationin the neural network architecture, the output 'y' is either fed as an input to successive nodes or represents a final output [14,15]. The neural network structure is a combination of interconnected nodes, grouped in layers. The number of nodes in the input layer is equal to the size of a feature vector plus 1. The additional node corresponds to a bias term "x 0 " which is assigned a value of 1. Bias nodes also exist for the hidden layer. The number of nodes in the output layer is equal to the number of possible outcomes/classes. A neural network contains an input layer, hidden layer(s) and, output layer. The most basic (and most common) neural network structure contains 3 layers, as shown in Figure 3. The output of each node (except input node) is calculated over two steps: first a sum operation "Equation (2)" that involves all inputs coming to this node and associated weights. Second, the obtained net sum is passed through an activation function "Equation (3)" to obtain the output "y j ".
(3) Where "h" is sum at node "j", "w ij " is the weight connecting node "i" with node "j", "x i "is the feature "i", "y ij " is output "j" and "d" is the total number of features. Several possible activation functions have been reported in the literature, such as threshold function, sigmoid function ,and hyperbolic tangent sigmoid function [14]. In this paper, the sigmoid function, given by "Equation (4)", was selected as the activation function. The sigmoid function constrains the output to values between 0 and 1. The value of each node output (class) in the output layer is interpreted as the likelihood of an input belonging to that specific class. The neural network would assign each input to the class with the highest likelihood.

Cost Function and Learning Algorithm
Training a neural network is the process of adjusting the weight parameters so that error is minimized. The error, which is obtained using a cost function, is an indication of how accurate the neural network was in predicting the real values of its inputs. In this study, the logistic regression cost function "Equation (5)" was used to compute the error [14].
Where "N" is the number of training samples, "K" is the number of possible classes and "y k i " is the output of example "i" for class "K".
The cost function was minimized by adjusting the weight parameters using a gradient descent algorithm. This process was completed over three main steps: the first step, known as forwarding propagation, computed the cost function with the current values of the weight parameters. The second step, back propagation, computed the gradient of the cost function concerning each weight. In the third step, the weights were updated using the gradient calculated in step 2. The above 3 steps were repeated until the cost function converged to a minimum, or until the algorithm completed a predetermined number of iterations.

Feature Extraction
Features were sets of variables believed to contain distinguishing information about an object. These features were ordered in a feature vector to form an instance. The main objective of the classification algorithm was to assign the correct class to a given instance, based on prior knowledge the algorithm acquired through a training phase.
The wavelet coefficients magnitude can be used to differentiate between different events in a typical CAS pressure signal. Therefore, the wavelet transform coefficient can be used as features to classify different events into their correct class.
As mentioned in section 3, the wavelet transform was computed using Matlab function 'cwt', which utilized a logarithmic discretization for scales and therefore frequencies. For the time shift, the discretization was equal to 1 second. Each second of the sample was considered as an instance whose class is determined by the neural network. The wavelet transform was applied to a signal with 3600-time samples, which resulted in magnitudes at 90 different frequencies. Those magnitudes were grouped in a feature vector of size 90x1. To train the neural network, a bias term was added to the feature vector and its size became 91x1.
The neural network used had a three-layer architecture. The input layer had 91 nodes, corresponding to the magnitudes at 90 different frequencies, in addition to one bias node. The hidden layer had 11 nodes, including a bias node. The output layer contained only two nodes, representing two possible classes: Faulty or Idle. A schematic representation of the neural network architecture is shown in Figure 4.

Experiments and Results
Experimental set-up A compressed air system installed in the Anglesea Building at the University of Portsmouth was used for data collection. The compressor was an Ingersoll Rand compressor with a capacity of 2.2 m3/min. A GEMS 3100 pressure sensor was connected to the piping network to measure its pressure. To simulate tool activation, an air gun was connected to the piping network. Data were recorded at a rate of 1 sample per second using a Picoscope 2204 data logger. The system and some components are shown in Figure 5. The compressor had start/stop control, meaning that the pressure signal cycled between predefined pressure limits. Three different scenarios were considered. The first one corresponds to the case where no tool is activated. In this case, the pressure slowly decreases due to permanent leaks in the system, until it reaches the lowest allowable pressure when the compressor switches on to re-pressurize the system. This case is called the idle case. In the second case, an air gun is activated to simulate a tool activation. The additional compressed air consumption due to tool activation is superimposed over the cycling pressure pattern. This case is referred to as the tool activation case. Finally, a third case corresponded to data recorded when the system has a leaking filter and different compressor control pressure limits. In the next sections, each of these cases is analysed using the wavelet transform. The results obtained from the implementation of wavelet transform coefficients in a neural network to identify idle and faulty cases are also discussed.

Idle Case
The idle case corresponded to the case where no known faults or tool activation were present. Compressed air consumption was due to leaks already present in the system. In practical CAS, a leaking rate below 10% of the compressed air system capacity is considered acceptable [16]. Figure 6 shows the results obtained for the variation in pressure corresponding to this case. The compressor is switched on when the system pressure decreases by ~0.15 bar leading to a rapid increase in system pressure. Once the compressor switches off, the pressure decrease. While the compressor is off, events such as filter activation, lead to an increased pressure loss in and a steeper decrease in pressure occurs. The wavelet transform of the signal in Figure 6 is shown as a 3D contour plot in Figure 7. On the z-axis, wavelet coefficient magnitude is plotted. On the x and yaxis, time and frequency are plotted, respectively. Lowfrequency components (~0.01 Hz) had the highest coefficient magnitude and were present at all times. These components correspond to the overall saw tooth pattern of the signal, which had a period of around 100 seconds corresponding to a frequency of 0.01 Hz. Compressor switching introduced higher frequency components that could be identified on the wavelet transform plot. These components had peaked (of different magnitudes) at frequencies of 0.05 Hz and 0.25 Hz, both of which disappeared once the compressor was switched off. Similarly, filter activation generated a pattern with a peak at a frequency of 0.05 Hz. The time and frequency resolutions of wavelet transforms are inversely proportional. The highfrequency components corresponding to compressor switching on and filter activation were localized in time, however, their frequency was not localized and they extended over a range of frequencies. The opposite was true for low-frequency components, which appeared well localized in frequency but suffered from a reduced time resolution.

Tool Activation Case
For tool activation experiments, an air gun was used to investigate the impact of a compressed air-consuming tool activation. Activation of such tools increased consumption of air, leading to a decrease in pressure. Compared to the idle case, tool activation while the compressor was on led to a longer compressor running time before the upper-pressure limit was reached. Tool activation while the compressor has off increased the rate of air discharge, which accelerated pressure decrease so that the system reached the lower pressure limit faster. Figures 8 shows results obtained for the pressure signal during which the air gun was on. The wavelet transforms of the tool activation signal (Figure 8) is shown as a 3D contour plot in Figure 9. The plot reveals two major patterns of interest. The first one is the coefficients at frequencies of 0.05 Hz, and the second pattern is the coefficients with a frequency range of 0.1-0.2 Hz. Both of these patterns were present at almost all times, unlike the idle case in which these frequency components only appeared when the compressor switched on or when a filter was activated. Compared to the idle case, the pressure signal while a tool was activated had a more uniform shape. Compressor charging and discharging in the time domain had relatively similar slopes. This led to similar frequency components being present at all times. Figure 10 compares the wavelet transform of idle and tool activation cases. Subplot (a) shows the time domain variation of the pressure for both cases. Subplots (b), (c) and (d) show the wavelet transform coefficients for tool activated, idle and, both respectively. Highfrequency components appear in the idle case when the compressor switches on or when a filter is activated. On the other hand, for tool activation case, as discussed in the previous paragraph, the same frequency components are present at almost all times. These differences between the two cases are clearly apparent when the wavelet transform for both cases isshown on the same graph.

Faulty Case
Data recorded when the system had two different faults was utilized to analyse faulty behaviour using a wavelet transform. The system's pressure control limits deviated from original settings, pushing the upper-pressure limit higher. In addition, one of the filters had a relatively large leak, as shown in Figure 11. The variation in pressure signal corresponding to this case is shown in Figure 12 alongside the idle case for comparison. Because the upper-pressure limit was now higher, and due to the leak in the filter, the time the compressor spent on was longer than the idle case. Moreover, the increased compressed air consumption due to the leak, meant the lower pressure limit was reached faster. These characteristics were further analysed using the wavelet transform.  The wavelet transform of the faulty system signal is shown as a 3D contour plot in Figure 13. Because the amplitude of the signal was relatively high (compared to idle and tool activation cases), the magnitude of the lowfrequency components was also high (0.14 compared to 0.025 and 0.1 in the idle and tool activation cases). The high-frequency spectral components were similar to the ones seen for the tool activation case. This result was expected since a tool activation pattern, such as that resulting from an air gun, resembles the presence of a temporary leak in the system. Figure 14 gives a closer view of the high-frequency components of the wavelet transform for the faulty system.

Identification of Cases
The wavelet transform coefficients for the idle and the faulty case were used to train a neural network as explained in section 4. The neural network was trained with 14,400 samples. Half of those samples belonged to the idle case, while the remaining half belonged to the faulty case. To test the accuracy of the neural network on unseen data, a pressure signal with idle and faulty data was synthesised as shown in Figure 15. The neural network showed an accuracy of 98.3% while classifying the samples in the signal shown below. Only the region between the two vertical red lines (time 1750 to 1770s) was misclassified as faulty when it was idle. The remaining points were correctly classified. Figure 15. Synthesized signal. The region between the two red vertical lines was misclassified.

Discussion and Conclusion
The objective of this paper was to investigate the suitability of the wavelet transform for extracting features from the pressure signal of a compressed air system. The wavelet transform was used to process the pressure signal and generate distinctive features. Three main cases were considered: Idle, Faulty, and Tool activation. The analysis proved that it is possible to generate features to be used in a pattern recognition algorithm. A Neural network was trained to recognise two different classes: idle and faulty. Results obtained showed that this approach could be used for developing intelligent monitoring and fault diagnosis tools.
The approach adopted in this research had several limitations. The compressed air system used for data collection was also being used by the University of Portsmouth as a source of compressed air. A more flexible system experimental set-up would allow investigating more cases. In addition to that, the neural network developed was relatively simple. More experiments and data are required to further expand the neural network to include more complex cases. Another limitation was the large quantity of data required for neural network training and operation. A system capable of operating in real-time would require very high computational power and therefore decreasing the number of features to reduce computational power requirements is essential. Finally, the impact of variables such as temperature, humidity, and atmospheric pressure on the pressure signal was not considered, however, since a variation in these variables might alter compressed air properties, their impact on the approach adopted should be considered.
Future work will investigate energy management [17], ambient sensing [18,19], control [20], intelligent monitoring [21], and decision making [22,23], and further utilise the wavelet transform for leak detection and possibly detection of other faults. A more flexible experimental setup will be used to collect the data and simulate system behaviour. In addition to that, more advanced machine learning algorithms, such as unsupervised learning, will be investigated and finally, the impact of compressed air properties will be considered.