Drill State Detection (Drilling, Screwing, Idle) – Filtering & Classification Stability Issues
Hello,
I’ve been working on a project inspired by STMicroelectronics project, where the goal is to identify different operation modes of a power drill — such as drilling, screwing, and idle — using motion sensor data.
I’m using one of ST’s development kits (e.g., STEVAL-STWINKT1B) and built my classification model using NanoEdge AI Studio.
System Overview:
Data Collection:
I collected 20 signal recordings per class, each consisting of approximately 200 rows of sensor data.Sensor Preprocessing:
The raw data from the accelerometer and gyroscope is passed through multiple filters to improve signal quality:Low-pass filter
Moving average filter
Kalman filter
Decision Mechanism (Sliding Window + Majority Voting):
To improve classification stability in real-time, I implemented a sliding window with majority voting strategy:A buffer stores the last 50 predictions from the model.
If at least 40 out of 50 predictions belong to the same class, that class is accepted as the current state.
This helps prevent noisy or sporadic misclassifications from affecting the system's output.
Problems Encountered:
During screwing, the system sometimes incorrectly classifies the behavior as drilling.
Even with multiple filters, the signals of different classes (especially drilling vs screwing) are occasionally too similar.
The classification model shows good offline performance, but in real-time usage, stability is not sufficient.
Looking for Advice On:
How can I improve signal preprocessing to make similar behaviors (like screwing vs drilling) more distinguishable?
Would you recommend specific feature engineering techniques (e.g., RMS, kurtosis, peak frequency, spectral entropy)?
Is it worth exploring time-frequency domain methods like STFT, Wavelet Transform, etc., to better separate classes?
Has anyone used temporal smoothing, Hidden Markov Models, or state machines to stabilize real-time classification results?
Additional Info:
Sensors used: Accelerometer (ACC) and Gyroscope (GYRO) ISM330DH
Environment: STM32CubeIDE + NanoEdge AI Studio
Benchmark accuracy (offline): ~95%
Real-time buffer: 50 predictions, classification accepted if ≥ 40 are identical
I’d really appreciate any suggestions, examples, or experiences you might be able to share.
Thanks in advance!


