1. Introduction
In a world where technology and the pursuit of efficiency are the fundamental drivers, the maintenance of systems and equipment is a cornerstone of safety and reliability [
1,
2]. From manufacturing to energy and transportation asset management, condition monitoring (CM) has emerged as one of the main strategies of condition-based maintenance. To do this, CM systems gather information that allows recognizing anomalies in operating parameters early enough to establish a cost-effective maintenance plan, thus reducing downtime and fault-related costs [
3,
4,
5].
According to Crespo et al. [
6], the implementation of CM not only leads to a better understanding of how industrial systems operate and behave but also provides a basis for their optimized management. From this perspective, CM is established as a key practice to anticipate failures, optimizing the performance and prolonging the lifetime of equipment and systems [
7,
8,
9]. Similarly, McMahon et al. [
10] described CM as an essential source of information on the condition of equipment and systems, allowing subsequent decisions to be made efficiently and effectively. Furthermore, the introduction of Industry 4.0 technology concepts has generated even more interest in considering CM as a key strategy for equipment diagnosis [
11,
12,
13]. These technologies (such as cloud, artificial intelligence, robotics, the Internet of Things, etc.) aim at automating and connecting all equipment, where the acquisition and processing of a large amount of data is a key factor. This has allowed expanding the capabilities and possibilities of CM implementation [
14].
At the initial stages of implementing a CM system, it is necessary to determine the criticality of the equipment under study and how it affects the production process. This allows estimating the warning time required, the parameters of interest to be monitored, and the data acquisition intervals. This selection requires adapting the sensors and the data acquisition system (DAQ) to the parameter of interest and the component being analyzed [
12]. According to Bustos et al. [
15], vibration signals are the most commonly used parameter in CM systems for diagnosing the critical components of rotary machinery. Vibration analysis is even considered to constitute 58% of the entire market of CM strategies [
16]. Consequently, bearings are considered to be components with a high probability of failure in a machine, where the appearance of unexpected defects can cause great economic losses and, in extreme cases, human losses [
17,
18].
Despite the undeniable benefits, CM faces significant challenges in its implementation. One of the main drawbacks in the implementation of CM lies in the cost of the initial instrumentation of the equipment. In areas such as bearing diagnostics using vibration signals, it is necessary to have high-performance recording equipment [
19]. Among the main characteristics that this type of DAQ must possess are accuracy, number of channels, and high sampling frequency. Although the latter depends on the geometric characteristics of the bearings, Bernal et al. [
20] recommended using a sampling frequency of 50 kHz for bearing diagnostics. This has led to studies focused on developing high-performance DAQ systems at low cost, which can guarantee accessibility in the implementation of this type of condition-based maintenance strategy.
Several studies of data acquisition system prototypes have been developed, but most of these fail to meet the requirements for acquiring bearing vibration signals. Seyedmilad et al. [
21] presented low-cost equipment (called CHEAP) designed for the accurate measurement of structural vibrations. This equipment was considered to be a high-sampling frequency unit, with a capacity of 85 Hz in each channel. Kumar et al. [
22] presented a low-cost data acquisition unit designed to acquire current, vibration, and sound signals at a sampling frequency of 140 Hz. Vidal and Pindado [
23] presented a 5-channel Arduino-based data acquisition system with the capacity for a sampling frequency of 500 Hz. In contrast, other studies have developed high-performance recording equipment but lack the data for them to be reproduced. Bosso et al. [
24] presented a prototype for a multifunctional system applied to railway vehicles capable of recording vibration and temperature. Saha et al. [
25] presented a prototype for a high sampling frequency DAQ system (10 MHz) designed to capture acoustic emission signals.
Finally, the Railway Technology Research Centre (CITEF) of the Polytechnic University of Madrid presented a data acquisition module based on a CPU unit and a data acquisition card [
26]. This DAQ was characterized by its use of low-cost components and high performance regarding the number of channels and recording capacity. Nevertheless, when all four channels were used to record data, the unit only reached a maximum sampling frequency of 35 kHz per channel, which limited its implementation for assessing certain types of bearings.
The present article describes improvements to the DAQ developed in [
26]. The main goal is to carry out a deep analysis of the unit’s behavior in order to guarantee even higher performance and more accurate data acquisition. These optimization tasks consider both hardware and software. For the hardware, the influence of power supply on the performance of the DAQ and the quality of the acquired data was analyzed. On the other hand, in the data acquisition software, the code structure was optimized, changing the type in which the data is written. Similarly, the estimation and selection of the best clock divider in the SPI bus speed configuration was optimized, considering the desired sampling frequency and the RPi system clock speed. The main contributions of this work are summarized as follows.
Increasing the maximum sampling frequency of the equipment, reaching 201 kHz when using one recording channel and reaching 50 kHz when using all of its channels (4). This represents an average increase of 60% in its capacity when compared to its previous version;
Improved sampling rate stability, reaching a constant sampling rate up to 20 kHz;
Increased data storage efficiency, guaranteeing an equivalence between the acquisition time and the time needed to write the data.
The rest of the document is organized as follows.
Section 2 provides a review of the DAQ structure, features, and limitations.
Section 3 details the optimization tasks developed in the DAQ.
Section 4 focuses on the experimental setup to acquire bearing state vibration signals using the optimized DAQ.
Section 5 presents the validation results and the new performance of the optimized DAQ. Finally, conclusions and future research directions are provided in
Section 6.
2. Background: Data Acquisition System (DAQ)
2.1. Equipment Structure
The DAQ system was developed taking into account the essential requirements for analyzing the bearing condition using vibration analysis. One of the main goals is that of acquiring data from different signals at once, which requires the equipment to have several recording channels. This DAQ must be at least as accurate as commercial equipment. Another important feature to be considered is the sampling frequency required by the equipment to acquire bearing vibration signals, which is recommended to be 50 kHz in each channel. Finally, it should be a complete DAQ module formed by a CPU unit and a converter card that allows easy transport for tests in the field and that is sufficiently compact with remote connectivity so that it can be placed in small locations with difficult access.
2.1.1. Hardware
The hardware of this equipment consists of a CPU unit and a data converter card. As a CPU unit, the DAQ developed uses a single-board Raspberry Pi 3 B+ (RPi) computer. This is a key component in the structure of the recording equipment, because of its high performance at an affordable cost. The RPi is the core of the system, responsible for managing, processing, and storing the vibration data acquired in its internal memory. Furthermore, depending on the storage requirements, the RPi allows using an external memory or cloud storage solutions for managing large volumes of data. This feature makes it an ideal option for condition-monitoring applications linked to SCADA systems. The RPi has an independent operating system that is compatible with several programming languages. It also has a processor, RAM memory, I/O interfaces, and options for remote connectivity that enable executing the required software remotely.
Data are recorded by a data acquisition and conversion card. This card is designed to capture and sample the vibration signals with great accuracy and at a high sampling frequency. The card has four input channels linked to a multiplexor (MAX4518CPD), which manages the connection of each connected channel and stores the data until the converter has completed its task. This allows acquiring data simultaneously from different sensors. The analog/digital converter (ADC) used in the acquisition card is ADS8326, with 16-bit resolution and is capable of reaching a sampling frequency of up to 250 kHz (FSample).
Communication between the RPi and the data acquisition card is achieved via the General Purpose Input/Output (GPIO) pins, using an SPI communication protocol (Serial Peripheral Interface).
Figure 1 shows the structure of the DAQ with the components that make up the data acquisition and conversion card.
2.1.2. Software V.1.0
The recording equipment uses specifically developed software to control the operation of the different components of the data acquisition and conversion card and manage the storage of such data. It is worth noting that the software is installed in the RPi memory, which makes it possible to control data acquisition via a remote connection. This software controls and manages the identification of the recording channels (either manually or automatically), configures the working frequency for the ADC clock (FClock), establishes the desired sampling frequency, manages the connection of each connected channel, receives the digital vibration signals from the acquisition card, and stores the acquired data in the RPi memory.
According to the ADS8326 data sheet specifications, the
FClock is defined using Equation (1). In this work, the maximum sampling frequency of the ADC (250 kHz) is considered, so the
FClock is estimated at 6 MHz.
A Double data type was chosen to manage the acquired data owing to the ease with which it can represent decimal values with high precision. Once the acquired data correspond to the desired sampling frequency, the data are dumped into a write string that will be temporarily stored in memory until the data are written into a text file. Finally, when the requested recording time has elapsed or the data acquisition order is stopped, the data will be stored in the text file, which will be closed.
2.2. Equipment Features
One of the main features of the DAQ developed is its high sampling frequency, of 110, 65, 45, and 35 kHz, respectively, when using 1, 2, 3, and 4 simultaneous channels. This allows the unit to be used to capture vibration data for rotating machinery, especially for critical components that require high sampling frequencies, such as bearings and gears. This enables performing condition-monitoring tasks on the machinery for the early detection of faults.
Another clear advantage of the proposed recording equipment is its low cost compared to other commercial data acquisition systems. Considering the DAQ as a complete data acquisition module, its cost is EUR 213, whereas the cost of a commercial DAQ with these characteristics, such as WebDAQ 504, is more than seven times higher. This makes it accessible for a wide range of applications and allows it to be implemented in industrial environments that require affordable and effective condition monitoring.
On the other hand, the components that make up the equipment guarantee the accurate capture of vibration signals in the frequency range required for monitoring the condition of rotating machinery. This has been verified through the capture of data from known waves and vibration signals for different bearing conditions. In each of these cases there was great data acquisition performance, in both identifying the known wave frequency and evaluating the frequency and classic fault modes of the bearing components [
26,
27].
Furthermore, the use of the RPi as a processing and data storage unit offers flexibility and enables customizing the DAQ unit to specific condition-monitoring needs. This feature, along with its remote connectivity, allows developing a DAQ system that is sufficiently compact to be placed in difficult-to-access locations and easily transported for tests in the field (see
Figure 2).
2.3. Limitations of the Equipment
Although the equipment presents significant advances in data acquisition at high sampling frequencies, it is important to mention the inherent limitations of this equipment. This study analyzes these limitations, focusing on key aspects such as sampling capacity, measurement accuracy, and the time it takes to store the data.
The recording equipment’s sampling capacity is an important limitation. Although it achieves a high sampling frequency, when using all four channels it does not achieve the recommended sampling frequency for acquiring bearing vibration signals (50 kHz). This limitation could compromise the capacity of the equipment to detect vibrations in the high-frequency bands associated with bearing condition, which is crucial to effective monitoring.
The accuracy of the vibration measurements is another limitation to be taken into account. Despite the low cost, the recording equipment may present limitations regarding accuracy during data acquisition. This leads to a variable sampling frequency that generates problems when analyzing the data in the frequency domain. This requires a resampling step to guarantee that each discrete sample is acquired at equally spaced time intervals.
Finally, the time required to store the data is another critical aspect for the operation of this equipment. Although the data acquisition time corresponds to that stored in the text file, there is a delay in the writing of these data after the end of the data acquisition process. This means that there is a certain delay for a given acquisition time until the equipment finishes writing all the data in the text file. This drawback is related to the way in which the data are dumped for writing. In this process, the data are queued in a buffer (volatile memory) while waiting to be written into the text file.
Figure 3 shows a record over 64 s, where blows were induced so that they are perceived by the sensors at approximately 30, 45, and 60 s. This demonstrates that the data are being acquired correctly. However, the problem lies in the time required to write such data.
3. Optimizing the Data Acquisition System
When developing a DAQ, the times of data capture and writing are critical factors that directly affect the efficiency and accuracy of any measurements. It is therefore necessary to assess different aspects that affect the DAQ system performance regarding the quality of the acquired data and the time required to acquire and store said data. These tasks are related to the power supply and the efficiency of the programming code. The following sections present each of these tasks, focusing on the most important ones.
3.1. Influence of Power Supply Voltage on the Recording Equipment
Power supply is a critical factor in the operation of data acquisition equipment. It is therefore essential to understand the influence of power supply voltage on the operation of each of the components of such equipment. Both the CPU unit, based on an RPi, and the ADC converter of the data acquisition card require a stable and adequate voltage for reliable and accurate operation. Any variation in this voltage can have a significant impact on the performance of these components, affecting the stability of the acquired signal and the capacity to manage and collect the data, thus causing the loss of critical information.
According to the specifications, the RPi requires a power supply that produces 5 V and a current of 2.5 A for maximum performance. The data acquisition card and the ADC require a constant supply of 5 V to achieve their maximum sampling frequency and to maintain a stable resolution. Therefore, the power supply must guarantee the conditions required by the RPi unit despite fluctuations in the current consumption generated by connecting other components such as the converter card or the requirements of actions such as the writing of the data.
3.1.1. Stability of the Acquired Signal
In performance tests of the DAQ, signals from vibration sensors were acquired using 5 V and 2.1 A portable batteries. The following are some drawbacks observed because of a poor power supply.
In the operation of the DAQ using generic portable batteries, there may be moments of time with instability in the acquired vibration signal. Therefore, data of the vibration signal and the voltage supplied by the power supply were captured.
Figure 4 presents these acquired signals, where in the representation of the vibration signal (
Figure 4b) the sensitivity and offset of the sensor were not considered. The results indicated that when the power supply voltage varies (
Figure 4a), this is likely to directly affect the stability of the acquired signal (
Figure 4b). This is generated when the power supply is insufficient, so it is not able to compensate for the oscillating voltage drop of up to 0.16 V generated by the operation of the RPi, the ADC converter, and other components sensitive to voltage changes (such as sensors). Furthermore, it is possible to observe that the instability of the acquired vibration signal is proportional to the variation in the supply voltage. This behavior is not related to the characteristics of the power supply alone, but also to the quality and length of the cable used to supply said power to the equipment. Similar behavior was observed when using generic wall adapters as the power source.
Portable power supply units are also affected by the time of use and charge capacity. The prolonged use of power supply units with poor capacity (5 V and 2.1 A) generates great wear, which then leads to poor power supply. This can be seen in
Figure 5, which shows the behavior of the acquired vibration signal (considering the sensitivity and offset of the sensor), according to the time of use of a portable power supply.
Figure 5 shows that, despite the battery having limited characteristics for the requirements of the recording equipment, this power source was capable of providing a sufficiently constant power supply during the first few hours. However, after a long time of use, the power source showed distortions in the power supply, generating distortions in the signal acquired and generating a voltage drop of 0.1 V.
3.1.2. Selecting the Power Source
To guarantee optimal operation of the DAQ, this study assessed the quality of the voltage supplied by different power supplies. The objective was to identify power sources that provide stable and adequate power and meet the specifications required by the DAQ system.
Table 1 shows this analysis. According to the specifications, each battery provides 5 V at currents of 2.1 and 3 amperes. Each of the batteries was used to acquire records over 60 s with a sampling frequency configured at 48,000 Hz. The analysis was performed by analyzing the average sampling frequency (Fs) achieved, the accuracy of the data acquired by means of the standard deviation (Std) of the sampling frequency, and the average storage time achieved.
According to the results presented in
Table 1, the RS and Havit power supplies showed the lowest performance, both in the average sampling frequency achieved and the greater standard deviation of the sampling frequency. However, they differed in the storage time achieved. This behavior was associated with their specifications, since these are the power supplies with the lowest capacity. On the other hand, the Baseus65w and Charmast power supplies were the two with which the DAQ system achieved its best performance. Although the Charmast power supply showed slightly greater accuracy for data capture (given its lower standard deviation), the Baseus65w power supply achieved an average sampling frequency closer to that requested and a significantly greater time for data capture. Therefore, according to the analysis performed, the Baseus65w power supply was considered as the power source unit. The summary of DAQ performance with the different power supplies is shown in
Figure 6.
3.1.3. Power Supply Mode
The RPi has several options for power supply, the Micro USB port being the one recommended by the manufacturer owing to its overcurrent protection circuit. Nevertheless, it can also be powered by feedback through the USB ports or the power supply pin on the GPIO port. In these last two cases it is important to ensure that the power supply used includes overcurrent protection measures. These power supply options for the RPi can be observed in
Figure 7 (red circles). Likewise, the converter card can be powered by the 5 V pin of the RPi GPIO port or externally at any point of the power supply line.
Considering the requirements of the recording equipment components and the effects these have on performance, this study analyzed different power supply modes in order to provide as stable a power supply as possible. Three power supply modes were evaluated in the DAQ system. The first two power supply modes involve supply in series from the Micro USB port of the RPi or from the data acquisition card. Finally, the third power supply is performed individually or in parallel through the RPi Micro USB port and the data acquisition card. This analysis used the Baseus65w power supply. The signal acquired was generated by a wave generator with a frequency of 5 kHz over 60 s.
Figure 8 shows the performance of the DAQ system according to the power supply mode. The results indicated that the RPi power requirements are guaranteed when using a DAQ power supply in series through the Micro USB port, which allows achieving longer data writing times. However, it reduces the current reaching the converter card (5 V pin of the GPIO port), which affects its sampling frequency performance. This is also observed if the power is supplied from the data acquisition card. On the other hand, the independent power supply (Ind) to the RPi and the data acquisition card guarantee the performance demanded from each component, thus reaching a greater sampling frequency, greater data writing time, and a reduction in the standard deviation for data acquisition frequency.
3.2. Influence of the Type of Data on Memory and Storage Speed
In a DAQ system, the type of data handled in the programming language takes on an important role in defining the storage methods and how to represent and interpret the information [
28]. This tells the computer the class, attributes, and precision of the data being handled while executing the program. The choice of data type thus has a significant impact on the RPi performance regarding memory efficiency and storage speed.
As mentioned in
Section 2.1.2, the data capture software used a Double data type. This type of data is characterized by representing decimal values with high precision via a 64-bit floating point. Running software thus requires greater storage capacity, since 8 bytes of data must be reserved in memory for each variable defined with this data type. This implies that more read and write operations are required to manage and store these data, which affects the general performance of the DAQ system. It is important to mention that each acquired sample is dumped into an independent write thread in the data capture management software. This leads to maintaining large amounts of data in queues waiting to be stored, reserving a large part of the memory for this task.
Since the converter used in the data acquisition card has a 16-bit resolution, using Double type data provides no benefits in terms of precision, since a large part of the memory is being reserved for data management, the precision of which is not related to the performance of the ADC converter being used. This has a direct influence on the performance of the RPi, producing delays in the data read and write times.
In contrast, uint data are smaller and occupy less space in memory. This type of data allows representing unsigned integers in a range from 0 to 65,535, which coincides with the representation capacity of the 16-bit ADC converter used in the acquisition card. Using this type of data thus ensures a direct correspondence between the input values captured by the ADC and those stored in the memory of the acquisition system.
This change in data type comprises the optimization task with the most influence on DAQ performance. This is possible since it frees up memory, facilitating data management. One of the main advantages lies in the equivalence between the times of acquisition and writing of the data. Thus, to acquire a 60 s recording, 60 s in real time are currently required. This can be observed in
Figure 9, which represents the difference in data acquired and stored over 60 s, using each of the data types evaluated. This shows that by using the Double data type (
Figure 9a), it is possible to store samples for the first 55 s, whereas by using the uint data type (
Figure 9b), it is possible to record all the data for the entire time requested.
3.3. SPI Clock Frequency Divider
One of the main attractions of the RPi is its ability to communicate with other devices through the SPI bus used in this study. This communication is established using the BCM2835 library, where it is possible to configure the SPI clock frequency. This SPI clock frequency determines the data transfer rate and the synchronization between the devices on the SPI bus (RPi and data acquisition board). On the other hand, the RPi has a system clock speed that directly affects the maximum frequency that can be achieved on the SPI bus. This makes it necessary to consider the system clock speed when setting the SPI clock frequency, and in turn, the SPI clock frequency will depend on the desired sampling frequency (FSample), see Equation (1).
The BCM2835 library provides functions for RPi communication with other devices, including SPI bus configuration. To set the SPI clock frequency using the BCM2835 library, it is necessary to calculate the appropriate divider based on the system clock rate and the desired sampling frequency. This divider is used to divide the system clock rate to obtain the SPI clock frequency (see Equation (2)). However, the SPI clock frequency on the RPi processor can only be configured based on a string of internal prescalers that are powers of 2 (according to the BCM2835 library documentation), such as 2, 4, 8, 16, 32, 64, 128, etc. Thus, when configuring a clock divisor that is not a power of 2, the SPI driver will automatically round to the nearest low clock divisor that is a valid power of 2.
As described in
Section 2.1.2, the SPI clock frequency (
FClock) of the ADC was defined at 6 MHz, so the
FClock is not always associated with the desired
FSample. In this case, the
FSample is defined by a data read loop, acquiring only the data corresponding to the time equivalent of the desired sampling frequency. Such a structure made it possible to achieve sampling frequencies of 110, 65, 45, and 35 kHz using 1, 2, 3, and 4 channels, respectively. However, this configuration significantly affects the performance of the DAQ, in both the desired data capture frequency and the stability of the sample acquisition rate per unit time.
According to Yang et al. [
29], setting the clock frequency too high may exceed the hardware capabilities and result in unstable communication or data transmission errors. On the other hand, too low a clock frequency may limit system performance and affect the data transfer rate. The latter ratifies the low sampling rate achieved in the DAQ proposed in [
26] and the instability of the acquired data at a low sampling rate.
This has made it necessary to use a structure that defines the SPI clock frequency, being consistent with the desired sampling frequency and considering the RPi system clock speed. Equations (1) and (2) are considered to estimate the clock divider to be used in the SPI bus speed configuration. The BCM2835 library specifies that the RPi used in this study has an FSystem clock of 400 MGz.
Figure 10 presents the influence of using a correct clock divider on the stability of the acquired data at different sampling frequencies (1, 10, 20, 50, 100, and 200 kHz). The results indicated that by calculating the right clock divider and selecting an appropriate SPI clock frequency, the desired sampling frequency can be achieved, and system performance optimized. This was mainly observed for data acquired at sampling frequencies of 1, 10, and 20 kHz, where the standard deviation of the sampling frequency was zero.
For data acquired at a sampling rate higher than 20 kHz, it was observed that a constant sampling rate was not achieved. However, a better performance of the DAQ was observed. The standard deviation of the data acquired at sampling frequencies of 50, 100, and 200 kHz significantly decreased compared to the results presented in [
26].
6. Conclusions
This study presents the optimization tasks developed to improve the performance of the DAQ unit, focusing on its recording capacity and the accuracy and stability of the data acquired. The results showed an average increase of 60% in DAQ-o data recording capacity, currently having maximum sampling frequencies of 201, 102, 69, and 51 kHz when using 1, 2, 3, and 4 channels, respectively. In addition, there was significant improvement in the accuracy of the data capture time, reaching a constant sampling rate of up to 20 kHz. On the other hand, the standard deviation of sampling frequencies was significantly reduced for sampling frequencies higher than 20 kHz, showing higher accuracy in data capture. The latter cases required additional resampling of the signal, which will be considered in future work.
According to the results, the quality of the power supply and the data type chosen in the programming software play an important role in the performance of a DAQ unit. The power supply ensures that both the RPi and the ADC converter operate at maximum performance, guaranteeing accuracy and stability of the acquired data. On the other hand, it is important to consider the type of data used in the programming software. This should be based on the nature of the acquired data and the accuracy requirements of the system. Handling a data type with greater precision than required will affect DAQ performance in terms of memory management and the time taken to store the data. Therefore, changing the data type from Double to uint was critical to balance data precision, memory efficiency, and DAQ performance. Consequently, it is important to highlight the influence of selecting the correct clock divider according to the operating frequency of the system and the desired sampling frequency in order to increase the stability of the data capture.
The new features of the equipment were validated by capturing data from known waveforms and from signals associated with bearing component failures. In each of these cases there was great data capture performance, both when identifying the known wave frequency and when evaluating the frequency and classic failure modes of the bearing components analyzed. This demonstrated the possibility of developing low-cost, high-performance data acquisition equipment, as well as the viability of implementing them in bearing condition-monitoring tasks.