On mechanical vibration analysis of a multi degree of freedom system based on arduino and MEMS accelerometers

This paper is aimed at undergraduate students of physics, engineering and mathematics, where a methodology for mechanical vibration analysis of a multi degree of freedom (DOF) excited by an harmonic force in the time and frequency domain is presented. The Arduino microcontroller is used as an acquisition system and low-cost MEMS accelerometers for the instrumentation of the system. System of multi DOF are studied in a great number of problems in mechanical sciences, however its experimental study is not always present in the courses due to the high costs and complexity. These problems are overpassed with the study proposed in this work. Besides, the application presented has an interface with several disciplines in undergraduation and graduation level. The method proposed can be easy implemented and the results obtained had good precision and are in agreement with the literature.


Introduction
The vibration phenomenon is seen in many everyday situations and is present in speaking, vision, audition and other activities involving human relation due to mechanical waves as well as digital communication through electromagnetic waves [1,2].Also, this phenomenon is necessary in several engineering applications such as in vehicle suspension, where the vibration is used to improve the comfort of the driver.
A mechanical system can have infinite of degree of freedom (DOF), but for a more simple analysis they are modeled as systems with a finite number DOF.In this way, the system can be described completely and a qualitative as well as quantitative idea of the system can be obtained.For example, some engineering structures like bridges and buildings, despite having infinite degrees of freedom, are commonly discretized for a better analysis.
The resonance phenomenon is found in a great number of applications where there is vibration and it happens when the frequency of excitation is equal to the natural frequency of the mechanical system which can cause damage in machines or structures.Therefore, the knowledge of the natural frequency of the structure as well as the excitation frequency is vital to avoid faults in engineering structures.The characterization of the natural frequency of a structure can be done analytically and experimentally.In undergraduate courses the analytical methods are introduced to the students, but it's interesting for them to know how to measure the natural frequency of structures and identify when they are at resonance.However, the experimental setup needed to measure the natural frequency can be expensive and the procedures technically difficult.To overcome these problems, in this paper the use of the Arduino microcontroller model Mega2560 Rev.3 together with low-cost MEMS sensors for measuring mechanical vibrations is presented, which is a cheap and simple alternative for an acquisition system.The sensors were used to measure the oscillations of a three story shear-building structure in its free vibration and when excited by an unbalance motor.The structure was excited near its natural frequency to characterize the resonance phenomenon.
A similar acquisition system was used in [3], were the kinematic quantities of a beam were obtained using accelerometer, gyroscope and ultrasound sensors.The results obtained were compared with analytical models and computer simulations.In [4] a gyroscopic sensor was used to measure the oscillations of a nonlinear pendulum which were compared with an analytical model; the Arduino was used as an acquisition system as well.Also, references [5]- [9] present the application of the Arduino for educational purposes.
Due to the low-cost and easy implementation of the Arduino microcontroller, its use it's motivated in wireless sensors networks (WSNs), which can be used from energy harvesting to monitoring processes.For some example in [10] a WSN is presented for Structural Health Monitoring (SHM) where the network is tested in a modal analysis in a cantilever beam, the results obtained are compared with the conventional wired vibration measurement system.In addition, references [11]- [15] present more applications of the Arduino in WSN.
The objective of this paper is to present the use of the Arduino microcontrollers for mechanical vibration analysis as done in [3] and [4], but with a study on a multi-DOF mechanical system, more specifically a three story shear building.The mechanical system studied is widely used in dynamic of structures with several stories, where each story is represented for a one-DOF massspring system [16][17][18][19][20].

Shear building model
The shear building structure is a mechanical system with infinite DOF, but it can be modeled as an equivalent spring-mass system, creating thus a lumped parameter or lumped mass system.This is commonly done to facilitate the analysis since in some engineering applications the interested parameters are the frequency of vibration and the vibration modes.The minimum number of coordinates necessary to describe the motion of the lumped masses and rigid bodies defines the number of degrees of freedom of the system.The system can be modeled as a unidimensional one due to its vibration characteristic, i.e, the horizontal vibration is more representative than the others.
In this paper a three story shear building is studied and modeled as a 3-DOF spring-mass system.The springs and dampers which connects the masses are the equivalent ones; this reduces the number of viscoelastic element by half [1], [2], [18], [21].Figures 1.a and 1.b show a schematic of the shear building structure and the springmass system used to model it, respectively.
The equivalent spring stiffness of the structure's columns which have rectangular cross-sectional area is obtained using (1) [1]; where E denotes the Young's modulus of the column's material, l is the the column's length and I is the polar moment of inertia of the cross-sectional area and is obtained using (2), being b and h the column's width and thickness, respectively In order to obtain the system's equation of movement (EOM) the Newton's second law is applied in each mass of the system.The system of equations (3) shows the EOM for the system's masses, which are linear ordinary differential equations.These equations are coupled with each other.Equation ( 4) can be rearranged in a matrix form, which is presented in Equations ( 5) and (6).With the equations in this form, the application of analytic methods as well as the manipulation of them is simplified.
In addition, the damping can be modeled as Rayleigh damping, which is defined as shown in equation ( 6), where α and β are given constants A wider approach can be found in [1], [2], [18], and [21] Alternatively, the system of equations ( 3) can be obtained using the Euler-Lagrange formulation [2].For such, the kinetic and potential energy of the system has to be obtained.Equations ( 7) and ( 8) present the kinetic and potential energy.As the system has dampers, an equation for the dissipation energy has to be given, which is presented in equation ( 9), considering viscous damping Given the kinetic, potential and dissipation energy equations, the Lagrangian of the system can be obtained using equation (10).Furthermore, the EOM for each mass can be obtained applying the Euler-Lagrange equation shown in equation ( 11) and (12).
The system of equations (11) gives the EOM for each mass shown in equation (3) when the equations ( 7), ( 8) and (9), for the kinetic, potential and dissipation energy, respectively, are used and the differentiations are done.
As we are interested only in the obtention of the structure's natural frequencies of vibration and to simplify the calculations, the damping of the system will not be considered in the model.Therefore, the system's EOM reduces to, The solution of the free vibration of the system is given by {x (t)} = {φ} e jωnt (14) where ω n is the natural frequency and φ the corresponding mode of vibration of the system.Substituting equation ( 13) in (12), the following eigenvalue and eigenvector problem is obtained, Since we are interested in the nontrivial solutions, the following characteristic equation is obtained Equation ( 16) is a three-order polynomial equation which solutions gives the natural frequencies of the system, ω n1 , ω n2 and ω n3 .The natural frequencies obtained solving (16) can be used to obtain the system's modes of vibration, {φ} 1 , {φ} 2 and {φ} 3 using equation (15).The stiffness [K], obtained using equation ( 1 Applying these matrices in equation ( 16), which is a characteristic equation for an eigenvalue and eigenvector problem; the first, second and third natural frequencies are obtained analytically, which are 4.09, 12.54 and 19.32 Hz, respectively.

Data Acquisition System
The experimental setup consists of an Arduino board model Mega 2560 Rev. The Arduino is an open-source hardware-and softwarebased electronic prototyping platform of easy use that can be used as a signal acquisition, to control motors and a great number of other things, by means of written programs in an easy-to-use computer language The Arduino board has analog and digital pins as well as some digital communication interfaces, being the SPI e I2C the most used ones [4].
One of the MEMS-based sensor used consist in a chip containing an accelerometer and a gyroscopic sensor, produced by Invensense model MPU6050.The accelerometer sensor possesses a configurable range of measurement between ±2, ±4, ±8 and ±16 g with a 16 bits resolution, while the gyroscopic sensor has a range between ±250, ±500, ±1000, ±2000 • /s, also configurable and with a 16 bits resolution.The linkage of the MPU-6050 chip with the Arduino is done by means of the serial pin via I2C protocol [3], [4], [24] and [25].The linkage of the MPU-6050 with the Arduino can be seen in the appendix.
The second MEMS-based sensor is an accelerometer produced by Analog Devices model ADXL-335 which has a fixed range of measurement of ±3 g.The output signal from the accelerometer is analogical in the form of voltage proportional to the acceleration that the sensor was subjected.In this case, as the signal is digitalized by the Arduino, its resolution is 10 bits [26][27].Also, the linkage of the ADXL-335 with the Arduino can be seen in the appendix.

Experimental Procedures
The three story shear-building studied is made by four polypropylene plates with dimensions of 400 x 76.2 x 15 mm, and six ASTM A-36 steel plates with dimensions of 300 x 76.2 x 1.75 mm.The complete structure possesses dimensions of 900 x 400 mm. Figure 2.a show the shearbuilding studied.
The structure is excited by an unbalanced motor mounted in the center of the top story of the building.The motor was unbalanced placing a mass of 6.59 g distant 15 mm from the axis of rotation as shown in Figure 3.The voltage vs frequency graph was obtained experimentally and it's shown in Figure 4. To control the voltage given to the motor a power source model MPL-3303M of Minipa was used.
For the data acquisition of the shear-building, it was mounted in an inertial bench, which is an experimental bench mounted on top of springs with the purpose of isolate the system from others form of excitation.However, the structure can be mounted in classrooms or laboratories on desks using "C" clamps.The problem of not using an inertial bench to perform the measurements is that frequencies from unknown sources can appear.
The signal acquisition was performed with a sample rate of 1 kHz and 8192 points, which were configured in the sketch and uploaded to the Arduino.The measurements were done for the free-vibration of the structure and when it was excited by the unbalanced motor in the steady state with the frequencies of excitation near the natural frequencies of the structure.Also, measurements were performed considering the transient state of the motor, were the frequency of excitation was varied from 0 to 24 Hz.In this last measurement more points were used, 32768, but the sample rate was maintained.In addition, the accelerometers were mounted in the structure's walls over an aluminum support which was fixed on the structure using bee wax, as shown in Figure 2.b.

Results
The acceleration of the structure was measured in five different scenarios: a free-vibration; a 4.2 Hz, a 13.12 Hz and a 20.4 Hz of excitation which correspond to the structure's natural frequencies of vibration; and an excitation varying the frequency from 0 to 24 Hz.The excitation frequency was controlled using a variable-voltage power source and defined using the voltage vs frequency graph shown in Figure 4.It was performed ten measurements  for each case described.For analysis of the signals in the frequency domain the Power Spectrum Density (PSD) was used.The implementation of the PSD was done using the Python 3.0 computer language by means of the SciPy library [28][29][30][31][32]. Also, others computers languages and computers programs can be used such as Matlab [33], Octave [34], Labview [35] and Fortran [36].
Figures 5 to 8 present the measurements done using the ADXL-335 accelerometer, while Figures 9 to 12 show the ones done with the MPU-6050 sensor.Figure 5.a presents the signal given for a free-vibration of the structure when subjected to an initial displacement, and Figure 5.b show the PSD applied in the free-vibration, where the natural frequencies of the structure can be seen in the graph's peaks.
Figure 6.a presents the acceleration signal for the case of steady state excitation with a 4.2 Hz frequency.In Figure 6.b, the PSD was applied in the signal where the peak corresponding to the frequency of excitation can be seen.This result is expected since the system is in its steady state.Furthermore, Figures 7.a     Figure 13 show the signals obtained by measuring the acceleration of the structure when it was subjected to a variable frequency of excitation, where Figure 13.a was obtained using the ADXL-335 and Figure 13.b using the MPU-6050.The frequency was varied from 0 to 24 Hz.From the figures one can identify the resonance peaks, which are the instants were the frequency of excitation got near the natural frequencies of the structure.In addition, Table 1 presents the comparison between the values of the natural frequency given by the two accelerometers used and the analytical value.

Remarks
In this paper presents an expansion of previous works initiated in [3], which aims at measuring mechanical vibrations using the Arduino microcontroller and lowcost sensors for educational purposes.This work treated in the evaluation of the Arduino and low-cost MEMSbased accelerometers for analysis and characterization of mechanical systems with multi degrees of freedom.
The sensors used showed suitable for the vibration analysis in mechanical systems with multi-DOF in the      1, showed that the measurements are in agreement with the analytical values and almost no variation is seen comparing the values given by the two accelerometers, as one can also note from the table.
The methodology proposed is adequate to undergraduate and graduate courses of physics and engineering, especially in disciplines such as dynamic of rigid bodies, mechanical vibrations, instrumentation, signal processing, dynamic of structures and so on.It's worth repeating the low-cost and simplicity characteristic of the experimental setup presented in this paper, which makes the mechanical vibration analysis more accessible for students.It is important to note that both sensors are suitable for the proposed application.
In the literature one may found that the level of precision of MEMS-based sensors has raised significantly [37][38][39][40][41][42][43][44][45], which allows its use in teaching, research and industrial applications, which require a higher precision in their results.The same can be spoken about the Arduino microcontrollers present in the market, which are being used in a wide range of applications from teaching and research to industrial.

Future Works
For the extension of the present work the authors propose: • Modal analysis of the three story shear building; • Use of piezoelectric sensors; • Remote monitoring of structures; • Evaluate the acquisition system proposed in this work on rotative systems.

Figure 1 :
Figure 1: a) Three story shear building and b) Spring-mass model.
), and the mass [M ] matrices for the studied structure are given by the following [ 3 based on the ATmega2560 microcontroller which has 54 digital I/O pins, 16 analog pins and 4 serial pins [22-23]; and two MEMS-based accelerometers, one model ADXL335 of Analog Devices, and other model MPU6050 of Invensense.

Figure 2 :
Figure 2: a) Three story shear building studied and b) location of the sensor.

Figure 3 :
Figure 3: Motor used for excite the structure.

Figure 4 :
Figure 4: Voltage vs frequency graph of the motor used.
, 7.b, 8.a and 8.b present the acceleration signal for a 13.12 Hz of excitation, the look of it in the frequency domain, the acceleration signal for a 20.4 Hz of excitation and its look on the frequency domain, respectively.It's worth noting that the higher peak appeared in the frequency domain graphs, just like Figure6.b, present the frequency of

Figure 5 :
Figure 5: Signal measured in the free-vibration of the structure using the ADXL-335 accelerometer: a) Time history and b) Power Spectrum Density.

Figure 6 :
Figure 6: Signal measured when the structure is excited by a frequency of 4.2 Hz using the ADXL-335 accelerometer: a) Time history and b) Power Spectrum Density.

Figure 7 :
Figure 7: Signal measured when the structure is excited by a frequency of 13.12 Hz using the ADXL-335 accelerometer: a) Time history and b) Power Spectrum Density.

Figure 8 :
Figure 8: Signal measured when the structure is excited by a frequency of 20.4 Hz using the ADXL-335 accelerometer: a) Time history and b) Power Spectrum Density.

Figure 9 :
Figure 9: Signal measured in the free-vibration of the structure using the MPU6050 accelerometer: a) Time history and b) Power Spectrum Density.

Figure 10 :Figure 11 :
Figure 10: Signal measured when the structure is excited by a frequency of 4.2 Hz using the MPU6050 accelerometer: a) Time history and b) Power Spectrum Density.

Figure 12 :
Figure 12: Signal measured when the structure is excited by a frequency of 20.4 Hz using the MPU6050 accelerometer: a) Time history and b) Power Spectrum Density.

Figure 13 :
Figure 13: Measurements of the structure's acceleration when subjected to a variable frequency from 0 a 24 Hz using a) ADXL335 and b) MPU6050 accelerometer.

Table 1 :
Comparison between the values of the natural frequencies obtained experimentally and the analytically Hz 12.94 ± 0.05 Hz 12.84 ± 0.00 Hz 3•19.32 Hz 20.26 ± 0.00 Hz 20.25 ± 0.05 Hz time and frequency domain.Also, the results obtained, which are shown in Table