The Effect of Crystallization and Phase Transformation on the Mechanical and Electrochemical Corrosion Properties of Ni-P Coatings

: This paper deals with the study of the crystallization and phase transformation of Ni-P coatings deposited on AZ91 magnesium alloy. Prepared samples were characterized in terms of surface morphology and elemental composition by means of scanning electron microscopy with energy-dispersive spectroscopy analysis. The results of X-ray diffraction analysis and differential scanning calorimetry suggested that increasing the phosphorus content caused Ni-P coatings to develop an amorphous character. The crystallization of Ni was observed at 150, 250, and 300 ◦ C for low-, medium- and high-phosphorus coatings, respectively. The Ni crystallite size increased with increasing temperature and decreasing P content. Conversely, the presence of the Ni 3 P phase was observed at a maximum peak of 320 ◦ C for the high-phosphorus coating, whereas the crystallization of the Ni 3 P phase shifted to higher temperatures with decreasing P content. The Ni 3 P crystallite size increased with increasing temperature and increasing P content. An increase in microhardness due to the arrangement of Ni atoms and Ni 3 P precipitation was observed. The deposition of as-deposited Ni-P coatings led to an improvement in the corrosion resistance of AZ91. However, the heat treatment of coatings resulted in a deterioration in corrosion properties due to the formation of microcracks.


Introduction
Magnesium and its alloys have unique properties such as low density, a high strength to weight ratio, and good castability, and are thus of great interest in many areas of industry, especially in the automotive industry, aviation, and electrochemistry [1][2][3]. However, poor corrosion resistance, low hardness, and low wear resistance are their main disadvantages [3,4]. One way of protecting magnesium and its alloys is the application of coatings. Electroless Ni-P coatings deposited on magnesium alloys have great potential for many industrial applications [4,5]. For example, they can improve resistance against external influences, wear, or corrosion, and can also contribute to improving the appearance of the coated part [6][7][8][9].
The properties of electroless Ni-P coatings depend on their phosphorus content and the heating process, and, thus, on their microstructure [10,11]. It was reported [6,12] that the hardness and wear resistance of Ni-P coatings decrease with increasing P content. On the other hand, corrosion resistance should increase with increasing P content, as shown in the works of Mainier [13] and Agarwala [14].
It is well known that electroless Ni-P coatings can be distinguished on the basis of whether they are low-phosphorus (LP) Ni-P coatings (approximately 1-5 wt. % of P), mediumphosphorus (MP) Ni-P coatings (6-9 wt. % of P), or high-phosphorus (HP) Ni-P coatings The samples of AZ91 alloy with deposited Ni-P coatings were prepared in the same way as reported in previous work [25]. The Ni 2+ /H 2 PO 2 − ratios in the electroless nickel bath were adjusted in order to deposit Ni-P coatings with a high, medium, and low P Coatings 2021, 11, 447 3 of 15 content. The deposition time was 4 h and the average thickness of the coatings was approximately 30 µm. The heat treatment of Ni-P coatings (for the determination of microhardness and electrochemical corrosion properties) was performed in a LAC LM07 muffle furnace (LAC, s.r.o., Židlochovice, Czech Republic) at 400 • C for 1 h.
The morphology and elemental composition of the deposited Ni-P coatings were analyzed using a Zeiss EVO LS-10 scanning electron microscope (SEM) (Carl Zeiss Ltd., Cambridge, UK) with energy-dispersive spectroscopy (EDS), an Oxford Instruments Xmax 80 mm 2 detector (Oxford Instruments plc, Abingdon, UK), and AZtec software (version 2.4, Oxford Instruments, High Wycombe, UK).
The deposited Ni-P coatings were mechanically separated from the magnesium substrates and crushed to a fine powder in an agate mortar. The phase analysis of the Ni-P powder was performed on a Pt pan using an Empyrean X-ray diffraction (XRD) spectrometer (PANalytical, Malvern, UK) with a high-temperature chamber (Anton Paar HTK 16N, Anton Paar, Graz, Austria). The parameter settings were as follows: Cu Kα radiation (λKα1 = 0.15406 nm, λKα2 = 0.15444 nm); scan range from 25 to 65 • ; scan step size, 0.013 • 2θ; time per step, 39 s; generator voltage, 40 kV; and tube current, 30 mA. X-ray diffraction patterns were recorded in the temperature range from 50 to 550 • C with a pattern record step of 50 • C. To achieve a more accurate record of phase changes, the pattern record step was set to 10 • C for the temperature range from 300 to 400 • C.
The crystallite size of the Ni and Ni 3 P phases was calculated from the full width half maximum (FWHM) according to the Scherrer equation using HighScore Plus (version 3.0.5, PANalytical B.V., Almelo, The Netherlands) software (Equation (1)): where τ is the crystallite size [Å], λ is the X-ray wavelength (nm), β 1/2 is the peak extension at half the maximum intensity (FWHM), θ is the diffraction Bragg's angle, and K is the shape factor (Scherrer constant) ranging from 0.62 to 2.08 (usually close to 1). To understand the crystallization and transformation behavior of Ni-P coatings, differential scanning calorimetry (DSC) analysis was performed. Ni-P coatings, separated and crushed to powder, were continually heated at a heating rate of 10 • C·min −1 from 50 to 500 • C using a DSC F1 204 differential scanning calorimeter (Netzsch, Selb, Germany). Samples of about 10 mg were placed into Al pans. An empty pan was used as a reference.
The microhardness of Ni-P coatings was measured using an LECO AMH55 (Leco, Saint Joseph, MO, USA) Vickers microhardness tester under an applied load of 25 g and with a dwell time of 10 s. The microhardness was measured ten times on a polished coated-sample cross-section.
The electrochemical corrosion properties of as-deposited and heat-treated Ni-P coatings were analyzed by means of a potentiodynamic polarization test in 3.5% NaCl solution using a Bio-Logic VSP-300 potentiostat/galvanostat (BioLogic, Seyssinet-Pariset, France) at room temperature. The solution was boiled before potentiodynamic measurement to remove CO 2 and oxygen. In the case of plain AZ91 magnesium alloy, the specimen surface was ground using SiC paper #1200. It was then cleaned with distilled water and isopropanol and dried with a stream of dry air. Immediately afterward, the measurement was performed. In the case of coated magnesium alloy, the samples were always cleaned before the measurement with distilled water and isopropanol and dried with a stream of dry air. The analyzed area of samples was approximately 1 cm 2 . The measurement was performed using a standard three-electrode cell: Pt gauze was used as a counter-electrode, a saturated calomel electrode (SCE) as a reference electrode, and a prepared sample as a working electrode. The potential range was set from −200 mV to +250 mV vs. open circuit potential (OCP) and the scan rate was 1 mV·s −1 . The stabilization time for the samples exposed to the corrosive environment was 10 min. Values of corrosion potential E corr and corrosion current density i corr were determined by applying the Tafel analysis.

Morphology of Deposited Ni-P Coatings
The surface morphology of Ni-P coatings deposited on AZ91 magnesium alloy is shown in Figure 1. The deposited Ni-P coatings had high-(10.8 ± 0.1 wt. % of P), medium-(7.4 ± 0.1 wt. % of P), and low-(5.5 ± 0.1 wt. % of P) phosphorus contents. All deposited coatings show a nodular morphology, which is typical for electroless Ni-P coatings [12]. As observed in Figure 1a-c, the nodule size decreases with increasing P content. As reported by Shu [26], the phosphorus has very low solubility in nickel; therefore, the reduced phosphorus tends to aggregate at the boundaries of the nickel grains during deposition. Hence, the phosphorus inhibits the growth of Ni particles and particles of Ni-P and increases the number of nucleation sites. The same dependence of nodule size on phosphorus content was also observed by Ashtiani et al. [10]. Some structural defects and associated cracks were rarely observed in MP Ni-P coatings. These microstructural defects (growths, micropores, microcracks) increased the roughness and worsened the corrosion resistance of MP Ni-P coatings.

Morphology of Deposited Ni-P Coatings
The surface morphology of Ni-P coatings deposited on AZ91 magnesium alloy is shown in Figure 1. The deposited Ni-P coatings had high-(10.8 ± 0.1 wt. % of P), medium-(7.4 ± 0.1 wt. % of P), and low-(5.5 ± 0.1 wt. % of P) phosphorus contents. All deposited coatings show a nodular morphology, which is typical for electroless Ni-P coatings [12]. As observed in Figure 1a-c, the nodule size decreases with increasing P content. As reported by Shu [26], the phosphorus has very low solubility in nickel; therefore, the reduced phosphorus tends to aggregate at the boundaries of the nickel grains during deposition. Hence, the phosphorus inhibits the growth of Ni particles and particles of Ni-P and increases the number of nucleation sites. The same dependence of nodule size on phosphorus content was also observed by Ashtiani et al. [10]. Some structural defects and associated cracks were rarely observed in MP Ni-P coatings. These microstructural defects (growths, micropores, microcracks) increased the roughness and worsened the corrosion resistance of MP Ni-P coatings. Figure 1d shows an example of a cross-section of a deposited LP Ni-P coating with an approximate thickness of 30 µm. The thickness of all the deposited coatings was uniform across each entire cross-section and exhibited no obvious defects or inhomogeneities.
During the heat treatment, the sizes of the nodules did not change. However, it was evident that the heat treatment led to the cracking of Ni-P coatings (Figure 1e-g) due to the transformation of the as-deposited Ni-P matrix and the precipitation of the Ni3P phase. The peeling or the deformation of the coating layer were not observed. The same cracks were observed in our previous research [27].

XRD Analysis
The results of the XRD analysis of as-deposited Ni-P coatings showed crystalline, microcrystalline-to-amorphous, and completely amorphous microstructures for LP, MP, and HP coatings, respectively (Figures 2-4).
The intensity of Ni {1 1 1} 2θ ≈ 44° for the LP Ni-P coating ( Figure 2) increased within the temperature range of 50-150 °C. The peak corresponding to Ni {2 0 0} for this sample was detected near the diffraction angle of 2θ ≈ 51.5° at 200 °C. The precipitation of the Ni3P phase was observed at 350 °C, where the peak corresponding to the Ni3P diffraction plane was detected at 2θ ≈ 41.7°. The distinct crystallization of the Ni and Ni3P phases occurred at 400 °C, when the broad peak of Ni transformed to a sharp crystalline peak and its intensity rapidly increased. The growth of Ni and Ni3P crystallites occurred in the temperature range from 400 to 550 °C. The crystallite coarsening of both Ni and Ni3P was obvious at 550 °C, as indicated by the increase in peak intensities ( Figure 2). The presence of NiO was evident between 400 and 550 °C, due to the oxidation of the Ni-P coating. The greatest increase in the intensity of Ni3P was recorded between 350 and 400 °C.
For the MP Ni-P coating (Figure 3), the increase in Ni {1 1 1} intensity indicated its crystallization at 250 °C. The presence of Ni3P was detected at a lower temperature (330 °C) but with a higher value of intensity (e.g., Ni3P {3 2 1} at 2θ ≈ 41.7°) compared to the LP coating. The distinct crystallization of the Ni and Ni3P phase was observed at 400 °C. The formation of NiO was simultaneously observed at 400 °C at 2θ ≈ 63°. The intensity of Ni and Ni3P increased with increasing temperature due to the increase in the crystallite size. From the XRD patterns (Figure 3), it is possible to detect peaks at 2θ ≈ 32°, 34°, and 36.5° corresponding to the primary α-Mg phase. The α-Mg phase was also detected in the works of Gu [28] and Hu [29]. Its presence can be explained by the separation of Mg alloy from the Ni-P coating during the XRD sample preparation.  Figure 1d shows an example of a cross-section of a deposited LP Ni-P coating with an approximate thickness of 30 µm. The thickness of all the deposited coatings was uniform across each entire cross-section and exhibited no obvious defects or inhomogeneities.
During the heat treatment, the sizes of the nodules did not change. However, it was evident that the heat treatment led to the cracking of Ni-P coatings (Figure 1e-g) due to the transformation of the as-deposited Ni-P matrix and the precipitation of the Ni 3 P phase. The peeling or the deformation of the coating layer were not observed. The same cracks were observed in our previous research [27].

XRD Analysis
The results of the XRD analysis of as-deposited Ni-P coatings showed crystalline, microcrystalline-to-amorphous, and completely amorphous microstructures for LP, MP, and HP coatings, respectively (Figures 2-4).
The intensity of Ni {1 1 1} 2θ ≈ 44 • for the LP Ni-P coating ( Figure 2) increased within the temperature range of 50-150 • C. The peak corresponding to Ni {2 0 0} for this sample was detected near the diffraction angle of 2θ ≈ 51.5 • at 200 • C. The precipitation of the Ni 3 P phase was observed at 350 • C, where the peak corresponding to the Ni 3 P diffraction plane was detected at 2θ ≈ 41.7 • . The distinct crystallization of the Ni and Ni 3 P phases occurred at 400 • C, when the broad peak of Ni transformed to a sharp crystalline peak and its intensity rapidly increased. The growth of Ni and Ni 3 P crystallites occurred in the temperature range from 400 to 550 • C. The crystallite coarsening of both Ni and Ni 3 P was obvious at 550 • C, as indicated by the increase in peak intensities ( Figure 2). The presence of NiO was evident between 400 and 550 • C, due to the oxidation of the Ni-P coating. The greatest increase in the intensity of Ni 3 P was recorded between 350 and 400 • C.      As shown in Figure 4, a broad peak 2θ ≈ 40° to 52° at 50 °C indicates the HP Ni-P coating to have a completely amorphous microstructure. Ni crystallization was observed at a lower temperature (300 °C) compared to the Ni-P coatings with lower phosphorus content. However, the onset of precipitation of the Ni3P phase was observed at 320 °C. For LP and MP coatings, a significant increase in the crystallite size of Ni and Ni3P occurred between 400 and 550 °C. Nickel oxide NiO was again detected between 400 and 550 °C ( Figure 4).
From the measured data, it is evident that the temperature of Ni crystallization increased and the temperature of Ni3P precipitation decreased with increasing P content in the Ni-P coatings ( Figure 5).  For the MP Ni-P coating (Figure 3), the increase in Ni {1 1 1} intensity indicated its crystallization at 250 • C. The presence of Ni 3 P was detected at a lower temperature (330 • C) but with a higher value of intensity (e.g., Ni 3 P {3 2 1} at 2θ ≈ 41.7 • ) compared to the LP coating. The distinct crystallization of the Ni and Ni 3 P phase was observed at 400 • C. The formation of NiO was simultaneously observed at 400 • C at 2θ ≈ 63 • . The intensity of Ni and Ni 3 P increased with increasing temperature due to the increase in the crystallite size. From the XRD patterns ( Figure 3), it is possible to detect peaks at 2θ ≈ 32 • , 34 • , and 36.5 • corresponding to the primary α-Mg phase. The α-Mg phase was also detected in the works of Gu [28] and Hu [29]. Its presence can be explained by the separation of Mg alloy from the Ni-P coating during the XRD sample preparation.
As shown in Figure 4, a broad peak 2θ ≈ 40 • to 52 • at 50 • C indicates the HP Ni-P coating to have a completely amorphous microstructure. Ni crystallization was observed at a lower temperature (300 • C) compared to the Ni-P coatings with lower phosphorus content. However, the onset of precipitation of the Ni 3 P phase was observed at 320 • C. For LP and MP coatings, a significant increase in the crystallite size of Ni and Ni 3 P occurred between 400 and 550 • C. Nickel oxide NiO was again detected between 400 and 550 • C ( Figure 4).
From the measured data, it is evident that the temperature of Ni crystallization increased and the temperature of Ni 3 P precipitation decreased with increasing P content in the Ni-P coatings ( Figure 5). content. However, the onset of precipitation of the Ni3P phase was observed at 320 °C. For LP and MP coatings, a significant increase in the crystallite size of Ni and Ni3P occurred between 400 and 550 °C. Nickel oxide NiO was again detected between 400 and 550 °C ( Figure 4).
From the measured data, it is evident that the temperature of Ni crystallization increased and the temperature of Ni3P precipitation decreased with increasing P content in the Ni-P coatings ( Figure 5).  The shift of Ni crystallization to higher temperatures is caused by the microstructure of the as-deposited Ni-P coatings. LP Ni-P coatings show a crystalline microstructure and the phosphorus atoms present do not cause such a distortion of the Ni lattice [15,16]. Therefore, there is no need for a large amount of energy to arrange Ni atoms into crystalline Ni crystallites, as in the case of Ni-P coatings with higher P content, where the microstructure is more distorted or amorphous [30]. Hence, the coatings with a higher P content required more energy for atoms to rearrange themselves and form Ni clusters [15,30,31]. The lower temperature of the precipitation of Ni 3 P can be explained by the presence of higher P content in the microstructure [32]. For HP coatings, there is much more frequent interaction between the free phosphorus atom and three atoms of nickel to form the Ni 3 P phase, when compared to MP and LP coatings [11,15,16].
Some authors [16,30,33] reported that the microstructure forms and new phases occur after the heating of electroless Ni-P coatings. Hur [34] reported that LP Ni-P coatings with crystalline or microcrystalline microstructure transform directly into a mixture of crystalline nickel matrix and stable Ni 3 P phase. Coatings with a higher phosphorus content first transform into a mixture of crystalline Ni and metastable Ni 12 P 5 and Ni 5 P 2 phases at lower temperatures (200-300 • C). Then, these metastable phases pass to Ni 3 P when the temperature gradually rises. The stable Ni 3 P phase is only apparent over a temperature of 400 • C [16,35].
However, Figures 2-4 show that there was no formation of metastable phases (Ni 12 P 5 and Ni 5 P 2 ) in the temperature range of 50-350 • C, and only the crystallization of Ni and Ni 3 P was observed.
The dependence describing Ni crystallite size on the temperature of individual Ni-P coatings is displayed in Figure 6a. As seen from Figure 6a, the Ni crystallization temperature differs depending on the P content, i.e., 150 • C for LP, 250 • C for MP, and 300 • C for HP. A significant increase in Ni crystallite size was observed above 300 • C for all samples. After deposition, the Ni {1 1 1} crystallite size was determined by the Debye-Scherrer method and found to be 38, 23, and 21 Å for LP, MP, and HP, respectively. The Ni crystallite size during the heating process up to 550 • C grew to values of 595, 382, and 287 Å for LP, MP, and HP, respectively (Figure 6a). The Ni crystallite size in MP and HP coatings was lower than the value determined for the LP coating, which is in agreement with findings presented elsewhere [6,19,30]. As mentioned in the literature [11,26], elemental phosphorus has a very low solubility in nickel; it inhibits the Ni grain growth and increases the number of Ni nuclei. It can be assumed that during the heat treatment up to ~300 °C, the growth of Ni crystallite is inhibited due to the presence of P in Ni crystallites (Figure 6a). In the temperature range of ~300-400 °C, a significant increase of Ni crystallite occurs due to the migration and rearrangement of P atoms from Ni crystallite, and the formation of Ni3P phase. The increase of Ni crystallites size was observed by XRD analysis, which can be explained by the decrease of P in Ni crystallites.
Kumar [22] assumes that Ni crystallites are formed from an amorphous Ni-P matrix, and the Ni3P phase can formed from both the Ni-P matrix, and from the Ni crystallites formed. The presence of phosphorus in Ni-P coatings increases the number of Ni nuclei. This also results in a slower growth of a larger number of the Ni3P crystallites with temperature (Figure 6b).

DSC Analysis
All DSC curves ( Figure 7) contain a prominent exothermic peak corresponding to Ni3P transformation from the Ni-P matrix [20,36]. DSC analysis confirmed that the temperature of Ni3P transformation shifts to lower values with increasing P content in the coating and more energy is released (Figure 7a-c). The DSC curve corresponding to the LP Ni-P coating (Figure 7a) shows that Ni3P transformation reached its maximum at 398 °C and the energy evolved was calculated to be 347.4 mJ·mol −1 . DSC peaks for MP and HP Ni-P coatings (Figure 7b,c) were observed at temperatures of 389 and 355 °C, with corresponding evolved energies of 390.6 and 507.9 mJ·mol −1 , respectively. The temperature determined correlates with the findings from XRD (Figure 2). The results also show that with increasing P content in the Ni-P coating, a smaller size of Ni crystallite was achieved. This is related to Ni {1 1 1} diffraction reflections in XRD spectra ( Figure 6).
From Figure 6b it is evident that the precipitation of Ni 3 P occurs at lower temperatures with increasing P content. In the case of HP coatings, precipitation occurred at 320 • C, whereas precipitation occurred at 350 and 330 • C for LP and MP coatings, respectively. The presence of this phase was not detected up to these temperatures. The temperature dependence of Ni 3 P crystallite size was almost linear, whereas the growth rate of the Ni 3 P phase was the highest for LP Ni-P coatings and the lowest for HP Ni-P coatings. The Ni 3 P crystallite sizes {3 2 1} at 550 • C were 441, 256, and 179 Å for LP, MP and HP coatings, respectively. Figure 6b also shows that a comparable Ni 3 P crystallite size (~250 Å) occurred in the narrow temperature range from 390 to 400 • C.
As mentioned in the literature [11,26], elemental phosphorus has a very low solubility in nickel; it inhibits the Ni grain growth and increases the number of Ni nuclei. It can be assumed that during the heat treatment up to~300 • C, the growth of Ni crystallite is inhibited due to the presence of P in Ni crystallites (Figure 6a). In the temperature range of~300-400 • C, a significant increase of Ni crystallite occurs due to the migration and rearrangement of P atoms from Ni crystallite, and the formation of Ni 3 P phase. The increase of Ni crystallites size was observed by XRD analysis, which can be explained by the decrease of P in Ni crystallites.
Kumar [22] assumes that Ni crystallites are formed from an amorphous Ni-P matrix, and the Ni 3 P phase can formed from both the Ni-P matrix, and from the Ni crystallites formed. The presence of phosphorus in Ni-P coatings increases the number of Ni nuclei. This also results in a slower growth of a larger number of the Ni 3 P crystallites with temperature ( Figure 6b).

DSC Analysis
All DSC curves (Figure 7) contain a prominent exothermic peak corresponding to Ni 3 P transformation from the Ni-P matrix [20,36]. DSC analysis confirmed that the temperature of Ni 3 P transformation shifts to lower values with increasing P content in the coating and more energy is released (Figure 7a-c). The DSC curve corresponding to the LP Ni-P coating (Figure 7a) shows that Ni 3 P transformation reached its maximum at 398 • C and the energy evolved was calculated to be 347.4 mJ·mol −1 . DSC peaks for MP and HP Ni-P coatings (Figure 7b Before Ni3P transformation (50-300 °C), all deposited coatings showed other less pronounced peaks, with energies much lower compared to the major exothermic peak (Ni3P transformation). The DSC curve corresponding to the LP Ni-P coating (Figure 7a) showed only one peak before Ni3P transformation at ~138 °C. According to [20,24,30], the observed peak corresponds to the release of strain induced in Ni-P coatings. In the case of LP Ni-P coatings, the presence of only one minor peak suggests that the release of the strain and the crystallization of Ni take place simultaneously. Martyak and Drake [20] reported that the strain reduction is associated with microstructural changes in the temperature range of 100-200 °C. The analysis of the MP Ni-P coating revealed the presence of two peaks before the major exothermic peak (Ni3P transformation) (Figure 7b). The first shoulder peak was observed at ~134 °C and the second one at ~202 °C. The DSC curve of the HP Ni-P coating also showed two minor peaks. The first one was detected at ~115 °C and the second one at ~270 °C (Figure 7c). The first peak at a lower temperature can be related to the release and reduction of the strain in Ni-P coating, as in the case of the LP coating [20].
According to [30,37], the reduction of the strain introduced into the coating is a result of short-range atomic movements. The formation of microcracks in the Ni-P coating occurs as a result of releasing the strain and microstructural changes [12,16]. The second mean peak at higher temperatures (202 and 270 °C; Figure 7b,c) corresponds to the XRD analysis ( Figure 5) and can be attributed to Ni crystallization.
Mallory [6] found that heat-treated amorphous Ni-P coatings are crystallized above 300 °C. Intermediary phases with differential coherence and different interatomic distances compared to the α Ni phase are formed during the heat-treating process [6,21]. With increasing heat-treatment time and temperature, these phases become larger. Vafaei- Before Ni 3 P transformation (50-300 • C), all deposited coatings showed other less pronounced peaks, with energies much lower compared to the major exothermic peak (Ni 3 P transformation). The DSC curve corresponding to the LP Ni-P coating (Figure 7a) showed only one peak before Ni 3 P transformation at~138 • C. According to [20,24,30], the observed peak corresponds to the release of strain induced in Ni-P coatings. In the case of LP Ni-P coatings, the presence of only one minor peak suggests that the release of the strain and the crystallization of Ni take place simultaneously. Martyak and Drake [20] reported that the strain reduction is associated with microstructural changes in the temperature range of 100-200 • C. The analysis of the MP Ni-P coating revealed the presence of two peaks before the major exothermic peak (Ni 3 P transformation) (Figure 7b). The first shoulder peak was observed at~134 • C and the second one at~202 • C. The DSC curve of the HP Ni-P coating also showed two minor peaks. The first one was detected at~115 • C and the second one at 270 • C (Figure 7c). The first peak at a lower temperature can be related to the release and reduction of the strain in Ni-P coating, as in the case of the LP coating [20].
According to [30,37], the reduction of the strain introduced into the coating is a result of short-range atomic movements. The formation of microcracks in the Ni-P coating occurs as a result of releasing the strain and microstructural changes [12,16]. The second mean peak at higher temperatures (202 and 270 • C; Figure 7b,c) corresponds to the XRD analysis ( Figure 5) and can be attributed to Ni crystallization.
Mallory [6] found that heat-treated amorphous Ni-P coatings are crystallized above 300 • C. Intermediary phases with differential coherence and different interatomic distances compared to the α Ni phase are formed during the heat-treating process [6,21]. With increasing heat-treatment time and temperature, these phases become larger. Vafaei-Makhsoos [33] and Wojewoda-Budka [37] suggest that these mean peaks may be associated with the formation of the metastable Ni 5 P 2 phase. Keong [30] and Agarwala [16] also suggest the existence of an Ni 5 P 2 and Ni 2 P phase. All these metastable phases transform into the Ni 3 P stable phase under higher temperatures above 300 • C. However, the presence of these metastable phases was not detected by XRD in this work. This can be attributed to the different composition of the nickel bath, different temperature modes during the heat treatment, or the use of a different substrate, etc. All Ni-P coatings showed exothermic oxidation, and the formation of NiO occurred at temperatures above 490 • C. Figure 8 shows the microhardness of the Ni-P coatings as a function of heat-treatment temperature. The dependence of the microhardness on the treatment temperature has a very similar character for all Ni-P coatings and has an almost sigmoidal shape. The microhardness always grows to a maximum value at 400 • C and then slightly decreases. The highest microhardness achieved at 400 • C was also confirmed in several works [9,38,39]. For the as-deposited coatings, the highest value of the microhardness was measured for the LP coating, and the value decreased with the increasing content of P in the coating. The slight increase in the microhardness with increasing temperature of the treatment (up to 250 • C) can be attributed to the movement and arrangement of Ni atoms over short distances and Ni-P matrix crystallization [40]. This fact also correlates with the observation of Ni crystallite size (Figure 6a). A sharp increase in the microhardness was detected at treatment temperatures between 300 and 400 • C. This sharp increase is associated with the precipitation of the bcc Ni 3 P phase [20]. This was consistent with the results shown in Figure 6b. The presence of this phase predetermines the microhardness of the coating [12]. Even though NiO formed above a heat-treatment temperature of 400 • C and contributed to an increase in the microhardness of the Ni-P coatings, a slight decrease in microhardness is evident in the case of higher heat-treatment temperatures, Figure 8. This can be due to Ni 3 P precipitate particles coarsening [27], leading to a decrease in microhardness. The highest values of microhardness were determined for the LP Ni-P coating and the lowest for the HP coating when comparing coatings treated at the same temperature ( Figure 8). Makhsoos [33] and Wojewoda-Budka [37] suggest that these mean peaks may be associated with the formation of the metastable Ni5P2 phase. Keong [30] and Agarwala [16] also suggest the existence of an Ni5P2 and Ni2P phase. All these metastable phases transform into the Ni3P stable phase under higher temperatures above 300 °C. However, the presence of these metastable phases was not detected by XRD in this work. This can be attributed to the different composition of the nickel bath, different temperature modes during the heat treatment, or the use of a different substrate, etc. All Ni-P coatings showed exothermic oxidation, and the formation of NiO occurred at temperatures above 490 °C. Figure 8 shows the microhardness of the Ni-P coatings as a function of heat-treatment temperature. The dependence of the microhardness on the treatment temperature has a very similar character for all Ni-P coatings and has an almost sigmoidal shape. The microhardness always grows to a maximum value at 400 °C and then slightly decreases. The highest microhardness achieved at 400 °C was also confirmed in several works [9,38,39]. For the as-deposited coatings, the highest value of the microhardness was measured for the LP coating, and the value decreased with the increasing content of P in the coating. The slight increase in the microhardness with increasing temperature of the treatment (up to 250 °C) can be attributed to the movement and arrangement of Ni atoms over short distances and Ni-P matrix crystallization [40]. This fact also correlates with the observation of Ni crystallite size (Figure 6a). A sharp increase in the microhardness was detected at treatment temperatures between 300 and 400 °C. This sharp increase is associated with the precipitation of the bcc Ni3P phase [20]. This was consistent with the results shown in Figure 6b. The presence of this phase predetermines the microhardness of the coating [12]. Even though NiO formed above a heat-treatment temperature of 400 °C and contributed to an increase in the microhardness of the Ni-P coatings, a slight decrease in microhardness is evident in the case of higher heat-treatment temperatures, Figure 8. This can be due to Ni3P precipitate particles coarsening [27], leading to a decrease in microhardness.

Microhardness Measurement
The highest values of microhardness were determined for the LP Ni-P coating and the lowest for the HP coating when comparing coatings treated at the same temperature (Figure 8).

Characterization of Electrochemical Corrosion Properties
The results of potentiodynamic polarization indicate an association between the microstructure of the Ni-P coatings and their electrochemical corrosion behavior in a 3.5% NaCl solution (Figure 9). In this work, of the measured samples, a plain AZ91 magnesium

Characterization of Electrochemical Corrosion Properties
The results of potentiodynamic polarization indicate an association between the microstructure of the Ni-P coatings and their electrochemical corrosion behavior in a 3.5% NaCl solution (Figure 9). In this work, of the measured samples, a plain AZ91 magnesium substrate achieved the highest corrosion current density i corr and the lowest corrosion potential E corr ( Table 2). The deposition of Ni-P coatings resulted in a decrease in i corr and an increase in E corr . As-deposited HP Ni-P coatings showed the best corrosion resistance of all the coatings (Table 2). According to published research [39], this is due to the increasing proportion of amorphous material in the Ni-P matrix. These results correlate with results published in other works [39,40]. The LP Ni-P coating achieved lower E corr and higher i corr values compared to the HP coating. The difference can be explained by the more ordered microstructure with a lower proportion of the amorphous phase in the case of the LP coating [15]. In terms of electrochemical corrosion properties, MP Ni-P and HP Ni-P coatings appeared to be the best. However, the HP Ni-P coating reached a slightly lower i corr value. The enhanced corrosion resistance of both samples is related to the absence of structural defects, and in the case of HP Ni-P also due to the amorphous structure. The inconsistent results of potentiodynamic measurements for the MP coating can be explained by the occurrence of comet-like structural defects on the surface of MP Ni-P coatings created during the deposition (Figure 10). We suppose that this phenomenon is associated with the inappropriate ratio of stabilizer and Ni 2+/ H2PO 2 − mixture in electroless Ni-P baths [12]. Insufficient concentration of the stabilizer in the bath could lead to the formation of undesirable precipitates [12,41]. These precipitates might be incorporated into the Ni-P coating or might adhere to the surface of the substrate during the deposition [42]. As a result, the local growth of the coating was affected, and the defects appeared. The released hydrogen gas in the immediate vicinity of the defect could interact with the surface of the coating, and could form a temporary barrier for the deposition of Ni and P on the surface. Thus, the secondary defects were formed in the direction of hydrogen gas evolution, and appeared to be the comet tail. substrate achieved the highest corrosion current density icorr and the lowest corrosion potential Ecorr ( Table 2). The deposition of Ni-P coatings resulted in a decrease in icorr and an increase in Ecorr. As-deposited HP Ni-P coatings showed the best corrosion resistance of all the coatings (Table 2). According to published research [39], this is due to the increasing proportion of amorphous material in the Ni-P matrix. These results correlate with results published in other works [39,40]. The LP Ni-P coating achieved lower Ecorr and higher icorr values compared to the HP coating. The difference can be explained by the more ordered microstructure with a lower proportion of the amorphous phase in the case of the LP coating [15]. In terms of electrochemical corrosion properties, MP Ni-P and HP Ni-P coatings appeared to be the best. However, the HP Ni-P coating reached a slightly lower icorr value. The enhanced corrosion resistance of both samples is related to the absence of structural defects, and in the case of HP Ni-P also due to the amorphous structure. The inconsistent results of potentiodynamic measurements for the MP coating can be explained by the occurrence of comet-like structural defects on the surface of MP Ni-P coatings created during the deposition ( Figure 10). We suppose that this phenomenon is associated with the inappropriate ratio of stabilizer and Ni 2+/ H2PO2 − mixture in electroless Ni-P baths [12]. Insufficient concentration of the stabilizer in the bath could lead to the formation of undesirable precipitates [12,41]. These precipitates might be incorporated into the Ni-P coating or might adhere to the surface of the substrate during the deposition [42]. As a result, the local growth of the coating was affected, and the defects appeared. The released hydrogen gas in the immediate vicinity of the defect could interact with the surface of the coating, and could form a temporary barrier for the deposition of Ni and P on the surface. Thus, the secondary defects were formed in the direction of hydrogen gas evolution, and appeared to be the comet tail.    These structural breakdowns increased the roughness of the MP Ni-P coating, as they contain a higher proportion of microstructural defects (micropores, microcracks) in their volume and around them (Figure 10), as observed in other works [6,41]. The corrosion environment can easily pass through these micropores and microcracks to the Mg substrate, and then galvanic corrosion can occur. Hence, the Ni-P coating does not completely fulfill its protective function.  Figure 9 also shows that the Ecorr of all the heat-treated Ni-P coatings was shifted to more negative values and that the icorr values significantly increased compared to the untreated as-deposited coatings. This is because the heat treatment led to the evolution of strain [12,15,16], Ni crystallization, and the formation of Ni3P precipitates. All these microstructural changes resulted in the shrinkage of the Ni-P coatings, which caused the formation of a microcrack network [43]. The corrosive environment containing NaCl passed through to the Mg substrate/Ni-P coating interface. This could result in the galvanic corrosion of the less noble Mg substrate, the formation of Mg(OH)2, and the peeling of the Ni-P coating from the substrate [44]. The values of Ecorr of samples with coatings after heat treatment were slightly more positive in comparison with the substrate; however, the values of icorr were significantly higher, which, from a kinetic point of view, means significantly lower corrosion resistance of coated and heat-treated samples when compared to untreated surfaces. The acceleration of the corrosion process is associated with the presence of a coating with higher resistance to corrosion compared to the substrate.

Conclusions
According to the analyses performed, the structural changes corresponding to the P content in Ni-P coatings and their effect on the properties of coated AZ91 magnesium alloy can be summarized as follows: -Increasing P content led to morphological changes-specifically, a decrease in nodule size. -Increasing P content in Ni-P coatings resulted in a decrease in Ni crystallite size at the same temperature. - The Ni3P precipitation temperature decreased with increasing P content in Ni-P coatings. - The growth rate of the Ni3P phase was the highest for LP Ni-P coatings, the growth rate decreasing with increasing P content. A comparable Ni3P crystallite size (~250 Å) occurred in the narrow temperature range of 390 to 400° C. - The evolved energy associated with Ni3P precipitation decreased with decreasing P content. These structural breakdowns increased the roughness of the MP Ni-P coating, as they contain a higher proportion of microstructural defects (micropores, microcracks) in their volume and around them (Figure 10), as observed in other works [6,41]. The corrosion environment can easily pass through these micropores and microcracks to the Mg substrate, and then galvanic corrosion can occur. Hence, the Ni-P coating does not completely fulfill its protective function. Figure 9 also shows that the E corr of all the heat-treated Ni-P coatings was shifted to more negative values and that the i corr values significantly increased compared to the untreated as-deposited coatings. This is because the heat treatment led to the evolution of strain [12,15,16], Ni crystallization, and the formation of Ni 3 P precipitates. All these microstructural changes resulted in the shrinkage of the Ni-P coatings, which caused the formation of a microcrack network [43]. The corrosive environment containing NaCl passed through to the Mg substrate/Ni-P coating interface. This could result in the galvanic corrosion of the less noble Mg substrate, the formation of Mg(OH) 2 , and the peeling of the Ni-P coating from the substrate [44]. The values of E corr of samples with coatings after heat treatment were slightly more positive in comparison with the substrate; however, the values of i corr were significantly higher, which, from a kinetic point of view, means significantly lower corrosion resistance of coated and heat-treated samples when compared to untreated surfaces. The acceleration of the corrosion process is associated with the presence of a coating with higher resistance to corrosion compared to the substrate.

Conclusions
According to the analyses performed, the structural changes corresponding to the P content in Ni-P coatings and their effect on the properties of coated AZ91 magnesium alloy can be summarized as follows: -Increasing P content led to morphological changes-specifically, a decrease in nodule size. -Increasing P content in Ni-P coatings resulted in a decrease in Ni crystallite size at the same temperature. - The Ni 3 P precipitation temperature decreased with increasing P content in Ni-P coatings. - The growth rate of the Ni 3 P phase was the highest for LP Ni-P coatings, the growth rate decreasing with increasing P content. A comparable Ni 3 P crystallite size (~250 Å) occurred in the narrow temperature range of 390 to 400 • C. - The evolved energy associated with Ni 3 P precipitation decreased with decreasing P content. - The microhardness of all deposited Ni-P coatings increased with increasing temperature up to a maximum at 400 • C. A higher temperature of heat treatment led to a decrease in the microhardness due to the coarsening of Ni 3 P precipitate. -Potentiodynamic measurements in 3.5% NaCl showed that as-deposited Ni-P coatings improved the corrosion properties, except for MP Ni-P coatings due to structural defects on the coating surface. The heat treatment of Ni-P coatings resulted in a significant decrease in electrochemical corrosion properties because of the formation of microcracks associated with shrinkage of the coatings. Informed Consent Statement: Not applicable.

Data Availability Statement:
The data presented in this study are available on request from the corresponding author.