# Wavelet-Based Analysis of Motor Current Signals for Detecting Obstacles in Train Doors
## 3 Simulation of Door Movement Obstruction
### Feature Extraction for Obstacle Detection  
Decomposing a signal into multiple levels divides it into various frequency bands. The norm is a quantification of the strength of a frequency-band signal and is derived by measuring the signal's magnitude. At higher levels of decomposition, the norm of the detail coefficients is greater (Figure 6) and is significantly different for the no-obstacle and hard-object conditions. Therefore, the norm was selected as an index for obstacle detection and further analyzed for various obstacle forces. Another index that can be used for obstacle detection is the signal peak. Whenever a motor starts or various obstacle forces are applied to it, the current signal peaks. Figure 5 reveals that obstacle forces can be easily detected in the level 9 decomposition by the db10 wavelet. The peaks for cD9 were calculated. To analyze the effect of different obstacle forces on norm and peak, forces above the sensitivity levels of 105, 120, 140, 160, and 180 N were applied in the mechanical model of a train door system. From Figure 7 it was observed that the norm and peak both increased as the obstacle force increased. Based on this observation, W9 and peak amplitudes for various forces were determined. Later, an assumption was made such that no force was regarded as no obstacle, forces ranging from 100 to 150 N as soft objects, and forces higher than 150 N as hard objects. Based on this assumption, borderline forces were applied to the simulation model and corresponding W9 and peak thresholds were derived. The numeric threshold ranges of the W9 and peak for the no-obstacle, soft-object, and hard-object conditions are presented in Figure 8. These ranges clearly map combinations of ranges of the extracted signal features to applied forces. The rules for obstacle detection and identification with these threshold values were written in a MATLAB function with two input arguments, W9 and peak, and one output argument, \(y\). The function assigned \(y\) a specific numeric value for each detection outcome. Table 2 presents the obstacle detection codes. Figure 8: W9 and peak range for different feature extractions. Figure 7: Norm and peaks at various obstacle forces. Hence, by calculating and comparing, the W9 (norm of the detailed coefficients at level 9 wavelet decomposition) and peak obstacle detection features were extracted and soft and hard objects were identified. Whenever the door close operation was initiated, the proposed algorithm followed the flowchart in Figure 9 and worked as below:  
1. Start: The system begins monitoring for obstacles when the train door operation is initiated. 2. Measure Motor Current Signal: The motor's current is measured using a current sensor, as it reflects any obstructions encountered during door movement. 3. Apply Discrete Wavelet Transform (DWT): The measured current signal is processed using DWT to analyze its time-frequency characteristics. 4. Extract Features: Key features, such as the W9 and peak values, are extracted from the transformed signal for further analysis. 5. Compare Features with Calibrated Thresholds: The extracted features are compared to predefined thresholds: 1. If the feature values fall in the soft-object range, it indicates a soft obstacle. 2. If the feature values fall in the hard-object range, it indicates a hard obstacle. 3. If the feature values are below the thresholds, it concludes that there is no obstacle. 6. Initiate Control Action: For detected obstacles, the system initiates a control action (reversing/stopping the door) within the required safety time frame. 7. End: The process concludes either with a control action or a confirmation that no obstacle is present. \begin{table}
\begin{tabular}{l l} \hline \hline
**Feature** & \(\mathbf{y}\) \\ \hline No obstacle & 10 \\ \hline Soft object detected & 20 \\ \hline Hard object detected & 30 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Feature extraction codes for obstacle detection. Figure 9: Flowchart of the proposed obstacle detection algorithm for train doors.