Accurate electrical power prediction is increasingly critical in industrial smart manufacturing environments, where energy fluctuations and demand variability pose significant operational challenges under the industry 4.0 paradigm. Existing approaches often rely on simulated or secondary data and lack integration with industrial-grade communication protocols, limiting their practical applicability. Incorporating machine learning with real-time data collection is essential for progressing industrial predictive monitoring. This research presents a framework to forecast electrical power usage by utilizing the RS-485 protocol to enhance smart manufacturing processes. The dataset used was obtained from a power meter, recorded over a period of 135 min, resulting in 3100 data. Three learning methods—Random Forest, Extra Trees, and XGBoost—were analyzed, with XGBoost being further refined through PSO for tuning hyperparameters. The models were trained on datasets that included voltage, current, frequency, and power factor, and their effectiveness was evaluated using time-based predictions, standard metrics, and error distributions through cross-validation. The findings illustrate that the PSO-XGBoost consistently surpasses the default XGBoost baseline R2 of 0.5746, achieving MAE of 0.14 W, RMSE of 0.21 W, and R2 of 0.8355, representing improvements of 41.67% in MAE, 38.24% in RMSE, and 45.40% in R2. The RS-485 protocol enables seamless integration with existing industrial infrastructure, supporting anomaly detection and energy optimization aligned with Industry 4.0 interoperability objectives.
Zulfa et al. (Tue,) studied this question.