# Measurement of the Speed of Induction Motors Based on Vibration with a Smartphone
## 2 Materials and Methods
This way, the frequency components referred to the motor reference frame, \(X\), \(Y\), and \(Z\), were obtained. These axes were taken as the absolute reference frame in this work because the axes of the smartphone accelerometer, \(X^{\prime}\), \(Y^{\prime}\), and \(Z^{\prime}\), change according to the relative position of the smartphone. For example, Figure 2a illustrates the selected reference frame, along with the axes of the smartphone accelerometer when the smartphone is perpendicular to the motor shaft and placed on the nameplate. In Figure 2b, the smartphone is parallel to the axis motor and over the terminal box. The frequency spectrum of the components of the motor vibration signal for each reference axis was obtained using the Fourier transform  
\[F_{REF}(j\cdot\omega)=\int_{0}^{(N-1)\cdot T}f_{REF}(t)\cdot e^{-j\cdot\omega} \cdot dt \tag{1}\]  
Figure 2: Absolute reference frame considered in this work, \(X\), \(Y\), and \(Z\), when the longitudinal axis, \(\gamma^{\prime}\), of the smartphone is (**a**) perpendicular to the motor shaft and on the nameplate and (**b**) parallel to the motor shaft and over the terminal box. where \(F_{REF}(j\cdot\omega)\) represents the set of Fourier transforms (frequency domain) of the functions of time, \(f_{REF}(t)\), corresponding to each reference axis, \(REF=\{X,\,Y,\,Z\}\), \(N\) represents the number of samples (through which the time signal has been acquired), and T is the uniform sampling period. The continuous Fourier transform (1) is approximated by the discrete Fourier transform (DFT) when the signals are known only at a few instants separated by sampling times. The DFT was obtained by means of the fast Fourier transform algorithm. The fast Fourier transform (FFT) algorithm was used because it calculates the discrete Fourier transform taking advantage of symmetry and periodicity of the signal, what reduces its computational cost [38]. After obtaining the Fourier transform of the motor vibration signal for each reference axis, \(F_{X}(j\cdot\omega)\), \(F_{Y}(j\cdot\omega)\), and \(F_{Z}(j\cdot\omega)\), the root mean square (RMS) value of the vibration spectrum, \(\left.\left.\left.\left|F(j\cdot\omega)\right.\right.\right\right|\), was obtained as  
\[\left.\left|F(j\cdot\omega)\right|\right|=\sqrt{\sum_{REF=\{X,Y,Z\}}\left|F_{REF }(j\cdot\omega)\right|^{2}}=\sqrt{\left|F_{X}(j\cdot\omega)\right|^{2}+\left| F_{Y}(j\cdot\omega)\right|^{2}+\left|F_{Z}(j\cdot\omega)\right|^{2}} \tag{2}\]  
A MATLAB-based algorithm calculated the fundamental mechanical frequency of the rotor shaft, \(\omega_{F}\), simply by applying a peak detection algorithm to the RMS vibration spectrum,  
\[\omega_{F}:\,\left|F(j\cdot\omega_{F})\right|=\text{MAX}\left|F(j\cdot\omega)\right| \tag{3}\]  
Finally, the motor speed value, \(\Omega\), was calculated as  
\[\Omega=2\cdot\pi\cdot\omega_{F} \tag{4}\]  
The value of the absolute relative error of the result was calculated comparing the estimation speed obtained using vibrations, \(\Omega\), with the actual rotor speed measured with two tachometers, \(\Omega_{m}\)  
\[\varepsilon=\left|\frac{\Omega-\Omega_{m}}{\Omega_{m}}\right| \tag{5}\]  
The flow chart in Figure 3 presents an overview of the proposed procedure to estimate the rotation speed of the motor shaft. Figure 3: Flow diagram of the proposed method to estimate the rotational speed based on the vibration.