Main Content

Acquire Machine Data for Anomaly Detection and Predictive Maintenance Using Analog Input Recorder

Since R2026a

This example shows how to extract features from machine vibration signals to detect anomalies and predict maintenance requirement.

This example uses a three-axis accelerometer to measure vibrations from the machine under test. Connect the accelerometer to an NI™ mioDAQ USB 6451. The NI module reads voltage signals through analog input channels. Acquire voltage data from the analog input channels using the Analog Input Recorder app. After recording both normal and anomalous machine states, import the data into the Diagnostic Feature Designer app to extract features for diagnostics and predictive maintenance.

Acquire Data Using Analog Input Recorder

  1. Attach the accelerometer to the machine under test and connect it to the data acquisition device. Connect the device to your system. This example uses mioDAQ USB 6451 as the data acquisition device.

  2. Open the Analog Input Recorder app by entering analogInputRecorder in the MATLAB® command prompt.

    Or on the Apps tab in the MATLAB Toolstrip, navigate to the Test and Measurement section and select Analog Input Recorder Analog Input Recorder App.

  3. The app opens with a list of devices connected or configured in your system. Select the data acquisition device to which the accelerometer is connected. The app previews the analog input signal using default settings.

    Choose required signals in Analog Input Recorder app.

  4. Add channels for the three-axis accelerometer (ai0, ai1, ai2) using the Configure Channels tab.

  5. To record data at two machine states, normal and anomalous, change the Workspace Variable to NormalMachineData and AnomalyMachineData, respectively, and click Record. For more information, see Acquire Data with Analog Input Recorder.

Extract Features from Acquired Data

  1. After you record the accelerometer data, click Diagnostic Feature Designer in the Analog Input Recorder app to launch a new session with access to the recorded data.

    Select Diagnostic Feature Designer.

  2. In the New Session dialog box, set the parameters to import the recorded data as signals by completing these steps:

    1. Select Source as the workspace variable that contains the recorded data.

    2. Select Use as signal to indicate that the data sets are signals.

    3. In the Similar dataset section, choose the data sets that you plan to import.

    4. Click Import to import the selected data sets.

    Import recorded signals into Diagnostic Feature Designer app.

  3. The Diagnostic Feature Designer app opens a new session and lists the imported data in the Variables panel on the left. For more information, see Diagnostic Feature Designer (Predictive Maintenance Toolbox).

    In this example, you import three-axis accelerometer data from three analog input channels.

    Session with imported accelerometer data.

  4. To visualize the signals, select a channel variable and click Signal Trace from the Plot section in the Feature Designer tab.

    This image shows the signal trace of the accelerometer values at the first axis for the machine states of normal and anomalous.

    Plot data.

  5. To extract features from the signals, select the signal variable, and click Auto Features from the Auto section in the Feature Designer tab.

    Select Auto Features option.

  6. In the Auto Features dialog box, set the parameters based on your machine data. For more information, see Auto Features (Predictive Maintenance Toolbox).

    This example analyzes data from rotating machinery with a constant RPM of 1000.

    Set parameters for feature computation.

  7. Click Compute to extract features from the selected analog input signal and generate histograms for the top five features.

  8. Repeat Steps 4 to 7 for the data acquired from the second and third axis of the accelerometer.

    This example uses a small data set to extract features. For deeper analysis, record and import large data sets from the Analog Input Recorder app.

  9. Export the extracted features to the MATLAB workspace to build a predictive maintenance algorithm. You can also generate code to reproduce the feature extraction in a MATLAB function or Simulink block. For more information, see Export (Predictive Maintenance Toolbox).

    Export features from Diagnostic Feature Designer app.

See Also

Apps

Topics