Dynamic Observer Modeling and Minimum-Variance Self-Tuning Control of EDM Interelectrode Gap

The electric discharge machining (EDM) interelectrode gap directly determines the discharge state, which affects the machining efficiency, workpiece surface quality, and the tool wear rate. The measurement of the real-time varying interelectrode gap during machining is extremely difficult, and so obtaining an accurate mathematical model of the dynamic interelectrode gap will make EDM gap control possible. Based on p-type single-crystal silicon EDM, a flat-plate capacitance model is introduced to analyze the time-domain characteristics of the inter-electrode voltage in the breakdown delay phase. Further, we theoretically established a physical model of the interelectrode spacing d and the charging time constant τ of the plate capacitor. The least-squares fitting of the experimental data was used to determine the model coefficients, and in combination with the actual machining process, a minimum-variance self-tuning controller was designed to control the interelectrode gap in real time. The experimental verification results show that the established physical model can correctly predict the interelectrode gap in the actual machining process. The minimum-variance self-tuning controller improves machining stability, and eliminates the occurrence of the short-circuit state.


Introduction
Single-crystal Si is a difficult-to-machine material with high brittleness and high hardness [1,2].Electric discharge machining (EDM) [3][4][5] technology for high-efficiency, the high-quality processing of single-crystal Si has become a research topic of great interest [6][7][8][9].EDM is a typical nonlinear multi-parameter time-varying system [10].Mechanical parameters and power parameters affect the system discharge stability and discharge state, determine the workpiece removal efficiency, surface quality, and electrode loss.According to different gaps between the electrode and the workpiece, the EDM discharge state can be divided into five types: The no-load state, normal spark discharge state, transitional arc state, stable arc state, and short-circuit state [4,11].Each discharge state corresponds to different voltage and current waveforms.Therefore, EDM equipment should have a perfect interelectrode gap detection and control system.The discharge mechanism of EDM is very complex and is often affected by many factors, such as adhesion, cavitation, and short-circuit phenomena [12,13], that make it difficult to detect and control the gap between electrodes.K.P. Rajurkar proposed to identify the EDM discharge state by comparing the detected gap voltage with the preset voltage [14].
In Reference [15], the discharge state was distinguished by monitoring the interelectrode characteristic voltage value and the known voltage threshold.According to D.F. Dauw and Y.S. Wong et al., although the gap voltage threshold comparison method is simple, the determination of the voltage threshold In order to analyze the EDM interelectrode voltage characteristics, self-designed EDM test equipment was adopted.The overall composition of the equipment is shown in Figure 1.The test equipment was mainly composed of three parts: Constant voltage pulse power supply, mechanical device, and optoelectronic distance measuring instrument.The three parts were independent of each other without any interference or coupling.The pulse power supply was a JZ-GD-10 (Taizhou Jiangzhou CNC Machine Tool Manufacturing Co., Ltd., Taizhou, Jiangsu, China) type constant voltage pulse power supply.Its pulse voltage adjustment range was 90-110 V, pulse width adjustment range was 4-100 µs, and pulse duty cycle range was 3-12.The mechanical device consisted of a marble base and vertical column, X-Y horizontal direction worktables and Z-direction worktables, precision ball screws, drive motors and couplings, etc.The worktable traveled in all three directions for 200 mm, and the feed resolution in the Z direction of the table was 0.1 µm.The photoelectric distance meter (Xi'an Technological University, Xi'an, Shaanxi, China) was composed of a precision grating sensor (Keyence, Osaka, Japan) mounted on the Z-direction workbench and an inductance micrometer(Xi'an Technological University, Xi'an, Shaanxi, China).The grating sensor was used to read the displacement value and the inductance micrometer was used to determine the zero reference point of the Z-axis table displacement.The insulating working fluid medium was a special oil for the electric spark.The signal acquisition device was a Tektronix DPO 2014B (TEKTRONIX, Solon, OH, USA) quad-channel digital phosphor oscilloscope.

Pulse Power Supply
Figure 1.Electric discharge machining (EDM) test equipment.

EDM Equivalent Circuit
According to the EDM interelectrode structure characteristics, the EDM can be considered equivalent to the plate capacitance discharge model shown in Figure 2, and the pulse power source is a constant voltage source.In Figure 2, Sw is a pulse power switch, RP is the power internal resistance, RE is the equivalent resistance of the electrode, RW is the equivalent resistance of the workpiece, Cg is the capacitance value of the interelectrode capacitance, S is the effective area of the planar capacitance (the positive opposite area of the electrode and the workpiece), and d is the interelectrode gap.For the EDM discharge test, the interelectrode voltage and current waveforms are shown in Figure 3.Under the action of the constant voltage pulse power supply, the discharge current can be formed after the interelectrode dielectric is broken down.When the interelectrode dielectric is not broken down, there is no discharge current in the discharge circuit, as shown in Figure 3a.Enlarge the red rectangle region in Figure 3a to get the Figure 3b graph.

EDM Equivalent Circuit
According to the EDM interelectrode structure characteristics, the EDM can be considered equivalent to the plate capacitance discharge model shown in Figure 2, and the pulse power source is a constant voltage source.In Figure 2, S w is a pulse power switch, R P is the power internal resistance, R E is the equivalent resistance of the electrode, R W is the equivalent resistance of the workpiece, C g is the capacitance value of the interelectrode capacitance, S is the effective area of the planar capacitance (the positive opposite area of the electrode and the workpiece), and d is the interelectrode gap.

EDM Equivalent Circuit
According to the EDM interelectrode structure characteristics, the EDM can be considered equivalent to the plate capacitance discharge model shown in Figure 2, and the pulse power source is a constant voltage source.In Figure 2, Sw is a pulse power switch, RP is the power internal resistance, RE is the equivalent resistance of the electrode, RW is the equivalent resistance of the workpiece, Cg is the capacitance value of the interelectrode capacitance, S is the effective area of the planar capacitance (the positive opposite area of the electrode and the workpiece), and d is the interelectrode gap.For the EDM discharge test, the interelectrode voltage and current waveforms are shown in Figure 3.Under the action of the constant voltage pulse power supply, the discharge current can be formed after the interelectrode dielectric is broken down.When the interelectrode dielectric is not broken down, there is no discharge current in the discharge circuit, as shown in Figure 3a.Enlarge the red rectangle region in Figure 3a to get the Figure 3b graph.For the EDM discharge test, the interelectrode voltage and current waveforms are shown in Figure 3.Under the action of the constant voltage pulse power supply, the discharge current can be formed after the interelectrode dielectric is broken down.When the interelectrode dielectric is not broken down, there is no discharge current in the discharge circuit, as shown in Figure 3a.Enlarge the red rectangle region in Figure 3a to get Figure 3b.

EDM Interelectrode Gap Modeling
Based on the EDM interelectrode structure feature (the electrode surface is parallel to the workpiece surface) combined with the interelectrode voltage signal, the EDM breakdown delay stage (regions A) can be used as the plate capacitor.Therefore, the interelectrode dynamic voltage (the voltage of the plate capacitor Cg) can be expressed as where U is the pulse supply voltage and τ is the time constant of the first-order RC loop, which can be expressed as where Rt is the total resistance of the circuit before discharge and Cg is the capacitance value of the interelectrode plate capacitance before discharge.According to Figure 2, Rt and Cg can be expressed as Combining Equations ( 2) and ( 4), the interelectrode gap d can be expressed as where ε is the dielectric constant of the insulating working fluid medium before discharge, S is the effective area of the plate capacitance, and k is the electrostatic force constant.Then, Combining Equations ( 5) and ( 6), the expression for the EDM interelectrode gap d can be obtained:

EDM Interelectrode Gap Modeling
Based on the EDM interelectrode structure feature (the electrode surface is parallel to the workpiece surface) combined with the interelectrode voltage signal, the EDM breakdown delay stage (regions A) can be used as the plate capacitor.Therefore, the interelectrode dynamic voltage (the voltage of the plate capacitor C g ) can be expressed as where U is the pulse supply voltage and τ is the time constant of the first-order RC loop, which can be expressed as where R t is the total resistance of the circuit before discharge and C g is the capacitance value of the interelectrode plate capacitance before discharge.According to Figure 2, R t and C g can be expressed as Combining Equations ( 2) and (4), the interelectrode gap d can be expressed as where ε is the dielectric constant of the insulating working fluid medium before discharge, S is the effective area of the plate capacitance, and k is the electrostatic force constant.Then, Combining Equations ( 5) and ( 6), the expression for the EDM interelectrode gap d can be obtained:

Determination of β
Figure 4 is obtained by amplifying the voltage signal of region A in Figure 3.According to the characteristics of the voltage signal across the flat-plate capacitor of the RC circuit, when t = τ, u c (t) = 0.63 U. When the interelectrode gap d changes, the capacitance C g of the panel capacitor also changes accordingly, resulting in a change of the time constant τ.Therefore, in the single-pulse discharge test of EDM, it was only necessary to detect the time t during which the voltage across the plate capacitor rose from 0 to 0.63 U in order to determine the constant τ.The rod copper electrode was used in the experiment and the electrode diameter was 10 mm.The workpiece material was p-type single-crystal Si, and the parameters are shown in Table 1.The no-load voltage of the pulse power supply was U = 100 V, and the pulse width and pulse interval of the power supply were 100 μs and 400 μs, respectively.Considering the randomness in EDM, each set of tests was conducted three times, and the test data is shown in Table 2. ⎯ is the average value of β in three trials.The rod copper electrode was used in the experiment and the electrode diameter was 10 mm.The workpiece material was p-type single-crystal Si, and the parameters are shown in Table 1.The no-load voltage of the pulse power supply was U = 100 V, and the pulse width and pulse interval of the power supply were 100 µs and 400 µs, respectively.Considering the randomness in EDM, each set of tests was conducted three times, and the test data is shown in Table 2. β is the average value of β in three trials.
A least-squares fit was performed on the experimental data in Table 2, and the fitting curve is shown in Figure 5.The R 2 of the least-squares fit between β and the interelectrode gap d was 0.9977.The closer the value is to 1, the higher the correlation between the fitted value and the experimental value.The correction coefficient (Adj R 2 ) was 0.9971, which means that 0.29% of the test data cannot be explained by this fitting expression.The root-mean-square error (RMSE) was 0.4453, which indicates a high degree of fitting.The least-squares fitting expression between β and the interelectrode gap d is as follows: According to Equations ( 7) and ( 8), the model expression of the EDM interelectrode gap d can be obtained as d = −50.4τA least-squares fit was performed on the experimental data in Table 2, and the fitting curve is shown in Figure 5.The R 2 of the least-squares fit between ⎯ and the interelectrode gap d was 0.9977.The closer the value is to 1, the higher the correlation between the fitted value and the experimental value.The correction coefficient (Adj R 2 ) was 0.9971, which means that 0.29% of the test data cannot be explained by this fitting expression.The root-mean-square error (RMSE) was 0.4453, which indicates a high degree of fitting.The least-squares fitting expression between ⎯ and the interelectrode gap d is as follows: According to Equations ( 7) and ( 8), the model expression of the EDM interelectrode gap d can be obtained as

Analysis of β
It can be learned from Equation ( 6) that β should be a constant, but the dielectric properties of the insulating working fluid in which electrodes were immersed changed during the discharge process, resulting in β not being constant in the test.Because the insulating working fluid media had good dielectric properties under the initial test conditions, in the single-pulse discharge test, the metal particles, carbon particles, and colloidal particles generated during the discharge process were diffused into the insulating medium.Since these materials have certain electrical conductivity that is equivalent to a piece of iron plate inserted into the insulating medium of the plate capacitor, and this effect is equivalent to the interelectrode gap decrease of the plate capacitor, the capacitance value Cg of the plate capacitor therefore increases.From Formula (2), we can see that the time constant τ will increase, and so the product β of the interelectrode gap d and the time constant τ will increase.
However, with the auxiliary effect of interelectrode flushing, the metal particles, carbon particles, and colloidal particles in the interelectrode insulating medium will reach saturation at a certain concentration, and as the discharge continues, β will not change substantially.

Verification of EDM Interelectrode Gap Model
The established model was verified by using an EDM single-pulse discharge test.The voltage of the pulsed power supply was 100 V, the pulse width was 100 μs, and the interval pulse was 400 μs.All of these parameters were kept constant.The interelectrode gap ranged from 10 to 80 μm, increasing by 10 μm each time.The time constant τ was introduced into the EDM interelectrode gap model by Equation ( 9), from which the interelectrode gap d can be calculated.Each group was conducted 30 times.According to error theory, the 3σ -test method was used to analyze the test data.σ is the standard deviation, which is expressed below as

Analysis of β
It can be learned from Equation ( 6) that β should be a constant, but the dielectric properties of the insulating working fluid in which electrodes were immersed changed during the discharge process, resulting in β not being constant in the test.Because the insulating working fluid media had good dielectric properties under the initial test conditions, in the single-pulse discharge test, the metal particles, carbon particles, and colloidal particles generated during the discharge process were diffused into the insulating medium.Since these materials have certain electrical conductivity that is equivalent to a piece of iron plate inserted into the insulating medium of the plate capacitor, and this effect is equivalent to the interelectrode gap decrease of the plate capacitor, the capacitance value C g of the plate capacitor therefore increases.From Formula (2), we can see that the time constant τ will increase, and so the product β of the interelectrode gap d and the time constant τ will increase.However, with the auxiliary effect of interelectrode flushing, the metal particles, carbon particles, and colloidal particles in the interelectrode insulating medium will reach saturation at a certain concentration, and as the discharge continues, β will not change substantially.

Verification of EDM Interelectrode Gap Model
The established model was verified by using an EDM single-pulse discharge test.The voltage of the pulsed power supply was 100 V, the pulse width was 100 µs, and the interval pulse was 400 µs.All of these parameters were kept constant.The interelectrode gap ranged from 10 to 80 µm, increasing by 10 µm each time.The time constant τ was introduced into the EDM interelectrode gap model by Equation ( 9), from which the interelectrode gap d can be calculated.Each group was conducted 30 times.According to error theory, the 3σ-test method was used to analyze the test data.σ is the standard deviation, which is expressed below as where, when n ≥ 25 for a certain observation data x i , its residual v i is satisfied as below: The observation data x i is the gross error, where x is the mean of observation data x i : Table 3 shows the actual gap value as well as the minimum, maximum, and average values of the model-calculated gap of the 30 sets of tests.The values of the maximum absolute error δ max under each gap are also given.Using a rectangular coordinate system, the horizontal axis is the gap d calculated by the model and the vertical axis is the actual gap.The minimum, maximum, and average values of the gap calculated by the model are plotted in Figure 6.It can be seen from the figure that the minimum, maximum, and average gap values calculated by the model are within ±3σ, where σ is the minimum value 0.9165 in Table 3.Therefore, there is no gross error in the gap d calculated by the model.When the actual gap is 80 µm, the maximum absolute error δ max between the calculated gap and the actual gap is only 2.31 µm, which indicates that the established interelectrode gap model is correct and reliable.As the actual gap increases, the absolute error between the calculated gap and the actual gap of the model also increases.This is because the fitting error between β and the interelectrode gap d increases as the interelectrode gap increases.It can be seen in Figure 5 that the degree of dispersion of several fitting curves reaches the maximum at 80 µm.

Order Identification Based on EDM System
In the actual process, due to the real-time erosion of the workpiece and electrode, the interelectrode gap d changes dynamically.By detecting the time constant τ in real time, the interelectrode gap d can be calculated by using the interelectrode gap model established by the previous section.In this study, the motion position of the electrode was used as the control input and the interelectrode gap d as the output.By continuously adjusting the electrode position, the interelectrode gap d can be precisely controlled.Combined with the characteristics of the EDM system, system identification theory [26] was used to establish a single-input, single-output (SISO) model.On the basis of input and output data, the order of the model was identified.
The determinant ratio method directly identified the order of the model by adopting the input and output data.First of all, the data matrix n ( ) H was constructed.Then, the determinant ratio of the matrix was used to construct the expression DR n * ( ) .When n is a positive integer starting from one, if DR n ( ) has a significant increase relative to ˆ-1 DR n * ( ) , then n is considered to be closer to the true order, i.e., the order 0 = n n of the model can be taken.
The model of single-input, single-output process is described as: is the input variable of the process.In the identification process, The estimated value of the model order is n , using the existing input and output data to construct the following matrix n H :

Order Identification Based on EDM System
In the actual process, due to the real-time erosion of the workpiece and electrode, the interelectrode gap d changes dynamically.By detecting the time constant τ in real time, the interelectrode gap d can be calculated by using the interelectrode gap model established by the previous section.In this study, the motion position of the electrode was used as the control input and the interelectrode gap d as the output.By continuously adjusting the electrode position, the interelectrode gap d can be precisely controlled.Combined with the characteristics of the EDM system, system identification theory [26] was used to establish a single-input, single-output (SISO) model.On the basis of input and output data, the order of the model was identified.
The determinant ratio method directly identified the order of the model by adopting the input and output data.First of all, the data matrix H( n) was constructed.Then, the determinant ratio of the matrix was used to construct the expression DR * ( n).When n is a positive integer starting from one, if DR( n) has a significant increase relative to DR * ( n − 1), then n is considered to be closer to the true order, i.e., the order n 0 = n of the model can be taken.
The model of single-input, single-output process is described as: where u(k) is the input variable of the process.In the identification process, u(k) represents the moving position of the electrode.y(k) is the output variable of the process and the interelectrode gap d. ξ(k) is the uncorrelated random noise with the mean value of zero and the variance σ 2 v .A(z −1 ) and B(z −1 ) are the delay operator polynomials: Appl.Sci.2018, 8, 1443 The estimated value of the model order is n, using the existing input and output data to construct the following matrix H n: where L is the data length.
In order to improve the accuracy of order discrimination as much as possible and to reduce the influence of error factors, the following determinant ratio was constructed to determine the order of the model: where When n is a positive integer starting from one and if DR * ( n) is significantly increased compared to DR * ( n − 1), then n can be considered as close to the real order of the model, i.e., the order of the model can be taken as n 0 = n.
The M sequence is a binary pseudorandom code sequence the autocorrelation function of which is close to the pulse function.However, the M sequences contain DC components, which can cause "net disturbances" to the identified objects.The spectral density of the inverted M sequence is similar to that of the M sequence, which is twice as large as that of the M sequence and has no direct current component.Therefore, in this study, the order of the EDM system was identified using the inverse M sequence that can fully stimulate various modes of the system.Combined with the characteristics of the EDM system and in view of the continuous erosion of the workpiece and the electrode in the actual processing, the amplitude of the reverse M sequence was set to 0 and 10 µm after repeated trials.The input signal of the inverse M sequence in the identification process is shown in Figure 7.The data length L of the inverse M sequence was 100.Zero means that the electrode remains in the original place and 10 µm means that the electrode moves 10 µm toward the workpiece.The experiment was repeated three times, and DR( n) can be calculated by using the determinant ratio method.The results are shown in Figure 8.It can be seen from the figure that when n changes from 1 to 2, DR(2) has a significant increase compared with DR(1), so the order of the EDM system model is where L is the data length.
In order to improve the accuracy of order discrimination as much as possible and to reduce the influence of error factors, the following determinant ratio was constructed to determine the order of the model: where ) When n is a positive integer starting from one and if DR n * ( ) is significantly increased compared to ˆ-1 DR n * ( ) , then n can be considered as close to the real order of the model, i.e., the order of the model can be taken as 0 = n n.
The M sequence is a binary pseudorandom code sequence the autocorrelation function of which is close to the pulse function.However, the M sequences contain DC components, which can cause "net disturbances" to the identified objects.The spectral density of the inverted M sequence is similar to that of the M sequence, which is twice as large as that of the M sequence and has no direct current component.Therefore, in this study, the order of the EDM system was identified using the inverse M sequence that can fully stimulate various modes of the system.Combined with the characteristics of the EDM system and in view of the continuous erosion of the workpiece and the electrode in the actual processing, the amplitude of the reverse M sequence was set to 0 and 10 μm after repeated trials.The input signal of the inverse M sequence in the identification process is shown in Figure 7.The data length L of the inverse M sequence was 100.Zero means that the electrode remains in the original place and 10 μm means that the electrode moves 10 μm toward the workpiece.The experiment was repeated three times, and DR n ( ) can be calculated by using the determinant ratio method.The results are shown in Figure 8.It can be seen from the figure that when n changes from 1 to 2, (2) DR has a significant increase compared with (1) DR , so the order of the EDM system model is 0 = 2 n n= .

Parameter Estimation
After the model order of the EDM system was determined, the parameters of the model needed to be estimated.The least-squares recursive algorithm is used to estimate the parameters in actual projects.With the increase of data collection, in order to prevent "data saturation", this paper used the forgetting factor recursive least-squares method to estimate the parameters of the system.Since EDM is a two-order system, for the SISO system model described in Equation ( 13), the least-squares expression is ( 2) ( ) where a1, a2, b0, and b1 are model parameters, ( ) u k is the moving position of the electrode, and ( ) y k is the interelectrode gap d.Equation ( 18) can be written as The parameter estimation formula for the forgetting factor recursive least-squares method can be derived by using the performance indicators shown in Equation ( 21): where λ (0 < λ ≤ 1) is the forgetting factor and P is the covariance matrix.

Controller Design
Adaptive control can make the system work automatically in the optimal or near-optimal operating state and obtain high-quality control performance under the condition that the model knowledge or environmental knowledge of the controlled object is incomplete or little known.The minimum-variance self-tuning controller adapts a recursive least-squares method to estimate the system parameters and uses the variance of the output error of the system as a performance index

Parameter Estimation
After the model order of the EDM system was determined, the parameters of the model needed to be estimated.The least-squares recursive algorithm is used to estimate the parameters in actual projects.With the increase of data collection, in order to prevent "data saturation", this paper used the forgetting factor recursive least-squares method to estimate the parameters of the system.Since EDM is a two-order system, for the SISO system model described in Equation ( 13), the least-squares expression is y where a 1 , a 2 , b 0 , and b 1 are model parameters, u(k) is the moving position of the electrode, and y(k) is the interelectrode gap d.Equation ( 18) can be written as where The parameter estimation formula for the forgetting factor recursive least-squares method can be derived by using the performance indicators shown in Equation ( 21): where λ (0 < λ ≤ 1) is the forgetting factor and P is the covariance matrix.

Controller Design
Adaptive control can make the system work automatically in the optimal or near-optimal operating state and obtain high-quality control performance under the condition that the model knowledge or environmental knowledge of the controlled object is incomplete or little known.The minimum-variance self-tuning controller adapts a recursive least-squares method to estimate the system parameters and uses the variance of the output error of the system as a performance index function by minimizing the performance index to calculate the control law.Finally, according to the calculated control law, the parameters are adjusted to realize the process control.Consider the following system: where u(k) and y(k) represent the moving position of the electrode and interelectrode gap, respectively.C(z -1 ) is a Hurwitz polynomial, ξ(k) is white noise with variance σ 2 , d = 1 is the number of pure delays, and The interelectrode gap at iteration k + d is based on the electrode position and gap measurement at iteration k and the previous iteration.This predicted gap at iteration k + d is denoted as ŷ(k + d|k) , and the prediction error is The interelectrode gap prediction error variance is The minimum d-step optimal prediction output with y * (k + d|k) in the above performance index Formula (25) needs to satisfy the equation below: where and Equation ( 26) is called the optimal output prediction equation, and Equation ( 27) is called the Diophantine equation.
Therefore, the minimum-variance control law is From Equation ( 29), the control law is where y r are the reference gaps, y are the measurement gaps, and the control variable at the current moment is calculated by the above formula and acts on the system, which completes the control of current time.Therefore, the minimum-variance self-correcting control is realized by such reciprocal execution.

Test Verification
The EDM equipment shown in Figure 1 was modified to meet the control requirements for the interelectrode gap in the machining.The improved EDM control system is shown in Figure 9.The no-load voltage of the pulse power supply was 100 V, the pulse width was 100 µs, the pulse interval was 400 µs, and the workpiece was p-type monocrystalline silicon.Since the no-load voltage between the electrodes was 100 V, the signal adjusting module was developed for linear transformations of the interelectrode output voltage.The output voltage range of the signal adjusting module was 0-10 V. Since the interelectrode gap model d was calculated based on the time constant τ when the voltage rose to 0.63 U, the sampling frequency of the data acquisition card was relatively high.The high-speed data acquisition card PXle-5172 from NI (National instruments, Austin, TX, USA) was used for high-speed acquisition of the voltage signal and data acquisition.The bandwidth of the data acquisition card was 100 MHz, the sampling frequency was 250 MS/s, and the input voltage range was −40 to 40 V.The PXle-7342 motion controller of NI (National instruments, Austin, TX, USA) was used to control the motor movement, and the pulse output rate of the motion controller was up to 4 MHz.The motor was a Yaskawa SGM7J-04AFC6S servo motor (National instruments, Austin, TX, USA) used in the position control mode.Through the calibration test, the positioning accuracy of the EDM system could reach 1 µm.The position of the electrode was adjusted every 0.1 s during the test.

Test Verification
The EDM equipment shown in Figure 1 was modified to meet the control requirements for the interelectrode gap in the machining.The improved EDM control system is shown in Figure 9.The no-load voltage of the pulse power supply was 100 V, the pulse width was 100 μs, the pulse interval was 400 μs, and the workpiece was p-type monocrystalline silicon.Since the no-load voltage between the electrodes was 100 V, the signal adjusting module was developed for linear transformations of the interelectrode output voltage.The output voltage range of the signal adjusting module was 0-10 V. Since the interelectrode gap model d was calculated based on the time constant τ when the voltage rose to 0.63 U, the sampling frequency of the data acquisition card was relatively high.The high-speed data acquisition card PXle-5172 from NI (National instruments, Austin, TX, USA) was used for high-speed acquisition of the voltage signal and data acquisition.The bandwidth of the data acquisition card was 100 MHz, the sampling frequency was 250 MS/s, and the input voltage range was −40 to 40 V.The PXle-7342 motion controller (National instruments, Austin, TX, USA) of NI was used to control the motor movement, and the pulse output rate of the motion controller was up to 4 MHz.The motor was a Yaskawa SGM7J-04AFC6S (National instruments, Austin, TX, USA) servo motor used in the position control mode.Through the calibration test, the positioning accuracy of the EDM system could reach 1 μm.The position of the electrode was adjusted every 0.1 s during the test.

Stability Tracking Verification
In order to verify the stability of the minimum-variance self-tuning controller, the p-type single-crystal silicon processing experiment was carried out by using the minimum-variance self-tuning control on the improved EDM control system.During the test, the motor was in position control mode and the electrode movement speed was 2 cm/s.In actual processing, in order to prevent short-circuit phenomena, after repeated tests, the absolute distance of the electrode positive feed does not exceed 40 μm.Since the detection range of the interelectrode gap model established in the first section was 10-80 μm, the output range of the control system was limited to 10-80 μm.The tracking input signal was separately a straight line, a square wave, a sine wave, and the output was a time constant τ .Equation ( 9) was used to further convert τ into the interelectrode gap d.Figures 10-12 show the tracking effect of the input signal and parameter identification effects.

Stability Tracking Verification
In order to verify the stability of the minimum-variance self-tuning controller, the p-type single-crystal silicon processing experiment was carried out by using the minimum-variance self-tuning control on the improved EDM control system.During the test, the motor was in position control mode and the electrode movement speed was 2 cm/s.In actual processing, in order to prevent short-circuit phenomena, after repeated tests, the absolute distance of the electrode positive feed does not exceed 40 µm.Since the detection range of the interelectrode gap model established in the first section was 10-80 µm, the output range of the control system was limited to 10-80 µm.The tracking input signal was separately a straight line, a square wave, a sine wave, and the output was a time constant τ.Equation ( 9) was used to further convert τ into the interelectrode gap d.Figures 10-12 show the tracking effect of the input signal and parameter identification effects.From the tracking effect in the actual machining process, it can be seen that the system had a certain adjustment time of 2 s in the initial stage of processing.Then, the interelectrode distance d could stably track the different interelectrode gap expected value dr.The right side of the tracking diagram is a local enlarged view.It can be seen from the red area in the local enlarged view that if the interelectrode gap d increases and the electrode is retracted, while d decreases, the electrode is fed to the workpiece.Therefore, the variation of the interelectrode gap is consistent with the actual advance and retreat of the electrode.It can be seen from the figure that the estimated values of parameters a and b are stable.The verification results show that the controller performs well and the parameters identified on-line are stable.

Comparison and Verification of Process Targets under Different Gap Conditions
EDM uses the high-temperature plasma generated by the discharge to remove the workpiece.The plasma energy is mainly determined by the interelectrode voltage and the loop current, while the material removal rate and the surface roughness in EDM are influenced by the interelectrode voltage and loop current.The literature [27] has studied the effect of the interelectrode gap on the interelectrode voltage and loop current.Therefore, it is of great significance to study the effect of the interelectrode gap on the material removal rate and surface roughness of EDM.A single-crystal silicon processing experiment was conducted by using the minimum-variance self-tuning control, and the interelectrode gap desired value was 60, 50, and 40 μm.The test processing time at the three desired gaps was 100 s.The tracking effect of the three different desired gaps is shown in Figure 13.From the tracking effect in the actual machining process, it can be seen that the system had a certain adjustment time of 2 s in the stage of processing.Then, the interelectrode distance d could stably track the different interelectrode gap expected value d r .The right side of the tracking diagram is a local enlarged It can seen from red area in the local enlarged view that if the interelectrode gap d increases and the electrode is retracted, while d decreases, the electrode is fed to the workpiece.Therefore, the variation of the interelectrode gap is consistent with the actual advance and retreat of the electrode.It can be seen from the figure that the estimated values of parameters a and b are stable.The verification results show that the controller performs well and the parameters identified on-line are stable.

Comparison and Verification of Process Targets under Different Gap Conditions
EDM uses the high-temperature plasma generated by the discharge to remove the workpiece.The plasma energy is mainly determined by the interelectrode voltage and the loop current, while the material removal rate and the surface roughness in EDM are influenced by the interelectrode voltage and loop current.The literature [27] has studied the effect of the interelectrode gap on the interelectrode voltage and loop current.Therefore, it is of great significance to study the effect of the interelectrode gap on the material removal rate and surface roughness of EDM.A single-crystal silicon processing experiment was conducted by using the minimum-variance self-tuning control, and the interelectrode gap desired value was 60, 50, and 40 µm.The test processing time at the three desired gaps was 100 s.The tracking effect of the three different desired gaps is shown in Figure 13.After the test was completed, the mass of single-crystal silicon before and after machining was measured by the JD500-3 precision electronic balance (Shenyang Longteng Electronics Co., Ltd, Shenyang, Liaoning, China) to calculate the material removal rate.The balance's maximum measurement mass is 500 g, with an accuracy of 0.001 g.The surface morphology and roughness of the processed single-crystal silicon was measured by the Leica DCM 3D white light interferometer (Leica, Solms, Hessen, Germany).The three-dimensional surface and two-dimensional shape of the workpiece surface are shown in Figures 14-16.The measurement results of material removal rate and surface roughness are shown in Table 4.After the test was completed, the mass of single-crystal silicon before and after machining was measured by the JD500-3 precision electronic balance (Shenyang Longteng Electronics Co., Ltd, Shenyang, Liaoning, China) to calculate the material removal rate.The balance's maximum measurement mass is 500 g, with an accuracy of 0.001 g.The surface morphology and roughness of the processed single-crystal silicon was measured by the Leica DCM 3D white light interferometer (Leica, Solms, Hessen, Germany).The three-dimensional surface and two-dimensional shape of the workpiece surface are shown in Figures 14-16.The measurement results of material removal rate and surface roughness are shown in Table 4.After the test was completed, the mass of single-crystal silicon before and after machining was measured by the JD500-3 precision electronic balance (Shenyang Longteng Electronics Co., Ltd, Shenyang, Liaoning, China) to calculate the material removal rate.The balance's maximum measurement mass is 500 g, with an accuracy of 0.001 g.The surface morphology and roughness of the processed single-crystal silicon was measured by the Leica DCM 3D white light interferometer (Leica, Solms, Hessen, Germany).The three-dimensional surface and two-dimensional shape of the workpiece surface are shown in Figures 14-16.The measurement results of material removal rate and surface roughness are shown in Table 4.In the EDM system, the plasma channel diameter and pit size formed by a single-pulse discharge are determined by the current and the effective discharge time [28,29], and the higher the current and longer the effective discharge time, the larger the plasma channel diameter and the crater.In continuous pulse machining, the higher the current and the longer the effective discharge time, the greater the material removal rate and surface roughness.The quantitative relationship between the plasma channel diameter and the interelectrode gap is given in Reference [27], and the larger the interelectrode gap, the smaller the loop current.Therefore, when the interelectrode gap increases, the loop current decreases, which leads to a reduction of the material removal rate and surface roughness.From Table 4, it can be seen that the material removal rate and surface roughness decrease with the increase of the interelectrode gap.The above analysis fully proves the rationality of the test results.

Conclusions
(1) Based on the EDM interelectrode structure characteristics, combined with the characteristics of the interelectrode voltage signal, a flat-plate capacitance model was introduced to quantitatively describe the mathematical relationship of the interelectrode gap d and the plate capacitor charging time constant τ .The reason for the increase of the proportional coefficient β of d and τ was analyzed and the model was verified by the 3σ -test method.The results show that the established  In the EDM system, the plasma channel diameter and pit size formed by a single-pulse discharge are determined by the current and the effective discharge time [28,29], and the higher the current and longer the effective discharge time, the larger the plasma channel diameter and the crater.In continuous pulse machining, the higher the current and the longer the effective discharge time, the greater the material removal rate and surface roughness.The quantitative relationship between the plasma channel diameter and the interelectrode gap is given in Reference [27], and the larger the interelectrode gap, the smaller the loop current.Therefore, when the interelectrode gap increases, the loop current decreases, which leads to a reduction of the material removal rate and surface roughness.From Table 4, it can be seen that the material removal rate and surface roughness decrease with the increase of the interelectrode gap.The above analysis fully proves the rationality of the test results.

Conclusions
(1) Based on the EDM interelectrode structure characteristics, combined with the characteristics of the interelectrode voltage signal, a flat-plate capacitance model was introduced to quantitatively describe the mathematical relationship of the interelectrode gap d and the plate capacitor charging time constant τ.The reason for the increase of the proportional coefficient β of d and τ was analyzed and the model was verified by the 3σ-test method.The results show that the established EDM interelectrode gap model can correctly reflect the true value of the interelectrode gap.When the actual gap is 80 µm, the absolute error maximum value δ max of the calculated gap and the actual gap is only 2.31 µm, The EDM interelectrode gap model established in this study is universal.When the model is applied to metal or alloy materials with good conductivity, only the equivalent resistance R W of the single-crystal silicon needs to be removed from Equation (3).β can be redetermined by a single-pulse discharge test, and the EDM interelectrode gap model suitable for common metals and alloy materials can be further deduced.
(2) Using the system identification method to obtain the transfer function of the electrode position and the interelectrode gap, the order and parameters of the model were determined by the determinant ratio method and the forgetting factor recursive least-squares algorithm.A minimum-variance self-tuning controller was designed to realize the adaptive control of the electrode position.The interelectrode gap can be steadily tracked by adjusting the electrode position in real time, which provides a theoretical basis and practical reference for precise control of the interelectrode gap.
(3) The experimental verification results show that the minimum-variance self-tuning controller can effectively track various reference trajectories (straight lines, square waves, etc.).The minimum-variance self-correcting control was adopted to avoid the short-circuit phenomenon caused by the excessive feed rate of the electrodes.The smaller the interelectrode gap, the larger the discharge current, and the higher the machining efficiency, but the surface roughness will also increase.

Figure 4
Figure 4 is obtained by amplifying the voltage signal of region A in Figure 3.According to the characteristics of the voltage signal across the flat-plate capacitor of the RC circuit, when t = τ , uc(t)

Figure 6 .
Figure 6.Distribution relationship between actual gap and model-calculated gap.
position of the electrode.
is the output variable of the process and the interelectrode gap d.) (k ξ is the uncorrelated random noise with the mean value of zero and the variance 2 v σ .
are the delay operator polynomials:

Figure 6 .
Figure 6.Distribution relationship between actual gap and model-calculated gap.

Pulse Power Supply Electrode Workpiece Range Finder Oscilloscope Servo Motor Figure
Appl.Sci.2018, 8, x FOR PEER REVIEW 3 of 18 1.Electric discharge machining (EDM) test equipment.
When the interelectrode gap d changes, the capacitance Cg of the panel capacitor also changes accordingly, resulting in a change of the time constant τ .Therefore, in the single-pulse discharge test of EDM, it was only necessary to detect the time t during which the voltage across the plate capacitor rose from 0 to 0.63 U in order to determine the constant τ .

Table 1 .
Parameters of p-type monocrystalline silicon.

Table 1 .
Parameters of p-type monocrystalline silicon.

Table 3 .
Actual gap and model-calculated gap.

Table 4 .
Material removal rate and surface roughness data.

Table 4 .
Material removal rate and surface roughness data.