# Intelligent Monitoring and Compensation between EDM and ECM
## 2 Materials and Methods  
To match the composite electrical machining, the process illustrated in Figure 1 was established. The electrical signals of ECM and EDM are collected, and the electrical signals and dimensions are simulated through a machine learning model to synchronously match the two process errors. Current estimate  
To estimate the amount of material removed to bridge the two processes, the value of the initial material (before machining) is defined as \(\mathrm{x_{i}}\), the ECM process removal amount is defined as \(\mathrm{A_{ECM}}\), the volume after ECM processing is defined as \(\mathrm{x_{c}}\), the EDM process removal amount is defined as \(\mathrm{A_{EDM}}\), and the volume after EDM processing is defined as \(\mathrm{x_{c}}\). \[\mathrm{x_{i}}-\mathrm{A_{ECM}}=\mathrm{x_{c}} \tag{1}\]  
\[\mathrm{x_{c}}-\mathrm{A_{EDM}}=\mathrm{x_{d}} \tag{2}\]  
When designing an ECDM machine, [PERSON] [28] et al. defined the equation for estimating the current as Equations (3), (4) and (9), where \(\mathrm{I_{ECM}}\) is the current of the electrochemical process, \(\mathrm{I_{EDM}}\) is the current of the electrochemical process, \(\mathrm{H}\) is the width of the electrode tool, \(\mathrm{b}\) is the electrode tool length, \(\mathrm{v_{f}}\) is the spindle feed rate, \(\mathrm{A_{ECM}}\) is an ECM dissolving surface, \(\mathrm{k_{ECM}}\) is the factor for estimating the ECM dissolution rate, and \(\mathrm{k_{EDM}}\) is the spark factor of EDM. \[\mathrm{I_{ECM}}=\mathrm{A_{ECM}}\frac{\mathrm{v_{f}}}{\mathrm{k_{ECM}}} \tag{3}\]  
\[\mathrm{I_{EDM}}=(\mathrm{Hb-A_{ECM}})\frac{\mathrm{v_{f}}}{\mathrm{k_{EDM}}} \tag{4}\]  
To determine the removal amount, Equations (3) and (4) are transformed, and the electrode is regarded as a constant value in the ideal condition as \((\mathrm{Hb-A_{ECM}})=\mathrm{A_{EDM}}\). Formulas (5) and (6) are as follows:  
\[\mathrm{A_{ECM}}=\mathrm{I_{ECM}}\frac{\mathrm{k_{ECM}}}{\mathrm{v_{f}}} \tag{5}\]  
\[\mathrm{A_{EDM}}=\mathrm{I_{EDM}}\frac{\mathrm{k_{EDM}}}{\mathrm{v_{f}}} \tag{6}\]  
Figure 1: Matching process for precise composite electrical machining. Equations (1) and (2) into Equations (5) and (6) to obtain (7) and (8). It is assumed that \(\frac{\mathrm{k}_{\mathrm{EDM}}}{\mathrm{v}_{\mathrm{f}}}\) and \(\frac{\mathrm{k}_{\mathrm{EDM}}}{\mathrm{v}_{\mathrm{f}}}\) are both in the optimal control state and can be regarded as fixed values so that the removal amount is proportional to the current. \[\mathrm{x}_{\mathrm{i}}-\mathrm{I}_{\mathrm{ECM}}\frac{\mathrm{k}_{\mathrm{ EDM}}}{\mathrm{v}_{\mathrm{f}}}=\mathrm{x}_{\mathrm{c}} \tag{7}\]  
\[\mathrm{x}_{\mathrm{c}}-\mathrm{I}_{\mathrm{EDM}}\frac{\mathrm{k}_{\mathrm{ EDM}}}{\mathrm{v}_{\mathrm{f}}}=\mathrm{x}_{\mathrm{d}} \tag{8}\]  
The sum of ECM and EDM machining currents can be defined as the total current. \(I_{total}\) can be regarded as the total removal. \[\mathrm{I}_{\mathrm{total}}=\mathrm{I}_{\mathrm{ECM}}+\mathrm{I}_{\mathrm{EDM}} \tag{9}\]  
Equations (7)-(9) describe the proportional relationship between the current and the removal amount: when \(\mathrm{I}_{\mathrm{ECM}}\) increases, \(\mathrm{x}_{\mathrm{c}}\) also increases. To ensure the accuracy of the final \(\mathrm{x}_{\mathrm{d}}\), the current range of \(\mathrm{I}_{\mathrm{EDM}}\) can be adjusted according to the change of \(\mathrm{x}_{\mathrm{c}}\). Average ignition delay time (AIDT)  
The ignition delay time is defined as the time difference between the finished time of charging voltage \(t_{d,i}\) and the effective start time of discharge current \(t_{e,i}\) at the ith spark. The AIDT is the average ignition delay times of all sparks, as presented in Equation (10). \[\mathrm{x_{c}}-\mathrm{A_{EDM}}=\mathrm{x_{d}} \tag{2}\]0  
Average spark frequency (ASF)  
A spark is defined as follows: when a tool (positive electrode) is charged during processing, the tool approaches a workpiece (negative electrode), and a current loop is formed between the tool and workpiece until complete discharge.