Smart Arbitrary Waveform Generator with Digital Feedback Control for High-Voltage Electrochemistry

This paper describes a design approach to a control system of power supply for highvoltage electrochemical processes such as plasma electrolytic oxidation (PEO) or high-voltage anodising (HVA), which require alternating polarisation pulses up to 750 V and a typical current density of 50–500 mA/cm2. Complex characteristics of the electrochemical system response on applied polarisations (positive or negative) cause necessity of precise control of polarising pulse shapes for better process operation and its understanding. A device performs cycle-by-cycle pulsewidth modulation (PWM) control, including feedback based on digital analysis of the instantaneous current and/or voltage output, and the desired pulse waveform stored in memory for each output polarity. The output stage has four states corresponding to positive or negative pulses, as well as openor short-circuit conditions, with respect to an electrochemical cell. A fully programmable controller allows one to generate arbitrary waveforms, as well as their sequences, by means of “regime designer” software. Moreover, a smart feedback system can provide adaptation of the next pulse parameter from analysis of the process prehistory. For instance, this approach allows one to separate main electrochemical process (coating formation) and diagnosis of the phenomenon through introduction of high-voltage triangular voltage sweep pulse within a pause of the main process, which is normally carried out under a current control.

However, in spite of all the positive features mentioned above, PEO is still a rather exotic technology provided by a few companies with necessity of a deep "research and development" procedure for each particular part or component to be coated with PEO.This happens because of a lack of PEO process understanding.This is likely the most important limiting factor for widespread PEO use in industry, rather than "energy consumption" mentioned by many researchers [22][23][24][25][26][27].Typical energy consumption in PEO is between 0.05 and 15 kWh per square decimetre [28]; thus, readers can easily evaluate energy cost in any given region.However, a reduction in energy consumption is important in view of global energy saving and a reduction of harmful substance emissions.
The second important reason for restricted PEO application is a lack of suitable equipment, i.e., power supplies which match the requirements of PEO in the best way.This generates a "vicious circle"; on the one hand, without understanding, we are unable to design a suitable power supply, and, on the other hand, without a suitable power supply, we are unable to figure out the mechanism of the PEO process.Moreover, quite specific process requirements (hundreds of volts and tens of amps per square dm) strictly limit the list of available devices which are at least somehow suitable for PEO.As a result, the current approach, when experimental design is adopted to available equipment, dominates.This is likely a reason for stagnation in the commercialisation of PEO.
The devices working synchronously with mains frequency (circuitries based on thyristors [29], capacitors [30], or transformers [31,32]) were intentionally excluded from consideration, since they are unable to provide flexible output control, although they are suitable for some particular applications.All power supplies suitable for bipolar PEO can be divided into two main groups, operating under voltage or current control.Under voltage control, two independent direct current (DC) power sources are connected to the load through the output inverter that alternates load between the power sources [33][34][35][36][37][38].Current control requires special approaches based on a special slope controller [39], inductive current sources [40], or current feedback [41,42].
Both voltage and current control modes allow one to extract additional information from current-voltage interrelation in respect of light emission [22,[43][44][45], response of the system to a single step, analysis of relaxation [46][47][48][49][50][51], diagnosis of the electrochemical system by average values of short pulse series [52], etc.All these diagnostic approaches operate with rectangular pulses or pulses with sharp edges; therefore, it is extremely difficult to extract real current-voltage characteristics caused by the processes conjugated with coating formation, rather than recharging of internal or parasitic capacitance.In order to exclude (or minimise) capacitive response, a linear voltage sweep voltammetry can be applied.In such a case, the capacitive nature of the load will cause constant bias in current response, which linearly depends on the sweep rate, and it can be easily eliminated if necessary.
The aim of this work was to demonstrate a new approach, whereby a device was designed especially for studying the PEO process mechanism.Mixed polarisation conditions, including both current and voltage control mode, were applied where necessary.The design process included analysis of the typical PEO load behaviour, a description of the pulse shaping procedure and software, and experimental examination of the prototype.

Load Analysis
It is known that valve metals being immersed in a suitable electrolyte possess unipolar properties, i.e., current can easily pass when the metal is negative, but is suppressed when the metal is positive.Many years ago, this found practical application as an "aluminium rectifier" [53].Currently, the blocking property of the positively charged valve metal electrodes is widely used in electrolytic capacitors [54].From this, the metal-oxide-electrolyte junction can be considered as a special diode, which is open when the substrate metal is negative and closed under reverse polarisation.The main difference between this PEO diode and well-known electronic diodes (solid state or vacuum tube) consists of the presence of electrochemical reactions and corresponding mass transfer within the oxide layer accompanying coating growth.
Thus, the load for power supply in the PEO process is an electrochemical cell, which necessarily consists of a metallic working electrode (WE), covered with an oxide layer (OX) that is immersed in electrolyte solution (ES), which in turn is in contact with the counter electrode (CE) (see Figure 1a).Both electrodes are typically made of metals and, thus, possess electronic conductivity.The oxide layer, depending on composition, structure, and morphology, may possess both ionic and/or electronic conductivity with a wide range of activation energies.The electrolyte solution is, normally, a pure ionic conductor (although sometimes molten salts can be used as well) [55].In such a circuit composed of materials with various types of conductivity, the transfer of charges and masses includes overcoming potential barriers at interphase contacts, as well as migration and diffusion within bulk phases.
The ratio between average negative and positive current densities (R = Jn/Jp) is usually used as a generalised characteristic of the alternating current regimes.For instance, DC mode is characterised by R = 0, symmetrical alternating current (AC) mode is characterised by R = 1.0, an excess of positive current is characterised by R < 1, an excess of negative current is characterised by R > 1, etc.In addition, anodic and cathodic voltages represent peak values for the corresponding positive and negative pulse envelope.The importance of the peak voltages results from the fact that achievable electrical energy of the system is characterised by maximal applied potential difference, rather than by its average or effective (rms) values.
The growth of the coating is accompanied by transformations of the material and its morphology, thereby affecting the transport conditions that are usually observed as a variation of cell voltage under current control mode (Figure 1b).From the figure, it can be seen that in an arcing regime (R = 0 for Al alloys), both anodic voltage and coating thickness grow monotonically until ultimate conditions are reached; after that, the coating is affected by large arcs, which reduce the coating quality or destroy it.Under soft sparking conditions (R > 1 for Al), there is a "critical point" in the process, after which coating growth is accompanied by a decrease in anodic voltage.The latter is probably counterintuitive, since breakdown voltage is expected to increase with coating thickness; however, phenomena underlying the role of cathodic (negative) current are quite complex, and few attempts of its analysis were performed [56][57][58].
A deeper understanding of the load behaviour in PEO can be achieved with analysis of transient current-voltage curves (CVC) (Figure 2).For the very beginning of the PEO process, i.e., before the critical point (Figure 1b), there is no effect of cathodic current, and anodic CVCs have no hysteresis (Figure 2a, line R = 0).This CVC has a blocking region below the breakdown voltage (Ubr), where strong capacitive response exists.This breakdown region of the CVC is characterised by high differential conductivity, and the shape of the curve is similar to the electrical breakdown of a zener diode (however, it is not the same).Once the critical point is reached with an adequate value of R Both electrodes are typically made of metals and, thus, possess electronic conductivity.The oxide layer, depending on composition, structure, and morphology, may possess both ionic and/or electronic conductivity with a wide range of activation energies.The electrolyte solution is, normally, a pure ionic conductor (although sometimes molten salts can be used as well) [55].In such a circuit composed of materials with various types of conductivity, the transfer of charges and masses includes overcoming potential barriers at interphase contacts, as well as migration and diffusion within bulk phases.
The ratio between average negative and positive current densities (R = J n /J p ) is usually used as a generalised characteristic of the alternating current regimes.For instance, DC mode is characterised by R = 0, symmetrical alternating current (AC) mode is characterised by R = 1.0, an excess of positive current is characterised by R < 1, an excess of negative current is characterised by R > 1, etc.In addition, anodic and cathodic voltages represent peak values for the corresponding positive and negative pulse envelope.The importance of the peak voltages results from the fact that achievable electrical energy of the system is characterised by maximal applied potential difference, rather than by its average or effective (rms) values.
The growth of the coating is accompanied by transformations of the material and its morphology, thereby affecting the transport conditions that are usually observed as a variation of cell voltage under current control mode (Figure 1b).From the figure, it can be seen that in an arcing regime (R = 0 for Al alloys), both anodic voltage and coating thickness grow monotonically until ultimate conditions are reached; after that, the coating is affected by large arcs, which reduce the coating quality or destroy it.Under soft sparking conditions (R > 1 for Al), there is a "critical point" in the process, after which coating growth is accompanied by a decrease in anodic voltage.The latter is probably counterintuitive, since breakdown voltage is expected to increase with coating thickness; however, phenomena underlying the role of cathodic (negative) current are quite complex, and few attempts of its analysis were performed [56][57][58].
A deeper understanding of the load behaviour in PEO can be achieved with analysis of transient current-voltage curves (CVC) (Figure 2).For the very beginning of the PEO process, i.e., before the critical point (Figure 1b), there is no effect of cathodic current, and anodic CVCs have no hysteresis (Figure 2a, line R = 0).This CVC has a blocking region below the breakdown voltage (U br ), where strong capacitive response exists.This breakdown region of the CVC is characterised by high differential conductivity, and the shape of the curve is similar to the electrical breakdown of a zener diode (however, it is not the same).Once the critical point is reached with an adequate value of R (Figure 1a), the process switches to soft sparking mode, and anodic voltage amplitude decreases; moreover, the hysteresis between upward and downward branches in the CVC can be observed (Figure 2a, R > 1).This hysteresis means that, after transition to soft sparking, the PEO coating is able to pass current at voltages much lower than the original breakdown level (U br , Figure 2a).An additional feature of the hysteresis is a region with negative differential conductivity, which is located between low-and high-voltage conductive regions.
upward branch in the CVC.This is typically taken as a positive phase shift between voltage and current, which formally can be attributed to the inductive element in an equivalent schematic (Figure 3).It should be emphasised here that the inductive-like response is not attributed to real magnetic effects; hence, it is used only as a formal representation of observed behaviours in the equivalent circuit, which can be likely attributed to kinetics features of the charge and mass transfer (deposition, gas evolution) [51].
Thus, from an electronic engineering point of view, the PEO load can be considered as a highvoltage zener diode with a large reverse recovery charge and time (representing hysteresis in the anodic CVC) that depends on the specimen prehistory (level and duration of cathodic polarity).
Moreover, the coating growth makes this system essentially non-steady; therefore, the PEO processes at the very beginning (substrate metal covered with thin natural oxide) and at the end of coating formation (layer of a few hundred of microns) have a dramatic difference in electrical response that must be correctly operated by the power supply.A general description is given below.For positive (anodic) polarisation below the breakdown voltage, the PEO coating provides strong capacitive behaviour that is typically seen for a reverse biased diode.A simplified equivalent circuit is denoted in Figure 3 as a positive branch.Such a resistor-capacitor (RC) diagram is not surprising for a system where two conductors (metal and electrolyte solution) are separated with a poorly conducting oxide coating.For negative (cathodic) polarisation, the thin PEO coating (t < t critical ) has responses with a nearly exponential growth of current similar to forward biased diode (Figure 2b).For negative polarisation, the transition to soft sparking is accompanied by an increase in the threshold voltage (U TR ) on the upward branch in the CVC.This is typically taken as a positive phase shift between voltage and current, which formally can be attributed to the inductive element in an equivalent schematic (Figure 3).It should be emphasised here that the inductive-like response is not attributed to real magnetic effects; hence, it is used only as a formal representation of observed behaviours in the equivalent circuit, which can be likely attributed to kinetics features of the charge and mass transfer (deposition, gas evolution) [51].
Thus, from an electronic engineering point of view, the PEO load can be considered as a high-voltage zener diode with a large reverse recovery charge and time (representing hysteresis in the anodic CVC) that depends on the specimen prehistory (level and duration of cathodic polarity).
Moreover, the coating growth makes this system essentially non-steady; therefore, the PEO processes at the very beginning (substrate metal covered with thin natural oxide) and at the end of coating formation (layer of a few hundred of microns) have a dramatic difference in electrical response that must be correctly operated by the power supply.A general description is given below.
For positive (anodic) polarisation below the breakdown voltage, the PEO coating provides strong capacitive behaviour that is typically seen for a reverse biased diode.A simplified equivalent circuit is denoted in Figure 3 as a positive branch.Such a resistor-capacitor (RC) diagram is not surprising for a system where two conductors (metal and electrolyte solution) are separated with a poorly conducting oxide coating.

Figure 3.
Simplified equivalent circuit of a PEO load for positive and negative polarity, based on data from Reference [50].MD-zener diode of microdischarges; R1-resistance of electrolyte; R2,R3resistances of the coating for positive and negative current; R4-differential resistance of microdischarges; R5-resistance characterising self-decay of the negative induced states; Ccapacitance of metal-oxide-electrolyte junction under reveres bias; L-virtual inductance attributed to slow chemical processes (absorption, desorption, surface diffusion, etc.); ideal diodes VD1,2 formally separate positive and negative branches.
It is obvious that transient processes for a capacitive load, which is connected to a voltage source, are rather complex and the current spike is limited only by electrolyte resistance and inductivity of the wires.Those spikes often require extra power capabilities of employed electronic components.They also reduce reproducibility of the final coating.Moreover, such spikes are probably able to ignite some breakdowns at specific conditions that affect coating continuity and corrosion resistance.To eliminate the spikes, the pulse has to be formed either under current control or under limited voltage rise time.Inductive-like behaviour under negative polarisation means that passage of certain charge requires the application of a certain voltage for a given time (similarly to the V•s product in real magnetic phenomena).Since PEO is an electrochemical process and the rate of electrochemical reactions is directly proportional to the number of passed charges, the current control mode looks like the best choice for PEO processes both for negative and positive polarities.
However, voltage control or combined "current control with limited voltage" modes of operation could be useful, for instance, in PEO on complex-shaped substrates.Moreover, voltage control is required for CVC analysis or voltammetry, since CVC may include regions with negative dI/dU differential resistance (see Figure 2).Therefore, the final design of the power supply for highvoltage electrochemical processes should be able to provide both current and voltage operational control.

Waveform Shape Generation
The desired output waveform is stored in the memory as a list of set points.Each set point n is described in terms of output magnitude (An) at a given particular time (tn), state of output inverter (positive, negative, open, closed), and control function y = f(u,i).This later allows us to choose which output parameter is employed for feedback and set point values.Normally, y = u for the voltage control mode and y = i for the current control mode, where u and i are the values attributed to instantaneous output voltage and current, respectively.However, if necessary, more complex  [50].MD-zener diode of microdischarges; R1-resistance of electrolyte; R2,R3-resistances of the coating for positive and negative current; R4-differential resistance of microdischarges; R5-resistance characterising self-decay of the negative induced states; C-capacitance of metal-oxide-electrolyte junction under reveres bias; L-virtual inductance attributed to slow chemical processes (absorption, desorption, surface diffusion, etc.); ideal diodes VD1,2 formally separate positive and negative branches.
It is obvious that transient processes for a capacitive load, which is connected to a voltage source, are rather complex and the current spike is limited only by electrolyte resistance and inductivity of the wires.Those spikes often require extra power capabilities of employed electronic components.They also reduce reproducibility of the final coating.Moreover, such spikes are probably able to ignite some breakdowns at specific conditions that affect coating continuity and corrosion resistance.To eliminate the spikes, the pulse has to be formed either under current control or under limited voltage rise time.Inductive-like behaviour under negative polarisation means that passage of certain charge requires the application of a certain voltage for a given time (similarly to the V•s product in real magnetic phenomena).Since PEO is an electrochemical process and the rate of electrochemical reactions is directly proportional to the number of passed charges, the current control mode looks like the best choice for PEO processes both for negative and positive polarities.
However, voltage control or combined "current control with limited voltage" modes of operation could be useful, for instance, in PEO on complex-shaped substrates.Moreover, voltage control is required for CVC analysis or voltammetry, since CVC may include regions with negative dI/dU differential resistance (see Figure 2).Therefore, the final design of the power supply for high-voltage electrochemical processes should be able to provide both current and voltage operational control.

Waveform Shape Generation
The desired output waveform is stored in the memory as a list of set points.Each set point n is described in terms of output magnitude (A n ) at a given particular time (t n ), state of output inverter (positive, negative, open, closed), and control function y = f (u,i).This later allows us to choose which output parameter is employed for feedback and set point values.Normally, y = u for the voltage control mode and y = i for the current control mode, where u and i are the values attributed to instantaneous output voltage and current, respectively.However, if necessary, more complex functions can be employed; for instance, the function y = i × u corresponds to power control mode, or the function y = a × i + b × u (where a and b are coefficients) may be used for the design of the specific output current-voltage characteristic.In addition, some additional information can be associated to each set point such as an external trigger control or a start position of the introducing diagnostic pulse.Moreover, the set point list includes headers, which define the number of pulse repetitions, as well as the end flag and service data.The structure of set points, their list, and the corresponding discreet functions are illustrated in Figure 4. functions can be employed; for instance, the function y = i × u corresponds to power control mode, or the function y = a × i + b × u (where a and b are coefficients) may be used for the design of the specific output current-voltage characteristic.In addition, some additional information can be associated to each set point such as an external trigger control or a start position of the introducing diagnostic pulse.Moreover, the set point list includes headers, which define the number of pulse repetitions, as well as the end flag and service data.The structure of set points, their list, and the corresponding discreet functions are illustrated in Figure 4.
where τ is a period of pulse-width modulation (PWM) frequency.
A diagram illustrating the phase shift technique is depicted in Figure 5.The counter register (CNT) continuously increases its value from 0 to a fixed maximum level (PWMmax), while both complimentary output units (PWM1, PWM2) toggle from a high to a low state and vice versa, when the CNT approaches corresponding comparison levels (PWM_ARR1, PWM_ARR2).Channel PWM1 operates in steady-state conditions; therefore, PWM_ARR1 is always equal to zero.In order to achieve a phase shift in channel PWM2 with respect to PWM1, the PWM_ARR2 can be changed between zero (0° shift) and PWMmax (180° shift).Since the output signal PWMout is proportional to the area overlapped by PWM1 and PWM2 signals, a 0-180° shift corresponds 100-0% of the output.The relationship between the value of PWM_ARR2 and the desired output duty ratio is PWM_ARR2 = PWMmax − PWMk.
The device operates in discrete mode, analogue-to-digital conversions (ADC) are synchronised with periods of PWM signal, i.e., the feedback loop can affect only the next period of pulse-width modulated signal, driving the power module.On one hand, this deficit could be minimised with an increase in PWM carrier frequency.On the other hand, the minimum PWM period is limited by the calculation time required by digital feedback control (see Figure 5).Within each particular working period, the calculations should be done and the PWM_ARR2 register should be updated before the CNT register reaches PWMmax, when the PWM timer updates its working registers.
where τ is a period of pulse-width modulation (PWM) frequency.
A diagram illustrating the phase shift technique is depicted in Figure 5.The counter register (CNT) continuously increases its value from 0 to a fixed maximum level (PWM max ), while both complimentary output units (PWM1, PWM2) toggle from a high to a low state and vice versa, when the CNT approaches corresponding comparison levels (PWM_ARR1, PWM_ARR2).Channel PWM1 operates in steady-state conditions; therefore, PWM_ARR1 is always equal to zero.In order to achieve a phase shift in channel PWM2 with respect to PWM1, the PWM_ARR2 can be changed between zero (0 • shift) and PWM max (180 • shift).Since the output signal PWM out is proportional to the area overlapped by PWM1 and PWM2 signals, a 0-180 • shift corresponds 100-0% of the output.The relationship between the value of PWM_ARR2 and the desired output duty ratio is PWM_ARR2 = PWM max − PWM k .
The device operates in discrete mode, analogue-to-digital conversions (ADC) are synchronised with periods of PWM signal, i.e., the feedback loop can affect only the next period of pulse-width modulated signal, driving the power module.On one hand, this deficit could be minimised with an increase in PWM carrier frequency.On the other hand, the minimum PWM period is limited by the calculation time required by digital feedback control (see Figure 5).Within each particular working period, the calculations should be done and the PWM_ARR2 register should be updated before the CNT register reaches PWM max , when the PWM timer updates its working registers.
The adjustment of the output signal in accordance with set points values is carried out by a proportional-integral-differential (PID) controller in the form of difference equation carried out by an Advanced RISC Machines (ARM) core.
where PWM k is the duty ratio for step k, e k = A n,k − f (u,i) k is the difference between set point value and output control function, and K p , K i , and K d are coefficients for the proportional, integral, and differential terms, respectively.Normally, latter PID coefficients are not once defined as constants since optimal signal parameters can be achieved only taking into account specific properties of the load (at least positive and negative waves should have a separate set of PID coefficients) and pulse parameters, such as rise and fall times, allowance of overshot, etc.An employment of fuzzy logic control could bring additional profit in the accuracy of the output signal.
Instruments 2019, 4, x FOR PEER REVIEW 7 of 17 The adjustment of the output signal in accordance with set points values is carried out by a proportional-integral-differential (PID) controller in the form of difference equation carried out by an Advanced RISC Machines (ARM) core.
where PWMk is the duty ratio for step k, ek = An,k − f(u,i)k is the difference between set point value and output control function, and Kp, Ki, and Kd are coefficients for the proportional, integral, and differential terms, respectively.Normally, latter PID coefficients are not once defined as constants since optimal signal parameters can be achieved only taking into account specific properties of the load (at least positive and negative waves should have a separate set of PID coefficients) and pulse parameters, such as rise and fall times, allowance of overshot, etc.An employment of fuzzy logic control could bring additional profit in the accuracy of the output signal.

Correction of the Long-Term Inaccuracies
Since pulse shaping is carried out within a limited time, a considerable systematic relative error in output pulse amplitude will often take place, normally from 10% to 50% depending on the particular pulse shape.Such inaccuracy can be avoided through an application of a secondary stabilisation loop, which compares the actual average or peak values with those derived from a set point list.If discrepancy exists, each set point value is multiplied by a correction coefficient using the secondary proportional-integral (PI) controller until desired values are achieved.A block diagram of the correction procedure is shown in Figure 6.An example of how the system works is shown below.Once measurements of passed charges (Qm) are completed, the difference Δ can be calculated as follows: where Q0 is the desired average value.This error in accordance with the proportional-integral approach is transformed to a correction function.
Then, this function can be transformed into a scaling coefficient, β.
Finally, the input set point value for PID controller (see Section 3.1) appears as

Correction of the Long-Term Inaccuracies
Since pulse shaping is carried out within a limited time, a considerable systematic relative error in output pulse amplitude will often take place, normally from 10% to 50% depending on the particular pulse shape.Such inaccuracy can be avoided through an application of a secondary stabilisation loop, which compares the actual average or peak values with those derived from a set point list.If discrepancy exists, each set point value is multiplied by a correction coefficient using the secondary proportional-integral (PI) controller until desired values are achieved.A block diagram of the correction procedure is shown in Figure 6.An example of how the system works is shown below.Once measurements of passed charges (Q m ) are completed, the difference ∆ can be calculated as follows: where Q 0 is the desired average value.This error in accordance with the proportional-integral approach is transformed to a correction function.
Then, this function can be transformed into a scaling coefficient, β.
Finally, the input set point value for PID controller (see Section 3.1) appears as thereby sustaining the correct average value of the output current.

Prototype Details
An experimental investigation of the proposed approach to pulse shape generation on a PEO load was performed with a laboratory-scale prototype including a power unit, personal computer (PC)-based software, and a electrochemical cell.
The power unit transformed the mains electricity into an output signal under PWM control.The power unit's particular design depended on the relationship between input voltage and desired output levels.For example, a step-up converter is required for mains with 230 VAC if a PEO process of Al alloys is necessary, since typical breakdown voltage is in the range of 350-650 V.In contrast, if mains provide 440 VAC voltage and Ti alloys are to be coated, a step-down converter is enough, since the PEO of Ti runs typically within the 200-400 V range.The requirements for the power unit include a suitable performance for generation of desired rise/fall times.Another important feature of the developed power stage is that a few units are able to operate on the same load in parallel by connecting together appropriate terminals (A1, A2) and synchronous control.
Since, in our experiments, output power was limited to around 2 kW, this device was powered by single-phase mains.Therefore, a step-up converter based on full-bridge topology was employed (Figure 7a, T1-T4).Auxiliary blocks such as an input filter, a power factor corrector, an input rectifier, and general protections are expected as included where necessary without further discussion.A simplified diagram of the pulse shape forming is depicted in Figure 7b.
A power converter operated under phase shift PWM control is shown in Figure 7(T1-T4).As a driver for power switches (T1-T4), conventional optical, capacitive, or transformer-insulated approaches can be employed; however, for the output stage, only drivers which are capable with DC operation are required (optical, capacitive-coupled).L1C1 and L3C3 are the input and output of the low-pass filters, respectively.L2 is an inductor with a saturated core, C2 is the capacitor removing the DC bias of the transformer (Tr), the RC circuit reduces parasitic oscillation spikes, VD is the fullbridge rectifier, R1, R2 is the voltage divider, R3 is the low inductive current shunt, T1-T9 are the

Prototype Details
An experimental investigation of the proposed approach to pulse shape generation on a PEO load was performed with a laboratory-scale prototype including a power unit, personal computer (PC)-based software, and a electrochemical cell.
The power unit transformed the mains electricity into an output signal under PWM control.The power unit's particular design depended on the relationship between input voltage and desired output levels.For example, a step-up converter is required for mains with 230 V AC if a PEO process of Al alloys is necessary, since typical breakdown voltage is in the range of 350-650 V.In contrast, if mains provide 440 V AC voltage and Ti alloys are to be coated, a step-down converter is enough, since the PEO of Ti runs typically within the 200-400 V range.The requirements for the power unit include a suitable performance for generation of desired rise/fall times.Another important feature of the developed power stage is that a few units are able to operate on the same load in parallel by connecting together appropriate terminals (A1, A2) and synchronous control.
Since, in our experiments, output power was limited to around 2 kW, this device was powered by single-phase mains.Therefore, a step-up converter based on full-bridge topology was employed (Figure 7a, T1-T4).Auxiliary blocks such as an input filter, a power factor corrector, an input rectifier, and general protections are expected as included where necessary without further discussion.A simplified diagram of the pulse shape forming is depicted in Figure 7b.
A power converter operated under phase shift PWM control is shown in Figure 7(T1-T4).As a driver for power switches (T1-T4), conventional optical, capacitive, or transformer-insulated approaches can be employed; however, for the output stage, only drivers which are capable with DC operation are required (optical, capacitive-coupled).L1C1 and L3C3 are the input and output of the low-pass filters, respectively.L2 is an inductor with a saturated core, C2 is the capacitor removing the DC bias of the transformer (Tr), the RC circuit reduces parasitic oscillation spikes, VD is the full-bridge rectifier, R1, R2 is the voltage divider, R3 is the low inductive current shunt, T1-T9 are the IGBT (or MOSFET for low input voltage) transistors, and the load is the electrochemical cell, including a working electrode (WE) immersed into an electrolyte solution and a counter electrode (CE) (see Section 2).The output stage of the power supply includes four switches (T5-T8) connected as a full-bridge schematic.Each particular switch is controlled independently.As a result, four various connections can be performed between the power unit and the load.Firstly, the load can be connected to the power unit with positive (anodic) or negative (cathodic) polarities.Secondly, within pause, the load can be in a state of open or short circuit for discharging of the remaining charges.Moreover, under normal application conditions, all switching within the output stage occurs at zero input current from the power converter, providing safe soft switching.Typical delay between PWM being off and the output stage switching is one PWM period.However, in special situations (e.g., metal-electrolyte combination with a high dissolution rate), hard switching of the output stage is also available.The latter allows one to more easily initiate the breakdowns using impact high-voltage excitation.
Instantaneous measurements of the output current and voltage are performed with resistive sensors (R1-R3).In such a case, the microcontroller unint (MCU) turns out under the potential of the high-voltage side, and communication occurs via an optically isolated interface between the control PC unit and secondary power units, when parallel operation is necessary.
The prototype had the following specifications:  The output stage of the power supply includes four switches (T5-T8) connected as a full-bridge schematic.Each particular switch is controlled independently.As a result, four various connections can be performed between the power unit and the load.Firstly, the load can be connected to the power unit with positive (anodic) or negative (cathodic) polarities.Secondly, within pause, the load can be in a state of open or short circuit for discharging of the remaining charges.Moreover, under normal application conditions, all switching within the output stage occurs at zero input current from the power converter, providing safe soft switching.Typical delay between PWM being off and the output stage switching is one PWM period.However, in special situations (e.g., metal-electrolyte combination with a high dissolution rate), hard switching of the output stage is also available.The latter allows one to more easily initiate the breakdowns using impact high-voltage excitation.
Instantaneous measurements of the output current and voltage are performed with resistive sensors (R1-R3).In such a case, the microcontroller unint (MCU) turns out under the potential of the high-voltage side, and communication occurs via an optically isolated interface between the control PC unit and secondary power units, when parallel operation is necessary.
The prototype had the following specifications: Because of the complex structure of the output signal, it is convenient to use "regime designer" (Figure 8) software, which allows the operator to synthesise the most often used output waveforms and their sequences as pulse trains and a set point list ready for the processing.Typically, the basic regime designer includes various combinations of trapezoidal waveforms defined by four points for each polarity (see Figure 9).As a result, triangular, saw-tooth, and trapezoidal waveforms can be easily generated.However, if necessary, a more complex waveform can be loaded from an external tabulated file.Moreover, regime designer allows one to include special diagnostic sequences, as well as markers, for external triggers that allow synchronising outstanding oscilloscopes or camera with particular process moment.Because of the complex structure of the output signal, it is convenient to use "regime designer" (Figure 8) software, which allows the operator to synthesise the most often used output waveforms and their sequences as pulse trains and a set point list ready for the processing.Typically, the basic regime designer includes various combinations of trapezoidal waveforms defined by four points for each polarity (see Figure 9).As a result, triangular, saw-tooth, and trapezoidal waveforms can be easily generated.However, if necessary, a more complex waveform can be loaded from an external tabulated file.Moreover, regime designer allows one to include special diagnostic sequences, as well as markers, for external triggers that allow synchronising outstanding oscilloscopes or camera with particular process moment.In addition to regime designer, the software part of this prototype includes monitoring facilities, which acquire data from the device, provide preliminary calculations, plot them both as time-chart graphs and as waveforms, and save data to a storage for further analysis (Figure 10).All communications between the power supply and the controlling computer are performed via either isolated USB or Wi-Fi interfaces.
Figure10.Appearance of monitoring software.Legend: 1-process time chart of anodic and cathodic voltages and currents, as well as additional process parameters calculated from this data; 2diagnostic pulse waveform; 3-XY graph of diagnostic pulse as current-voltage characteristics; 4numerical values of measured parameters (Ua,Uc-anodic and cathodic voltages; Ia,Ic-anodic and cathodic currents; Qh-absolute value of asymmetric charge (see below); Qh/Qtot-percentage of asymmetric charge with respect to the total charge within the diagnostic pulse); 5-process controls; 6-waveform auto save settings; 7-timer.

Results and Discussion
As an example of the device performance, four different functions (I-IV) were tabulated as anodic pulse shapes, whereas cathodic pulses were simple rectangular (Figure 11a).With Microsoft Excel, a table was exported to a CSV file and uploaded into the power supply with twofold repetition of each pulse in the series.Experimental waveforms of load voltage and current are depicted in Figure 11b.
In view of intelligent process control, the combined polarisation conditions, including producing the pulse train (Figure 11c) under current control and a single diagnostic pulse under voltage control, can be considered (Figure 11d).In addition to mixed operation (current/voltage), this regime is complicated by the fact that diagnostic pulse amplitude (in terms of voltage) cannot be taken as an In addition to regime designer, the software part of this prototype includes monitoring facilities, which acquire data from device, provide preliminary calculations, plot them both as time-chart graphs and as waveforms, and save data to a storage for further analysis (Figure 10).All communications between the power supply and the controlling computer are performed via either isolated USB or Wi-Fi interfaces.In addition to regime designer, the software part of this prototype includes monitoring facilities, which acquire data from the device, provide preliminary calculations, plot them both as time-chart graphs and as waveforms, and save data to a storage for further analysis (Figure 10).All communications between the power supply and the controlling computer are performed via either isolated USB or Wi-Fi interfaces.
Figure10.Appearance of monitoring software.Legend: 1-process time chart of anodic and cathodic voltages and currents, as well as additional process parameters calculated from this data; 2diagnostic pulse waveform; 3-XY graph of diagnostic pulse as current-voltage characteristics; 4numerical values of measured parameters (Ua,Uc-anodic and cathodic voltages; Ia,Ic-anodic and cathodic currents; Qh-absolute value of asymmetric charge (see below); Qh/Qtot-percentage of asymmetric charge with respect to the total charge within the diagnostic pulse); 5-process controls; 6-waveform auto save settings; 7-timer.

Results and Discussion
As an example of the device performance, four different functions (I-IV) were tabulated as anodic pulse shapes, whereas cathodic pulses were simple rectangular (Figure 11a).With Microsoft Excel, a table was exported to a CSV file and uploaded into the power supply with twofold repetition of each pulse in the series.Experimental waveforms of load voltage and current are depicted in Figure 11b.
In view of intelligent process control, the combined polarisation conditions, including producing the pulse train (Figure 11c) under current control and a single diagnostic pulse under voltage control, can be considered (Figure 11d).In addition to mixed operation (current/voltage), this regime is

Results and Discussion
As an example of the device performance, four different functions (I-IV) were tabulated as anodic pulse shapes, whereas cathodic pulses were simple rectangular (Figure 11a).With Microsoft Excel, a table was exported to a CSV file and uploaded into the power supply with twofold repetition of each pulse in the series.Experimental waveforms of load voltage and current are depicted in Figure 11b.
coating properties (breakdown voltage), the diagnostic pulse amplitude has to be adopted in accordance with the maximum voltage within a prior producing pulse train.In other words, after the end of the producing pulse train, a special diagnostic procedure should be carried out that includes (a) finding the maximum voltage, (b) recalculating the function of the diagnostic pulse, and (c) sending the acquired data to the PC for further analysis.Figure 11d illustrates relations between the voltage envelope (UA) during the producing pulse train and amplitude of diagnostic pulse (marked by arrow).An example of a diagnostic pulse response is depicted in Figure 12a.The green area represents the asymmetrical part of the current, which is proportional to the hysteresis in the CVC (see Figure 2a), and the Qh symbol corresponds to the absolute value of charge (coulombs) represented by this area (Figure 12, Iup-Idown).In this test, the additional ADC input was used for acquisition of the intensity of light (L, a.u.) produced by microdischarges (Figure 12b) with the BPW21 photodiode loaded to a 10k resistor.In view of intelligent process control, the combined polarisation conditions, including producing the pulse train (Figure 11c) under current control and a single diagnostic pulse under voltage control, can be considered (Figure 11d).In addition to mixed operation (current/voltage), this regime is complicated by the fact that diagnostic pulse amplitude (in terms of voltage) cannot be taken as an initial parameter, since breakdown voltage evolves during coating growth.
Thus, in order to provide reasonable diagnostic conditions, i.e., conditions that match particular coating properties (breakdown voltage), the diagnostic pulse amplitude has to be adopted in accordance with the maximum voltage within a prior producing pulse train.In other words, after the end of the producing pulse train, a special diagnostic procedure should be carried out that includes (a) finding the maximum voltage, (b) recalculating the function of the diagnostic pulse, and (c) sending the acquired data to the PC for further analysis.Figure 11d illustrates relations between the voltage envelope (U A ) during the producing pulse train and amplitude of diagnostic pulse (marked by arrow).
An example of a diagnostic pulse response is depicted in Figure 12a.The green area represents the asymmetrical part of the current, which is proportional to the hysteresis in the CVC (see Figure 2a), and the Qh symbol corresponds to the absolute value of charge (coulombs) represented by this area (Figure 12, Iup-Idown).In this test, the additional ADC input was used for acquisition of the intensity of light (L, a.u.) produced by microdischarges (Figure 12b) with the BPW21 photodiode loaded to a 10k resistor.Figure 13a illustrates the behaviour of the anodic voltage amplitude and the corresponding diagnostic pulse value during the first 2 min of the process.It can be seen that the auto adjusting system caught the correct voltage level by the first minute; after that, through the whole process, the average discrepancy between the anodic voltage amplitude (U+) and the diagnostic pulse maximum value (Udiag) was around +3 V (Figure 13a inset), except for the period of transition to the soft sparking mode (~29 min), where average discrepancy achieved a level of −8 V. Finally, Figure 13b demonstrates the evolution of the main electrical parameters of the PEO process (U+, U−), as well as characteristic function Qh, proportional to the charge associated with hysteresis in the anodic CVC, thereby establishing the numerical parameter connecting the associated processes under negative and positive polarisations in course of the PEO process.It is expected that this parameter helps disclose the internal mechanism of PEO, and improves the efficiency and reproducibility of the coatings.Finally, the advanced control method can be employed, when control 5 mm Figure 13a illustrates the behaviour of the anodic voltage amplitude and the corresponding diagnostic pulse value during the first 2 min of the process.It can be seen that the auto adjusting system caught the correct voltage level by the first minute; after that, through the whole process, the average discrepancy between the anodic voltage amplitude (U+) and the diagnostic pulse maximum value (U diag ) was around +3 V (Figure 13a inset), except for the period of transition to the soft sparking mode (~29 min), where average discrepancy achieved a level of −8 V. Figure 13a illustrates the behaviour of the anodic voltage amplitude and the corresponding diagnostic pulse value during the first 2 min of the process.It can be seen that the auto adjusting system caught the correct voltage level by the first minute; after that, through the whole process, the average discrepancy between the anodic voltage amplitude (U+) and the diagnostic pulse maximum value (Udiag) was around +3 V (Figure 13a inset), except for the period of transition to the soft sparking mode (~29 min), where average discrepancy achieved a level of −8 V. Finally, Figure 13b demonstrates the evolution of the main electrical parameters of the PEO process (U+, U−), as well as characteristic function Qh, proportional to the charge associated with hysteresis in the anodic CVC, thereby establishing the numerical parameter connecting the associated processes under negative and positive polarisations in course of the PEO process.It is expected that this parameter helps disclose the internal mechanism of PEO, and improves the efficiency and reproducibility of the coatings.Finally, the advanced control method can be employed, when control 5 mm Finally, Figure 13b demonstrates the evolution of the main electrical parameters of the PEO process (U+, U−), as well as characteristic function Qh, proportional to the charge associated with hysteresis in the anodic CVC, thereby establishing the numerical parameter connecting the associated processes under negative and positive polarisations in course of the PEO process.It is expected that this parameter helps disclose the internal mechanism of PEO, and improves the efficiency and reproducibility of the coatings.Finally, the advanced control method can be employed, when control function y = f (u,i) (see Section 3.1) includes additional parameters (and/or conditions) derived from analysis of the diagnostic pulse response, optical signal, etc.

Summary
The device described in this work allows one to carry out high-voltage electrochemical processes, as well as analyse charge and mass transfer in situ.Flexible control of the operational mode (current/voltage controls), pulse shape, and polarity, as well as instantaneous data acquisition with fast on-board analysis will bring high-voltage electrochemistry to a new level of understanding and control due to intelligent adjustment of the local process parameters with the help of digital feedback.
A control function term associated with the external input can be connected to various sources of process information (optical signal, spectrometer, thermometer placed in either solution or substrate, acoustic microphone, etc.), allowing the coating formation process to be comprehensively controlled.A further development of the presented approach includes an introduction of perturbation into the output signal for frequency response analysis of the load in course of the coating formation process.
It is expected that a comprehensive understanding of the process basis will considerably extend the applicability of this electrochemical technique to a wider range of applications, where reproducibility, energy efficiency, and ecology compatibility are the main important features.

Figure 1 .
Figure 1.Schematic view of electrochemical cell (a) and evolution of anodic (positive) voltage peak (envelope of the positive pulses) and coating thickness during plasma electrolytic oxidation (PEO) processes of Al under current control (b).Value R = Jn/Jp is the ratio of negative to positive current densities.

Figure 1 .
Figure 1.Schematic view of electrochemical cell (a) and evolution of anodic (positive) voltage peak (envelope of the positive pulses) and coating thickness during plasma electrolytic oxidation (PEO) processes of Al under current control (b).Value R = J n /J p is the ratio of negative to positive current densities.

Figure 2 .
Figure 2. Transient current-voltage curves in PEO for anodic (a) and cathodic (b) polarisations.Symbols t and R have the same meanings as in Figure 1.

Figure 2 .
Figure 2. Transient current-voltage curves in PEO for anodic (a) and cathodic (b) polarisations.Symbols t and R have the same meanings as in Figure 1.

Figure 3 .
Figure3.Simplified equivalent circuit of a PEO load for positive and negative polarity, based on data from Reference[50].MD-zener diode of microdischarges; R1-resistance of electrolyte; R2,R3-resistances of the coating for positive and negative current; R4-differential resistance of microdischarges; R5-resistance characterising self-decay of the negative induced states; C-capacitance of metal-oxide-electrolyte junction under reveres bias; L-virtual inductance attributed to slow chemical processes (absorption, desorption, surface diffusion, etc.); ideal diodes VD1,2 formally separate positive and negative branches.

Figure 4 .
Figure 4. Illustration of the list and structure of set points and their corresponding waveform.

Figure 4 .
Figure 4. Illustration of the list and structure of set points and their corresponding waveform.Interpolation between two set point values occurs on the fly with particular values of the intermediate (kth) set point calculated as follows:

Figure 5 .
Figure 5. Phase shift pulse-width modulation (PWM) timing diagram.Complementary signals and dead times are not shown.

Figure 5 .
Figure 5. Phase shift pulse-width modulation (PWM) timing diagram.Complementary signals and dead times are not shown.
correct average value of the output current.

Figure 6 .
Figure 6.Block diagram for pulse shaping and the correction of systematic inaccuracies.MEM is the set point memory, and PWM is the timer with PWM output.

Figure 6 .
Figure 6.Block diagram for pulse shaping and the correction of systematic inaccuracies.MEM is the set point memory, and PWM is the timer with PWM output.
Instruments 2019, 4, x FOR PEER REVIEW 9 of 17 IGBT (or MOSFET for low input voltage) transistors, and the load is the electrochemical cell, including a working electrode (WE) immersed into an electrolyte solution and a counter electrode (CE) (see Section 2).

Figure 7 .
Figure 7. Schematic diagram of the double full-bridge power unit (a); simplified path of pulse shape from memory to the load (b).

Figure 7 .
Figure 7. Schematic diagram of the double full-bridge power unit (a); simplified path of pulse shape from memory to the load (b).

Figure 8 .
Figure 8. Appearance of regime designer software.Legend: 1, 2-parameters of anodic and cathodic pulses, respectively; 3-list of regime elements for editing; 4-list of set points; 5-simplified preview of the waveform.

Figure 8 .
Figure 8. Appearance of regime designer software.Legend: 1, 2-parameters of anodic and cathodic pulses, respectively; 3-list of regime elements for editing; 4-list of set points; 5-simplified preview of the waveform.

Figure 9 .
Figure 9. Sketch of the trapezoidal pulse waveform and corresponding parameters.

Figure 9 .
Figure 9. Sketch of the trapezoidal pulse waveform and corresponding parameters.

17 Figure 9 .
Figure 9. Sketch of the trapezoidal pulse waveform and corresponding parameters.

Figure 10 .
Figure 10.Appearance of monitoring software.Legend: 1-process time chart of anodic and cathodic voltages and currents, as well as additional process parameters calculated from this data; 2-diagnostic pulse waveform; 3-XY graph of diagnostic pulse as current-voltage characteristics; 4-numerical values of measured parameters (Ua,Uc-anodic and cathodic voltages; Ia,Ic-anodic and cathodic currents; Qh-absolute value of asymmetric charge (see below); Qh/Qtot-percentage of asymmetric charge with respect to the total charge within the diagnostic pulse); 5-process controls; 6-waveform auto save settings; 7-timer.

Figure 11 .
Figure 11.Scheme of tabulated set points for different functions of current (a): I-sinusoidal half wave, II-triangle, III-saw tooth, IV-function sequentially composed of linear sweep, part of the sinusoidal, and a constant value; (b) corresponding voltage and current output waveforms, as well as output signal waveform within (c) the producing pulse train, and (d) the triangle diagnostic pulse.PEO process on A2024 Al alloy in a silicate-alkaline electrolyte; 250 V/div, 500 mA/div, 10 ms/div.

Figure 11 .
Figure 11.Scheme of tabulated set points for different functions of current (a): I-sinusoidal half wave, II-triangle, III-saw tooth, IV-function sequentially composed of linear sweep, part of the sinusoidal, and a constant value; (b) corresponding voltage and current output waveforms, as well as output signal waveform within (c) the producing pulse train, and (d) the triangle diagnostic pulse.PEO process on A2024 Al alloy in a silicate-alkaline electrolyte; 250 V/div, 500 mA/div, 10 ms/div.

Figure 12 .
Figure 12.Example of a diagnostic pulse response (a) and appearance of the microdischarges (b) in course of the PEO process of Al in a silicate-alkaline electrolyte.Legend: I, mA-current; U, Vvoltage, Iup-Idown-difference between upward and downward branches of current; L, a.u.photodiode current.

Figure 13 .
Figure 13.Initial period of anodic voltage (U+) of PEO process under current control, producing a pulse train and a self-tuning diagnostic pulse amplitude (Udiag) (a).The inset illustrates the discrepancy U-Udiag within the entire process.Evolution of the positive and negative voltage amplitudes and the hysteresis charge (b).

Figure 12 .
Figure 12.Example of a diagnostic pulse response (a) and appearance of the microdischarges (b) in course of the PEO process of Al in a silicate-alkaline electrolyte.Legend: I, mA-current; U, V-voltage, Iup-Idown-difference between upward and downward branches of current; L, a.u.-photodiode current.

17 Figure 12 .
Figure 12.Example of a diagnostic pulse response (a) and appearance of the microdischarges (b) in course of the PEO process of Al in a silicate-alkaline electrolyte.Legend: I, mA-current; U, Vvoltage, Iup-Idown-difference between upward and downward branches of current; L, a.u.photodiode current.

Figure 13 .
Figure 13.Initial period of anodic voltage (U+) of PEO process under current control, producing a pulse train and a self-tuning diagnostic pulse amplitude (Udiag) (a).The inset illustrates the discrepancy U-Udiag within the entire process.Evolution of the positive and negative voltage amplitudes and the hysteresis charge (b).

Figure 13 .
Figure 13.Initial period of anodic voltage (U+) of PEO process under current control, producing a pulse train and a self-tuning diagnostic pulse amplitude (Udiag) (a).The inset illustrates the discrepancy U-Udiag within the entire process.Evolution of the positive and negative voltage amplitudes and the hysteresis charge (b).