The Effect of Electrolytic Solution Composition on the Structure, Corrosion, and Wear Resistance of PEO Coatings on AZ31 Magnesium Alloy

Plasma electrolytic oxidation coatings were prepared in aluminate, phosphate, and silicate-based electrolytic solutions using a soft-sparking regime in a multi-frequency stepped process to compare the structure, corrosion, and wear characteristics of the obtained coatings on AZ31 magnesium alloy. The XRD results indicated that all coatings consist of MgO and MgF2, while specific products such as Mg2SiO4, MgSiO3, Mg2P2O7, and MgAl2O4 were also present in specimens based on the selected solution. Surface morphology of the obtained coatings was strongly affected by the electrolyte composition. Aluminate-containing coating showed volcano-like, nodular particles and craters distributed over the surface. Phosphate-containing coating presented a sintering-crater structure, with non-uniform distributions of micro-pores and micro-cracks. Silicate-containing coating exhibited a scaffold surface involving a network of numerous micro-pores and oxide granules. The aluminate-treated sample offered the highest corrosion resistance and the minimum wear rate (5 × 10−5 mm3 N−1 m−1), owing to its compact structure containing solely 1.75% relative porosity, which is the lowest value in comparison with other samples. The silicate-treated sample was degraded faster in long-term corrosion and wear tests due to its porous structure, and with more delay in the phosphate-containing coating due to its larger thickness (30 μm).


Introduction
Magnesium (Mg) and its alloys are among the top choices for materials selection due to the need for weight reduction in the automotive industry or biocompatibility of implants in the human body applications [1,2]. This is because of their unique characteristics such as high strength-to-weight ratio, low density, damping capacity, non-toxicity, and the ability to be recycled, which have drawn the attention of other industries as well [3,4]. There are also downsides to their direct applications, as Mg alloys are susceptible to corrosion in the presence of aggressive environments [5]. Moreover, the low hardness of magnesium alloys cannot provide enough resistance while contacting with a counterpart, thereby resulting in high wear loss [6]. Due to these limitations, a proper anti-corrosion and wear-proof coating must be situated on Mg substrate to make its application possible.
Researchers have found Plasma Electrolytic Oxidation (PEO) more interesting than other methods to overcome magnesium alloys weaknesses, which has caused a meaningful increase in the number of

Preparation of Specimens, Electrolyte Solutions, and Coatings
AZ31 Mg alloy with the same chemical composition as in our previous work [30] was used as the substrate material. The samples were 3 mm thick cylinders with 16 mm of diameter, ground by SiC emery papers up to 2400 grit on flat sides until surface roughness (Ra) values were decreased to below 0.08 ± 0.01 µm. The samples were then immersed in pure ethanol, washed by deionized water, dried by air blowing, and finally connected to shield copper wires through drilled holes.
PEO coating cell consisted of a stainless steel-made container with 7 L volume, also serving as the counter electrode. The cell was placed in a water-filled bath, in which a chiller controlled its temperature. The external cell walls kept the temperature at 15 ± 1 °C as the heat exchanger for cooling the solution. A power supply 700 V/30 A equipped with an IGBT-based pulse generator was employed for applying the pulsed voltage waveform. During the PEO process, the cell current-time responses were recorded by programmed DSP inside the power source, and a GPS 2024 digital oscilloscope was used to monitor the shape of the current waveforms. Three aqueous solutions were prepared for comparing the electrolyte types on properties of the related obtained coatings. NaAlO2, Na3PO4, and Na2SiO3 were added to separate solutions containing hydroxyl and fluoride to represent aluminate, phosphate, and silicate-based electrolytes and were coded as Al, Ph, and Si, respectively ( Table 1). The experiments were carried out by applying a soft-sparking voltage waveform with 10% anodic and 70% cathodic duty cycles at the whole 15 min duration. The multi-step coating process started with 1 min of voltage ramping to reach anodic and cathodic peak voltages of 380 and 20 V, respectively. Then, the voltage values were kept constant in the first half (7 min) operated at 1 kHz, and the second half (7 min) at 2 kHz. According to discussions about the influence of process frequency [13], this method could be a promising technique for structural optimization. After the preparation of the coatings, the specimens were rinsed by deionized water and dried in air. Table 1 shows detailed information about the characteristics of the solutions and voltage waveforms employed in this work.

Characterization, Electrochemical, and Tribological Evaluations
An eddy current gauge (model CEM DT-156) was used to obtain random measurements of coatings thicknesses. Surface and cross-sectional morphologies of the coatings were observed by field emission scanning electron microscope (FESEM, FEI model Quanta FEG 450, Amsterdam, The Netherlands), combined with an energy dispersive spectrometer (EDS, EDAX Octane Elite, Amsterdam, The Netherlands). Elemental distribution was obtained by maps from cross-sections, and at the same time, two 1 cm 2 areas, one close to the substrate, and the other close to the surface of the coatings were examined by EDS to study the chemical composition at different layers. The observations were used to analyze the relative porosity on the surface by Image J 1.44p and in crosssections by Dragonfly Pro 2.0, as well as for the measurement of the coating thickness at random locations. The phase composition of the coatings was identified by grazing incident beam X-ray Coatings 2020, 10, x FOR PEER REVIEW 3 of 20

Preparation of Specimens, Electrolyte Solutions, and Coatings
AZ31 Mg alloy with the same chemical composition as in our previous work [30] was used as the substrate material. The samples were 3 mm thick cylinders with 16 mm of diameter, ground by SiC emery papers up to 2400 grit on flat sides until surface roughness (Ra) values were decreased to below 0.08 ± 0.01 µm. The samples were then immersed in pure ethanol, washed by deionized water, dried by air blowing, and finally connected to shield copper wires through drilled holes.
PEO coating cell consisted of a stainless steel-made container with 7 L volume, also serving as the counter electrode. The cell was placed in a water-filled bath, in which a chiller controlled its temperature. The external cell walls kept the temperature at 15 ± 1 °C as the heat exchanger for cooling the solution. A power supply 700 V/30 A equipped with an IGBT-based pulse generator was employed for applying the pulsed voltage waveform. During the PEO process, the cell current-time responses were recorded by programmed DSP inside the power source, and a GPS 2024 digital oscilloscope was used to monitor the shape of the current waveforms. Three aqueous solutions were prepared for comparing the electrolyte types on properties of the related obtained coatings. NaAlO2, Na3PO4, and Na2SiO3 were added to separate solutions containing hydroxyl and fluoride to represent aluminate, phosphate, and silicate-based electrolytes and were coded as Al, Ph, and Si, respectively ( Table 1). The experiments were carried out by applying a soft-sparking voltage waveform with 10% anodic and 70% cathodic duty cycles at the whole 15 min duration. The multi-step coating process started with 1 min of voltage ramping to reach anodic and cathodic peak voltages of 380 and 20 V, respectively. Then, the voltage values were kept constant in the first half (7 min) operated at 1 kHz, and the second half (7 min) at 2 kHz. According to discussions about the influence of process frequency [13], this method could be a promising technique for structural optimization. After the preparation of the coatings, the specimens were rinsed by deionized water and dried in air. Table 1 shows detailed information about the characteristics of the solutions and voltage waveforms employed in this work.

Characterization, Electrochemical, and Tribological Evaluations
An eddy current gauge (model CEM DT-156) was used to obtain random measurements of coatings thicknesses. Surface and cross-sectional morphologies of the coatings were observed by field emission scanning electron microscope (FESEM, FEI model Quanta FEG 450, Amsterdam, The Netherlands), combined with an energy dispersive spectrometer (EDS, EDAX Octane Elite, Amsterdam, The Netherlands). Elemental distribution was obtained by maps from cross-sections, and at the same time, two 1 cm 2 areas, one close to the substrate, and the other close to the surface of the coatings were examined by EDS to study the chemical composition at different layers. The observations were used to analyze the relative porosity on the surface by Image J 1.44p and in crosssections by Dragonfly Pro 2.0, as well as for the measurement of the coating thickness at random locations. The phase composition of the coatings was identified by grazing incident beam X-ray

Characterization, Electrochemical, and Tribological Evaluations
An eddy current gauge (model CEM DT-156) was used to obtain random measurements of coatings thicknesses. Surface and cross-sectional morphologies of the coatings were observed by field emission scanning electron microscope (FESEM, FEI model Quanta FEG 450, Amsterdam, The Netherlands), combined with an energy dispersive spectrometer (EDS, EDAX Octane Elite, Amsterdam, The Netherlands). Elemental distribution was obtained by maps from cross-sections, and at the same time, two 1 cm 2 areas, one close to the substrate, and the other close to the surface of the coatings were examined by EDS to study the chemical composition at different layers. The observations were used to analyze the relative porosity on the surface by Image J 1.44p and in cross-sections by Dragonfly Pro 2.0, as well as for the measurement of the coating thickness at random locations. The phase composition of the coatings was identified by grazing incident beam X-ray diffractometer (GIXRD, model ASENWARE AW-XDM300, Zhongshan, China), recording patterns over 2θ range of 10 • -80 • , with 5 • incident angle, and 0.05 • step Coatings 2020, 10, 937 4 of 19 size per 3 s using Cu Kα (40 kV, 30 mA, and λ = 0.15406 nm). HighScore Plus software was employed to analyze XRD patterns by the PDF2 database.
Electrochemical impedance spectroscopy (EIS) measurements were performed using an AMETEK potentiostat/galvanostat (model PARSTAT 2273, Oak Ridge, TN, USA) to evaluate the long-term corrosion behavior of PEO coatings. A conventional three-electrode system consisted of a working electrode (specimen), reference electrode (saturated Ag/AgCl), and counter electrode (platinum plate) was utilized. The tests were conducted after 2, 6, 9, and 10 days of exposure of 1.33 cm 2 surface area of the coatings to 3.5 wt.% NaCl solution at pH 6.5 ± 0.1. The tests were carried out at 10 mV perturbation amplitude versus open circuit potential (OCP), and scanning frequency ranged from 100 kHz to 100 mHz. As soon as the samples' impedance response showed partial overlap with that of Mg alloy substrate, the tests were interrupted. The samples were washed afterward to examine the cross-sections of corrosion pits using FESEM.
Wear resistance of the coatings was studied by reciprocating ball-on-flat tribometer equipped with a SiC ball (Ø = 5 mm) as the counter body. A constant normal load of 5 N was applied on the ball under dry conditions, ambient temperature, and 27% relative humidity. The sliding velocity and the stroke length were 14 mm/s and 7 mm, respectively. The wear tests were performed for 15, 30, 60 min in order to prevent excessive damage to the substrate of coatings with low load-bearing capacity and study wear rate variations during the dry-sliding periods. Worn tracks were then examined by a profilometer (model Mitutoyo SJ 210, Sakado, Japan), which was previously used to measure surface roughness (R a and R z ), and volume loss was determined for each timing and sample. The wear tracks were also observed by FESEM to inspect the damage and wear mechanism. Figure 1 shows the cell current density (sum of absolute magnitudes of anodic and cathodic values) versus time in different electrolytes, comprising three main stages. The first stage corresponds to the one-minute voltage ramp for reaching the positive and negative target values. Breakdown potential of magnesium and its alloys lies between 100 to 200 V [31]. Therefore, the first stage is considered to be divided into conventional anodizing and spark initiation [20]. Cell current density increases sharply at this stage to peak values of~46.4, 41.6, and 22.3 A dm −2 in aluminate, phosphate, and silicate solutions, respectively. It is suggested that the conductivity of each solution significantly affects the current density level achieved during the PEO process [7]. For instance, AlO 2 − ions are incorporated faster due to higher conductivity (Table 1), while PO 4 3− ions are accelerated slightly slower toward the substrate [32].

Cell Current Response Evolution during Peo Treatment
Coatings 2020, 10, x FOR PEER REVIEW 4 of 20 diffractometer (GIXRD, model ASENWARE AW-XDM300, Zhongshan, China), recording patterns over 2θ range of 10°-80°, with 5° incident angle, and 0.05° step size per 3 s using Cu Kα (40 kV, 30 mA, and λ = 0.15406 nm). HighScore Plus software was employed to analyze XRD patterns by the PDF2 database. Electrochemical impedance spectroscopy (EIS) measurements were performed using an AMETEK potentiostat/galvanostat (model PARSTAT 2273, Oak Ridge, TN, USA) to evaluate the long-term corrosion behavior of PEO coatings. A conventional three-electrode system consisted of a working electrode (specimen), reference electrode (saturated Ag/AgCl), and counter electrode (platinum plate) was utilized. The tests were conducted after 2, 6, 9, and 10 days of exposure of 1.33 cm 2 surface area of the coatings to 3.5 wt.% NaCl solution at pH 6.5 ± 0.1. The tests were carried out at 10 mV perturbation amplitude versus open circuit potential (OCP), and scanning frequency ranged from 100 kHz to 100 mHz. As soon as the samples' impedance response showed partial overlap with that of Mg alloy substrate, the tests were interrupted. The samples were washed afterward to examine the cross-sections of corrosion pits using FESEM.
Wear resistance of the coatings was studied by reciprocating ball-on-flat tribometer equipped with a SiC ball (Ø = 5 mm) as the counter body. A constant normal load of 5 N was applied on the ball under dry conditions, ambient temperature, and 27% relative humidity. The sliding velocity and the stroke length were 14 mm/s and 7 mm, respectively. The wear tests were performed for 15, 30, 60 min in order to prevent excessive damage to the substrate of coatings with low load-bearing capacity and study wear rate variations during the dry-sliding periods. Worn tracks were then examined by a profilometer (model Mitutoyo SJ 210, Sakado, Japan), which was previously used to measure surface roughness (Ra and Rz), and volume loss was determined for each timing and sample. The wear tracks were also observed by FESEM to inspect the damage and wear mechanism. Figure 1 shows the cell current density (sum of absolute magnitudes of anodic and cathodic values) versus time in different electrolytes, comprising three main stages. The first stage corresponds to the one-minute voltage ramp for reaching the positive and negative target values. Breakdown potential of magnesium and its alloys lies between 100 to 200 V [31]. Therefore, the first stage is considered to be divided into conventional anodizing and spark initiation [20]. Cell current density increases sharply at this stage to peak values of ~46.4, 41.6, and 22.3 A dm −2 in aluminate, phosphate, and silicate solutions, respectively. It is suggested that the conductivity of each solution significantly affects the current density level achieved during the PEO process [7]. For instance, AlO2 − ions are incorporated faster due to higher conductivity (Table 1), while PO4 3− ions are accelerated slightly slower toward the substrate [32].  In the second stage, plasma sparks started in the previous stage, become more evident on the surface. The current density abruptly decreases due to the formation of a dense and thick ceramic layer through fine and homogeneous sparking. The current drop rate is initially very significant in all electrolytes, but later the slope of the curves becomes less steep. This transition is also marked by the change in the color of discharges that turns into a more yellowish appearance in the second half of this stage. The layers are formed and broken continuously, causing cell current fluctuation. Since the coating growth rate is much higher than its dissolution, the current density drops during the whole duration of this stage, and it is considered the main step of oxidation. This can provide the basis to predict that the specimens treated in silicate type electrolyte have the least, and the specimens treated in phosphate type electrolyte have the highest thickness, as they represent the shortest and longest second stage, respectively. Ph coating experiences significant fluctuations for a certain period, which are simultaneous with random intense sparks scanning the samples' surface. Colored arrows in Figure 1 show the end of the second stage, or the beginning of the third stage, where the steady-state discharging regime begins and cell current density fluctuates the least among all steps. At the last stage, compact PEO coatings have already been formed all over the surface and discharges occur only in weaker areas, because the breakdown voltage is raised significantly by further thickening. The number of discharges is decreased, and their color turns orangish with deeper penetration and higher energy. By altering frequency to 2 kHz in the second half cycle, cell current density remains constant for all electrolyte types (1.8 A dm −2 ) and does not change. Applying a higher frequency decreases the life span of discharges that neutralizes the orange-colored sparks and helps prevent intense breakdowns at the final stage [33].

Surface Morphology and Cross-Sectional Observations
Surface morphologies of the obtained coatings from different electrolytic solutions are presented in Figure 2. As typical of PEO coatings, micro-pores, ceramic granules, and micro-cracks are revealed in all cases. The occurrence of repeated discharges, breakage of coating layers during oxidation, and gas trapping cause the formation of micro-pores on the surface. At the same time, micro-cracks are formed after molten oxide is rapidly solidified and undergoes thermal stress as a result of different thermal coefficient compared to the substrate. Although these mechanisms are considered the same for all specimens, each electrolyte type promotes a different morphology.
According to Figure 2a, Al coating shows a combination of fine nodular particles on the background and craters distributed all over the surface. This structure is known as the crater or volcano-like morphology that appears widely on the surface of PEO coatings grown on aluminum or magnesium alloys treated in aluminate solutions by bipolar regimes [29,34]. These findings determine that the type of discharges in aluminate-based electrolyte happen either on the upper section within pores and cracks of the coating (C-type) or at the coating top layer at the oxide/electrolyte interface (A-type), based on the growth model proposed by Hussein et al. [35]. Ph coating ( Figure 2b) exhibits a sintering-crater structure [26], where the lower layers can also be detected. Micro-pores are not evenly distributed in the film, and micro-cracks are interconnected all through the ceramic coating, ending in micro-pore walls. This is detrimental for corrosion protection but could be favorable in orthopedic applications by promoting cell attachment and osseointegration [36]. Si coating ( Figure 2c) shows a highly porous surface where ejected material, originating from random discharge channels, has formed a network of micro-pores and oxide compounds granules. This net-like morphology is similar to a foam or scaffold structure usually formed on Mg alloys treated in silicate-based electrolytes, indicating a net formation consisting of pores and their walls [37].
To better understand the surface characteristics of PEO coatings obtained from different electrolytes, porosity percentage is estimated for each type and the obtained results are summarized in Table 2. It seems that in aluminate-containing solution, the discharging phenomenon occurs more uniformly, Coatings 2020, 10, 937 6 of 19 in a way that small traces occupy almost 7% of the coating surface. The formation of secondary sintered layers on the top makes Ph coatings show the least, and Si coating the highest percentage area of porosity due to the formation of the scaffold structure. To better understand the surface characteristics of PEO coatings obtained from different electrolytes, porosity percentage is estimated for each type and the obtained results are summarized in Table 2. It seems that in aluminate-containing solution, the discharging phenomenon occurs more uniformly, in a way that small traces occupy almost 7% of the coating surface. The formation of secondary sintered layers on the top makes Ph coatings show the least, and Si coating the highest percentage area of porosity due to the formation of the scaffold structure.  Figure 3 illustrates cross-sectional observations combined with the views of the porosity percentage. It can be noted that by observing the image of Al coating and data corresponding to its cross-section porosity in Table 2, tiny cavities, mainly located at the top of the coating, are distinguished. This observation is compatible with the surface morphology of Al coating. A and Ctype discharges occur at the oxide/electrolyte interface and lead to surface sparks with less intensity [34]. In contrast, cross-section images of Ph and Si coatings contain discrete and connected structural defects in most parts of the coatings. Typically, B-type discharges are responsible for deep channels that stem from sparking at the coating/substrate interface. As evident in Figure 3c, an uneven appearance is observed in Si coating, at the area adjacent to the substrate, which may result from strong B-type discharges that can increase the distortions at the interface. D and E-type discharges were later added to the previous model by Cheng et al. [38]. According to their new model, enclosed micro-pores in the structure are developed by D-type discharges that occur at the interfacial pores   Figure 3 illustrates cross-sectional observations combined with the views of the porosity percentage. It can be noted that by observing the image of Al coating and data corresponding to its cross-section porosity in Table 2, tiny cavities, mainly located at the top of the coating, are distinguished. This observation is compatible with the surface morphology of Al coating. A and C-type discharges occur at the oxide/electrolyte interface and lead to surface sparks with less intensity [34]. In contrast, cross-section images of Ph and Si coatings contain discrete and connected structural defects in most parts of the coatings. Typically, B-type discharges are responsible for deep channels that stem from sparking at the coating/substrate interface. As evident in Figure 3c, an uneven appearance is observed in Si coating, at the area adjacent to the substrate, which may result from strong B-type discharges that can increase the distortions at the interface. D and E-type discharges were later added to the previous model by Cheng et al. [38]. According to their new model, enclosed micro-pores in the structure are developed by D-type discharges that occur at the interfacial pores between inner and outer layers. In contrast, E-type discharges occur only slightly upper the inner/outer layer interface that can leave open pores (pancakes) on the top [38]. The formation of these intense discharging makes Ph and Si coatings highly porous in the thickness (Table 2), especially Ph coating (7.25%). Ma et al. [39] secluded phosphate type coatings from conventional dual-layered PEO coatings and determined three sub-layers, counting the pores as a separate mid-layer and the upper section with penetrated channels as the outer layer.
Coatings 2020, 10, x FOR PEER REVIEW 7 of 20 between inner and outer layers. In contrast, E-type discharges occur only slightly upper the inner/outer layer interface that can leave open pores (pancakes) on the top [38]. The formation of these intense discharging makes Ph and Si coatings highly porous in the thickness (Table 2), especially Ph coating (7.25%). Ma et al. [39] secluded phosphate type coatings from conventional dual-layered PEO coatings and determined three sub-layers, counting the pores as a separate midlayer and the upper section with penetrated channels as the outer layer. The thickness of prepared PEO coatings was also measured using cross-sectional observations. The results are shown in Table 2, along with thickness values obtained by the eddy-current method and roughness variations by mechanical profilometry. An inconsiderable difference exists between the values measured by image analysis and eddy-current, probably due to the wavy-jagged nature of the coating/substrate interface and the presence of defects in the structure. It is also evident that the thickness of Al, Ph, and Si coatings are around 15, 30, and 14 µm, respectively, which means the rate of coating formation in the phosphate electrolyte is almost twice that of silicate and aluminatebased electrolytes. It is supposed in the literature [26,40] that a higher growth rate of PEO coatings in phosphate electrolyte is attributed to different reactivity of Mg 2+ to PO4 3− rather than other anions. It could also be discerned that growth kinetics indirectly affect the discharging characteristics of phosphate coatings. During PEO treatment, higher thickness induces strengthening of the electrical field at the barrier layer, and single sparking is promoted, which involves high energy pulses and intense discharging. Seyfoori et al. [26] mentioned this phenomenon as secondary sparks that occur on primary micro-pores, producing more oxide and leaving greater pores. Another proposition was forwarded by Mori et al. [40] that molten substance is more fluid during coating formation in a phosphate solution. In this way, sparking is suppressed, and the number of discharges reduces, but the intensity is enhanced [40], which explains the fluctuations in the current-time curve (Figure 1). Commonly, surface roughness is increased with thickness due to the presence of large channels remained from single sparking in Ph coating [41]. Although A and C-type discharges happen at the outermost section of PEO coatings, they are so soft on Al coating that it exhibits the lowest surface The thickness of prepared PEO coatings was also measured using cross-sectional observations. The results are shown in Table 2, along with thickness values obtained by the eddy-current method and roughness variations by mechanical profilometry. An inconsiderable difference exists between the values measured by image analysis and eddy-current, probably due to the wavy-jagged nature of the coating/substrate interface and the presence of defects in the structure. It is also evident that the thickness of Al, Ph, and Si coatings are around 15, 30, and 14 µm, respectively, which means the rate of coating formation in the phosphate electrolyte is almost twice that of silicate and aluminate-based electrolytes. It is supposed in the literature [26,40] that a higher growth rate of PEO coatings in phosphate electrolyte is attributed to different reactivity of Mg 2+ to PO 4 3− rather than other anions.
It could also be discerned that growth kinetics indirectly affect the discharging characteristics of phosphate coatings. During PEO treatment, higher thickness induces strengthening of the electrical field at the barrier layer, and single sparking is promoted, which involves high energy pulses and intense discharging. Seyfoori et al. [26] mentioned this phenomenon as secondary sparks that occur on primary micro-pores, producing more oxide and leaving greater pores. Another proposition was forwarded by Mori et al. [40] that molten substance is more fluid during coating formation in a phosphate solution. In this way, sparking is suppressed, and the number of discharges reduces, but the intensity is enhanced [40], which explains the fluctuations in the current-time curve (Figure 1). Commonly, surface roughness is increased with thickness due to the presence of large channels remained from single sparking in Ph coating [41]. Although A and C-type discharges happen at the outermost section of PEO coatings, they are so soft on Al coating that it exhibits the lowest surface roughness. Si coating reveals higher R a and R z values despite its close thickness with Al, which could be ascribed to the occurrence of strong B and E-type discharges, leaving deeper valleys and higher peaks behind. Figure 4 illustrates the X-ray diffractometry results of PEO coatings produced in aluminate, phosphate, and silicate-based electrolytes. All specimens exhibit shared peaks of Mg (ICDD PDF no. 01-1141), MgO (ICDD PDF no. 75-1525), and MgF 2 (ICDD PDF no. 01-1196) in their patterns that originate from common constituents in the electrolytes or the substrate. The thin and porous structure of PEO coatings allows the penetration of radiation and results in the appearance of substrate Mg peaks in the patterns. The intensity of such peaks decreases in Ph specimen due to the formation of a thicker coating. It is well established that by the start of PEO on Mg alloys, MgO is formed directly by the reaction between Mg 2+ and O 2− ions that exist in discharge channels, and indirectly through dehydration of unstable Mg(OH) 2 at the substrate/electrolyte interface under high temperature and pressure [32]. Therefore, MgO is the dominant crystalline phase of PEO coatings grown in different electrolytes [42]. Fluoride ions are also incorporated in coating growth during anodic polarization with formation of MgF 2 [42]. roughness. Si coating reveals higher Ra and Rz values despite its close thickness with Al, which could be ascribed to the occurrence of strong B and E-type discharges, leaving deeper valleys and higher peaks behind. Figure 4 illustrates the X-ray diffractometry results of PEO coatings produced in aluminate, phosphate, and silicate-based electrolytes. All specimens exhibit shared peaks of Mg (ICDD PDF no. 01-1141), MgO (ICDD PDF no. 75-1525), and MgF2 (ICDD PDF no. 01-1196) in their patterns that originate from common constituents in the electrolytes or the substrate. The thin and porous structure of PEO coatings allows the penetration of radiation and results in the appearance of substrate Mg peaks in the patterns. The intensity of such peaks decreases in Ph specimen due to the formation of a thicker coating. It is well established that by the start of PEO on Mg alloys, MgO is formed directly by the reaction between Mg 2+ and O 2− ions that exist in discharge channels, and indirectly through dehydration of unstable Mg(OH)2 at the substrate/electrolyte interface under high temperature and pressure [32]. Therefore, MgO is the dominant crystalline phase of PEO coatings grown in different electrolytes [42]. Fluoride ions are also incorporated in coating growth during anodic polarization with formation of MgF2 [42].  ICDD PDF no. 01-0773) in Si, and magnesium pyrophosphate (Mg 2 P 2 O 7 ; ICDD PDF no. 05-0582) in Ph are unique phases that characterize the coatings produced in each solution. In addition to crystalline phases detected in the patterns, halos can be noted in the XDR patter of all samples. It is common in PEO coatings that amorphous phases are formed due to reaching local high temperatures in layers with different depths and at various concentrations of constituents, which are then subjected to rapid cooling, and sufficient time is not provided for rearrangement of atoms [43,44]. Depending on their glass-forming ability, three elements of Si, P and Al can form amorphous phases such as silica, phosphate-containing compounds, and alumina at the inner or outer layer affected by their thermal conductivity [43]. Therefore, it can be mentioned that the coatings contained both crystalline and amorphous phases. Table 3 shows the atomic percentage (at.%) of elements obtained using EDS analysis on the cross-section at the region close to the coating surface and close to the barrier layer. Elemental mapping of the cross-sections is also given in Figure 5 for showing the distribution of elements in the coating. It is revealed that all of the coatings consist of Mg, O, F, and their corresponding solution electrolyte element (Al, P, Si). As seen, the elements are distributed uniformly in Al and Ph structures. A and C-type discharges promote the incorporation of electrolyte constituents on top layers, which is why the surface of Al coating seems rich in aluminum [38]. In contrast, B-type discharges result in forming an inner layer containing substrate metal as the main element, as evident for Ph and Si specimens [38]. Table 3 and Figure 5c confirm that by moving from the Si specimen surface toward the substrate/coating interface, the magnesium atomic percentage is increased, while the silicon amount drops significantly. Moreover, faster fluoride ions are absorbed into Si inner layer as soon as a strong electrical field is employed to react with the substrate, and reveals a high concentration of F products at the interface, confirmed by the EDS map illustrated in Figure 5c'. A higher Pilling-Bedworth ratio of MgF 2 (1.4) in comparison to MgO (<1), and the synergistic effect of fluoride mobility promote the formation of compact MgF 2 layers, which have a lower melting point than other constituents in the coating [45,46].

Phase Analysis and Chemical Composition
Coatings 2020, 10, x FOR PEER REVIEW 9 of 20 unique phases that characterize the coatings produced in each solution. In addition to crystalline phases detected in the patterns, halos can be noted in the XDR patter of all samples. It is common in PEO coatings that amorphous phases are formed due to reaching local high temperatures in layers with different depths and at various concentrations of constituents, which are then subjected to rapid cooling, and sufficient time is not provided for rearrangement of atoms [43,44]. Depending on their glass-forming ability, three elements of Si, P and Al can form amorphous phases such as silica, phosphate-containing compounds, and alumina at the inner or outer layer affected by their thermal conductivity [43]. Therefore, it can be mentioned that the coatings contained both crystalline and amorphous phases. Table 3 shows the atomic percentage (at.%) of elements obtained using EDS analysis on the crosssection at the region close to the coating surface and close to the barrier layer. Elemental mapping of the cross-sections is also given in Figure 5 for showing the distribution of elements in the coating. It is revealed that all of the coatings consist of Mg, O, F, and their corresponding solution electrolyte element (Al, P, Si). As seen, the elements are distributed uniformly in Al and Ph structures. A and Ctype discharges promote the incorporation of electrolyte constituents on top layers, which is why the surface of Al coating seems rich in aluminum [38]. In contrast, B-type discharges result in forming an inner layer containing substrate metal as the main element, as evident for Ph and Si specimens [38]. Table 3 and Figure 5c confirm that by moving from the Si specimen surface toward the substrate/coating interface, the magnesium atomic percentage is increased, while the silicon amount drops significantly. Moreover, faster fluoride ions are absorbed into Si inner layer as soon as a strong electrical field is employed to react with the substrate, and reveals a high concentration of F products at the interface, confirmed by the EDS map illustrated in Figure 5c

Corrosion Resistance of the Coatings
The fabricated PEO coatings using aluminate, phosphate and silicate electrolytes show different electrochemical behaviors over time. Generally, the high-frequency range of EIS diagrams reflects the outer layer properties of PEO coatings, while the low frequency characterizes the inner layer features. Figure 6 exhibits the Nyquist and Bode-Phase plots of experimental measurements and fitted curves to reproduce and simulate the EIS data. The equivalent circuits (ECs) best fitting the measurements are presented in Figure 7, and the obtained data are summarized in Table 4, which also explains which circuit is used to fit each case. R s , R out, and R in correspond to the solution, outer layer, and inner barrier layer, respectively. CPE out and CPE in represent the constant phase element modeling the non-ideal capacitance of outer and inner layers, respectively; L is the inductive element and R L is its series resistance.
According to Figure 6c, after 2 days of exposure, the Si sample shows one capacitive loop with the highest diameter with respect to Ph and Al samples (Figure 6a,b). The bode-phase curve (Figure 6c') shows a broad hump located at a phase angle higher than 80 • , indicating a strong barrier performance. It was previously stated that the inner layer of Si coating contains high amounts of MgF 2 and silicon-rich regions are stacked on top. It was approved [42,47] that the addition of MgF 2 and silicate products is preferred to oxides since they are more stable and can compensate for the volume shrinkage caused by MgO formation. Therefore, Si coating exhibits good barrier performance at the early stages resulting from its inner layer. For longer immersion time, the performance of this layer weakens, and the substrate is intensively attacked, which is observable by the naked eye on the surface of the sample after 6 days of exposure. In this way, an inductive loop also appears as seen in Figure 6c. The inductive behavior is ascribed to localized corrosion at the sites where the substrate is in contact with the electrolyte and hydrogen evolution occurs on uncoated Mg surface [48]. A combination of highly porous structure and low thickness made silicate-type samples degrade faster in the corrosion test. Despite exhibiting an inductive loop after 2 days of exposure, the high thickness of Ph coating delays the penetration of aggressive ions and shows a superior barrier effect at first. As seen from the bode-phase curve (Figure 6b'), two humps can be distinguished, indicating the responses from both the inner and outer layers of the coating. However, the inner layer resistance drops remarkably in Ph specimen after the dismissal of the outer layer functionality. Notably, the diameter of capacitive loops decreases faster than Al coating, and after 9 days of exposure, visible pits can be distinguished on the surface, associated with the evidence of the inductive loop in the Nyquist diagram. It seems that the interconnected porosity is responsible for the transition of aggressive ions from the corrosive solution inside the coating. The PEO coatings produced from phosphate-containing solutions are more corrosion resistant than silicate-based coatings due to a lower hydrophilic nature, greater thickness, and higher stability, as described in refs. [26,49].
On the other hand, Al coating endured 10 days of exposure to 3.5 wt.% NaCl solution. Although the substrate of the Al specimen is also under attack at 2 days of exposure, the compact structure of Al containing coating allows for the least entrance of corrosive solution into the defects, explaining why the corrosion pits are not as large as those present in Si and Ph coatings. As seen from the bode-phase curve (Figure 6a'), the presence of two humps indicates both inner and outer layers of the coatings respond at all immersion times. It is well documented that the presence of aluminum is beneficial in improving the passivity of magnesium, and the formation of dense inert MgAl 2 O 4 phase enhances the corrosion performance of PEO coatings [22]. The values of fitted electrical parameters (Table 4) indicate that the two-layered structure of the Al specimen is preserved well during all time periods, unlike the Si and Ph samples. According to Wang et al. [47], to achieve high corrosion performance, the coating should not only be thick but also needs to be free of structural defects, which differentiate the protection levels.  On the other hand, Al coating endured 10 days of exposure to 3.5 wt.% NaCl solution. Although the substrate of the Al specimen is also under attack at 2 days of exposure, the compact structure of Al containing coating allows for the least entrance of corrosive solution into the defects, explaining why the corrosion pits are not as large as those present in Si and Ph coatings. As seen from the bodephase curve (Figure 6a'), the presence of two humps indicates both inner and outer layers of the coatings respond at all immersion times. It is well documented that the presence of aluminum is beneficial in improving the passivity of magnesium, and the formation of dense inert MgAl2O4 phase enhances the corrosion performance of PEO coatings [22]. The values of fitted electrical parameters (Table 4) indicate that the two-layered structure of the Al specimen is preserved well during all time periods, unlike the Si and Ph samples. According to Wang et al. [47], to achieve high corrosion performance, the coating should not only be thick but also needs to be free of structural defects, which differentiate the protection levels. Figure 8 illustrates cross-sections of the specimens after revealing surface pits that are cut in the center to see the depth and shape of the corroded region. These holes represent the weakest parts of the coatings that are later dissolved in the aggressive solution. It is evident that the damage on Al is the smallest in depth and width, and the rest of the ceramic coating uniformly protects the substrate. In contrast, Ph and Si coatings display severe attack that has created a coating breakage network and allows the corrosive media to advance into neighboring areas. As a result, Mg(OH)2 is formed through the reaction between MgO and H2O, but chloride ions are capable of breaking through Mg(OH)2 layers, and corrosion accelerates into deeper areas [32]. Moreover, the hole area can be extended or generate stress to adjacent sites due to the inflection caused by a higher equivalent volume of formed Mg(OH)2 compared to in situ MgO [45].   Figure 8 illustrates cross-sections of the specimens after revealing surface pits that are cut in the center to see the depth and shape of the corroded region. These holes represent the weakest parts of the coatings that are later dissolved in the aggressive solution. It is evident that the damage on Al is the smallest in depth and width, and the rest of the ceramic coating uniformly protects the substrate. In contrast, Ph and Si coatings display severe attack that has created a coating breakage network and allows the corrosive media to advance into neighboring areas. As a result, Mg(OH) 2 is formed through the reaction between MgO and H 2 O, but chloride ions are capable of breaking through Mg(OH) 2 layers, and corrosion accelerates into deeper areas [32]. Moreover, the hole area can be extended or generate stress to adjacent sites due to the inflection caused by a higher equivalent volume of formed Mg(OH) 2 compared to in situ MgO [45].

Wear Resistance of the Coatings
Line profiles of wear tracks are examined, and important parameters such as depth, width, and worn volume of each scar are calculated, as depicted in Table 5. The surface appearance of the wear tracks is also examined by FESEM and shown in Figure 9 along with the approximate determination of scar borders and width. The numbers 15, 30, and 60 after each specimen code in this section are referred to the durations of 15, 30, and 60 min in dry-sliding tests. For the test, which lasted 15 min, the Si sample shows the highest volume loss, track width, and depth even higher than the coating thickness. According to Figure 9c, Si coating is completely removed, and sliding direction is clearly observed by keeping track of surface grooves. In the vicinity of wear track borders, the ceramic coating is fractured when subjected to shear stress and left deformed areas in the edges [29]. For Al and Ph coatings (Figure 9a,b), the damage is not severe after 15 min and only asperities have been micro-polished. The status of friction pairs is "ball-on-protrusions" style indicating that the ceramic ball wears small-sized bumps and smoothens the asperities in the contact area [50]. Therefore, it could be observed that the micro-morphology of wear tracks is almost the same after 15 and 30 min for both Al and Ph coatings. In the first stages, fragmentation of protrusions does not intensify the wear process because the micro-pores and cracks act as reservoirs on the surface. As sliding continues, generated debris fills the larger-sized flaws, and the rest of the spalling particles engage in the wear process as third-bodies [29,50]. The literature [33,50] supposed third-body abrasion is the main wear mechanism in PEO coatings.

Wear Resistance of the Coatings
Line profiles of wear tracks are examined, and important parameters such as depth, width, and worn volume of each scar are calculated, as depicted in Table 5. The surface appearance of the wear tracks is also examined by FESEM and shown in Figure 9 along with the approximate determination of scar borders and width. The numbers 15, 30, and 60 after each specimen code in this section are referred to the durations of 15, 30, and 60 min in dry-sliding tests. For the test, which lasted 15 min, the Si sample shows the highest volume loss, track width, and depth even higher than the coating thickness. According to Figure 9c, Si coating is completely removed, and sliding direction is clearly observed by keeping track of surface grooves. In the vicinity of wear track borders, the ceramic coating is fractured when subjected to shear stress and left deformed areas in the edges [29]. For Al and Ph coatings (Figure 9a,b), the damage is not severe after 15 min and only asperities have been micro-polished. The status of friction pairs is "ball-on-protrusions" style indicating that the ceramic ball wears small-sized bumps and smoothens the asperities in the contact area [50]. Therefore, it could be observed that the micro-morphology of wear tracks is almost the same after 15 and 30 min for both Al and Ph coatings. In the first stages, fragmentation of protrusions does not intensify the wear process because the micro-pores and cracks act as reservoirs on the surface. As sliding continues, generated debris fills the larger-sized flaws, and the rest of the spalling particles engage in the wear process as third-bodies [29,50]. The literature [33,50] supposed third-body abrasion is the main wear   In Figure 9f,g, it is evident that the outer layers are partially worn in Al and Ph coatings after 60 min. However, it seems that the Ph coating loses its protection in random directions, most probably due to the presence of interconnected pores of the structure. In Al coating, the area around the centerline is worn because it is bearing a higher load than wear track borders. Considering these stages are the same for Si coating before its elimination from the surface, the mechanism changes to adhesive wear when the ball touches the substrate in Si specimen, which is consistent with previous studies [29,32,50].
The wear rates are calculated by taking into account the worn volume, applied load, and the test distance for a better comparison of coatings, and the results are illustrated in Figure 10. The first period of 0-15 min is shown by 15, the second period of 15-30 min by 30, and the last period of 30-60 min by 60. As the weakest coating, Si reveals the highest wear rate, and the underlying metal experienced intensive ploughing as soon as the ceramic coating is removed before 15 min. Loosely connected layers, originated from B and D-type discharges, account for the very low endurance of Si specimen in dry-sliding. Ph coating shows the second-high wear rate, which is further increased as the tests advance. This could be attributed to the microstructure of Ph coating with a sintering layer on the top and a porous middle layer. In contrast, Al coating's wear rate remains almost constant during all testing durations. A compact structure with uniformly distributed layers and the presence of dense MgAl 2 O 4 make Al the most wear-resistant coating, in accordance with other researches [32,51,52]. Although the depth of wear scars in Al and Ph coatings are at the range of their thicknesses after 60 min, it should be noticed that the thickness of Al is only half of Ph and reveals a much lower track width and volume loss in all evaluations (Table 5). Commonly, the higher surface roughness induces more intensive wear for Ph coating. Larger thickness delays the degradation process for Ph coating just like corrosion, but as higher thickness is usually parallel with higher surface roughness, these two factors act in favor of and against tribological properties of phosphate-containing coatings, respectively. Thus, the Al sample provides the highest resistance against the wear damages. The wear rates are calculated by taking into account the worn volume, applied load, and the test distance for a better comparison of coatings, and the results are illustrated in Figure 10. The first period of 0-15 min is shown by 15, the second period of 15-30 min by 30, and the last period of 30-60 min by 60. As the weakest coating, Si reveals the highest wear rate, and the underlying metal experienced intensive ploughing as soon as the ceramic coating is removed before 15 min. Loosely connected layers, originated from B and D-type discharges, account for the very low endurance of Si specimen in dry-sliding. Ph coating shows the second-high wear rate, which is further increased as the tests advance. This could be attributed to the microstructure of Ph coating with a sintering layer on the top and a porous middle layer. In contrast, Al coating's wear rate remains almost constant during all testing durations. A compact structure with uniformly distributed layers and the presence of dense MgAl2O4 make Al the most wear-resistant coating, in accordance with other researches [32,51,52]. Although the depth of wear scars in Al and Ph coatings are at the range of their thicknesses after 60 min, it should be noticed that the thickness of Al is only half of Ph and reveals a much lower track width and volume loss in all evaluations (Table 5). Commonly, the higher surface roughness induces more intensive wear for Ph coating. Larger thickness delays the degradation process for Ph coating just like corrosion, but as higher thickness is usually parallel with higher surface roughness, these two factors act in favor of and against tribological properties of phosphate-containing coatings, respectively. Thus, the Al sample provides the highest resistance against the wear damages. On the other hand, the aluminate containing electrolyte allows the production of surface with lower roughness than phosphate or silicate-based ones due to its compatibility with soft-sparking. According to the previous surface and cross-sectional observations, Al coating shows high relative porosity on the surface but the minimum percentage in the cross-section. This structure provides optimum protection against the rubbing ball because the micro-polishing stage lasts more at the presence of surface pores until fragmented protrusions fill and press inferior layers. From this point forward, compact MgAl2O4, reported to be harder than silicate and phosphate products [52], plays an essential role in offering the best wear performance.

Conclusions
Plasma electrolytic oxidation (PEO) coatings were grown on AZ31 Mg alloy in aluminate, phosphate, and silicate-based electrolytes using a soft-sparking waveform with 10% anodic and 70% On the other hand, the aluminate containing electrolyte allows the production of surface with lower roughness than phosphate or silicate-based ones due to its compatibility with soft-sparking. According to the previous surface and cross-sectional observations, Al coating shows high relative porosity on the surface but the minimum percentage in the cross-section. This structure provides optimum protection against the rubbing ball because the micro-polishing stage lasts more at the presence of surface pores until fragmented protrusions fill and press inferior layers. From this point forward, compact MgAl 2 O 4 , reported to be harder than silicate and phosphate products [52], plays an essential role in offering the best wear performance.

Conclusions
Plasma electrolytic oxidation (PEO) coatings were grown on AZ31 Mg alloy in aluminate, phosphate, and silicate-based electrolytes using a soft-sparking waveform with 10% anodic and 70% cathodic duty cycles. The coating waveform was performed in two stages at different frequencies of 1 and 2 kHz. The following results were obtained: (1) The surface morphology of obtained coatings is strongly affected by the electrolyte composition.
Aluminate containing coating showed a volcano-like morphology with a combination of nodular particles and craters distributed over the surface. Phosphate comprising coating exhibited a sintering-crater structure, with non-uniform distribution of micro-pores and micro-cracks connected and to porosities. Silicate containing coating illustrated a highly porous scaffold surface formed by a network of micro-pores and oxide granules. (2) The cross-sectional image obtained in aluminate-based electrolyte included tiny pores due to occurrence of A and C-type discharges and formed more compact coating. The B, D, and E-type discharges were responsible for deep channels and open pores (pancakes) in phosphate and silicate containing coatings. Hence, a larger porosity percentage was related to phosphate and silicate containing coatings. (3) The coatings contained MgO and MgF 2 phases, along with stoichiometric and non-stoichiometric MgAl 2 O 4 , Mg 2 SiO 4 , MgSiO 3 , and Mg 2 P 2 O 7 in aluminate, silicate, phosphate, electrolytes, respectively. (4) After 2 days of exposure to 3.5 wt.% NaCl solution, the silicate specimen showed the highest corrosion resistance, due to the presence of the most MgF 2 amount in the inner barrier layer. However, after 6 days, the substrate was intensively attacked, which stemmed from the low thickness and its porous structure. For the phosphate-containing coating, the substrate was exposed to the corrosive solution after 9 days of exposure. Aluminate-containing coating endured 10 days of exposure, despite exhibiting an inductive loop after 2 days of exposure. Therefore, the highest corrosion resistance at short-immersion time is shown by the silicate-containing coating, while at long-immersion time, this was provided by the aluminate-containing coating. (5) The highest wear resistance was given by the coating produced in aluminate solution, with revealing a much lower track width and volume loss in all evaluations. The lowest wear resistance was shown by the silicate-containing coating with the highest volume loss, track width and depth before 15 min. At the same time, the phosphate-containing coating with higher thickness delayed the degradation process, but as the sliding continued to 60 min, generated debris filled the larger-sized flaws, and the rest of the spalling particles engaged in the wear process as third-bodies, which increased the wear rate over time. Funding: This research has not received any external funding.