# Development of an On-Line Defect Detection System for EDM Process
## 2 Proposed Methodology
### Feature Calculation Method  
Electric discharge machining melts the workpiece through spark discharge to achieve the purpose of material removal. In the discharge process, the process indicators of peak current, peak voltage, discharge cycle time, discharge gap, etc. change over time. The key characteristics will be calculated, which can be defined as follows:  
1. Average spark frequency (ASF)  
Spark is defined as when the electrode (positive electrode) almost touches the workpiece (negative electrode) during the machining process, when the electrode is charged and discharged, a current loop will be formed between the electrode and the workpiece, and the current will rise and continue until the end of the discharge. The process is called a spark. The spark frequency is defined as the total number of sparks \(\mathrm{N_{t}}\) generated within a period of time \(T_{\mathrm{t}}\), as shown in Equation (1):  
\[\mathrm{ASF}=\frac{\mathrm{N_{t}}}{T_{\mathrm{t}}} \tag{1}\]
2. Average peak discharge current (APDC)  
When the \(i\)-th spark is generated in the discharge process, the maximum current \(\mathrm{I_{i(max)}}\) existing is defined as the discharge peak current. The average discharge peak current when all sparks are generated is the average discharge peak current, as shown in Equation (2):  
\[\mathrm{APDC}=\frac{1}{\mathrm{N_{t}}}\sum_{i=1}^{\mathrm{N_{t}}}\mathrm{I_{i( max)}} \tag{2}\]
3. Average discharge current pulse duration (ADCPD)  
When \(\mathrm{\Delta t_{i}}\) period is from the beginning to the end of the \(i\)-th spark generation. \(\mathrm{T_{t}}\) is defined as the discharge current pulse duration. \(\mathrm{N_{t}}\) is defined as the discharge current pulse duration. The average discharge current pulse duration is the average of all spark times, as shown in Equation (3):  
\[\mathrm{ADCPD}=\frac{1}{\mathrm{N_{t}}}\sum_{i=1}^{\mathrm{N_{t}}}\mathrm{ \Delta t_{i}} \tag{3}\]  
Figure 3: Discharge machining abnormality monitoring system. Average discharge energy, ADE  
In the spark discharge process, the actual voltage and current are variable values, as well as the \(i\)-th discharge energy (E\({}_{i}\)). Formula is shown in Equation (4):  
\[\text{ADE}=\frac{1}{\text{N}_{\text{t}}}\sum_{i=1}^{\text{N}_{\text{t}}}\text{E} _{i} \tag{4}\]  
where E\({}_{i}=\int_{0}^{T_{\text{t}}}\text{I}_{\text{V}}\text{t}\text{dt}\), V\({}_{\text{t}}\) is discharge voltage and I\({}_{\text{t}}\) is the discharge current. Average ignition delay time, AIDT  
In the \(i\)-th discharge, the open circuit voltage time t\({}_{\text{d},i}\) and the effective discharge current time t\({}_{\text{e},i}\) are defined as the ignition delay time. The average ignition delay time is the average of all ignition delay times, as shown in Equation (5):  
\[\text{AIDT}=\frac{1}{\text{N}_{\text{t}}}\sum_{i=1}^{\text{N}_{\text{t}}}( \text{t}_{\text{e},i}-\text{t}_{\text{d},i}) \tag{5}\]  
Average gap voltage, AGV  
When the open circuit voltage of the \(i\)-th discharge reaches the effective discharge current, the maximum voltage V\({}_{i(\text{max})}\) generated during this period is defined as the gap voltage. The average of all open-circuit peak voltages are taken to get the average gap voltage, as shown in Equation (6):  
\[\text{AGV}=\frac{1}{\text{N}_{\text{t}}}\sum_{i=1}^{\text{N}_{\text{t}}}\text{ V}_{i(\text{max})} \tag{6}\]  
Open circuit ratio, OCR  
When the voltage peak ends, discharge is required, but the current peak does not rise and is defined as an open circuit. The open circuit ratio is the total number of open circuits O\({}_{\text{t}}\) divided by the total number of sparks N\({}_{\text{t}}\) in a period of time \(T\), as shown in Equation (7):  
\[\text{OCR}=\frac{\text{O}_{\text{t}}}{\text{N}_{\text{t}}} \tag{7}\]  
Coefficient of variation, CV  
The coefficient of variation of a set of data is defined as the value obtained by dividing the standard deviation \(\sigma\) of this set of data by the mean \(\mu\), as shown in Equation (8).