Demonstrator: Drift detection on a motor bearing setup on a PLC (icw Beckhoff)
This demonstrator shows how to implement drift detection on a motor bearing setup driven by a Beckhoff PLC.
The setup
The hardware for this demonstrator was provided by Beckhoff. It consists of a motor, connected to a bearing and driven by a PLC. The bearing can be switched between four different bearing types. The first one is a normal, working bearing which is called the "ideal bearing". Second, we have the "misaligned bearing" where the axis between the bearing and the motor forms an angle. Third, there is the "faulty bearing", which is a broken version of the ideal bearing, and lastly, the "weighted bearing", which is a non-uniform weight that can be added to the ideal bearing to create imbalance in the bearing setup. A magnetic vibration sensor is mounted on the setup which measures the vibrations of the setup when the motor is running. This sensor is also connected to the PLC, which calculates the FFT of the sensor readings. Using this setup, it is possible to create a machine learning model that can predict which type of bearing is connected to the motor. However, this model is trained on data from a specific speed. This means that the machine learning model can accuractly predict the bearing type at that speed, but fails to do so for other speeds. This variation in speed introduces data drift, which causes model degradation, known as concept drift. This means that the data has changed in such a way that the concept learned by the model is no longer valid. The goal of this demo is to detect this data drift.

Figure 1: The full motor bearing setup.

Figure 2: The different types of faults in the bearing: A) The axis misalignment. B) imbalanced weight. C) faulty bearing.
The autoencoder
To detect this drift, we apply a commonly used technique. For this we use a type of machine learning model called the autoencoder. The autoencoder is a type of neural network whose main goal is to reconstruct its input data. It consists of two main parts. The first part is the encoder, which creates a smaller representation, called an embedding, of the input data. The second part is the decoder, which attempts to reconstruct the input data from this smaller representation. This means that when an autoencoder is trained on a certain dataset, it can accurately reconstruct data from that distribution. However, when the data distribution changes, for example the speed of the motor changes, the model will fail to reconstruct the data. This means that the difference between the input and output of the autoencoder, also called the reconstruction loss, serves as a metric for detecting drift. Using a threshold we can determine whether drift is present. If the reconstruction loss is below the threshold, no drift is detected. Otherwise, drift is present.

Figure 3: Drift detection with autoencoder. The top graphs show the reconstruction of data with the same distribution, the bottom graphs show reconstruction of data with a drifted distribution.
The result
On the setup we trained an autoencoder that can reconstruct the FFT of the vibration data at 10 rev/s. When the motor rotates at a higher speed, the autoencoder can no longer recreate its input, and drift is detected.
Slides and poster
This demonstrator was presented during the interim meeting 1:
