Frequency Features Based Fuzzy System for Rotating Machinery Vibration Analysis Using Smartphones Low-Cost MEMS Sensors

Smart devices have become an important entity for many applications in daily life activities. These devices have witnessed a rapid improvement in its technology to fulfill the increasingly diverse usage demands. In the meanwhile, rotating machinery vibration analysis based on low-cost sensors has gained a considerable attraction over the last few years. For a long time, the vibration analysis of machines has been accepted as an effective solution to detect and prevent failures in complex systems to avoid the sudden malfunction. The objective of this work is to use MEMS accelerometer measurements to monitor the different level of vibration of a machine. This work presents a new technique for rotating machinery vibration analysis. It uses Fast Fourier Transformation as a feature extraction algorithm and Fuzzy Logic System (FLS) as the classifier algorithm. A smartphone accelerometer is used to collect the data from the vibrating machine. The performance of the proposed technique is tested using data from different vibration resources at a different speed of operations. The results are discussed to illustrate the various vibration levels.


Introduction
Vibration studying and analysis can help in identifying some of the major problems in the industrial rotating machines, vehicles, home appliances, and buildings. Technicians use meters or tools to monitor vibration at regular intervals and report vibration readings in real time [1]. New smart devices have embedded sensors that can help in vibra-Open Access tion analysis and monitoring. Smart devices refer to power computing devices that have a platform contains a microprocessor and memory and able to run with an operating system. It could be a smartphone, tablet, smartwatch, or any other smart wearable devices. With the increasing pervasiveness and computing power of the smart devices, it has become a part of the daily life activities of the user. In many areas of applications, smart devices can provide an alternative measurement or analysis tools. Of course, the quality of the quality of the results based on the smart devices with low-cost sensors will not be the same the dedicated devices with high-quality sensors. However, the smart devices can be used as a multi-purpose device in uncountable applications. Smart devices have started replacing the personal computer in most of the daily tasks [2]- [4]. In the field of sport and fitness, smartphones and wearable smart devices are widely used to provide a complete analysis of the user's performance including distance, speed, track, and calories. In another area, smartphones are involved in different applications and tools such as a measuring tool for displacement, light intensity, magnetic field intensity, and compassing. In the last few years, researchers have got attracted to use the smartphone with low-cost Micro Electro-Mechanical Sensors (MEMS) in the field of mechanical vibration analysis which gains new achievements day after day. The use of smartphones for vibrations analysis allows researchers of developing new applications for the different rotating machinery devices ranging from small home appliances to industrial factory level.
Machine or structural vibration can take various forms. A particular machine part may vibrate over small or large distances, slowly or quickly, resulting or not resulting a noticeable heat or sound [5]. Vibrations are not always undesirable; sometimes machine vibrations are designed to have a function purpose such as conveyors, surface finishers, musical instruments and loudspeakers, and ultrasonic probes. However, in other cases, machine vibrations occur unintentionally and could lead to machine damage. Figure 1 shows some examples for undesirable machine vibration. Vibrations could happen due to numerous conditions which may act individually or in combination. These are some leading causes of vibration such as looseness, imbalance, misalignment, or wear. The consequences of unwanted vibration can be severe which it can speed the equipment damage rate and lead to reducing the performance conditions and production of the working place.
Detailed vibration analysis can be used to observe and make concerning about the health and performance of a rotating machine. If it is measured and analyzed correctly, vibration can be used as an indicator of machine condition, and help guide to take pre-emptive steps to maintain and prevent damages. Vibration is a continuous cyclic motion of a structure or a component that has some important attributes for developing a vibration analysis tool. The low cost MEMS accelerometers can measure object motion information. As any periodic signal, vibration can be analyzed using the frequency domain analysis. A 3D accelerometer is mounted at a point on the vibrating machine or structure to measure accelerations in three orthogonal directions. Then, the velocity and displacement are derived from the measured acceleration. Acceleration, velocity, and displacement are different ways to express the unit of vibration measuring.
In this paper, a novel technique is presented that used for rotating machinery vibration analysis. This method uses Fast Fourier Transformation as a feature extraction algorithm and Fuzzy Logic System (FLS) as the classifier algorithm. A smartphone accelerometer is used to collect the data from the vibrating machine. The rest of the paper is organized as follows. Section 2 explains the importance of the smartphone accelerometer. In Section 3 and Section 4, brief explanations of the FLS and FFT basics are explained, respectively. The detailed steps of the proposed technique are described in Section 5. Results and discussion are presented in Section 6 while Section 7 gives the conclusion of the work.

Smart Device Sensors and Measurements
Sensor is a converter that measures a physical quantity and converts it into a signal which can be read by an observer or by an instrument. The vast majority of the smart devices contains a huge variety of sensors. Smart devices have become a favorite tool around the world and even an important part of the daily life activities. There were more than a billion smartphones were sold worldwide in 2014, a 23% increase in shipments for the full year 2013 and 2014 [6] [7]. The sharp decline in the cost of the smart device parts allows growth in the emerging markets. The sensor group includes motion sensors such as accelerometer and gyroscope, magnetic field measurement, light and proximity sensing. Besides that, sound can be sensed using a microphone while images are captured using a camera. Sensors have been used in smartphones since they were presented. New smart mobile devices such as smartphones, tablets, and smartwatches are powerful computing devices which always are held or carried around and have access to a wireless connection [8]. Every day the smart devices are getting more capabilities to be added to the present ones. So, the user carries only one device, smartphone, instead of carrying different devices each has an individual task. The rapid progress in the smartphones technology allows emerging of new applications. Nowadays, most of the smartphones are programmable and equipped with self-contained, low cost, small size, and power-efficient sensors, such as magnetometers, gyroscopes, and accelerometers. Smart devices technology is continually advancing and growing, attracting developers to new trends of applications. Nowadays, most of the smart devices are programmable and equipped with self-contained, low cost, small size, and power-efficient sensors. All these factors lead to a real opportunity to embed them in many of the personal applications trends.
The earlier versions of smart devices, smartphone, models contained a single MEMS sensor, an accelerometer. The integration of 6 degrees of freedom inertial measurement unit (IMU) within the smart devices enabled the development of new methods dependent on the measurements from the IMU to estimate the human physical movement. The accelerometer is considered one of the most popular components in the smart devices. It can measure the earth gravity and the platform acceleration. In one application, it is used to sense enable the screen rotation of the device from one view to another view (for example from portrait to horizontal) based on the gravity measurements. In other application, it is used in falling protection application. A tri-ad accelerometer axes can be represented in the Cartesian coordinates where each accelerometer provides a measurement for one of the x, y, and z directions as shown in Figure 2.
In most of the applications, it is used for estimating the device tilt by measuring the roll and pitch angles. Also, it has been used widely in the navigation applications by determining the travelled distance. The accelerometer is measured in g-force where 1 g = 9.81 m/s 2 .
There are several important specifications should be taken into account to choose the appropriate accelerometer for any application. The performance of the acceleration sensors are measured in range, accuracy, quantization, sampling rate, noise, and power consumption [9]. The need for these features is determined based on the nature of the application in which the accelerometer is incorporated. New generations of accelerometers have a selectable range of g-forces they can measure. Most of the smart devices have accelerometers with ranges can vary from ±1 g up to ±8 g. Nowadays, there are different smartphones are working at different ranges such as Samsung Galaxy S4 at ±2 g, Nexus 4 at ±4 g, iPhone 6 at ±8 g, and Moto x 2 nd generation at ±16 g. Also, these devices come with different resolutions, for example, 10-bit, 12-bit, 14-bit, and 16-bit for the internal Analog to Digital Converter (ADC). Characteristically, the smaller the range, the more sensitive the readings will be from the accelerometer while, the more resolution, the more readings accuracy. Table 1 shows a comparison between two accelerometers which are found in iPhone 6 plus.
Theoretically, the displacement can be calculated using Equation (1) [10]: where d(t) is the total displacement at time t, 0 is the initial displacement, v 0 is the initial velocity, and a(t)is the measured acceleration.
Equation s1 is a continuous function while a(t) is discrete measurement due to sampling. To calculate the discrete displacement, Equation (2) has to be used [11].
where a i is th sample, and Δ is the time interval. Then, the velocity and displacement can be calculated as the following [12]: In Equations (3) and (4), i refers to the current value and i − 1 refers to the previous value.
The 3D accelerometer measures the acceleration in three dimensions where the total acceleration is represented by the vector summation of the three components in the three directions as in Equation (5).
( ) x y z a t a a a = + +     

Fuzzy Logic System
Fuzzy logic [13] uses graded or quantified statements rather than ones that are strictly true or false. The results of fuzzy reasoning are not definite as those derived by strict logic. The fuzzy sets allow objects to have grades of membership from 0 to 1. These sets are represented by linguistic variables, which are ordinary language terms. They are used to represent a particular fuzzy set in a given problem, such as "large", "medium", and "small" [14]. Fuzzy Logic System (FLS) had been one of the most important fields in artificial intelligence. It is much closer to human thinking and natural language than the traditional logical systems. Basically, it provides an effective means of capturing the approximate inexact nature of the real world. The essential part of FLS is a set of linguistic rules related by the dual concepts of fuzzy implication and the compositional rule of inference. The methodology of the FLS appears very useful when the process under control is very complex for analysis using the conventional mathematical modeling. So, FLS may be viewed as a step toward a rapprochement between conventional mathematical control and human-like decision making. Experience shows that the FLS is superior to conventional control methods for ill-defined systems or for systems with no mathematical model at all. Figure 3 shows the basic configuration of an FLS. The fuzzifier maps crisp inputs into fuzzy sets, and the defuzzifier maps fuzzy sets into crisp outputs again. The fuzzy rule base consists of a collection of fuzzy IF-THEN rules, then the fuzzy inference engine uses theses fuzzy IF-THEN rules to determine a mapping from fuzzy sets in the input universe of discourse to fuzzy sets in the output universe of discourse based on fuzzy logic principles [15].
Fuzzifier and defuzzifierare based on using a Membership Function (MF) to map the variables between crisp values and linguistic expressions. Each variable at the input side or the output side is assigned for a membership function. There are several possible choices of membership function shape (triangular, trapezoidal, singleton, and Gaussian) as shown in Figure 4. Each variable value is converted into a corresponding linguistic value. For example, N is used for Negative, P for Positive, and Z for zero while B and S refer to Big and small, respectively. In a different way, the linguistic values may take different symbols based on the nature of the variable. For example, terms such as "Very Cool", "Cool", "Normal", "Hot", and "Very Hot" are used to express temperature. In another example, "Fast", "Slow", and "Normal" are used to express the speed of rotor or person.  Also, the selection of the suitable MF may consider the simplicity to implement and fast for computation such as triangle and trapezoidal shapes.
There are four basic elements of the FLS; Fuzzifier, Rule Base, Inference Engine, and Defuzzifier. A brief description of each part is given below.

Fuzzifier
A fuzzifier measures and converts crisp input variables into a fuzzy variable represented by membership grades in some fuzzy sets. To convert from crisp inputs to fuzzy inputs, fuzzy sets and associated membership functions must first be determined for each input.

Fuzzy Inference Engine
In fuzzy inference engine, fuzzy logic principles are used to combine the fuzzy IF-THEN rules in the fuzzy rule base into a mapping from fuzzy sets in 1 n U U U = × ×  to fuzzy sets in V. A fuzzy IF-THEN rule is interpreted as a fuzzy implication Let a fuzzy set A in U be the input to the fuzzy inference engine, then each IF-THEN rule determines a fuzzy set B l in V using the sup-star composition as in Equation (7).
There are several interpretations [15] for a fuzzy implication, and in each interpretation we may employ different t-norm or t-conorms; therefore, a fuzzy IF-THEN rule (1) can be interpreted in a number of ways. For simplicity, suppose that Or according to the product-operation rule:

Defuzzifier
The defuzzifier performs a scale mapping from fuzzy sets in V to a crisp point y V ∈ .
There are three possible choices of this mapping at least:

Frequency Domain Analysis
The   (14) where F(k)components are called the "Fourier Coefficients" or "harmonics".
The sequence f(n) can be calculated from F(k) using the Inverse Discrete Fourier Transform (IDFT) as shown in Equation (15): Usually, the sequences f(n) and F(k) are referred to as time domain data and frequency domain data, respectively where both f(n) and F(k) are complex. In most cases, the FFT size is chosen to be a power of 2 (N = 2 p ).

Vibration Analysis Technique
The proposed technique uses the accelerometer data to estimate the vibration level for the rotating machinery. Figure 6 shows the main steps of the proposed method. First of all, he collected data is manipulated with different preprocessing methods to eliminate the unwanted components. This is followed by transforming the data to the frequency domain to extract the important features that characterize the behavior of the signal.
Finally, a fuzzy logic system is used to classify the different ranges of the vibration.

Data Pre-Processing
Pre-processing the low-cost accelerometer data is important to ensure the quality of the measured data. It is recommended to remove the gravity component from the measurements. This can happen by using leveled accelerometer data. The leveling process requires the knowledge of the device tilt angles, roll and pitch. These angles can be estimated using a static period of the data for about 30 seconds to be collected at the beginning of the test as shown in Equation (16). tan tan where , , In order to transfer observations into a horizontal plane, the direct cosine matrix is built by using Euler angle (roll ( φ ), pitch ( θ ) and azimuth (ψ )) as shown in Equation Another component to be considered for removal is the total acceleration mean. The total acceleration is calculated using Equation (18).
where f x , f y , and f z are the acceleration vectors in the main directions.  The effect frequencies of the frequency domain are used to analyze the vibration level of the signal. The primary frequency, main frequency, and the average of the harmonics are selected to be inputs for the fuzzy system. The average of the harmonics is calculated for the harmonics above acertain threshold. This threshold is selected based on the experience about the different dynamics and system behavior.

Frequency Features Based Fuzzy System
The proposed fuzzy system and its main parts are shown in Figure 8. It consists of input, rule base, and output. The inputs are fed from the frequency domain analysis with the magnitude of the main component as first input and the average magnitude of the harmonics magnitudes that are greater than thresholds. The output represents the signal level of vibration. Figure 9 shows details about the design of the membership functions that represent the input and output variables. Both membership functions are chosen to be represented by Gaussian function while a triangle membership function represents the output variable. Different levels are set for the inputs to cover a wide range of the magnitude values. The ranges are set from very low till very high with a total of six memberships. On the other hand, the output has set to six membership functions ranging from "very weak" to "super high".
The different rule bases that used for the FIS are shown in Table 2. The rule bases   reflect the relation between the different inputs with the output. Figure 10 shows the rule surface viewer for the entire system between the input and output. This plot shows the effect of each membership function on the output.

Results and Discussion
In this section, different tests are conducted for the purpose of evaluating the proposed algorithm performance in order to examine the capabilities of the smartphone sensors for measuring different levels of vibration.
The data is collected using a Galaxy s4 smartphone from different speeds of a small rotary machine. The accelerometer measurements are obtained and processed. The sliding window technique is used with window size of 1 second of data. The first step of processing is obtaining the roll and pitch angles from a static period at the beginning.
The calculated angles are used to level the data to obtain the vertical and horizontal    Figure 13. The levels are divided into six different categories ranged from "very weak" to "very strong".
The second dataset is somehow longer that the first dataset. Figure 14 shows the vertical acceleration data which has varying amplitudes. The input values for the FIS membership at the input side are shown in Figure 15. The resulted vibration levels for the second dataset are shown in Figure 16.

Conclusion
Vibration analysis is growing and developing and becomes an important characteristic to monitor the performance and condition of most of the machines. It could be used to indicate the need for an immediate maintenance or further assessment of causes. The new technology of low cost MEMS sensors is emerging new trends for vibration analysis where it is facilitating a wider usage for this type of measurements. This paper presents a new technique for vibration level estimation using the FFT feature extractions and fuzzy inference system. The data transforms into the frequency domain to se-