1. Introduction
The rapid development of micro-electromechanical systems (MEMSs) has driven the demand for the integration of magnetic materials, particularly in miniaturized, high-performance components. MEMS technology, which includes micro-sensors, actuators, and other devices, is now essential in fields such as biomedicine, telecommunications, and data storage. By incorporating micro-magnets into MEMSs, researchers can leverage the unique properties of magnetic materials at the microscale to enhance device functionality.
Recent advances in micro-magnet fabrication have introduced various techniques, including powder-based methods, physical vapor deposition (PVD), and electrochemical deposition, each offering unique advantages and challenges. Powder-based techniques, such as bonding, screen printing, and additive manufacturing, can create complex shapes but often lack the precision required for microscale applications [
1,
2,
3]. On the other hand, PVD methods such as sputtering, thermal evaporation, and pulsed laser deposition produce high-quality magnetic thin films but are limited by high costs and slow processing times [
4,
5,
6].
Localized electrochemical deposition (LECD), introduced by Madden and Hunter in 1996 [
7], has shown great promise for micro-magnet fabrication. LECD employs a sharp-tipped electrode in an electrolyte solution, where a voltage induces localized deposition. This technique offers precise control over the material’s shape and size. Additionally, advancements such as ultrasound-assisted LECD and electrolyte-column LECD have further improved deposition rates and pattern complexity [
8,
9]. However, despite these improvements, LECD and other traditional methods struggle to efficiently optimize multiple parameters, which are critical to achieving uniform and high-performance microstructures.
In recent years, machine learning has proven to be a powerful tool in materials science, particularly for optimizing complex fabrication processes [
10,
11,
12]. Researchers have successfully applied machine learning to electroplating and deposition techniques, improving accuracy, efficiency, and control. For instance, Li et al. applied the Least Absolute Shrinkage and Selection Operator (LASSO) regression technique to analyze the effects of nano-clay content, foaming temperature, and foaming time on the density and cell size of PVC matrix foam [
13]. Katirci and Danaci used NSGA-II and machine learning algorithms to optimize nickel electroplating, resulting in significant improvements in coating quality [
14]. Frydrych et al. applied LSTM networks to optimize crystal plasticity parameters in electrodeposited copper, demonstrating accurate prediction and control under cyclic deformation [
15]. Similarly, Katirci et al. used the XGBoost algorithm to optimize thickness and nickel content in Zn-Ni alloy electroplating [
16]. These successes highlight the potential of machine learning to address complex optimization problems in deposition processes. However, its application to the electrochemical deposition of magnetic materials, such as Co-Pt, remains relatively unexplored.
Moreover, machine learning has significantly impacted additive manufacturing by optimizing 3D printing parameters, leading to improved product quality and process efficiency [
17,
18,
19]. Wang et al. employed machine learning to predict surface roughness in laser additive manufacturing, allowing for real-time adjustments and enhanced surface quality [
20]. Scime and Beuth developed a machine learning framework for real-time anomaly detection in laser powder bed fusion, improving the reliability of printed components [
21]. These studies demonstrate the effectiveness of machine learning in overcoming the intricate challenges associated with additive manufacturing processes.
Current micro-magnet fabrication methods often do not allow for film-free shaping, with most micro-magnets having thicknesses significantly less than 100 µm or greater than 1 mm [
22,
23]. PVD techniques, while effective for thin films, are costly and slow, with limited shape control [
24,
25]. Additionally, electrochemical deposition combined with photoresist methods cannot produce shapes with different top and bottom cross-sections, adding to the cost and time of the process [
26,
27]. The use of liquid electrolytes in many electrochemical deposition techniques poses further challenges, including difficulty in control and leakage issues, limiting their application in three-dimensional spaces [
28].
Despite the advancements in micro-magnet fabrication, achieving consistent and high-quality Co-Pt microstructures through electrochemical deposition remains a significant challenge. Variations in deposition rates, inconsistent layer thickness, and the complex interplay of parameters such as Co-Pt ion ratio, solution pH, nozzle scanning speed, and deposition voltage lead to inconsistencies in magnetic properties and performance. Traditional methods often rely on trial-and-error approaches to optimize these parameters, which is both time-consuming and inefficient. Additionally, the lack of real-time control mechanisms for fine-tuning these parameters exacerbates the issue, resulting in nonuniform deposition and reduced functionality of the final product. To overcome these challenges, a data-driven, optimized approach is necessary to ensure precise control over the deposition process, leading to more uniform and high-performance Co-Pt microstructures.
In this work, we propose a novel method that integrates machine learning algorithms with electrochemical deposition to optimize the fabrication of Co-Pt magnetic alloys. Our approach not only enhances the uniformity of the microstructures but also improves the magnetic properties, such as coercivity and remanence, by optimizing key deposition parameters through data-driven methods. This system provides precise control over the shape and size of micro-magnets, showing significant potential for MEMS applications. By incorporating machine learning into the LECD process, we aim to create a versatile and high-performance platform for fabricating Co-Pt microstructures, ultimately bridging the gap between traditional deposition techniques and modern, data-driven manufacturing solutions.
2. Methodology
2.1. Electrochemical Deposition Theory
The electrochemical deposition method described in this paper relies on charge transfer reactions at the electrode–solution interface. A regulated DC power supply, wires, anodes, cathodes, and electrolytes form a complete circuit. The electrochemical reactions are governed by thermodynamics and kinetics, which influence the rate and direction of reactions.
Thermodynamics of Electrochemical Deposition
The thermodynamics of electrochemical reactions are described by the Nernst equation, which relates the electrode potential to the concentrations of the reactants and products:
In this equation, E represents the electrode potential, is the standard electrode potential, R is the universal gas constant, T is the temperature in Kelvin, n is the number of electrons transferred, and F is the Faraday constant. The concentrations of the oxidized and reduced species are represented by [Ox] and [Red], respectively.
For this study, the primary reactions involve the reduction of cobalt and platinum ions:
The equilibrium potentials for these reactions are approximately E∘Co = −0.277 V and E∘Pt = 1.2 V.
The kinetics of electrochemical reactions are modeled using the Butler–Volmer equation, which relates the current density
j to the overpotential η:
Here, j0 denotes the exchange current density, αa and αc are the anodic and cathodic transfer coefficients, respectively, and η is the overpotential defined as η = E − Eeq, where Eeq is the equilibrium potential.
At high overpotentials, the Butler–Volmer equation simplifies, with either the anodic or cathodic term dominating.
Mass transport in the electrolyte involves diffusion, convection, and migration. The Nernst–Planck equation describes the flux
Ji of species
i:
where
Di is the diffusion coefficient,
Ci the concentration,
zi the charge number,
ui the mobility,
ϕ the electric potential, and v the velocity field. In our setup, convection is minimized, so diffusion and migration are the primary transport mechanisms.
2.2. Experimental Setup
The experimental setup shown in
Figure 1 comprises a desktop electrochemical deposition 3D printer designed with four main components: the work platform, the electrochemical deposition system, the supply device, and the control equipment. The integration of hardware and software ensures precise control over the deposition process. The hardware system is further categorized into three integral components: mechanical displacement, electrochemical deposition, and deposition pressure control. The inter-module communication is established employing the pyserial serial communication method.
For the Co-Pt alloy magnetic structures, graphite electrodes and ITO conductive glass electrodes are used as anodes and cathodes, respectively. The electrolyte solution contains cobalt and platinum ions, tailored for the deposition process.
Subsequent to meticulous electrolyte composition selection and preparation, along with comprehensive theoretical derivation of the thermodynamics and kinetics governing electrochemical deposition, as well as rigorous simulation and experimental validation, the electromechanical system for 3D printing featuring micro-magnetic structures, alongside its parameter range, is established. The realization of the micro-magnetic structure 3D-printing electromechanical system, culminating in the formation of a predetermined magnetic pattern, necessitates a sequence of pivotal procedures. These procedures encompass graphic edge recognition, edge path generation, internal path generation, controller recognizable code generation, and the actual realization of the electromechanical system, among others.
2.3. Simulation of Multiple Physical Fields
2.3.1. Effects of Average Current Density on Electrodeposition
Simulations were performed using COMSOL Multiphysics to study the effects of average current density on electrodeposition. The initial electrolyte concentration was set to 0.5 mol/L. Under an applied electric field, changes in ion concentration near the cathode interface were observed over 5 s, resulting in a deposition thickness of approximately 6.62 nm. The deposition rate was about 1.3 nm/s, indicating a relatively uniform thickness distribution as illustrated in
Figure 2.
2.3.2. Effect of Electrolyte Concentration on Electrodeposition
The influence of electrolyte concentration on deposition thickness was examined by simulating various concentrations (0.5 mol/L, 1 mol/L, 1.5 mol/L) at a constant current density. Higher electrolyte concentrations resulted in slightly decreased deposition thickness but improved uniformity as observed in
Figure 3.
2.4. Machine Learning Optimization of Deposition Parameters
To enhance the precision and efficiency of the Co-Pt microstructure fabrication process, we incorporated machine learning algorithms to optimize the deposition parameters (
Figure 4). The objective was to identify the optimal Co:Pt ion ratio, solution pH, nozzle scanning speed, and deposition voltage to achieve a Co-Pt atomic ratio of 50:50.
The optimization process began with data collection and preprocessing. Experimental data from previous Co-Pt deposition experiments were compiled, focused on the following parameters: Co:Pt ion ratio, solution pH, nozzle scanning speed, and deposition voltage. The target variable was the Co-Pt atomic ratio. The data were preprocessed to handle missing values and outliers, and then standardized to ensure consistency in the machine learning models.
Feature engineering was performed to enhance the predictive power of the models. Additional features were generated through polynomial transformations and interaction terms, including squared and cubic terms of the original features as well as pairwise interaction terms.
We evaluated a comprehensive set of regression models, including Linear Regression (LR), Ridge Regression, Lasso Regression, ElasticNet, Random Forest (RF), Gradient Boosting Regressor (GBR), Extreme Gradient Boost (XGB), Extra Trees Regressor (ETR), and AdaBoost Regressor (ADA). Each model was rigorously trained and validated using leave-one-out cross-validation (LOO CV), a method that minimizes bias by testing each observation as a single validation set, thereby enhancing model robustness and reducing the likelihood of overfitting. Additionally, we performed extensive hyperparameter tuning for each model, employing both grid search and random search methodologies to identify optimal configurations that maximize predictive accuracy and generalizability. Initially, a grid search was conducted to systematically explore a predefined set of hyperparameter combinations for each model. For example, in the Ridge Regression model, we tested alpha values ranging from 0.01 to 10 in increments of 0.5. This initial search helped us identify a promising range, after which we refined our focus to the interval of 0.1–0.5, ultimately selecting an alpha value of 1.0 as optimal.
Upon evaluating the models, the Extra Trees Regressor (ETR) was selected as the final model due to its superior performance metrics. This model was then used to predict the optimal deposition parameters. The identified optimal parameters were as follows: Co:Pt ion ratio (1:10), solution pH (5), nozzle scanning speed (2 mm/min), and deposition voltage (15 V).
The machine learning optimization enabled a data-driven approach to identify the optimal deposition parameters, significantly reducing the trial-and-error efforts traditionally required in experimental setups and ensuring a more efficient and precise fabrication process for Co-Pt microstructures. By integrating machine learning into the electrochemical deposition process, we demonstrated the potential to enhance the fabrication of high-performance Co-Pt microstructures, facilitating the achievement of the desired Co-Pt atomic ratio, which is critical for applications in MEMS, micro-robots, and data storage devices.
3. Results and Discussion
3.1. Machine Learning Results
To assess the performance of each machine learning model, we employed a variety of evaluation metrics, including Mean Squared Error (MSE), Mean Absolute Error (MAE), Mean Absolute Percentage Error (MAPE), correlation coefficient (R), and R-squared (R
2).
Table 1 provides a detailed summary of these metrics for each model, allowing for direct comparison of predictive accuracy and error rates on the test dataset. The performance metrics indicate that ensemble methods, especially Extra Trees and XGBoost, significantly outperform Linear Regression models (Linear, Ridge, Lasso, and ElasticNet) in predicting the target variable. These models exhibit the lowest Mean Squared Error (MSE) and Mean Absolute Error (MAE), reflecting their ability to make more accurate predictions. They also achieve the highest R-squared (R
2) values, explaining over 80% of the variance in the target, and maintain a strong correlation with actual values, as shown by their high correlation coefficient (R) close to 0.90. The Mean Absolute Percentage Error (MAPE) is exceptionally low for these models, indicating minimal relative error and high predictive reliability. In contrast, linear models show much higher error rates and lower explanatory power, likely due to their inability to capture non-linear patterns in the data.
Results in
Table 2 showed that the Extra Trees Regressor (ETR) and Extreme Gradient Boost (XGB) outperformed other models, as evidenced by their lower MSE and higher R
2 values. Specifically, the Extra Trees Regressor achieved an MSE of 18.1 and an R
2 of 0.81, while the XGBoost model yielded an MSE of 19.01 and an R
2 of 0.80. This level of performance underscores the suitability of these ensemble models in handling complex interactions, even within relatively small datasets.
The robustness of the Extra Trees Regressor can be attributed to its ensemble structure, which reduces variance by utilizing random splits of data at each node. This approach enables the model to generalize effectively, providing stable and reliable predictions. In contrast, XGBoost leverages a gradient boosting framework, which iteratively improves predictions by minimizing residual errors, making it particularly powerful in capturing complex relationships in the data. Its regularization techniques also help prevent overfitting, allowing it to perform well on both training and validation sets.
Despite their strengths, these models do present certain trade-offs. The Extra Trees Regressor, while highly effective, demands considerable computational resources due to the extensive ensemble of trees it builds. This requirement can lead to longer training times, particularly in resource-limited environments. Conversely, while XGBoost’s gradient boosting mechanism improves accuracy, it can require extensive tuning of hyperparameters to achieve optimal performance. By systematically applying leave-one-out cross-validation and thorough hyperparameter tuning, we ensured that these models were configured to mitigate these limitations, achieving a balance between computational efficiency and predictive power.
As shown in
Figure 5, the red line in the prediction plot represents the ideal fit line (y = x), where predictions would match the true values perfectly. Points closer to this line indicate more accurate predictions. Most predictions cluster near the line, showing that these ensemble models generally perform well. However, there are some deviations, particularly at certain value ranges, indicating occasional prediction errors.
In conclusion, the Extra Trees Regressor and XGBoost emerged as the most effective models in this analysis, leveraging their respective strengths to handle intricate data patterns and providing accurate, generalizable predictions. Future work could explore additional ensemble techniques or advanced feature engineering methods to further improve predictive performance and model robustness.
3.2. Plane Path Planning Results
In this study, we developed a path planning program to generate G-code for printing complex patterns. The program utilized the Shapely library in Python to perform path planning. Initially, it converts the input images to grayscale, simplifying the data and enhancing the efficiency of subsequent edge detection. The Canny algorithm is then employed to identify and delineate the edges within the image. Following edge detection, the program transforms the detected edge pixels into coordinate values. These coordinates are subsequently sorted and used to form closed shapes. The Shapely library’s parallel function is then utilized to offset the path, generating internal paths that are necessary for creating intricate patterns. This methodical approach ensures that the generated G-code accurately represents the complex patterns intended for printing.
Figure 6 shows the deposition process of the “Qiu Shi Eagle” pattern. The printing process began with the outermost contour, gradually offsetting inward to complete the entire figure. The overall movement path ensured that each layer was deposited sequentially, minimizing interruptions and ensuring consistent material deposition.
However, some deviations were observed in internal regions due to path overlap and variations in deposition width. These discrepancies highlighted the need for further refinement in the path planning algorithm to enhance precision. The printed sample closely matched the planned path, although certain areas exhibited uneven deposition due to variations in gel conductivity and viscosity over time. Additionally, the pressure control system, which employed intermittent pneumatic control, introduced inconsistencies in extrusion, affecting deposition uniformity.
3.3. Spatial Structure Results
The capability of the 3D printing system to fabricate vertical column structures was evaluated using a nozzle with a 160 µm inner diameter. The
Z-axis movement speed was set to 10 µm/min, while the X and Y axes remained stationary. The deposition voltage was maintained at 15 V. The resulting columns exhibited diameters of approximately 200 µm and heights of about 1200 µm, achieving a height-to-diameter ratio of 6:1, shown in
Figure 7.
The printed columns demonstrated the system’s ability to produce high-aspect-ratio structures, a critical requirement for many MEMS applications. Column diameters slightly exceeded nozzle diameter due to gel expansion upon extrusion and minor horizontal system vibrations. The lower sections of the columns (denoted as region A in
Figure 7b) were more uniform in diameter, closely matching the nozzle size, while the upper sections (region B) showed increased diameters and rougher surfaces.
Several factors contributed to these observations. First, the electrolyte adherence was more substantial in the lower sections, leading to a lower current density and smoother surfaces. Second, excess electrolytes at the base could spread out, while the upper sections had to build upon the previously deposited layers, resulting in more significant accumulation and unevenness. Third, the system’s internal vibrations, particularly at low speeds, affected the stability of the deposition process.
Further improvements to system performance require enhancements to stepper motor stability and overall system structure to reduce internal vibrations. Additionally, controlling the environmental humidity could minimize the formation of irregular structures like the observed water droplet shapes, which are more likely to occur at lower humidity levels. Future iterations of the experimental setup should include humidity control to better regulate the deposition environment.
3.4. Influence of External Magnetic Field
The influence of external magnetic fields on the thickness and magnetic properties of the deposited layers was thoroughly investigated using both simulations and experiments. Simulations were performed using FEMM 4.2 and Maxwell 2021 R1 software to determine the distribution of magnetic fields generated by permanent magnets. These simulations assumed a gap of 2–3 mm between the substrate and the deposition container walls, and a lateral width of 10 mm. To accommodate the experimental setup’s space requirements, magnets were placed 40 mm apart.
The simulations revealed that using two aligned magnets produced a higher magnetic field density compared to a single magnet. However, the field exhibited some divergence, necessitating the use of magnets with a width of 20 mm to ensure a uniform magnetic field over the central 10 mm region. Comparing N52 and N35 magnets showed that N52 magnets generated stronger fields, but N35 magnets with dimensions of 20 mm × 10 mm × 20 mm were deemed sufficient for generating the required field strength of 300 mT.
To experimentally investigate the influence of the external magnetic field on the deposition process, a setup was created using a graphite electrode as the anode and ITO glass as the cathode. The deposition voltage was set to 10 V, and the process lasted 4 h. Two experimental groups were compared: one with an external magnetic field generated by N35 magnets and one without any external magnetic field. The results demonstrated that the external magnetic field significantly enhanced the uniformity of the deposited layers. The thickness distributions of samples deposited with and without the magnetic field, as illustrated in
Figure 8a,b, show that in the presence of the magnetic field, the maximum thicknesses were 3.49 µm and 5.07 µm, compared to 2.90 µm and 3.03 µm without the field. While the average thicknesses were similar (2543.8 nm with the field and 2459.3 nm without), the magnetic field reduced the variability in thickness, leading to more uniform deposition.
The magnetic properties of the deposited samples were also evaluated.
Figure 8c compares the M-H curves of samples deposited with and without the magnetic field, measured both parallel and perpendicular (vertical) to the film surface. The results indicated that the external magnetic field reduced the magnetic anisotropy of the deposited films. Without the magnetic field, remanence in the parallel direction was significantly higher (5.24 kA/m) than in the perpendicular direction (0.74 kA/m). With the 360 mT magnetic field, the remanence values were closer (1.36 kA/m parallel and 0.69 kA/m perpendicular), reducing the anisotropy.
Furthermore, the saturation magnetization was highest in the perpendicular direction with the external magnetic field (13.42 kA/m), compared to 3.48 kA/m without the field. The parallel saturation magnetization values were 11.68 kA/m without the field and 10.61 kA/m with the field. These results suggest that the external magnetic field enhances the vertical alignment of magnetic domains, thereby improving the magnetic properties in the perpendicular direction. These findings are consistent with the theory of magnetic domain alignment, where an external magnetic field acts as an external force to align the magnetic domains vertically, thus reducing the anisotropy typically observed in planar magnetic films. This alignment effect is particularly beneficial for applications requiring vertically oriented magnetic properties.
Future research will focus on optimizing the fabrication process and seamlessly integrating the external magnetic field with the deposition system. Additionally, the combined effects of external magnetic fields and various deposition parameters, such as current density and electrolyte composition, will be systematically studied to refine the deposition process and enhance the performance of the fabricated microstructures.
In summary, the path planning program successfully generated accurate G-code for complex patterns, and the experimental setup demonstrated the system’s capability to produce high-aspect-ratio structures with uniform deposition. The application of an external magnetic field significantly improved the uniformity and magnetic properties of the deposited films, highlighting the potential of magnetic field-assisted electrochemical deposition for advanced material fabrication.