Development of Rotating Machinery Monitoring and Fault Diagnosis System under Intranet
2026-04-06 06:20:34··#1
Abstract: This paper proposes a development scheme for a rotating machinery monitoring and fault diagnosis system under Intranet. The entire system was developed in the Visual C++ environment, integrating DAQ acquisition, network, database, and multithreading technologies, realizing multiple functions such as high-speed real-time data acquisition, on-site monitoring, signal analysis, fault diagnosis, and network communication. This paper proposes a method for implementing signal processing using the Matlab mathematical function library interface. Practice has proven that using this method for fault diagnosis system development can make system development more efficient and its performance more stable. Currently, the entire system has been put into monitoring operation in the rotating unit of Jinzhou Petrochemical and has practical engineering application value. Keywords: Fault diagnosis; Data acquisition; Signal processing; Multithreading 1 Introduction Rotating machinery is a key component in the production of large enterprises. Modern production places increasingly higher demands on it in terms of power, speed, mechanical performance, automation level, reliability, and safety. Applying fault diagnosis technology to the production of rotating machinery will effectively reduce the failure rate in the production process and has considerable guiding significance for fault prevention and post-fault maintenance. Data shows that after adopting diagnostic technology, the production accident rate has decreased by 75%, and maintenance costs have decreased by 25% to 50%. It greatly improves the economic benefits of enterprises[1]. The development of rotating machinery fault diagnosis and monitoring system involves knowledge of sensor technology, data acquisition and processing and signal analysis technology, fault mechanism research, and diagnostic method research. It can be said to be a comprehensive system development that is interdisciplinary and cross-domain. At the same time, the rapidly developing network technology represented by TCP/IP model has injected fresh blood into the fault diagnosis system and also put forward new requirements for the designers of the fault diagnosis system. The addition of the network has brought about revolutionary development in the fault diagnosis system from the overall working mode design to the selection of data sharing and transmission methods. Therefore, the development of a complete and efficient fault diagnosis system under the enterprise intranet has profound significance for improving the enterprise's benefits. 2 Overall Design The fault diagnosis and monitoring system has gone through the development process of offline, stand-alone and distributed diagnosis. Distributed diagnosis is further divided into B/S and C/S working modes. Considering flexibility, economy, pertinence, reliability, security, and promotion, it can be said that various diagnostic models have their own characteristics. Within the enterprise's intranet, considering the system's complex functional requirements, security, reliability, and the current development scale and level of distributed fault diagnosis systems in China, this system adopts a client/server (C/S) diagnostic working model. After the unit's operating data is collected and processed by the on-site computer, it is connected to the enterprise intranet via the network switch in the workshop monitoring room and transmitted to various functional departments. This allows the enterprise's management and maintenance technicians to understand the on-site unit's operating status in a timely manner from their offices via network-connected computers and make corresponding decisions. Simultaneously, through the enterprise's intranet gateway, the system can also extend to Internet diagnostic nodes, thus considering both security and spatial expansion of the diagnostic system. 3. Functional Design The C/S model facilitates the design of complex, targeted, and highly reliable diagnostic and testing systems. The server runs on the on-site computer, employing multi-threading technology, primarily performing data acquisition, status monitoring, system management, and implementing data server functions to meet the requirement of simultaneously transmitting data to multiple clients. Basic functional modules include: data acquisition, status monitoring, trend analysis, system management, and network communication modules. The client software runs on computers in various functional departments and has functions such as network communication, status monitoring, and analysis and diagnosis. Basic functional modules include: data management, status monitoring, trend analysis, signal analysis, fault diagnosis, and network communication. Similarly, the client can connect to multiple servers simultaneously to achieve mesh interconnection within the enterprise, achieving a surface-based structure for fault monitoring and diagnosis. The specific functions of the server and client are shown in Figure 1. l Data Acquisition: Operates in parallel with other server functions, completing high-speed real-time acquisition of temperature, speed, vibration, and interphase data, and dynamically configuring acquisition parameters (such as sensitivity, upper and lower limits, and attenuation coefficient). See the Data Acquisition section below for details. l Status Monitoring: Performs dynamic display of real-time graphs and peak-peak graphs. Provides alarm prompts and automatic recording of alarm data. l Signal Processing: Utilizes the Matlab C/C++ mathematical function library to implement various time-domain and frequency-domain signal analyses, including: time-domain waveforms, FFT spectrum, autopower spectrum, cross-power spectrum, cepstrum, holographic spectrum, autocorrelation analysis, cross-correlation analysis, coherence function, time spectrum array, Wigner time-frequency distribution, filtered shaft center trajectory and reconstructed shaft center trajectory, rotational speed spectrum array, etc. l Trend Analysis: Employs autoregressive analysis for trend prediction. Based on historical data, it infers the development speed and trend of defects, aiming to provide an effective means for early fault identification. l Fault Diagnosis: System diagnosis is divided into automatic diagnosis and human-machine interactive diagnosis. Automatic diagnosis uses the spectral structure of vibration signals to identify faults, comparing the spectrum of the vibration signal of the object under diagnosis with the spectrum of standard fault samples, and drawing diagnostic conclusions based on the degree of similarity. Human-machine interactive diagnosis utilizes the experience of professional personnel; based on the analysis results of signal processing, fault symptoms are manually selected, and faults are identified according to optimal diagnostic rules. The diagnostic rules are derived from actual diagnostic cases and expert summaries, and are generated through reduction based on generalized rough set theory. They cover 32 common faults across three main categories: sub-asynchronous, synchronous, and hyper-asynchronous. Network Communication: The network server includes a real-time data server, a trend analysis data server, and a historical file data server. Clients can dynamically download the server file list and display it in a tree control. The entire communication system is developed in Visual C++ using a combination of multithreading and Socket programming. See the section on Network Communication and Multithreading below for details. System Management: This module includes three functions: data management, security management, and server management. Data management allows for automatic deletion of historical data and setting the number of days for normal data retention and the number of times alarm data is retained. Security management includes user permission management, password management, registration management, etc. Server management mainly implements dynamic setting of server IP address and communication port, and real-time management of server status. Based on the database size and the required system functions, the entire module uses Microsoft Access database for unified management in the backend. Since the Access database is built on the Microsoft Jet engine, the DAO technology provided by Microsoft for accessing database files in Visual C++ was chosen to achieve fast data access and retrieval. Report printing and online help: The system can automatically complete the statistical work of monitoring data in reports based on the monitoring module. Simultaneously, graphical analysis reports can be generated using the analysis results from the signal analysis module. Most of the report generation process is automated, making it convenient and intuitive. The online help system uses a unified RTF format file, compiled using the Microsoft Help Workshop tool. It implements functions such as topic search and keyword indexing. The help file includes system information, operation methods, and introductions to some basic technical principles. The entire system adopts a user-friendly interface, making operation simple, intuitive, and diverse. It integrates data acquisition technology, multi-threading technology, Socket network programming technology, database access technology, and COM technology. It is characterized by strong targeting and comprehensive functionality. The following will discuss the specific module functions and technical details of module implementation using the data acquisition, signal processing, and network communication modules as examples. 4. Technical Details (1) Data Acquisition With the rapid development of digital technology, data acquisition technology has developed towards parallelism, high speed, large-scale storage, real-time analysis and processing, and integration. At the same time, data acquisition is also the source of information element work for the entire system. Through this module, the system can perform signal analysis, trend analysis, and fault diagnosis on the acquired data, and publish it as an information carrier throughout the Intranet. The specific configuration of the sampling hardware part of the entire system is as follows: l Sensor system: Make full use of the monitoring instruments and sensor systems already equipped in the unit, such as Bently eddy current sensors, tachometers, and temperature sensors. l Sampling system: This system adopts the PCI bus E-series multi-function DAQ data acquisition board from National Instruments (NI Instruments, Inc., USA), model 6071E. It provides excellent performance with up to 64 single-ended, 32 differential analog inputs and 12-bit analog input accuracy. l Field computer: A reliable industrial control computer is used. The system connects the analog signals of rotor radial vibration, axial vibration, speed, key phase and bearing temperature measured by the sensor to the multi-channel high-speed A/D sampling card of the industrial computer on the field through the 1-5V or 4-20mA standard signal interface of the field monitoring instrument. In this process, the data collected is accurately and safely sent to the field industrial control computer through signal anti-interference, power scaling and other steps. The specific hardware layout of the acquisition system is shown in Figure 2. In the process of industrial production, the field conditions are harsh, and the vibration and temperature signals generated during the operation of the machine are affected by the surrounding environment. Therefore, the complete extraction of fault information requires a high sampling rate. Only in this way can the characteristics of machine operation be reflected in the monitoring system. At the same time, in order to achieve complete fault tracking, it is not enough to deeply extract the sampling information at a certain moment. This also requires us to conduct extensive monitoring of machine operation in the entire time domain. Therefore, real-time acquisition has become one of the decisive factors for fault information extraction. In modern acquisition technology, there are three ways to trigger A/D conversion: software trigger, timer synchronous trigger and external trigger. The data transmission methods include software query, interrupt mode, DMA mode and FIFO mode [2]. Taking Advantech PCL1800 sampling card as an example, the four data transmission rates are compared as follows: software polling (10-20kHz); interrupt mode (10-30KHz); DMA mode (200KHz); FIFO mode (330KHz). In the case of high-speed continuous data acquisition, considering the cost-effectiveness of the entire system, we use the 6071E fast discrete DMA technology to combine timer synchronous triggering with FIFO data transmission mode, so that the processor is freed from the events of the DAQ board. Practice has proven that this method will greatly improve the sampling frequency and data reliability of the system, and also improve the performance of the entire system in real-time data acquisition under the WINDOWS environment. The software design of the sampling part starts from the development efficiency and working performance of the entire system. Using the API function provided by NI: NI-DAQ Function, high-speed signal acquisition is performed in Visual C++ language, so that the highest sampling speed of the entire system reaches 1.25M/s, laying the foundation for subsequent development and analysis. (2) Signal processing system The signal processing part is completed using C++ and MATLAB, a scientific computing software launched by MathWorks. MATLAB is a powerful scientific computing software launched by MathWorks. It has high-speed computing power and a stable and secure algorithm library. It is currently used in many disciplines. Its open software system makes it possible for MATLAB to work with other tool languages. Through MEX files, programs written in C, C++ or Fortran can be called in the MATLAB environment; MAT files provide a way for MATLAB to exchange data with other applications; and MATLAB ActiveX technology realizes the client and server working mode between MATLAB and other applications. Using the started MATLAB process, MATLAB can be used as a computing engine server and called directly in other programs [3]. However, the above three methods have a common disadvantage, that is, their work cannot be separated from the MATLAB software environment, which is a fatal weakness for distributed application software. In order to overcome this disadvantage and improve the efficiency of data processing or program development, this system chose the mathematical function library interface provided by MATLAB for C/C++ language. The MATLAB mathematical function library provides a large number of efficient mathematical functions, especially in complex matrix calculation and processing. By utilizing the Matlab C/C++ mathematical function library, functions can be called from within C or C++ programs. From an overall performance perspective, this approach improves algorithm design speed, shortens program development cycles, makes development more flexible and independent, and significantly enhances program performance and stability, ensuring robust program execution. The following example, using the one-dimensional fast Fourier transform, illustrates how to call Matlab C/C++ mathematical library functions within a C++ environment. #include "matlab.h" /* * Function introduction: Uses Matlab mathematical functions to perform Fourier transform on input data and output the result. * Input parameters: double dDataIn Input data before transformation * Output parameters: double dDataOut Output data after transformation * Return value: None */ void CFuction::FFT(double dDataIn[], double dDataOut[], int iNum) { mlfEnterNewContext(0,0); // Establish memory context double *fpAbs; mxArray *mxpArray=NULL; mxArray *mxpFft=NULL; mxArray *mxpAbs=NULL; // Create array variable mlfAssign(&mxpArray,mlfDoubleMatrix(iNum,1,dDataIn,NULL)); // Construct array from input data mlfAssign(&mxpFft,mlfFft(mxpArray,NULL,NULL)); // Fourier transform calculation mlfAssign(&mxpAbs,mlfAbs(mxpFft)); // Get Fourier transform modulus fpAbs=mxGetPr(mxpAbs); // Real part of modulus for(i=0;i { dDataOut[i]=(*fpabs)/N; fpAbs++; } // end of if mlfRestorePreviousContext(0,0); // Import original memory context mxDestroyArray(mxpAbs); // Destroy array mxDestroyArray(mxpArray); // Destroy array mxDestroyArray(mxpFft); //Array destruction return; } Figure 3 shows the FFT spectrum curve, which is the characteristic curve automatically generated in the diagnostic system after the field sampled data is processed by Matlab C/C++ mathematical library functions. It can be seen that this technology provides a favorable guarantee for the stability of program operation and the correctness of results. This system, through the combination of C++ language and Matlab C/C++ mathematical library functions, implements signal processing and analysis in the signal processing component, including time-domain waveforms, FFT spectrum, autopower spectrum, cross-power spectrum, cepstrum, holographic spectrum, autocorrelation analysis, cross-correlation analysis, coherence function, time spectrum array, Wigner time-frequency distribution, filtered shaft center trajectory and reconstructed shaft center trajectory, rotational speed spectrum array, etc. (3) Network Communication and Multithreading In the Windows operating system environment, server software has three technologies to concurrently handle service requests from multiple clients: multithreading, message-driven, and loop processing. Multithreaded programming is the most straightforward. The 32-bit Windows operating system provides multitasking management, allowing the server program to create one or more task threads for each requesting client to handle multiple tasks simultaneously. Message-driven and loop processing require only one thread, saving CPU overhead from context switching between threads. They also solve the problem of handling multiple client requests simultaneously using a single task thread. In the message-driven approach, when a request arrives, the system distributes a specific message, and the server, upon receiving the message, triggers a message response program. In the loop processing approach, the program actively loops to check if the system has received the client's request. To prevent thread blocking, asynchronous I/O calls can be used to perform other processing simultaneously. However, while satisfying multitasking, both loop processing and message-driven approaches disrupt the natural logical order of program execution. Loop processing programs... To respond promptly to client requests, the code uses asynchronous data reception and transmission, dividing long transmission intervals into small time slices. Furthermore, during human-computer interaction, it constantly queries input devices such as the keyboard and mouse. This disrupts the program's natural logical order. The message-driven approach also cannot predict message arrival times, similarly failing to guarantee the program's natural logical structure and making it difficult to determine the actual execution order of the code. Considering the multi-tasking nature, high processor demands, and I/O requirements of the fault diagnosis program, this system adopts a concurrent TCP approach as the server program. First, listening threads are established for each data server. This allows a thread handling client requests to remain blocked until a complete request is received, without interfering with the processing of other server modules. Simultaneously, each thread employs a message loop mechanism to implement message-driven user request processing. Upon receiving a request, the listening thread immediately creates a connection thread to provide service to the client. The listening thread then blocks and returns to continue listening for other client requests. After completing its service, the connection thread automatically closes the connection. This completes one user request loop. In the Visual C++ environment, if message-driven support is required inside a thread, a user interface thread must be started. Here, the system has established a user interface listening thread for each of the historical data server, real-time data server, and trend analysis server. The threads are created and the interfaces of each thread are hidden at the same time, so that the server can block and listen at the same time, and the design requirement of message-driven inside the thread is achieved. The network transmission part of this system is written according to the Windows Sockets[4] specification. First, both the client and the server create a socket. Then the server calls the bind() function to allocate a public port to the socket. In this way, the client and the server can use the same port to represent the server socket. Once the client and the server establish a connection, the send() function can be used to send data and information to the server. Similarly, the server can also use the send() and recv() functions to transmit data until the communication is completed. Finally, closesocket() is called to close the socket and complete the information transmission. 5 Conclusion The development of fault monitoring and diagnosis systems involves a wide range of disciplines. This system uses an external program interface to complete the sampling and analysis modules, and incorporates multi-threading and network programming technologies in communication, thus efficiently developing a powerful distributed monitoring and diagnosis system. This system has been running in petroleum enterprises for a long time, and its performance and stability have been tested. In the future, monitoring and diagnosis system standards can be established to connect various diagnostic systems and ultimately form a unified large-scale fault monitoring and diagnosis network to guide engineering production. References 1 Shi Shengkang. Development status of vibration fault diagnosis technology for steam turbine generator sets [J]. Power Engineering, 2001, 21 (4): 1295-1298 2 Wu Daohu, Wang Xujun. Design and implementation method of high-speed continuous data acquisition with high reliability [J]. Electronic Technology Application, 2002, 6: 13-15 3 Liu Zhijian, Pan Xianfei, Lian Junxiang. Matlab External Program Interface [M]. Beijing: Science Press, 2002 4 Wang Puyang. Internet Application Programming [M]. Beijing: Tsinghua University Press, 2000.