Research on micro-EDM discharge state detection technology based on inter-electrode impedance variation characteristics

To address the difficulty in detecting the discharge state of a narrow pulse width and small duty cycle pulse, in this study, we investigate the variation characteristics of the inter-electrode impedance in the micro-EDM process and propose a detection method to distinguish different discharge states in micro-EDM based on the change in electrical signal caused by the change characteristics. The influence of the pulse width and duty cycle on the quality of micro-EDM is summarised. The results show that the workpiece surface machining quality can be considerably improved by compressing the pulse width of the pulse power supply. A micro-EDM discharge state detection system based on the variation characteristics of the inter-electrode impedance is designed, and experiments verify the detection method. The control strategy of the discharge state detection system is analysed, and a control strategy based on the forward direction and discharge state is proposed. The machining effect of the control strategy is tested through a trial-machining experiment. According to the machining control strategy, the control signal is outputted, which can realise a stable and efficient micro-EDM process.


Introduction
With the increasing demand for miniaturised components in industry, terahertz vacuum devices have been rapidly developed in recent years. In the field of terahertz communication, the precision of micro devices must be high, which necessitates improved precision and efficiency in the existing micromachining technology [1]. Currently, the main technology methods that can be used for microstructure parts machining include micro laser machining technology, micro-milling technology, micro electrochemical machining technology [2], ion beam and electron beam machining technology, and micro ultrasonic machining technology. Micro-electrical discharge machining (Micro-EDM) technology [3,4] has the advantages of no macro cutting force, non-contact, low requirements for tool strength and stiffness, wide application range of materials, and can process deep micro-holes and special-shaped cavity dies. It shows good technical potential in the field of micro-scale manufacturing and is one of the effective means to solve the problem of micro-manufacturing of difficult processing materials and micro-scale structural parts. With this unconventional processing technology, conductive and semiconductor materials can be precisely processed. Interelectrode discharge state detection technology is necessary to ensure the stability of micro-EDM. Through a preliminary investigation, with the narrowing of the pulse width, the surface quality of the EDM workpiece is observed to be higher [5]. In the field of micro-EDM, to further improve the surface quality, researchers are exploring the pulse power supply with a narrower discharge pulse width.
To realise the macro control of the gap inter-electrode in EDM, many researchers have carried out extensive research on the detection and recognition technology of the EDM discharge state. As shown in Fig. 1, the recognition of the EDM discharge state is mainly based on the detection of the discharge signal in the discharge gap, and the waveform of the discharge signal collected by the detection circuit is different under different discharge states. Traditional EDM state recognition technology includes average voltage detection technology, breakdown delay detection technology, and high-frequency signal detection technology. In recent years, many researchers have studied the intelligent recognition of the discharge state from the perspective of high-speed detection, data processing, and intelligent recognition. With regard to intelligent recognition, some researchers use neural network recognition, fuzzy logic recognition, fuzzy neural recognition, and other intelligent algorithms to detect and recognise the discharge state. However, these detection methods are not suitable for the discharge state detection of micro-EDM using a new narrow pulse width and a small duty cycle pulse power supply.
The average voltage detection technology judges the inter-electrode discharge state by comparing the average voltage with the set threshold voltage. Figure 2 shows a schematic of the common average voltage detection technology. The average voltage detection technology is widely used in the discharge state recognition of EDM and can be applied to micro-EDM. Pamidighantam et al. [6] proposed an inter-electrode pulse recognition system based on average voltage detection technology that detects peak voltage, breakdown delay, and other parameters, and it then identifies the pulse. Liu et al. [7] carried out theoretical research on the gap average voltage detection method in micro-EDM and established a numerical model of the relation between the steady value of the average voltage, circuit parameters, and pulse parameters. When using the average voltage detection technology to detect the discharge state of the new pulse, owing to the narrow pulse width and small duty cycle, capturing the discharge signal between the poles is difficult, and the accuracy is low.
Bhattacharyya et al. [8] from the Birmingham University studied the high-frequency signal detection technology. The principle of this technology is to use a high-frequency signal on the gap voltage to distinguish arc discharge from spark discharge. Detection technology based on high-frequency audio signals has a complex circuit and poor stability. When using a narrow pulse width and a small duty cycle pulse for micro-EDM, the detection circuit can be easily disturbed. Therefore, high-frequency and audio signal detection technology is difficult to be suitable for the identification of narrow pulse widths and small duty cycle pulses.
Other techniques to distinguish spark discharge from arc discharge in EDM include the breakdown delay detection technology [9]. Snoeys et al. [10] studied the breakdown delay detection technology. The theoretical source of this method is that the breakdown delay time of the arc discharge is different from that of the spark discharge in EDM [11]. When using the new narrow pulse width and small duty cycle pulse power supply for EDM, owing to the narrow pulse width, the breakdown delay in the spark discharge state is short, thereby making it difficult to capture the breakdown delay signal. Identifying the spark discharge state using this method is difficult.
Geng et al. [12] researched the gap average pulse width voltage detection technology. The basic idea of the technology is to abandon the pulse interval voltage waveform, only detect the voltage value at the pulse width, and obtain the average voltage detection signal through the filter circuit. When the average pulse width detection technology is used to detect the discharge state of the new pulse, the sampling synchronisation requirements are very high, and realising a sampling switch with an ultra-narrow pulse width is very  difficult. If the sampling switch synchronisation is not accurate, the wrong pulse width voltage information will be collected, which will affect the detection accuracy. Jiang et al. [13,14] used wavelet transform to detect and identify the inter-electrode discharge state in micro-EDM small-hole machining. This method distinguishes singlepulse discharge based on the low-frequency coefficient of the wavelet transform. Using wavelet transform to analyse the data collected in the micro-EDM process, it is known that compared with a single detection technology, the wavelet transform can obtain more comprehensive information. However, for narrow pulse width and small duty cycle pulses, the detection system based on this method has difficulty capturing a single-pulse discharge signal in a short period of time.
The principle of fuzzy logic identification of the micro-EDM discharge state is to use a fuzzy identifier to deal with the voltage and gap current of the input signal. Subsequently, the corresponding rules are established according to the expert experience and knowledge, and the fuzzy reasoning method is used to identify the pulse type. Tarng et al. [15,16] developed a fuzzy recognition system for the micro-EDM gap state. The input to the fuzzy recognition system is the gap current and voltage. At the same time, a simulated annealing algorithm is applied to the fuzzy recognition system of the discharge state, and the membership function structure was optimised to realise the recognition of the gap discharge state.
Through a comprehensive analysis of the research results, it was determined that when using a narrow pulse width and small duty cycle pulse power supply for micro-EDM, the discharge state is complex, and the discharge state detection and identification circuit is greatly disturbed; at the same time, due, owing to the narrower pulse width, it is difficult for the detection circuit to capture the discharge process of a single pulse. Gap average voltage detection technology is the most commonly used method. Although this method has the advantages of simple principles and universal applications, the method of threshold setting is relatively single. In actual processing, the parameters of the pulse power supply need to be changed, so its adaptability needs to be improved. Currently, the main problems are as follows: for the new type of narrow pulse width and small duty cycle pulse, realising the detection and recognition of the discharge state owing to the narrow pulse width and small duty cycle is difficult; therefore, exploring new detection methods for the discharge state is necessary. In this paper, a new method is proposed to detect the discharge state of micro-EDM with a narrow pulse width and a small duty cycle. A discharge state detection system based on inter-electrode impedance variation characteristics was designed. The threshold setting of the detection system does not change with the change in the parameters of the pulse power supply but is only related to the inherent parameters of the components of the detection circuit, so it has better adaptability. A control strategy based on the current and discharge states was proposed. It provides a new idea and technical feasibility scheme for the field of micro-EDM discharge state detection and lays a foundation for realising the discharge state detection of a narrow pulse width and small duty cycle pulse power supply.

Principle and simulation analysis of discharge state detection based on inter-electrode impedance variation characteristics
As an inherent characteristic of an electrical system, the impedance does not change with the change in the input signal, and its change can reflect the change in the electrical system. The discharge state of EDM can be divided into open circuit, normal discharge, transitional arc discharge, stable arc discharge, and short circuit [17]. As identifying the state of arc discharge and transition arc discharge is difficult, these two states are ignored in this study; only three discharge states are detected and identified, namely open

Equivalent model of inter-electrode impedance
The pulse discharge process can be divided into three stages: ionisation preparation, discharge thermal etching, and deionisation. In the ionisation preparation stage, no discharge channel is formed because there is no breakdown of the electrode under the current voltage, the electric field strength inter-electrode increases, but no current is formed, and the capacitor between the positive and negative electrodes is in the charging process. When the electric field intensity of the electrode increases to a sufficiently large level, the dielectric inter-electrode breaks down and forms a discharge channel, which is the stage of discharge heat etching, and considerable plasma is produced. Under the influence of an electric field, the charged particles in the dielectric violently collide with the dielectric, and the plasma is hindered in the process of high-speed motion between the electrodes, resulting in an impedance inter-electrode. In the stage of discharge thermal etching, charged ions form conductive channels, and there is a current inter-electrode, proving that there is a magnetic field between the positive and negative electrodes, so the inductance also exists in the channel. In the deionisation stage, the inter-electrode plasma channel disappears, and the inter-electrode plasma channel returns to the state before discharge. The analysis of the pulse discharge process above shows that the capacitor state exists independently before the formation of the discharge channel, so the capacitor should be independent. When the discharge channel is formed, the inductance and resistance characteristics are caused by the behaviour of the inter-electrode plasma discharge channel, so the equivalent resistance and inductance between the electrodes are connected in series [18,19], as shown in Fig. 3. The equivalent model of the inter-electrode impedance, as shown in the figure, is obtained, including the typical resistance, inductance, capacitance, and other principle devices. The impedance at a certain time between the positive and negative poles P + and P − can be expressed by Eq. (1).
(1) Output the signal used to control the numerical control system

Analysis of variation characteristics of inter-electrode impedance
Electrical impedance is a crucial characteristic of an electrical system. For an electrical system, the impedance Z is usually the ratio of voltage V and current I in the frequency domain. In the time-domain impedance calculation, the voltage and current in the actual representation are converted into the corresponding complex representation, and the converted signal is called the analysis signal. Subsequently, the impedance can be calculated by dividing the analytical voltage by the analytical current. The impedance can be expressed by the real and imaginary parts of the complex number. The real part represents the resistance, and the imaginary part represents the capacitance and inductance.
Combined with the fast Fourier transform, the impedance at a given frequency is obtained. To obtain the impedance in the time domain and study its changing trend with time, the measured voltage and current are converted into corresponding analysis signals using the Hilbert transform, and then the impedance is calculated. Finally, Eq. (3) was obtained to evaluate the electrical impedance.
Equation (3) shows that under different states of micro-EDM, the value of the inter-electrode impedance is different. The inter-electrode impedance in the open circuit is greater than that in the spark discharge, and the inter-electrode impedance in the spark discharge is greater than that in the short circuit. It can be concluded that before the dielectric breakdown between the electrodes, the impedance between the electrodes is high, and when a discharge channel is formed inter-electrode [20], they are in a medium impedance state, and when the inter-electrode gap is zero, the inter-electrode impedance is low. In the process of machining, the formation and disappearance of the inter-electrode plasma channel will affect the voltage amplitude between the positive and negative poles, characterising the change in the inter-electrode impedance.

Principle of discharge state detection based on inter-electrode impedance variation characteristics
Based on the characteristics of the inter-electrode impedance analysed above, a new detection circuit was designed, as shown in Fig. 4. Its principle is to set an independent constant-voltage power supply DC in the detection circuit as the detection reference source. In the open-circuit state, the current cannot flow through diode D2 owing to the large impedance, and the resistances R1 and R2 form a loop with the power supply DC; when the inter-electrode gap is zero, that is, after the short circuit between the positive and negative electrodes, the inter-electrode impedance is close to zero, and the voltage Us will decrease. At this time, diode D2 and resistance R3 are also connected to the detection circuit; in the spark discharge state, the dielectric is broken down, and the inter-electrode impedance changes. The impedance value is greater than that in the short-circuit state but smaller than    SVL short-circuit voltage threshold RXBUFFER [3] SIH_H open-circuit voltage threshold high byte RXBUFFER [4] SIH_L open-circuit voltage threshold low byte RXBUFFER [5] SIL_H circuit voltage threshold high byte RXBUFFER [6] SIL_L circuit voltage threshold low byte RXBUFFER [7] ax duty cycle RXBUFFER [8] Imax_h Max short circuit current high byte RXBUFFER [9] Imax_l Max short circuit current low byte that in the open-circuit state. The magnitude of the voltage in the detection circuit varied with the impedance value or the inter-electrode discharge state. Therefore, the discharge state between electrodes in micro-EDM can be obtained by measuring its amplitude.
In the open-circuit state, the value of Us is U open: In the state of spark discharge, the value of Us is U spark: In the short circuit state, the value of Us is U short: According to the characteristics of impedance change between electrodes, the state change of the micro-EDM process can be effectively identified by means of an external power supply, providing the basis for the control strategy for the micro-EDM process.

Simulation analysis of discharge state detection circuit
According to the change characteristics of the inter-electrode impedance and the principle of the detection circuit mentioned above, the simulation circuit shown in Fig. 5 was constructed to simulate the circuit model. A schematic of the simulation model of the inter-electrode state-switching module is shown in Fig. 6. A voltage-controlled switch is used to realise the change and switching of the inter-electrode impedance state. By setting the model, the effective rate of the inter-electrode spark was 40%, and the periodic pulse waveform of the spark discharge, open circuit, and short circuit can be obtained. As the detection object, the effectiveness of the impedance detection method can be determined by circuit simulation.
Using the simulation circuit model of discharge state detection designed in the previous part, a simulation experiment is carried out for the detection effect of the pulse power supply under different duty cycle conditions. In the actual simulation process, the cycle of the pulse power supply was 10 µs. We then obtain the detection waveform for pulse widths of 500 ns, 100 ns, 50 ns, 10 ns, and 1 µs, as shown in Fig. 7.
It can be seen from the oscilloscope detection waveform that for different pulse power duty cycles, the detection circuit based on impedance variation characteristics can achieve a good detection effect, and the voltage can be distinguished obviously under different states of open circuit, spark discharge, and short circuit.

Design of micro-EDM discharge state detection system
Based on the above analysis of detection principle, the circuit design and the design of each part of the function module were carried out, and a discharge state detection system was constructed to realise the complete detection and control function of the system.

Overall design of detection system
The overall functions of the detection system include the inter-electrode voltage signal acquisition function, detection system, pulse control board communication function, and control signal output function. The overall hardware scheme of the detection system is illustrated in Fig. 8. STM32F103 was selected as the core chip for the detection system. A total of 232 units realise the communication function between the detection system and the pulse control board and obtain the power control parameters related to the pulse control board. The state signal inter-electrode    In progress (V > = 0) 3-Slow down 4-Slow acceleration Falling back (V < 0) 5-Speed up Short circuit In progress (V > 0) 6-Slow down Falling back (V < 0) 7-Maximum value of return speed is transformed into a voltage signal after being processed by the impedance detection circuit, and it then enters the ADS8681 data acquisition chip after the isolated operational amplifier. The main control chip STM32 communicates with the ads8681 data acquisition chip and obtains voltage data through the SPI bus. The modular design is carried out according to the hardware system scheme, and the main function modules are shown in Fig. 9.

Module design of detection system
(1) System power module The positive and negative 12-V voltage is provided by the external interface, and the voltage parameters used in the detection system are 12 V, 5 V, and 3.3 V, among others, so it is necessary to design a power conversion module of 12 to 5 V, 5 to 3.3 V, and 5 to 12 V.
To realise the voltage conversion from 12 to 5 V, an LM2596 [21] switching voltage regulator is selected, an AMS-1117 low-voltage linear regulator is used to realise the voltage conversion from 5 to 3.3 V, and a WRA0512SDC/DC module power supply is used to realise the voltage conversion from 5 to 12 V.
(2) Serial communication module To realise the communication between the detection system and the pulse control board, the detection system can obtain the inter-electrode pulse parameters and other information, including perception or processing, whether the inter-electrode chip removal environment is good, and the need to design serial communication between the detection system and the pulse control board. This study uses a TD301D232H single-channel high-speed RS232 isolated transceiver module. The function of serial communication is to realise communication between the detection system and the pulse control board. The pulse control board sends pulse parameters such as the duty cycle to the detection system, and the detection system sends the threshold information to the pulse control board. With this module, the TTL level can be converted to the RS232 level to realise signal isolation and the RS232 protocol network connection function. The circuit principle is shown in Fig. 10.
The protocol of serial communication is shown in Table 1, with 0XFF as the start flag, and the consecutive 9 bytes after the start flag contain the data of communication between the detection system and the pulse control board. When the detection board sends the serial port receiving interrupt, it judges whether it is the start flag and carries out data receiving pro- cessing. After receiving a group of data, it sends the received data to the pulse control board for data verification. When the pulse control board sends the 0X01 confirmation character to the detection system, the flag data transmission is correct. At this time, the detection system stores the received data. (

3) Data acquisition module
In the data acquisition module, ADS8681 was used as the acquisition chip in this system. The inter-electrode signal processing path is shown In Fig. 11. The interelectrode voltage signal X1 was filtered by the impedance detection circuit. The processed signal X2 is isolated by the isolated operational amplifier after passing through the resistance-capacitance low-pass filter. Signal X4 is used as the input signal of the ADS8681 chip by the operational amplifier; STM32's SPI is used to communicate with ADS8681, which is used to obtain the voltage data collected by the data acquisition chip.
(4) DAC output module A TF6550GN high-precision signal conditioning module was used to realise the control signal output. A schematic of the DAC output circuit designed in this study is shown in Fig. 12.

Program design and control strategy analysis
The software system design of the detection system based on hardware design is shown in Fig. 13. The main function, 232 interrupt function and timer interrupt function, handle different tasks. The system software is based on the Keil μVision5 development system completed by the C language, including the main program and subroutine. A flowchart of the main program is shown in Fig. 14. A flowchart of the state judgement program in the micro-EDM process is shown in Fig. 15. The STM32 SPI bus was used to read the data acquisition results and accumulate the results. After reaching the set number, the average value was calculated, and the inter-electrode discharge state was obtained by comparing the average value with the threshold value. According to the scheme in the control strategy table, different control strategies are selected according to the state and feed direction of the axis of the CNC system, and the control signal is output to control the feed of the axis of the CNC system.
To realise high-efficiency and high-quality machining of micro-EDM, different control strategies are proposed based on the feed direction of the CNC system axis in different states of the micro-EDM process. As shown in Table 2, when the shaft is open in the feeding process, slowly accelerating the feeding is necessary until discharge occurs, and when the shaft is in the discharge state during the forward process, fast deceleration or slow acceleration can be adopted. The former is adopted because the etching speed is slow to prevent short circuits, and the latter is adopted to improve machining efficiency; in the case of a short circuit in advance, slow down quickly until the short circuit disappears; when the shaft is open circuit during retraction, the fast acceleration retraction mode is adopted until the shaft stops; if discharge occurs during fallback, there will be a false short circuit caused Fig. 18 Data acquisition results. a Acquisition results when the setting voltage is 1 V. b Acquisition results when the setting voltage is 2 V Fig. 19 Serial port test result chart by electric corrosion products in the discharge gap, and the control of the shaft will lag. Take fast acceleration fallback to stop the shaft; in case of short circuit during fallback, the fallback can be accelerated until the maximum fallback speed is reached, waiting for the state to change.

Experimental scheme and test platform
The test environment was built as shown in Fig. 16 to carry out the test experiment of the discharge state detection system, select the function signal generator as the signal source, PI power amplifier to amplify the signal source, and use the amplified pulse as the pulse source. The workpiece and electrode were connected to the discharge circuit, and the input signal was obtained by collecting the voltage signal between the electrodes through the discharge state detection system. The discharge state detection system judges the state of the input signal and outputs the control signal to the feed shaft to control the tool electrode forward or backward. As shown in Fig. 17, the discharge state detection system designed herein integrates the gap average voltage detection method and detection methods based on the inter-electrode impedance variation characteristics. First, the functional modules of the detection system are tested, including data acquisition module test and serial communication test. To ensure the safety of the electrode, the corresponding delay time of different positions of the detection system was tested. We test and verify the control strategy mentioned above; when different states appear between poles, check whether

Modular test of detection system
(1) Data acquisition module tests Using the handheld signal generator as the sampling object, the communication between ADS8681 and the chip is realised by the SPI bus. The data are read into the main control chip and then sent by serial communication, and the specific value of the data is checked by the serial debugging assistant. As shown in Fig. 18a, when the output voltage of the handheld signal generator is 1 V, the value collected by the detection board is 0X151E = 5046. ADS8681 in the software was configured to select an internal reference of 4.096 V, and the input range was 0-12.288 V. The calculated value of sampling is (0X151E) / (65,536) × 4.096 × 3 = 1.014, which is close to the actual value of 1 V, and the deviation is 1.4%. As shown in Fig. 18b, when the output voltage of the handheld signal generator was 2 V, the value collected by the detection system was 0X29C7 = 10,695. The calculated value of sampling is (0X29C7) / (65,536) × 4.096 × 3 = 2.005, which is close to the actual value of 2 V, and the deviation is 0.5%.
(2) Test of serial communication module The serial port debugging assistant is used to communicate with the detection system for the protocol test. The protocol starts with a 0 XFF frame and sends nine data points continuously. When the detection system receives one data point, it returns the current data value to the serial debugging assistant. When the detection system receives 10 data points, it returns the complete 10 data points to the serial debugging assistant. The content of the test data is as follows: starting from 0XFF, sending data from 01 to 09. After receiving the data, the detection system checked the data. If the check is successful, the data are returned. Figure 19 shows the test result diagram of the serial communication module.

Test of output control strategy of test board
After the detection system identifies the inter-electrode state through data acquisition and processing, the strategy adopted is not only related to the current discharge state and processing environment but also to the CNC feed direction at this time. The feed direction under different   Impedance  change  detection   1  1  10  50  20  20  2  2  10  50  36  40  3  3  10  50  52  46  4  4  10  50  68  66  5  5  10  50  84  88 discharge states was distinguished, and different control strategies were adopted. As shown in Fig. 20, it is a typical waveform of the control signal output in the case of a continuous short circuit. When the inter-electrode changes from open circuit to continuous short circuit, the change process of control signal output waveform can be divided into the following 7 stages: (1) The inter-electrode is open circuit, and the DAC output has reached the upper limit, so it is output according to the upper limit value.  Then, the fast acceleration is restored to make the electrode move forward.
When there are multiple short circuits and continuous open circuits, the detection system dynamically adjusts the upper limit value of the control signal according to the corresponding discharge state, as shown in Fig. 21, which shows the inter-electrode DAC output waveform under different states. As shown in Fig. 21a, when there are multiple short circuits, the upper limit value of the speed continuously decreases. When the short-circuit inter-electrode begins, the DAC decreases rapidly. However, owing to the multiple short circuit inter-electrode, the upper limit value of the speed was adjusted. When there is an open circuit, the DAC maintains the adjusted upper limit value output. As shown  Fig. 21b, when the inter-electrode is in a continuous open circuit, if the upper limit of speed has not been adjusted to the maximum value, the detection system will dynamically adjust the upper limit of speed; thus, when the interelectrode is in a continuous open circuit, the DAC output waveform presents the shape of the ladder rise.

Detection effect under different pulse power parameters
(1) Amplitude of pulse power supply The signal generator and PI power amplifier were used as the pulse source to test the detection board. Different voltages were set to test the threshold setting of the resistance partial voltage detection method and impedance detection method. A schematic of the test circuit is shown in Fig. 22. The oscillography was used to collect waveform images of different positions. Channel 1 is the collected inter-electrode voltage, channel 2 is the DAC output, and channel 3 is the waveform after the resistance partial voltage detection filter module or impedance change detection filter module.
The function signal generator and PI power amplifier are used as pulse power supplies to test the gap average voltage detection method and detection method based on the inter-electrode impedance variation characteristics. The peak-to-peak parameters of the signal source were set as shown in Table 3. Under this condition, the gap average voltage detection method and detection method are based on inter-electrode impedance variation characteristics to set the threshold. The threshold settings are listed in Table 4. When the peak-to-peak value of the signal source is 5 V, the processing state is judged after the threshold is set, and the waveform when the continuous short circuit occurs is shown in Fig. 23. From top to bottom, the collected inter-electrode voltage, waveform after the detection and filtering module, and DAC output waveform are shown.
(2) Duty cycle of pulse power supply Different duty cycles of the pulse power supply are set, and the influence of different duty ratios on the threshold setting of the detection method based on the inter-electrode impedance change characteristics is analysed. The experimental data are presented in Table 5. The duty cycle ranged

Experimental verification of trial machining based on Inspection Board
A detection system based on inter-electrode impedance variation characteristics was applied to a micromodular electrical machining machine tool to test the feasibility of the system for measuring and controlling the discharge process. As shown in Fig. 25, after the discharge pulse is applied to the positive and negative poles, the velocity displacement curve appears when the positive and negative poles are quickly short-circuited by wires. In the open circuit, the maximum speed is maintained under the upper speed threshold. When there is a short circuit or spark discharge, the speed is adjusted dynamically over time.
The detection system is based on the variation characteristics of the inter-electrode impedance for drilling trial processing. The voltage signal information in the processing process was collected by the oscilloscope, and the waveform shown in Fig. 26 was obtained. From top to bottom, the collected inter-electrode voltage, the waveform after the detection and filtering module, and the DAC output waveform are obtained.
As shown in Fig. 27, for the velocity displacement curve of the machining process, as the electrode does not rotate during the machining process, the electrode retreats many times, and the velocity changes and fluctuates considerably.

Conclusions
To address the problem that the adjustment of pulse parameters will affect the accuracy of threshold setting when the existing detection technology is applied to the state detection and recognition of a narrow pulse width and small duty cycle pulse electrical discharge machining process, this study analysed the change characteristics of inter-electrode impedance in micro-EDM process and propose a detection method to distinguish different discharge states in micro-EDM based on the change in electrical signal caused by the change characteristics. In the research process of this method, the equivalent model of inter-electrode impedance in micro-EDM was established, the theoretical calculation formula of inter-electrode impedance was proposed combined with theoretical analysis, the variation characteristics of inter-electrode impedance was studied, and the relationship between inter-electrode impedance and discharge state was explored. A discharge state detection system based on the variation characteristics of inter-electrode impedance was designed. A control strategy based on the forward direction and discharge state was proposed. It provides a new idea and technical feasibility scheme for the field of micro-EDM discharge state detection and lays a foundation for the discharge state detection of narrow pulse width and small duty cycle pulse power supply. The main research work and conclusions are as follows: (1) The characteristics of inter-electrode impedance of micro-EDM are analysed. The influence of the pulse width and duty cycle on the quality of micro-EDM is summarised. From the mechanism of micro-EDM, the equivalent model of inter-electrode impedance was analysed, and the inter-electrode equivalent model composed of variable resistance, variable capacitance, and variable inductance was established. (2) The discharge state detection system was designed.
This study proposed the overall design scheme, carried out the peripheral circuit design with STM32F103 core, and completed the design of each functional module according to the overall design scheme. The overall design of the program, divided into functional modules, completed the realisation of the main function and peripheral driver, analysed the control strategy of the discharge state detection system, and proposed the control strategy based on the current electrode feed direction and discharge state. (3) The test of the discharge state detection system was carried out, and each functional module of the detection system works normally through the modular test. Through the output control strategy test, the control strategy based on the given direction and discharge state of the spindle was realised. The threshold setting of the gap average voltage detection method will change with the change of voltage amplitude, while the detection method based on the inter-electrode impedance variation characteristics is almost unaffected. The machining effect of the control strategy was tested through the trial machining experiment. According to the machining control strategy, the control signal is outputted, which can realise the stable and efficient micro-EDM process.
Author contribution Rui Chen is responsible for the concept, experiment, and paper draft; Yongbin Zhang is responsible for funding acquisition and supervision; Bo Hu is responsible for some experiments and compiling flow charts; Guangmin Liu is responsible for supervision; and Yue Dai and Jie Shen are responsible for assisting the experiment. Data availability Data and materials used in this research are available.

Declarations
Ethical approval The manuscript in part or in full has not been submitted or published anywhere, and the manuscript will not be submitted elsewhere until the editorial process is completed.