Characterization and Corrosion Properties of Fluoride Conversion Coating Prepared on AZ31 Magnesium Alloy

: Wrought AZ31 magnesium alloy was used as the experimental material for ﬂuoride conversion coating preparation in Na[BF 4 ] molten salt. Two coating temperatures, 430 ◦ C and 450 ◦ C, and three coating times, 0.5, 2, and 8 h, were used for the coating preparation. A scanning electron microscope and energy-dispersive X-ray spectroscopy were used for an investigation of the surface morphology and the cross-sections of the prepared coatings including chemical composition determination. The corrosion resistance of the prepared specimens was investigated in terms of the potentiodynamic tests, electrochemical impedance spectroscopy and immersion tests in the environment of simulated body ﬂuids at 37 ± 2 ◦ C. The increase in the coating temperature and coating time resulted in higher coatings thicknesses and better corrosion resistance. Higher coating temperature was accompanied by smaller defects uniformly distributed on the coating surface. The defects were most probably created due to the reaction of the Al x Mn y intermetallic phase with Na[BF 4 ] molten salt and/or with the product of its decomposition, BF 3 compound, resulting in the creation of soluble Na 3 [AlF 6 ] and AlF 3 compounds, which were removed from the coating during the removal of the secondary Na[MgF 3 ] layer. The negative inﬂuence of the Al x Mn y intermetallic phase was correlated to the particle size and thus the size of created defects.


Introduction
Magnesium alloys have been investigated in recent years in terms of benefits for their usage as biodegradable metal implants [1][2][3][4][5]. The biomedical magnesium alloys reach better biodegradable and absorption properties in the environment of the human body when compared to the conventional metallic implant materials such as titanium alloys, stainless steels, and cobalt alloys [2,5]. However, a major obstacle to the use of magnesium alloys as medical implants is their low corrosion resistance in vivo [6,7]. Moreover, the degradation of magnesium alloys is accompanied by alkalization and hydrogen release which may cause subcutaneous inflammation [8,9]. The surface treatment of biodegradable magnesium alloys can be an efficient way to improve its corrosion properties and limit the negative effects of the degradation on the surrounding tissues.
For its potential in biomedical applications is the group of magnesium alloys alloyed by aluminum and zinc widely studied for several years [1][2][3][4][5]. Zinc in combination with aluminum eliminates the negative influence of impurities such as iron and nickel on the alloy corrosion resistance and also improves alloys mechanical properties [10]. The presence of alloying elements such as aluminum and zinc in the magnesium alloys exhibit potential cytotoxicity of implants [11]; however, no influence of aluminum on neurodegenerative diseases has yet been proven [12,13], and any negative effect connected with the use of zinc such as genotoxicity and mutagenicity test was not observed in [14,15].
Several studies [16][17][18][19][20][21] have shown that the fluoride conversion coating is suitable for protecting the biodegradable magnesium alloys against corrosion in biological environments while the coating is acceptable for the human body. The preparation of fluoride conversion coating can be based on dipping the magnesium alloy into the HF solution [16][17][18]22,23] or the less used way based on dipping the magnesium alloy into Na [BF 4 ] molten salt [24][25][26][27].
The fluoride conversion coating prepared by dipping AZ31 or AZ61 magnesium alloys into Na [BF 4 ] molten salt consisted of two layers [24][25][26][27][28]. The layer located closer to the base material is composed of MgF 2 compound and the layer located on the top of the fluoride conversion coating is composed of Na[MgF 3 ] double salt [24]. The MgF 2 compound cytotoxicity was evaluated as satisfactory in the literature [29] while the secondary Na[MgF 3 ] double salt should be removed from the surface by boiling the treated specimens in the distilled water [25]. Na[MgF 3 ] compound should be removed from the coating due to the absence of its toxicologic information. Additionally, if part of the Na element is present in the form of NaF salt in the secondary layer, the NaF salt can cause serious health problems because of its toxicity [30].
The corrosion resistance of AZ31 magnesium alloy with the coating prepared by dipping the magnesium alloy into the Na[BF 4 ] molten salt was studied in [26]. It has been shown that the corrosion resistance of magnesium alloy was significantly improved by the coating in the environments of 1% NaCl, 1% HCl, 1% HNO 3, and 1% H 2 SO 4 solutions. However, the secondary Na[MgF 3 ] layer has not been removed from the specimen's surface before the tests. A positive effect of the fluoride conversion coating, particularly the MgF 2 layer, preparation by dipping AZ61 magnesium alloy into Na [BF 4 ] molten salt was shown with the authors in [25,28,31]. Even though the thickness and chemical composition of the fluoride conversion coating prepared by dipping specimens into HF solution for 24 h at laboratory temperature and Na [BF 4 ] molten salt for 2 h at 450 • C was the same, a higher improvement of the corrosion resistance was observed in the case of applying the fluoride conversion coating from Na [BF 4 ] molten salt [31]. Even though the authors described the coating creation mechanism in [27] and the alloy corrosion resistance improvement in [25,28], they did not explain the presence of defects on the coating surface.
The presented paper is focused on the preparation and characterization of the fluoride conversion coating in terms of coating morphology and corrosion resistance to determine the influence of the coated alloy microstructure on the coating characteristics. The fluoride conversion coating was prepared on AZ31 magnesium surface by dipping the magnesium alloy into Na [BF 4 ] molten salt at different treatment conditions. AZ31 magnesium alloy was used in this study due to its low Al content. Even though the structure and corrosion resistance of the fluoride conversion coating prepared on AZ31 magnesium alloy was studied in [24,26], the authors did not consider the potential toxicity of the secondary Na[MgF 3 ] layer and analyzed properties of the complex system (of both MgF 2 and Na[MgF 3 ] layers). The present study focuses on the characterization of only primary MgF 2 conversion coating layer creation and the description of the effect of the coated alloy. The character and morphology of the layer will be considered in terms of electrochemical corrosion characteristics in the environment of simulated body fluids, and the mechanism of its degradation. The obtained data are compared to the untreated AZ31 characteristics and discussed with results present in literature focusing on the differences in the chemical composition and microstructure of coated alloys. Based on the obtained results, the mechanism of the creation of defects present on the coating s surface will be assumed.

Experimental Material
The wrought AZ31 magnesium alloy delivered in the form of a sheet was used as a base material. The chemical composition of the experimental alloy, according to the ASTM B90/B90M [32] standard, is given in Table 1.

Characterization of the Base Material Microstructure
The microstructure of the wrought AZ31 magnesium alloy was investigated on the surface parallel to the sheet production direction. Specimens were mechanically ground by the Tegramin-25, Struers A/S, Ballerup, Germany with SiC emery papers up to 4000 grit and were subsequently polished with diamond pastes with a particle size up to 0.25 µm. During the surface preparation, isopropanol was used as a lubricant and cooling medium. The polished specimens were rinsed in isopropanol and dried in a warm stream of air.
The microstructure of the wrought alloy was revealed by the picral etchant (containing 4.2 g of picric acid, 10 cm 3 of acetic acid, 10 cm 3 of distilled water and 70 cm 3 of ethanol) and investigated by scanning electron microscopy (SEM) using Evo LS 10 microscope, Zeiss, Oberkochen, Germany Energy-dispersive X-ray spectroscopy (EDS, model OXFORDINSTRUMENTS X-MAX 80 mm 2 , Oxford Instruments plc, Abingdon, UK) was used to examine material chemical composition. The texture and grain boundaries of AZ31 were observed using electron backscattered diffraction (EBSD), using an SEM LYRA 3 XMU FEG/SEMxFIB, Tescan, Brno, Czech Republic. The grain boundaries were identified by the misorientation angle >15 • .

Preparation of the Fluoride Conversion Coating
The specimens of dimensions of 38 mm × 40 mm were cut (using the Discotom-6, Struers A/S, Ballerup, Germany) from the wrought AZ31 magnesium alloy sheet with a thickness of 2 mm. Using the Tegramin-25, Struers A/S, Ballerup, Germany the specimens were ground with SiC emery papers of successively finer grit down to 4000 grit and polished (diamond pastes 3, 1 and 0.25 µm) to achieve the mirror-like surface. The polished specimens were rinsed in isopropanol and dried in a warm stream of air. The prepared specimens were dipped into the Na[BF 4 ] molten salt tempered at temperature levels of 430 • C or 450 • C. The immersion time of individual specimens dipping in Na [BF 4 ] salt melt at the set temperatures was 0.5, 2, and 8 h. After the set treatment times, the coated specimens were lifted out from the melt. Lifted specimens were subsequently dipped into the boiling distilled water for the time necessary for the dissolution of the salt residuals and the undesired secondary coating layer from the specimens' surfaces. For more details see [25,28]. The process was finished at the time when only Mg and F elements were present on the surface of the coated specimens (determined by the EDS analysis). If the Na element was detected on the specimen's surface, the Na[MgF 3 ] secondary layer was considered to be still present on the fluoride conversion coating and the process of dissolution was not finished and the boiling was continued [27]. If the presence of Na was not confirmed, the secondary layer Na[MgF 3 ] was considered to be removed successfully.

Coatings Surface Morphologies and Cross-Section Characterization
The coating surface morphology and integrity were studied via SEM and EDS analysis using Evo LS 10 microscope, Zeiss, Oberkochen, Germany microscope. The thickness of the created conversion coating and its chemical composition were analyzed in the cross-section of the coated specimens using SEM and EDS. The three specimens prepared at the same conditions were used for the coating thickness measurement. The thickness of the coating was determined by measurement of the 10 places at each analyzed specimen.

Electrochemical Corrosion Tests
A three-electrode configuration was used to carry out potentiodynamic polarization tests (PD) and electrochemical impedance spectroscopy (EIS). The platinum electrode was used as a counter electrode, a saturated calomel electrode was used as a reference electrode (SCE, +0.242 vs. standard hydrogen electrode) and the specimen was used as a working electrode. For each measurement 250 mL of simulated body fluids (SBF) was used as a corrosive medium and the exposed area of specimens was 1 cm 2 . The measurements were performed in the SBF with the temperature kept at 37 ± 2 • C. The chemical composition of the used SBF solution is listed in Table 2. The PD and EIS measurements were carried out using VSP-300 potentiostat, BioLogic, Seyssinet-Pariset, France and obtained data were analyzed via EC-Lab ® v11.33 software, Biologic, Seyssinet-Pariset, France. The PD tests were carried out with a scan rate of 1 mVs −1 from −0.2 V to +0.2 V vs. open circuit potential (OCP). The specimens were kept in the SBF solution for 5 min of stabilization before polarization. Measured data were evaluated by the Tafel analysis to get the electrochemical corrosion characteristics. Six specimens prepared at the same coating conditions were used for the PD measurements for the statistical evaluation of the data.
The EIS measurements were performed at the OCP with a perturbation amplitude of 5 mV and a scan frequency range from 100 kHz to 10 mHz. The measurement time was set in the range from 5 min to 168 h. Three specimens prepared at the same conditions were used for the EIS measurements.
For comparison, both the measurements were performed on the untreated specimens as well.

Immersion Tests
The immersion tests of untreated and coated specimens of AZ31 magnesium alloy were performed in SBF solution at 37 ± 2 • C. The exposed surface area of specimens was 1 cm 2 . The measurement was performed in 250 mL of SBF solution and the sequence of immersion times was equal to the EIS measurements. The specimens were taken out of the SBF solution after the set immersion time, rinsed with distilled water, and dried with a stream of warm air. The specimens exposed surfaces were analyzed to reveal the signs of corrosion attack and were documented with a stereo-microscope (SM), Zeiss, Oberkochen, Germany (macro-observation) and repeatedly dipped into the SBF solution.
The surfaces and cross-sections of specimens after 168 h of immersion in SBF solution were additionally analyzed using SEM and EDS to investigate the mechanism of corrosion degradation through prepared conversion coating to the base material.

Microstructural Analysis of Base Material
The revealed microstructure and texture of the wrought AZ31 magnesium alloy in the rolling direction (marked by an arrow) are shown in Figure 1. The microstructure is char-acterized by the polyhedral grains of a solid solution of alloying elements in magnesium matrix and Al x Mn y intermetallic phase. The presence only of Al x Mn y intermetallic phase is in agreement with the literature [33,34]. The average polyhedral grain size determined using the interception method was 9 ± 2 µm. Al x Mn y intermetallic phase was detected within the grains and also on the grain boundaries. The microstructure exhibits a texture in the sheet production direction (see Figure 1b).

Fluoride Conversion Coating Characterization
The authors in [24,27] proved that the fluoride conversion coating prepared by dipping the magnesium alloy into the Na[BF 4 ] molten salt is composed of two layers. The first onethe primary layer (closer to the base material) is created by MgF 2 compound and the second one-the secondary layer, which is situated at the top of the MgF 2 layer, is composed of Na[MgF 3 ] compound [24]. Because of the possibility of a partial NaF compound creation in the layer of Na[MgF 3 ] and its neurotoxicity, [30], the layer was removed by its dissolution. Dissolution was carried out by dipping the coated specimens into the boiling distilled water as long as EDS confirmed that the fluoride conversion coating was created only of Mg and F elements in all the cases (see Section 2.3).
The surface morphology of the fluoride conversion coatings prepared at different coating conditions is shown in Figure 2. The presence of irregularity in the form of pores can be seen on prepared coatings. The EDS map analysis of the specimen prepared at 430 • C for 0.5 h (Figure 2a) revealed the defect-passing through the coating to the base material. However, the EDS analysis of the defects detected at other coatings (higher coating temperature and longer coating times (Figure 2b-f)) revealed that the defects did not pass through to the base material and the coatings can be considered as compact and covering whole the surface of the specimens. In the authors' previous study [25,28] the defects in the form of pores were also observed in the case of the coating prepared on AZ61 magnesium alloy at the same coating conditions. However, the sizes of observed defects were significantly lower when compared to the sizes of pores in the case of AZ31. In both the cases, the defects amount content was decreasing with increasing coating time.
SEM and EDS analysis of the cross-section of AZ31 specimens with fluoride MgF 2 conversion coatings revealed the presence of a compact coating with uniform thickness and homogeneous chemical composition in the whole inspected area for all the tested specimens. The EDS cross-section maps of the coatings prepared at 430 and 450 • C for 2 h of the specimens immersion in Na [BF 4 ] salt melt are shown in Figure 3. The amount ratio of chemical elements Mg and F, detected in the coating by EDS, was determined to be 1:2 which corresponds to the ratio of MgF 2 compound. EDS confirmed that the secondary Na[MgF 3 ] layer was successfully removed from the top of the coating by boiling in the distilled water. This result is in agreement with the literature [24,27], where the fluoride conversion coating was prepared on AZ61 magnesium alloy.  The change of coating thickness as a function of time is plotted in Figure 4. The coating thickness is dependent on preparation time and temperature. Higher coating thickness was measured for the coatings prepared at 450 • C when compared to the coatings prepared at 430 • C, considering the same coating time. A significant coating growth rate was observed up to 2 h of specimens immersion in Na [BF 4 ] salt melt in both cases. Longer time (8 h) of coating creation resulted in a decrease in the coating growth rate. Based on the trend of the measured data, a subsequent decrease of the coating growth rate can be assumed with increasing coating time. The fluoride conversion coating prepared on AZ61 magnesium alloy using Na[BF 4 ] molten salt [25] showed a slower increase in the coating thickness with the increasing coating time when compared to AZ31 magnesium alloy presented here. The thickness of the coating prepared here for 8 h at 430 and 450 • C is 2.0 ± 0.2 µm and 2.6 ± 0.2 µm, respectively, while the thickness of the coating prepared on AZ61 was 1.9 ± 0.2 µm and 1.5 ± 0.2 µm, respectively [25]. Additionally, we can see the opposite trend in the reached value of MgF 2 coating thickness wherein AZ61 treated for 2, and 8 h reached a lower value of MgF 2 coating thickness at a higher coating temperature (450 • C) when compared to lower coating temperature (430 • C). The creation mechanism of fluoride conversion coating by dipping the magnesium alloy into the Na[BF 4 ] was particularly described in the literature [27]. It can be assumed that the coating formation is based on the decomposition of Na[BF 4 ] compound. The Na [BF 4 ] salt decompose at 384 • C forming NaF and BF 3 compounds [35,36]. BF 3 can react with magnesium to form the MgF 2 primary layer of fluoride conversion coating [31]. By incorporation of NaF compound into the MgF 2 structure, the Na[MgF 3 ] secondary layer could be created.
F − anion is one of the smallest anions in general. Its diameter is determined to be 133 pm [32]. Therefore, the thickness of the created MgF 2 layer is directly related to the amount of F − anions diffused to the magnesium lattice. For this reason, the rate of MgF 2 layer creation could be described by the rate constant k 1 that is mainly dependent on F − anions diffusion cross the created fluoride conversion coating into the hexagonal closepacked lattice of magnesium [27]. The creation of Na[MgF 3 ] layer could be described by the rate constant k 2 . The rate constant k 2 is depended on the rate of NaF incorporation into the MgF 2 primary layer.
The diffusion process of F − anions over the 410 • C was described by kinetic function g(α) in literature [27]. The determined kinetic function is known as the Jander equation, Equation (1): where the α is a degree of conversion of MgF 2 layer of the fluoride conversion coating. The Jander equation determines the rate of the three-dimensional directional diffusion, [37], of F − anions through the growing layers of the fluoride conversion coating and magnesium lattice. At shorter times of the fluoride conversion coating creation, easier F − anions penetration through an already created layer with smaller thickness is allowed when compared to longer coating times resulting in the thicker coating layer. Consequently, it can be predictable, that k 1 will be acquiring higher values when compared to k 2 in shorter times of fluoride conversion coating preparation. Higher coating temperature also accelerates particle movement which relates to easier F − anions penetration, but also the incorporation of NaF compound to the MgF 2 primary layer is accelerated. If the rate constant k 2 reached a higher value when compared to k 1 , the rate of MgF 2 layer creation will be slower when compared to Na[MgF 3 ] layer creation. For this reason, the resulting thickness of the MgF 2 layer depends on the difference between k 1 and k 2 rate constants.
The decrease in the value of coating thickness observed in the case of AZ61 magnesium alloy treated at 450 • C for 8 h [25] could relate to k 1 and k 2 ratio. The k 2 probably reaches a higher value when compared to k 1 between the 4-8 h of fluoride conversion coating preparation. It results in a decrease/slowing down the rate of new MgF 2 layer creation. Additionally, a higher coating temperature accelerates this process.
This situation was not observed in the case of AZ31 and higher coating thickness was measured at the selected coating times. These results could be related to the microstructure of the base coated materials, where the AZ61 had a much finer microstructure (average grain size 6 ± 1 µm [25]) when compared to the microstructure of AZ31 (average grain size 9 ± 2 µm). The grain boundaries provide an easier way for F − anions penetration into the coated material volume and it can be predicted that the rate of fluoride conversion coating creation is higher in the case of their higher amount [38]. A faster diffusion of F − anions could acceleration not only MgF 2 layer creation but also the creation of Na[MgF 3 ] layer. For this reason, the difference between the k 1 − k 2 could be lower in the case of AZ61 when compared to the difference between k 1 − k 2 in the case of AZ31. This statement could explain the differences in the values of measured coating thicknesses in the case of AZ31 vs. AZ61.
The microstructure of the MgF 2 fluoride conversion coating layer is characterized by the presence of defects in the form of pores (see Figure 2). In the case of the coating temperature 430 • C and coating time 0.5 h, the EDS map analysis revealed the defect which passed across the fluoride conversion coating and reached the substrate. For this reason, the coating time of 0.5 h at 430 • C is not long enough to create the coating which fully covers the specimen's surface. The chemical analysis of the fluoride conversion coating (see Figure 2), also, did not reveal the presence of any intermetallic phases in the coating. It can indicate that the intermetallic phases present on the substrate surface visually disappear during the coating process, which can be explained as follows. The intermetallic phases of Al x Mn y on the surface of AZ31 magnesium alloy (see Figure 1) can react with Na[BF 4 ] molten salt or with products of its decomposition, BF 3 , according to Equations (2) or BF 3 + Al = AlF 3 + B.
The reaction (Equation (3)) is also controlled by diffusion of F − anions (from BF 3 ) through the growing conversion coating into the substrate including Al x Mn y intermetallic phases. Both Na 3 [AlF 6 ] and AlF 3 created compounds are fully soluble in water [40,41]. It can be assumed that the observed defects were created during the process of removal of the secondary layer in the boiling distilled water (see Section 2.3) which was accompanied by a solution of Na 3 [AlF 6 ] and AlF 3 compounds, that is, Al x Mn y phases present on the substrate surface and in the depth of the coating thickness. The illustrative description of the observed surface defect creation is shown in Figure 5.
Similarly, the microstructure analysis of the MgF 2 fluoride conversion coating prepared on AZ61 magnesium alloy at the same coating conditions revealed the presence of surface defects that did not reach the base material [25]. The chemical analysis of surface morphologies and cross-sections of coated AZ61 magnesium alloys also did not reveal the occurrence of intermetallic phases in its structure. The microstructure of the wrought AZ61 magnesium alloy contains the intermetallic phases Mg 17 Al 12 and Al x Mn y [25] with a size up to 2 µm. On the other hand, the microstructure of the wrought AZ31 magnesium alloy revealed the presence only of Al x Mn y intermetallic particles, in some cases with much bigger size, up to 10 µm (see Figure 1). The difference in the size of Al x Mn y intermetallic particles can be explained mainly by different chemical compositions of the alloys and affinity of Al to Mn, and partially also to the competitive creation of Mg 17 Al 12 phase (con-suming Al) in AZ61 and additionally also by potentially different processing conditions (casting temperature, rolling temperature, etc.) of the two alloys. The difference in the Al x Mn y intermetallic phase size can therefore significantly influence the quality of the prepared MgF 2 conversion coating. Depending on the presence and size of the intermetallic phase, the defects can be observed on the coating surface. With the increasing size of the phases the size of pores increase. If the size of the intermetallic phase is bigger than the thickness of the prepared coating (including MgF 2 and Na[MgF 3 ] layers), the pores reach the base material (see Figure 5). It is a result of the dissolution of the large compounds created due to the reaction of Al x Mn y and the molten salt (Equations (2) and (3)) during the boiling of the coated specimens in distilled water. Since the creation of the coating is controlled by diffusion, in case of smaller intermetallic phase size, only the surface pore is observed after the coated specimen boiling. As F − diffused through the intermetallic phase into the substrate, only the compounds of reactions described by Equations (2) and (3) are dissolved during boiling and the MgF 2 layer bellow the particle (with a pit after the dissoluted compound) covering the substrate is revealed after boiling. In case, the Al x Mn y intermetallic phase was below the substrate surface, it can be incorporated into the primary MgF 2 layer (depending on the coating thickness and particle size). Even though the phase will react according to Equation (3), it will remain in the coating as the primary layer is created even above the particle and protect the created compounds against dissolution during boiling of the coated specimen in the distilled water.

Potentiodynamic Polarization Tests
In Figure 6 are shown the potentiodynamic curves for untreated and coated AZ31 magnesium alloy obtained in the environment of the SBF solution at 37 ± 2 • C. The values of the corrosion potential, E corr , and corrosion current density, i corr , determined by Tafel analysis are shown in Table 3. The changes in the values of electrochemical corrosion characteristics correlate to coating conditions, especially with the used coating time. A slight shift of the corrosion potential to the more positive values and a decrease of the corrosion current density with increasing coating time was observed. The intensity of the change of the measured corrosion characteristics was comparable for both the treatment temperatures.  All polarization curves exhibit a step-change in the pitting potential, E pitt , which is attributed to the pitting attack of the coating. Pitting corrosion, typical for AZ31 magnesium alloy, [42], occurs due to the creation of galvanic cells on the intermetallic phase Al x Mn y /magnesium solid solution interface. In the case of the coated specimens, the pitting attack can be attributed to the presence of the defects.
The value of the E corr was increased with the increasing treatment time. Large measurement errors of E corr observed in the case of specimens prepared for 2 and 8 h at both treating temperatures can relate to the presence of the different number of defects with different sizes in the tested area. The obtained value of i corr indicates the corrosion rate of the tested specimens. The i corr of the AZ31 treated for 8 h was decreased significantly from 19,200 ± 1115 nA·cm −2 to 185 ± 50 nA·cm −2 (in the case of the treatment temperature 430 • C) and 281 ± 43 nA·cm −2 (in the case of the treatment temperature 450 • C). The specimens treated at 430 • C for 8 h showed the lowest value of i corr , nearly 100 times lower than that of untreated AZ31 magnesium alloy. Different surface morphology of the individual coatings could influence the real size of the exposed area. The results above demonstrate that fluoride conversion coatings reduced the corrosion tendency and corrosion rate of AZ31 magnesium alloy. In all the cases, the i corr reached higher values when compared to the AZ61 coated under the same conditions presented in [28]. The explanation could be found in the character of the coating, where more defects were observed in the case of AZ31 coated alloy surface comparing to AZ61. This also supports the fact that the defects are connected with the presence of Al x Mn y on the coated alloy surface. A larger amount of larger phase particles resulted in larger surface defects created on the coating connected with faster coating degradation. As a consequence higher values of i corr expressing the corrosion kinetics were measured for AZ31 comparing to AZ61 containing smaller Al x Mn y phase particles (i.e., smaller defects were observed on the coating surface).
Nevertheless, the trend of the obtained electrochemical characteristics is the same for AZ31 and AZ61 [28] alloys, thus the improvement of the corrosion resistance with increase of the coating time and temperature can be concluded.

Electrochemical Impedance Spectroscopy
Equivalent circuits shown in Figure 7 were used to evaluate the Nyquist plots presented in Figure 8, displaying the spectrum of obtained EIS data of the untreated and coated AZ31 magnesium alloy in the SBF solution at 37 ± 2 • C. The appropriate equivalent circuit model was selected according to the shape of the obtained Nyquist diagrams and the reactions ongoing on the specimen surface. Each model describes a different corrosion behavior of specimens in the corrosive environment. The EIS data obtained for untreated AZ31 magnesium alloy (Figure 8a) were investigated using the equivalent circuit listed in Figure 7a,b. The elements presented in these equivalent circuits can be described as follows: R s is solution resistance, the element R 1 , and CPE 1 represent the corrosion products resistance and constant phase element, respectively. The element CPE 1 can be described as the capacity formed between the corrosion environment and the corrosion product created on the material surface [43,44]. The charge transfer resistance, R 2 , and constant phase element, CPE 2 , stand for the electric double layer at the electrolyte and substrate interface [43,45]. In the case of the circuit shown in Figure 7a, the element L is inductance which represents the area fraction of partial protective film of corrosion products and R L is the resistance of inductor and the resistance of the base material. The low-frequency inductive loop (characterized by L and R L ) is presented in the Nyquist diagram due to the existence of relaxation processes of adsorbed species on the electrode (specimen) surface or partial protection of the discontinuous surface oxide film, alternatively the presence of adsorbed surface ions Mg(OH) + , Mg(OH) 2 and Mg + [44].
In the case of specimens with fluoride conversion coatings, the equivalent circuit models presented in Figure 7c,d were used to evaluate the obtained EIS data. The elements R s , R 2 , CPE 2 , L, and R L are equivalent to the elements in the case of the equivalent circuit shown in Figure 7a, described above. The elements R C and CPE C are the resistance and constant phase elements of the prepared fluoride conversion coating, respectively [46]. In Table 4 are provided the calculated values of the polarization resistance, R p , of untreated and coated AZ31 magnesium alloy. It can be seen the primary increase in values of R p while the value measured at 8 h was decreased by 40% when compared to the value measured at 4 h of the specimen exposition into the solution. Subsequently, the increase of R p up to the measurement in time of 96 h was observed. However, another drop in the value of polarization resistance in the measurement time of 196 h was detected.
The untreated AZ31 magnesium alloy indicates the primary increase in values of R p which can be related to the corrosion product creation. Created corrosion products can act as a barrier between the SBF solution and base material. However, the created layer of corrosion products does not show the long-term protection of the base material against corrosion in the SBF solution [6,7]. When the created layer of corrosion products is damaged, the corrosive environment reaches the base material which results in a decreased corrosion resistance. For this reason, the determined values of R p are mainly dependent on the degree of damage to the layer of created corrosion products in time. The used equivalent circuit describing this situation is given in Figure 7a. In the case when the inductive loop was not observed (immersion time 168 h) the equivalent circuit given in Figure 7b was used. This situation indicates the creation of corrosion products that provided effective corrosion protection to the material at this time.
Similar behavior and also similar values of R p were characteristic for the specimens coated at a time of 0.5 h, regardless of the used treatment temperature. The determined values of R p related to coating time of 0.5 h at both coating temperatures indicate, that the coating time is not enough to create the compact fluoride conversion coating. Observed defects (Figure 2) act as a preferential place for the penetration of SBF solution to the base material represented by a decrease in the value of R p .  (Figure 7) used for the EIS data analysis and R p calculation.
Specimens treated for longer coating times (2 and 8 h) showed higher R p values when compared to untreated AZ31 magnesium alloy and alloy treated for 0.5 h. The values were slightly increasing up to the measurement at 16 h and 96 h for the specimens coated at 430 and 450 • C, respectively. After these periods, the polarization resistance decrease was observed.
Coating time of 8 h resulted in a significant increase of the polarization resistance comparing to the sorter coating times. However, also, in this case, the R p decrease at the time of 24 and 96 h for the specimens coated at 430 and 450 • C was observed, respectively. Obtained values of R p for the immersion time 168 h in SBF (55 and 52 kΩ·cm 2 ) solution are more than twelve times higher when compared to untreated alloy (4.3 kΩ·cm 2 ).
If the pores reached the substrate, the slight increase in R p values at the beginning of the exposition to SBF can indicate the reaction of the substrate with the solution resulting in the creation of the corrosion products. Corrosion products could fill the pores and the subsequent penetration of the SBF solution through the coating to the base material could be slowed down or even eliminated.
Another explanation was described in [27] where it was revealed that the microstructure of fluoride conversion coating prepared by dipping AZ61 magnesium alloy into the Na[BF 4 ] salt melt is formed by columnar grains. The finer columnar grains were observed in the case of lower coating temperature (430 • C) when compared to the higher temperature (450 • C). The finer columnar grains microstructure is related to the higher amount of grain boundaries, the microchannels through which the SBF solution could penetrate to the base material resulting in the formation of the corrosion products. These corrosion products can fill the microchannels in the grain boundaries and act as a barrier between SBF solution and AZ31 magnesium alloy resulting in R p increase (see Table 3). This assumption is supported by the obtained Nyquist plots, where the inductive loops could be observed. For the investigation of the measured impedance in such cases, the electrical equivalent circuit given in Figure 7c was used. If only the capacitive loops were observed, the electrical equivalent circuit given in Figure 7d was used. In such cases, the coating provides effective protection against corrosion. Decreasing R p values or their drop-in time can be related to disruption of the created layer of corrosion products and further penetration of the SBF solution through the fluoride conversion coating.
In general, longer treatment times and higher treatment temperatures have a positive influence on the corrosion resistance of the specimens of AZ31 magnesium alloy which relates to the R p values increase. On the other hand, the shorter treatment time of 0.5 h did not show any positive effect on the corrosion resistance of the coated AZ31 when compared to the untreated AZ31 magnesium alloy. Any significant difference between the values of R p calculated for specimens coated at 430 and 450 • C was observed, comparing the same coating time and test duration.

Immersion Tests
The surfaces of specimens after the first visual detection of corrosion attack in time and the surface of specimens after 168 h of immersion in SBF solution are documented in Figure 9. In the case of the untreated AZ31 magnesium alloy, the hydrogen bubbles' evolution was observed immediately after the specimen immersion in SBF solution. The first visual evidence of corrosion attack was already observed after 5 min of sample immersion. The completely corroded surface was observed after 4 h of immersion in the corrosive environment. The surface morphology during the immersion test took the form of filiformlike corrosion. The corrosion attack observed after 168 h of the sample exposition in SBF solution is documented in Figure 9. The R p values obtained during the EIS measurement are in good agreement with the immersion test where up to 4 h of immersion the values of R p were increasing which can relate to the protection of a created layer of corrosion products on the alloy surface against corrosion. A subsequent decrease in the R p values can be related to damage of the corrosion products layer, that is, corroded surface after 4 h exposition to SBF.
Any evolution of the hydrogen bubbles was not observed after the coated AZ31 magnesium alloy specimens were immersed in the SBF solution. However, the first evidence of the corrosion attack was observed already after 1 h of the sample immersion in SBF solution in the case of the specimen coated for 0.5 h at 430 • C. The area of the corrosion attack was increasing with increasing immersion time. The morphology of the corroded area took the form of filiform-like corrosion. This type of corrosion attack is characteristic of the proliferation of the corrosion under the coating or under the created layer of corrosion products in the case of untreated AZ31 magnesium alloy [47]. The corrosion products covered the whole surface after 168 h of sample immersion in SBF solution, Figure 9.
The sample prepared at 430 • C for 2 h and the specimens prepared at 450 • C for 0.5 and 2 h showed the first evidence of the corrosion attack after 8 h of immersion in SBF solution. After 168 h of specimens immersion, the most significant corrosion attack was observed in the case of the sample with fluoride conversion coating prepared at 450 • C for 0.5 h of immersion in Na[BF 4 ] molten salt. The specimens treated for 8 h in Na [BF 4 ] salt melt showed the first evidence of the corrosion attack after 48 h of immersion in SBF solution regardless of the used coating temperature. The higher coating time resulted in higher corrosion resistance of AZ31 magnesium alloy.
The specimens prepared at 450 • C showed a much lower number of corrosion attack nuclei when compared to the lower coating temperature of 430 • C. The main aspect influencing the damage of the coating will be the present defects. The higher coating temperature was accompanied by a lower amount of uniformly distributed defects in the coating comparing to the lower coating temperature. Besides the present defects, the difference can also be attributed to the structure of MgF 2 fluoride conversion coating, [28], where the lower coating temperature results in the creation of finer columnar grains when compared to the higher coating temperature. Finer columnar grains are related to a higher amount of grains boundaries which offer more channels for the species migration from the SBF solution to AZ31 magnesium alloy surface across the coating [28].
The cross-section of the exposed surface of the untreated AZ31 magnesium alloy after 168 h exposure in SBF solution during immersion test is shown in Figure 10. The layer of corrosion products with uniform thickness was observed on the whole exposed surface. The intermetallic phase was detected in AZ31 bulk and also in the area of the corrosion products.
The cross-sections of AZ31 magnesium alloy with the fluoride conversion coatings after 168 h of immersion in SBF solution are presented in Figure 11. The SEM and EDS analysis revealed the areas of corrosion attack. The corrosion products were observed below the damaged fluoride conversion coating. The EDS analysis identified the presence of O, P, C, Cl, Na and Ca elements in the area of the corrosion attack (corrosion products). The obtained elements composition of corrosion products indicates mainly the presence of MgO and Mg(OH) 2 compounds. Other measured elements, such as Cl, P, Na, and Ca, could be a part of the corrosion products in form of phosphate (Mg 3 (PO 4 ) 2 ) and hydroxyapatite (Ca 10 (PO 4 ) 6 (OH) 2 ) created due to the reaction of AZ31 magnesium alloy with SBF solution [48]. The formation of hydroxyapatite illustrated the bioactivity of the prepared coating.

Conclusions
Fluoride conversion coating was prepared on AZ31 magnesium alloy by dipping the magnesium alloy into Na [BF 4 ] salt melt at temperatures of 430 and 450 • C for 0.5, 2, and 8 h.
The coated specimens were analyzed in terms of surface morphologies, electrochemical tests and immersion tests with a focus on the correlation of the coated alloy microstructure with the characteristics of the prepared coating. Based on the experimentally obtained data, the following conclusions can be stated:

•
The fluoride conversion coating was successfully created on AZ31 magnesium alloy surface in the case of all coating temperatures and times. • Defects in form of pores were characteristic of the coatings. The EDS analysis revealed that, in the case of the coating time of 0.5 h and coating temperature of 430 • C, the pores went through the coating to the base material. In the case of longer coating time and higher temperature, regardless of the used time, the EDS analysis did not reveal the defects pass the coating and reach the base material.

•
The increase in the coating temperature and coating time resulted in higher coatings thicknesses and better corrosion resistance of the coated material in the SBF solution.
The specimens treated for 8 h in Na[BF 4 ] at 430 and 450 • C reached comparable and the best electrochemical corrosion properties from the tested specimens. However, the immersion test revealed that a higher coating temperature of 450 • C results in the creation of uniformly distributed places with smaller sizes of corrosion attacks on the coated surface, when compared to lower coating temperature 430 • C.

•
The performed experiments support the assumption that the microstructure of the coated magnesium alloy can significantly affect corrosion resistance. The defects in the coating structure are most probably created due to the reaction of the Al x Mn y intermetallic phase with Na[BF 4 ] molten salt and/or with product of its decomposition, BF 3 compound, resulting in the creation of soluble Na 3 [AlF 6 ] and AlF 3 compounds which were removed from the coating during the removal of the secondary Na[MgF 3 ] layer.