iconOpen Access

ARTICLE

A Hybrid LSTM–FNN Framework for Safety-Constrained Energy Management in Mining Microgrids

Sravani Parvathareddy1,*, Abid Yahya1, Lilian Amuhaya1, Ravi Samikannu1, Raymond S. Suglo2

1 Department of Electrical and Communications Systems Engineering, Botswana International University of Science and Technology, Palapye, Botswana
2 Department of Mining Engineering, Botswana International University of Science and Technology, Palapye, Botswana

* Corresponding Authors: Sravani Parvathareddy. Email: email, email

Energy Engineering 2026, 123(6), 10 https://doi.org/10.32604/ee.2026.079449

Abstract

This paper presents a novel framework for the development of a real-time energy management system for mining microgrids, which integrates the benefits of a long short-term memory (LSTM) network and a feedforward neural network (FNN) for the prediction of the load and solar power, and the optimization of the dispatch, respectively, while ensuring the safety of the microgrid through the application of a convex safety filter. In the proposed framework, the LSTM provides probabilistic multi-step forecasts of load and photovoltaic generation, capturing the high volatility characteristic of mining operations with ramp rates up to 5 MW/min. The FNN approximates the optimal power dispatch policy, enabling sub-millisecond inference times essential for real-time control. The convex safety filter projects the FNN’s proposed actions onto the feasible set defined by operational constraints, ensuring voltage regulation within ±0.1% and preventing safety violations. The framework was validated using operational data from Jwaneng Mine, Botswana, within a MATLAB/Simulink co-simulation environment that couples discrete-time EMS decisions (15-min intervals) with continuous-time electrical dynamics (1-s resolution). Simulation results demonstrate an 18.7% reduction in operational costs, renewable energy utilization of 79.1%, voltage deviation of only 0.08%, and constraint violations reduced to 0.3% of intervals. The complete system achieves end-to-end latency of 50.8 ms, with the core optimization requiring just 0.8 ms, satisfying the stringent real-time requirements of mining microgrid control.

Graphic Abstract

A Hybrid LSTM–FNN Framework for Safety-Constrained Energy Management in Mining Microgrids

Keywords

Mining microgrids; energy management system; long short-term memory; feedforward neural networks; safety constraints; renewable energy integration; predictive control; convex optimization

Nomenclature

xt System state vector at time t
ut Control action vector at time t
Pload,t Load demand at time t (MW)
Ppv,t Solar PV power output at time t (MW)
SOCt Battery state of charge at time t (pu)
λt Electricity price at time t (BWP kW-1 h)
Mt Mining operational indicator at time t
Pgrid,t Grid power exchange at time t (MW)
Pbatt,t Battery charge/discharge power at time t (MW)
Pcurtail,t PV curtailment at time t (MW)
Vt Voltage at point of common coupling at time t (V)
Δt Control interval (0.25 h)
ηch, ηdis Battery charging/discharging efficiency
Erated Battery rated capacity (MW h)
𝒰 Feasible action set
MAE Mean Absolute Error
RMSE Root Mean Square Error
MAPE Mean Absolute Percentage Error
PCC Point of Common Coupling
DoD Depth of Discharge
HIL Hardware-in-the-Loop
QP Quadratic Programming
OSQP Operator Splitting Quadratic Program

1  Introduction

The mining industry is one of the most energy-intensive industries in the world as most mining operations take place in remote, off-grid locations [1]. The use of traditional energy infrastructure in most mining operations is reliant upon diesel generators and weak grid connections [2]. The integration of microgrids that incorporate renewable energy sources is one of the alternatives that can be used to provide sustainable mining operations [3,4]. However, for these microgrids to function effectively, there must be an energy management system (EMS) that can deal with the intermittent nature of the renewable energy sources as well as the dynamic and unpredictable load from the mining operations [5,6].

1.1 Problem Statement and Technical Challenge

Mathematically, the mining microgrid EMS is a safety-constrained stochastic optimal control problem. The mining environment presents three major challenges to the control system. First, the loads have high intermittency; for example, in some mining processes, load transients may have rate as high as 10 MW min1 [7]. Second, the safety and reliability constraints are very strict; deviations in voltage from the nominal value of ±5% can damage electrical equipment in mining processes, and the downtime costs can be as high as 50,000$h1 [8]. Third, the battery experiences high cycling, which accelerates the battery degradation. The primary objective of the control system is to find the optimal power dispatch in real time (latency <100 ms) to minimize operational costs while satisfying safety constraints.

1.2 Limitations of Existing Approaches

The traditional approaches to EMS for microgrids rely on rule-based or deterministic models that are inadequate for the stochastic nature of mining environments [9,10]. Even though MPC methods are an appropriate approach in theory, the computational cost of using MPC to control microgrids at a 1–10 s control interval is prohibitive [11,12]. The majority of existing methods also treat forecasting and optimization as separate steps. In mining environments, this can be problematic. The consequences of violating operational constraints due to forecast errors can be severe.

Although individual AI methods, such as long short-term memory (LSTM) networks for load forecasting [13,14] and feedforward neural networks (FNN) for fast approximation of optimization problems [15], have shown considerable promise, there is a significant gap in the literature regarding the seamless integration of these methods. Current methods are unable to ensure that hard operational constraints will be respected with a high probability [16,17]. Recent comprehensive reviews have highlighted the potential of AI in microgrid design and control [18].

1.3 Proposed Approach and Contributions

To address the above limitations, this paper proposes a novel architecture based on the integration of LSTM and FNN components with a convex safety filter for mining microgrid EMS. The proposed architecture consists of three main components: (i) an LSTM component, which is responsible for probabilistic load and generation forecasting; (ii) an FNN, which approximates the policy of a stochastic optimization problem; and (iii) a real-time convex safety filter that ensures the solution suggested by the FNN is feasible. The approach was specifically designed to account for the specific technical characteristics of mining operations.

The main contributions of this work are:

(1)   A novel hybrid LSTM-FNN architecture that integrates multi-step forecasting with learned optimization policies for real-time energy management in mining microgrids, achieving sub-millisecond inference times while maintaining high forecast accuracy.

(2)   A convex safety filter formulation that projects neural network recommendations onto the feasible set defined by operational constraints, providing deterministic safety guarantees with 98.2% reduction in computation time compared to traditional MPC approaches.

(3)   Comprehensive validation using two years of operational data from Jwaneng Mine, Botswana, demonstrating 18.7% cost reduction, 79.1% renewable utilization, and voltage regulation within ±0.1% through co-simulation that couples discrete-time EMS decisions with continuous-time electrical dynamics.

(4)   An ablation study quantifying the individual contributions of LSTM forecasting, FNN optimization, and the safety filter, showing that the safety filter alone reduces constraint violations by 83.3%.

The remainder of this paper is organized as follows: Section 2 reviews the relevant literature. Section 3 details the proposed methodology. Section 4 presents the experimental results and discussion. Section 6 concludes the paper and proposes future directions for this work.

2  Literature Review

2.1 Microgrid Energy Management: Evolution and Challenges

Numerous different approaches to energy management for microgrids have emerged over time [19]. Early systems were based on rules and logic, but as the complexity of microgrids has increased, so has the need for more sophisticated energy management systems based on optimization. Despite the variety of different methods that have been developed, there are still a number of significant challenges to be overcome before the majority of the technology can be applied to mining microgrids.

The nature of mining operations places distinct demands on the energy management system of a microgrid. The high levels of volatility in the required power (5 MW min1), the voltage requirements of ±0.5%, and the demands of mining operations require specialized energy management systems.

2.2 Forecasting Methods in Energy Management

The accurate forecasting of energy production requirements is a crucial element of effective energy management. A variety of different methods have been used for this purpose, ranging from classical machine learning methods to deep learning.

A class of deep learning models known as Long Short-Term Memory (LSTM) networks has been shown to be particularly effective at learning the dynamics of time series data [13,14]. The gating mechanisms that govern data flow in LSTM networks allow them to learn both short-and long-term temporal dynamics. For the specific case of mining applications, where feature sets are limited to a few dozen features and data volumes are only moderate in size (about 1–3 years of 15-min time series), LSTMs may be the most suitable models for energy management.

Alternative architectures such as Gated Recurrent Units (GRU) [20], Temporal Convolutional Networks (TCN), and Transformers [21] have also shown promise in time series forecasting. Other architectures such as N-BEATS have also shown promise [22]. However, these models often require larger datasets or longer training times, making them less practical for deployment in mining environments where data may be limited and rapid retraining may be necessary.

2.3 Optimization Approaches for Real-Time Control

There are a variety of techniques for performing optimization within the EMS. For instance, model-based methods such as Mixed-Integer Linear Programming [23] and quadratic programming (QP) can be used. More specifically, Model Predictive Control (MPC) frameworks are often used, which formulate the control problem as a series of optimization problems and use the optimal control action from each step as the current control input. While these methods can offer performance guarantees, the computational cost is prohibitive for real-time control within complex systems. For example, while there are efficient implementations of these methods, the typical solving time for these models is between 100 and 500 ms, which is too long for the requirements of mining operations.

An alternative approach to solving this problem is to use Deep Reinforcement Learning (DRL) [24]. DRL methods learn a policy for the control action given the system state. The advantages of DRL are that it can handle the complex, non-linear dynamics of the system without requiring explicit models of the system. The primary disadvantage of DRL is that these methods are often sample inefficient and can pose safety risks during the learning process. These factors make them less appropriate for critical control in mining operations.

Another class of methods that shows promise as an approach for learning control policies for EMS is the use of hybrid approaches that combine learning and optimization. For example, the integration of differentiable optimization methods, such as the method proposed by [25], allows for the end-to-end training of models that include optimization components. Additionally, the use of imitation learning, such as the method proposed by [26], allows for the training of models to mimic the optimal solution to a control problem. These approaches enable learning models to achieve the computational efficiency required for real-time control.

2.4 Safety Assurance in Learning-Based Control

Another critical concern within the use of learning-based control strategies for EMS is the issue of safety. A variety of techniques have been developed to provide different levels of safety and to do so with different degrees of computational efficiency:

Methods based upon constraint-aware optimization aim to find control actions that will satisfy the safety constraints with a certain degree of probability. For instance, chance-constrained programming [27] and distributionally robust optimization [28] methods are used. While such methods provide guarantees, they are often conservative in their approaches and can have high computational cost.

Control Barrier Functions (CBF) [29] are used to provide guarantees of safety. This technique involves finding a function and a cost function such that the safety constraints are satisfied if the control action is chosen to minimize the cost function. This technique ensures safety, but can require significant effort to apply it to complex safety constraints.

Safe reinforcement learning methods incorporate the safety constraints within the reinforcement learning framework during the training process. For instance, the techniques based on Lagrange multipliers, such as those proposed by [30] and [31], ensure that the safety constraints are satisfied by the policy that is learned by the reinforcement learning process. While this is an effective method for ensuring safety, the safety of learned policies in complex environments is a challenge.

Safety projection layers are a technique in which a set of safety constraints is defined and a control action is chosen (potentially leading to a violation of the safety constraints). Then, a safety filter, such as the safety filter proposed by [25], is used to find a new control action that guarantees that the safety constraints are satisfied. The advantages of this approach are that it is simple to implement, and the resulting safety filter is computationally efficient. This approach is well-suited for critical processes such as those occurring in mining operations, especially when the requirement for sub-millisecond response times.

2.5 Mining-Specific Considerations and Research Gaps

Although there is a significant amount of literature on EMS, the specific consideration of mining microgrids is lacking, with most of the research focused on residential, commercial, and industrial applications [12]. The specific characteristics of mining operations are as follows:

•   Extreme load volatility with equipment with a ramp rate of up to 5 MW/min implies that the control system must have a response time of less than 1 ms.

•   Production-driven operational constraints due to the way in which the mine’s operations are dictated by the requirements of the production levels.

•   Stringent power quality requirements with a voltage tolerance of ±0.5% as compared to the general standard of ±5%

•   Remote operation with weak grid conditions with short-circuit ratios below 4.0.

•   Accelerated battery degradation due to the need for continuous cycling of batteries.

Table 1 presents a comparative analysis of existing EMS approaches and their suitability for mining applications.

images

3  Methodology

3.1 System Model and Problem Formulation

The mining microgrid features a connection to the utility grid, a solar PV installation, a battery energy storage system, and loads from the mining operations. The EMS operates with 15-min dispatch intervals, which is the standard dispatch interval for mining operations.

Fig. 1 illustrates the architecture of the microgrid. The energy management system at the supervisory level makes optimal dispatch decisions. The local controllers execute the dispatch decisions from the EMS to carry out the control objectives.

images

Figure 1: Schematic representation of the mining microgrid architecture. Solid arrows indicate power flow; dashed arrows represent communication links. The EMS (central controller) exchanges data with local controllers of the PV array, battery, grid interface, and mining loads.

Let T={0,1,,T1} be the discrete time horizon over which the EMS optimizes the energy dispatch. The state of the system at time t is given by xt=[Pload,t,Ppv,t,SOCt,Tamb,t,Mt]T. The load in the mining operations varies between 0.15 and 7.87 MW. The solar PV generation ranges between 0 and 8 MW. The state-of-charge level of the battery ranges between 0.2 and 0.95. The ambient temperature ranges between 18C and 41C. The mining operations indicator takes values between 0 and 1. The control action at time t is given by ut=[Pgrid,t,Pbatt,t,Pcurtail,t]T. The power that flows in and out of the grid ranges from 20 to 20 MW. The power that flows in and out of the battery ranges from 5 to 5 MW. The curtailment of solar power is given by Pcurtail,t0

The primary objective of the EMS is to minimize the expected total cost of operation. Eq. (1) defines the overall objective function of the EMS.

minu0:T1E[t=0T1t(xt,ut,ξt)](1)

The cost function t consists of the costs associated with energy procurement, battery degradation, peak demand, and safety assurance. Battery degradation is modeled following [32,33], and joint optimization for peak shaving and frequency regulation can yield superlinear gains [34]. The battery state-of-charge dynamics are given by Eq. (2).

SOCt+1=SOCt+ηchPbatt,t+Δt(1/ηdis)Pbatt,tΔtErated(2)

where Erated=4 MWh is the battery’s rated energy. ηch=0.95 and ηdis=0.95 are the charging and discharging efficiencies of the battery. Δt=0.25 h is the time interval (15 min) of dispatch decisions made by the EMS.

3.2 Component Specifications and Operational Parameters

The key components of the mining microgrid and their operational parameters are listed in Table 2.

images

3.3 Hybrid LSTM-FNN EMS Algorithm

Fig. 2 shows the general structure of the proposed algorithm.

images

Figure 2: Flowchart of the proposed hybrid LSTM-FNN energy management algorithm. The algorithm starts with data acquisition. Then, the LSTM models load and PV power production. The FNN finds an initial control action, which is passed through a safety filter to ensure that the resulting state remains within the feasible set. Finally, the control action is dispatched to the microgrid components.

The LSTM receives 12 features over time, comprising load and PV power lags, temperature, humidity, and four temporal indicators. The LSTM comprises two stacked layers of 128 neurons each. The mean absolute error of the LSTM is 47.2 kW. The Adam optimizer with a learning rate of 0.001, a batch size of 32, and a dropout regularization of 0.2 is used for training.

The FNN consists of four layers with 14, 256, 128, and 64 neurons, with ReLU activation functions. The network was trained for 1000 epochs using L2 regularization with β=0.01. The training time of the FNN is under 0.3 ms.

At each control interval, the algorithm first forecasts the load and PV power production using the LSTM. It then observes the current SOC and tariff. Following that, it uses the FNN to find an initial control action, projects the resulting state through the safety filter to find the feasible set of states, and dispatches the control action to the local actuators.

3.4 Unified Optimization and Safety Enforcement

3.4.1 Cost Function Formulation

The stage cost t is composed of the following terms:

t=λtPgrid,tΔt+αmax(0,Pgrid,t15)2+Cdeg(Pbatt,t,SOCt)+Csafety(xt,ut)(3)

The cost includes a tariff term λt[0.75,2.40] Pula/kWh, which represents the electricity tariff in Botswana. The second term considers the cost of importing too much power from the grid, with α=0.002 Pula/MW2. The third and fourth terms are degradation and safety costs, respectively.

3.4.2 Consolidated Operational Constraints

All operational constraints are unified in a single formulation:

Power flow: 0Pgrid,t20,4Pbatt,t5,0Pcurtail,tPpv,t(4)

Battery operation: 0.2SOCt0.95,|Pbatt,tPbatt,t1|30(5)

Mining-specific: SOCt0.3+0.15Mt,Pgrid,t17(1+0.3Mt)(6)

Power quality: |Vt5000|25(7)

Power balance: Pgrid,t+Ppv,tPcurtail,t+ηdirPbatt,t=Pload,t+Plosses,t(8)

where ηdir=1 for discharge (Pbatt,t0) and 1 for charge (Pbatt,t<0), with distribution losses Plosses,t0.015(Pload,t+|Pbatt,t|).

Fig. 3 shows that the safety filter projects the action proposed by the neural network to a feasible region defined by the tightened constraints. This guarantees that the operation will remain within the safe operating region. The safety filter solves a quadratic programming problem:

ut=argminu𝒰(xt)uu~t22(9)

where 𝒰(xt) is the feasible action set defined by constraints (4)(8). This projection is implemented using the OSQP solver [35], achieving sub-millisecond solution times.

images

Figure 3: Illustration of the safety filter. The action proposed by the neural network (u~t, red point) may lie outside the feasible region (shaded area). The safety filter projects the action to the nearest feasible point (ut, green point).

3.5 Algorithm Integration and Computational Efficiency

Step 1: Data Acquisition: Collect measurements xt from microgrid sensors.

Step 2: Forecasting: LSTM generates P^load,t+1:t+H and P^pv,t+1:t+H with H=4 steps (1 h ahead).

Step 3: Initial Action: FNN computes u~t=πFNN(xt,P^load,P^pv,λt).

Step 4: Safety Projection: Solve QP to project u~t onto 𝒰(xt), obtaining ut.

Step 5: Dispatch: Send ut to local controllers.

Step 6: Update: tt+1, repeat.

The complete algorithm achieves end-to-end latency of 50.8 ms on standard hardware, with the core optimization requiring just 0.8 ms, satisfying the stringent real-time requirements of mining microgrid control.

4  Experimental Results and Discussion

4.1 Dataset and Simulation Setup

4.1.1 Dataset Description and Characteristics

The presented framework is tested on operational data from the Jwaneng Diamond Mine in Botswana. The data contains 730×96=70,080 samples and spans exactly from January 1, 2021, to December 31, 2022 (inclusive). Table 3 presents a detailed description of the dataset variables and the preprocessing applied to them.

images

4.1.2 Data Partitioning and Normalization

The training, validation, and test data were divided as follows:

•   Training set: January 1, 2021–June 30, 2022 (548 days, 52,608 samples, 75%).

•   Validation set: July 1, 2022–September 30, 2022 (92 days, 8832 samples, 12.5%).

•   Test set: October 1, 2022–December 31, 2022 (90 days, 8640 samples, 12.5%).

The data was also normalized as follows:

1.   Calculate the normalization statistics using only the training data.

2.   Use these statistics to normalize the validation and test data.

3.   For each variable x: x~=(xxmintrain)/(xmaxtrainxmintrain).

4.   Divide the data into sequences of L=24 lookback steps (6 h) and H=4 forecast steps (1 h).

4.1.3 Simulation Architecture and Model Integration

Fig. 4 depicts the architecture used to co-simulate the various components of the EMS. This figure illustrates the critical interface between the EMS and the electrical network, which forms the basis of the validation.

images

Figure 4: Co-simulation architecture showing the integration of discrete-time EMS decisions (15-min interval) with continuous-time electrical dynamics (1-s resolution). The EMS provides setpoints to local controllers, which regulate voltage and frequency in real-time. Measurements are fed back to the EMS at each control interval.

1. Continuous-Time Electrical Dynamics (Inner Loop, 1 s resolution):

•   Implemented in MATLAB/Simulink R2023a using ode45 solver with Δtmax=1 s.

•   Physical components modeled via Simscape Electrical.

•   Fast inner-loop controllers: Voltage/frequency regulation operating at 100 ms intervals.

2. Discrete-Time EMS Decisions (Outer Loop, 15 min interval):

•   Hybrid LSTM-FNN controller executed at 15 min boundaries.

•   Control actions ut=[Pgrid,t,Pbatt,t,Pcurtail,t] applied using zero-order hold.

•   Voltage stability assessment via power flow solution at each 1 s step.

•   Constraint verification: Continuous monitoring of Vt[4975,5025] V, ft[49.8,50.2] Hz.

3. Co-Simulation Interface:

•   EMS provides setpoints to inverter outer-loop controllers.

•   Inner-loop controllers implement these setpoints via PI regulators with anti-windup.

•   Measurements (SOC, voltages, powers) sampled at 15 min intervals for EMS feedback.

•   Communication delays modeled as normally distributed with μ=50 ms, σ=10 ms.

4.1.4 Training Configuration and Computational Details

The neural network training employed the following configuration:

•   Dataset size: 52,608 training samples × 10-fold augmentation = 526,080 sequences.

•   Sequence structure: Input = [tL:t], Target = [t+1:t+H] with L=24, H=4.

•   LSTM architecture: 2 layers, 128 units each, dropout = 0.2, recurrent dropout = 0.1.

•   FNN architecture: 14-256-128-64-3 feedforward network, ReLU activations.

•   Training: Adam optimizer (lr = 0.001), batch size = 64, early stopping (patience = 10).

•   Hardware: Intel i9-13900K, 64 GB RAM, NVIDIA RTX 4090 GPU.

•   Training time: 4.2 h total (LSTM: 2.8 h, FNN: 1.4 h).

Table 4 presents the statistical summary of the training dataset.

images

This comprehensive simulation setup ensures that the EMS is operated in the following ways: (1) under realistic conditions, (2) with appropriate time-scale separation, and (3) such that all claims regarding voltage and computational performance can be validated.

4.2 System Performance and Load Analysis

4.2.1 Load Profile Characterization and Volatility Metrics

The load profile of the mining operation is characterized by considerable volatility. As shown in Fig. 5, the load profile over a 24-h period shows significant fluctuations in the load. Table 5 presents the statistical measures of the load.

images

Figure 5: Analysis of the load profile of the mining operation. (a) 24-h profile with a peak of 7.87 MW during crushing operations and a minimum of 0.15 MW during maintenance; (b) Ramp rate distribution with 95% of the ramp rates under 3.2 MW min1; (c) Duration curve with 18% of the operation at loads above 5 MW.

images

4.2.2 Load Variability and Operational Regime Analysis

The load factor can also be measured by the peak-to-average ratio. This high PAR value indicates that there are extreme fluctuations in the load, with the peak load being six times higher than the average load.

Ramp Rate Distribution:

•   95th percentile ramp rate: 3.42 MW min1 (exceeds typical battery response capabilities).

•   Maximum observed ramp: 5.1 MW min1 during crusher startup.

•   75% of ramp rates below 1.5 MW min1.

4.2.3 Operational Regime Clustering

In order to characterize the operational modes of the mining indicator Mt, k-means clustering was applied to the normalized load profiles:

•   Cluster 1 (Low): Maintenance/standby (load < 0.5 MW), Mt=0.0, 28% occurrence.

•   Cluster 2 (Medium): Normal operations (0.5 to 3 MW), Mt=0.5, 54% occurrence.

•   Cluster 3 (High): Intensive processing of ore (>3 MW), Mt=1.0, 18% occurrence.

This clustering directly informs the mining operational indicator Mt used in constraint formulations.

4.2.4 Volatility Implications for EMS Design

The characteristics of the load profiles of this cluster have specific implications for the design of the EMS:

Forecasting Requirements:

•   The high level of autocorrelation on a daily basis (ρ24h=0.72) can allow for accurate forecasts from LSTM models.

•   The rapid rate of change of load (3.42 MW min1 at the 95th percentile) means that multi-step forecasts will be required.

•   The bimodal distribution indicates that regime-aware forecasting models will be required.

Safety and Constraint Management:

•   The rapid change of the load can complicate the feasibility of dispatch decisions.

•   The high PAR (6.10) indicates large swings in the battery’s state of charge, which can create safety risks.

•   High loads during peak demand periods require ensuring that voltage levels do not become too high and damage the mining equipment.

Computational Requirements:

•   The control intervals of 15 min imply that sub-millisecond decision times will be needed.

•   The rapid changes in load mean that real-time constraint enforcement will be required.

•   The need to take advantage of low electricity prices during these periods requires fast optimization techniques.

4.3 Forecasting Performance and Evaluation

To compare the forecasting models fairly and reproduce the presented results, all models were evaluated under the same conditions using 15-min ahead one-step forecasts. The features used by the forecasting model include the load, PV generation, temperature, irradiance, time-of-day, day-of-week, mining operational indicators, and electricity tariffs. The model configurations are detailed in Table 6.

images

The results in Table 7 reveal that the proposed LSTM model achieves the lowest error among all the metrics considered. Furthermore, its MAE of 47.2 kW is only 0.60% of the peak load and 3.66% of the mean load of the mining operations.

images

As shown in Table 7, the proposed LSTM outperforms all benchmarks across every metric. The MAE of 47.2 kW is 9.4% lower than GRU and 14.6% lower than Transformer. For ramp periods where the change in load is >3 MW/min, it is observed that LSTM maintains an MAE of 73.8 kW, and this is acceptable for safety filter calibration. The large R2 value of 0.941 indicates 94.1% of the total variation in loads is explained by the model, making it suitable for predictive EMS.

Residual analysis of the model indicates that errors in forecasts are normally distributed with mean μ=2.1 kW and standard deviation σ=52.7 kW. Although there is a small negative bias, it is desirable for safety-critical applications. For rapid transitions in loads, i.e., >3 MW min1, there is a drop in accuracy for forecasts, and an MAE of 73.8 kW is observed. Empirical 95% prediction intervals cover 94.3% of test data, making it essential for robust optimization.

4.4 Economic and Operational Performance

The proposed hybrid LSTM-FNN-based EMS is observed to have significant economic benefits, with 18.7% reduction in operation costs from 862.4 to 701.3 Pula/MWh over a 90-day test period. This is due to forecast-aware scheduling, optimized tariffs (reducing grid imports during peak tariff periods), and increased renewable utilization.

The lowest cost of 701.3 Pula/MWh, highest renewable penetration of 79.1%, and lowest computation time of 0.8 ms are obtained by our framework compared to all approaches. The constraint violation is reduced significantly to 0.3%, compared to 3.2% and 8.7% of LSTM-MPC and traditional EMS, respectively. This is because of the safety filter’s performance. The improvement in computation times is significant, as shown in Table 8. This is because of the end-to-end latency of our framework.

images

4.5 Grid Stability and System Validation

The proposed framework offers significant improvements in the stability of the electrical grid, the optimization of power flow, and the safety of the grid operations. The framework achieves exceptional levels of grid stability with only 0.08% average voltage deviation (Table 9). Fig. 6 indicates that the voltage levels remain within the range of 5000 ± 5 V (0.1%) for 99.97% of normal operation and a peak deviation of 22 V (0.44%) during extreme conditions. The occurrences of safety violations reduce from 3.2% to 0.2% as the percentage of normal operation, and the success of islanding mode is 98.7% with frequency deviation within ±0.5% and voltage within ±1% within 150 ms. These results are presented in Table 9.

images

images

Figure 6: Voltage stability analysis: (a) 24-h voltage profile at PCC showing tight regulation within 5000 ± 5 V (dashed lines); (b) voltage deviations during load transients, with maximum deviation of 22 V annotated at the peak of a 5.1 MW/min ramp; (c) statistical distribution of voltage measurements (histogram) with overlaid normal curve, confirming 99.97% compliance with ±0.1% bounds (marked by vertical lines).

Power flow optimization reduces grid dependency by 27.8% while increasing solar utilization by 87.8% and tripling battery discharge energy (Table 10). Curtailment decreases by 82.5% through coordinated resource management. The power flow distribution in Table 10 directly supports the economic and renewable utilization claims made in Section 4.4.

images

The component attribution analysis of the proposed method leads to a confirmation of the benefits of each component. The results of the analysis show that the LSTM-based cost and voltage deviation reduction is 4.9% and 77.3%, respectively. The safety filter also led to a reduction in the number of safety violations from 1.2% to 0.2%, which is 83.3%, and improved the success of islanding operations by 4.6%. These results are visualized in Fig. 7c and quantified in Table 11.

images

Figure 7: Impact of forecast error: (a) correlation between the error in the load forecast and the deviation of the voltage (scatter plot and trend line); (b) the activation rate of the safety filter relative to the magnitude of the error made in the load forecast; (c) the contribution of each component towards the improvements in the evaluated metrics.

images

Fig. 7a shows that the error made in the load forecast is positively correlated with voltage deviations from the nominal (Pearson’s r=0.42). Also, as illustrated in Fig. 7b, the safety filter is activated more often as the error in the load forecast increases. Finally, the contribution of each component is summarized in Fig. 7c and in Table 11.

The results of the ablation study are provided in Table 11. The results show that the cost increases by 7.3%, and the voltage deviation increases by 23 times for the FNN Only configuration. For the LSTM+FNN configuration, the safety filter is not active, and the number of constraint violations increases from 0.2% to 1.2%, a six-fold increase. These results further confirm that both the LSTM-based forecasting and the safety filter are essential components of this framework.

The results of this analysis also allow confirming that the developed framework meets or exceeds the standards required by the IEEE 1547 for voltage regulation (0.1% achieved vs. 5% required) and mining industry voltage tolerance (0.1% achieved vs. 0.5% required). Given the assumptions made in the modeling of these components, the results also indicate significant improvements in the performance of these operations when applied to real mining operations.

4.6 Discussion and Performance Analysis

The experimental results show that the proposed framework can provide a promising solution to the mentioned problems of interest. The achieved 18.7% reduction in the operational energy cost is mainly due to the intelligent scheduling of the battery. This intelligent scheduling allows the framework to buy less from the grid and use more of the solar energy that is generated onsite.

The increased percentage of utilized renewable energy, up to 79.1%, is due to the short-term forecast of the renewable energy provided by the LSTM model. The FNN-based optimizer benefits from having this information to help it make decisions that minimize the amount of solar energy curtailed.

The results of the ablation study (see Table 11) also indicate that by replacing the LSTM-based renewable energy forecast with a model that simply persists the most recent renewable energy value (the persistence model), there is a 6.2% drop in the amount of renewable energy that is utilized by the system.

The level of grid stability improved, with the percentage of voltage deviation reduced to 0.08%. This is a more general indicator of the quality of the electrical power supplied to the grid.

The criticality of the convex safety filter is also evident. The safety filter was activated 12.3% of the time, preventing 142 potential constraint violations. The majority (68%) of these constraint violations happened during periods of high load and generation ramps. The safety filter introduced a 12.5% adjustment in the FNN’s proposed action. Furthermore, the ablation study confirms that this safety filter is necessary, as disabling it would lead to a 312% increase in potential constraint violations.

The increased level of battery cycling is a trade-off that the framework makes to achieve higher cost savings and self-consumption of renewable energy. The framework includes a linearized degradation cost in the FNN’s training loss function, following models from [32,33]. The increase in cycling to 22% is countered by the fact that the average depth-of-discharge is only 40%, and the degradation cost is factored into the cost savings.

The most critical aspect of the computational results is the calculation of the inference time. The results show that the FNN and convex safety filter both require, on average, only 0.8 ms to be executed in Python on a standard desktop CPU.

Cross-referencing the results: Fig. 5 shows the level of volatility in the load. The predictions made by the LSTM model (see Table 7) can capture this level of volatility. The activation of the safety filter (see Fig. 7b) coincides with periods of high forecast errors. The economic benefits (see Table 8) result from the improved levels of renewable energy utilization and grid power reduction (see Table 10). These results taken together confirm how the proposed framework can effectively address the challenges posed by the mining process as described in Section 2.

5  Limitations and Future Analysis

This paper also has a few important limitations. The first relates to the fact that the energy values shown are energy per 15-min dispatch interval for a representative feeder rather than total mine consumption. The second limitation relates to the fact that the voltage stability metric is only a high-level measure, and a detailed model of the electrical network is required to fully assess power quality, which is part of the future work. The third limitation is that while the safety filter is designed to provide deterministic robustness against forecast errors, there is no formal stochastic guarantee. The fourth limitation is that performance is only measured on a two-year dataset from a single mine. Generalization to other sites would require training on data from those sites. The fifth and final limitation is that although the MPC method used was standard, a well-tuned convex MPC would likely have achieved lower runtimes. Despite this, the qualitative results support the conclusion that the method is computationally efficient.

6  Conclusion and Future Work

6.1 Conclusion

This research presents a novel architecture that seamlessly integrates the features of both LSTMs and FNNs to enable effective energy management for mining microgrids. Conventional energy management systems tend to fail in the specific scenarios typical of mining operations.

The proposed architecture achieves a reduction in operational costs of 18.7%, increases the percentage of energy from renewable sources to 79.1%, and limits voltage deviations to 0.08%. The average time to reach an optimal decision via the proposed framework is 0.8 ms for the optimization and 50.8 ms for the entire system. In addition, the results show that the inclusion of the convex safety filter is critical to preventing constraint violations in 12.3% of time steps and improving stability by 96.3%.

The improvements achieved by this method are primarily due to three factors. First, the coupling of the LSTM and FNN components ensures that the decisions made by the optimizer are based on accurate forecasts. Second, the mining-specific constraints allow the algorithm to consider the costs of factors such as battery degradation and equipment operation. Finally, the convex safety filter ensures that the proposed solution is viable to be deployed within mining microgrids in real time.

Furthermore, the validation conducted on real-world mining data from Botswana illustrates that the proposed method is applicable to real-world mining scenarios and outperforms existing methods.

This study also makes theoretical as well as practical contributions to the existing literature in the area of energy management for microgrids. The theoretical findings suggest that using the proposed architecture, especially the integration of the safety filter, can achieve accurate and safe operations. In addition, the proposed method is practical because it can be readily applied to existing mining operations to improve the energy management of mining microgrids.

6.2 Future Work

The future work that will be performed in the context of this project will include the following topics:

(1)   Hardware-in-the-Loop (HIL) validation, commercial EMS integration, and dynamic EMT simulations to validate voltage stability claims.

(2)   Extensions to support energy trading between microgrids within large mining operations to improve cost efficiency [36].

(3)   Online learning techniques to provide long-term performance optimization.

(4)   Incorporation of robust and stochastic optimization techniques for improved reliability in the face of extreme uncertainty [37].

(5)   Incorporation of additional renewable sources (wind, hydro) and energy storage technologies.

(6)   Development of secure communication protocols.

(7)   Integration of long-term planning to enable optimal management of the equipment lifecycle.

(8)   Development of explainable AI tools to provide decision support and build trust with human operators [38,39].

(9)   Application of the proposed methodology to multiple mine sites.

(10)   Integration of chance constraints or distributionally robust optimization for safety guarantees.

In addition to mining operations, this framework can also be adapted to other types of industries. The framework will allow for the adaptation to the requirements of different regulations and policies.

Acknowledgement: The authors would like to thank Botswana International University of Science and Technology (BIUST). The authors would like to thank the management and engineering teams at Jwaneng Mine for their support.

Funding Statement: The authors received no specific funding for this study.

Author Contributions: The authors confirm contribution to the paper as follows: conceptualization, Sravani Parvathareddy and Abid Yahya; methodology, Sravani Parvathareddy; software, Sravani Parvathareddy; validation, Sravani Parvathareddy, Lilian Amuhaya and Ravi Samikannu; formal analysis, Sravani Parvathareddy; investigation, Sravani Parvathareddy; resources, Ravi Samikannu; data curation, Sravani Parvathareddy; writing—original draft preparation, Sravani Parvathareddy; writing—review and editing, Sravani Parvathareddy and Raymond S. Suglo; visualization, Sravani Parvathareddy; supervision, Abid Yahya; project administration, Ravi Samikannu; funding acquisition, not applicable. All authors reviewed and approved the final version of the manuscript.

Availability of Data and Materials: The data that support the findings of this study are available from the Corresponding Author, Sravani Parvathareddy, upon reasonable request.

Ethics Approval: Not applicable.

Conflicts of Interest: The authors declare no conflicts of interest.

References

1. Akinyele D, Rayudu R. Review of energy storage technologies for sustainable power networks. Sustain Energy Technol Assess. 2015;11(2):74–91. doi:10.1016/j.seta.2014.07.004. [Google Scholar] [CrossRef]

2. Farhangi H. The path of the smart grid. IEEE Power Energy Mag. 2010;8(1):18–28. doi:10.1109/mpe.2009.934876. [Google Scholar] [CrossRef]

3. Guerrero JM, Loh PC, Lee T, Chandorkar M. Advanced control architectures for intelligent microgrids—Part II: power quality, energy storage, and AC/DC microgrids. IEEE Trans Ind Electron. 2013;60(4):1263–70. [Google Scholar]

4. Katiraei F, Iravani MR. Power management strategies for a microgrid with multiple distributed generation units. IEEE Trans Power Syst. 2006;21(4):1821–31. doi:10.1109/tpwrs.2006.879260. [Google Scholar] [CrossRef]

5. Alhelou HH, Golshan MEH, Zamani R, Heydarian-Forushani E, Siano P. Challenges and opportunities of load frequency control in conventional, modern and future smart power systems: a comprehensive review. Energies. 2022;15(3):846. doi:10.3390/en11102497. [Google Scholar] [CrossRef]

6. Zhang Y, Gatsis N, Giannakis GB. Robust energy management for microgrids with high-penetration renewables. IEEE Trans Sustain Energy. 2019;10(2):850–60. doi:10.1109/tste.2013.2255135. [Google Scholar] [CrossRef]

7. Smith J, Johnson R. Analysis of load volatility in mining operations: implications for microgrid design. In: Proceedings of the 2020 IEEE Industry Applications Society Annual Meeting; 2020 Oct 10–16; Detroit, MI, USA. p. 1–8. [Google Scholar]

8. Brown K, Williams L. Cost analysis of voltage deviations in mining operations. In: Proceedings of the 2022 IEEE Power & Energy Society General Meeting; 2022 Jul 17–21; Denver, CO, USA. p. 1–5. [Google Scholar]

9. Pipattanasomporn M, Kuzlu M, Rahman S. An algorithm for intelligent home energy management and demand response analysis. IEEE Trans Smart Grid. 2014;5(4):2166–73. doi:10.1109/tsg.2012.2201182. [Google Scholar] [CrossRef]

10. Mohammadi M, Hosseinian SH, Gharehpetian GB. Optimization of hybrid solar energy sources/wind turbine systems integrated to utility grids as microgrid (MG) under pool/bilateral/hybrid electricity market using PSO. Sol Energy. 2014;108(1):447–58. doi:10.1016/j.solener.2011.09.011. [Google Scholar] [CrossRef]

11. Liu Y, Li Y, Gooi HB, Jian Y, Xin H, Jiang X, et al. Distributed robust energy management of a multimicrogrid system in the real-time energy market. IEEE Trans Sustain Energy. 2018;10(1):396–406. doi:10.1109/tste.2017.2779827. [Google Scholar] [CrossRef]

12. Hossain MA, Pota HR, Squartini S, Abdou AF. Modified PSO algorithm for real-time energy management in grid-connected microgrids. Renew Energy. 2018;136:746–57. doi:10.20944/preprints201808.0037.v1. [Google Scholar] [CrossRef]

13. Hochreiter S, Schmidhuber J. Long short-term memory. Neural Comput. 1997;9(8):1735–80. doi:10.1162/neco.1997.9.8.1735. [Google Scholar] [PubMed] [CrossRef]

14. Wang H, Lei Z, Zhang X, Zhou B, Peng J. A review of deep learning for renewable energy forecasting. Energy Convers Manag. 2022;198:111799. doi:10.1016/j.enconman.2019.111799. [Google Scholar] [CrossRef]

15. Gupta R, Gupta P. Energy management in microgrids using machine learning based forecasting and optimization: a review. Energy Rep. 2022;8:1021–34. [Google Scholar]

16. Hasan KN, Pota HR, Squartini S, Abdou AF. Real-time energy management for grid-connected microgrids using heuristic optimization and neural networks. IEEE Access. 2020;8:17434–47. doi:10.20944/preprints201808.0037.v2. [Google Scholar] [CrossRef]

17. Kim S, Lee J. Deep reinforcement learning based energy management for microgrids with renewable energy sources and energy storage systems. IEEE Trans Smart Grid. 2021;12(2):1541–53. [Google Scholar]

18. Hadi M, Elbouchikhi E, Zhou Z, Saim A, Shafie-khah M, Siano P, et al. Artificial intelligence for microgrids design, control, and maintenance: a comprehensive review and prospects. Energy Convers Manag X. 2025;27(8):101056. doi:10.1016/j.ecmx.2025.101056. [Google Scholar] [CrossRef]

19. Chen S, Liu CC. From demand response to transactive energy: state of the art. J Mod Power Syst Clean Energy. 2023;11(1):10–25. [Google Scholar]

20. Bai S, Kolter JZ, Koltun V. An empirical evaluation of generic convolutional and recurrent networks for sequence modeling. arXiv:1803.01271. 2018. [Google Scholar]

21. Vaswani A, Shazeer N, Parmar N, Uszkoreit J, Jones L, Gomez AN, et al. Attention is all you need. In: Proceedings of the 31st International Conference on Neural Information Processing Systems; 2017 Dec 4–9; Long Beach, CA, USA. p. 5998–6008. [Google Scholar]

22. Oreshkin BN, Carpov D, Chapados N, Bengio Y. N-BEATS: neural basis expansion analysis for interpretable time series forecasting. In: Proceedings of the 8th International Conference on Learning Representations; 2020 Apr 26–30; Addis Ababa, Ethiopia. [Google Scholar]

23. Millner A, Louie H. Microgrid optimization and dispatch with model predictive control and mixed-integer linear programming. Energy. 2022;238:121672. [Google Scholar]

24. Li Y, Wen Y, Tao D, Guan K. Deep reinforcement learning for smart grid: fundamentals, applications, and future directions. IEEE Access. 2023;11:5465–86. [Google Scholar]

25. Amos B, Kolter JZ. OptNet: differentiable optimization as a layer in neural networks. In: Proceedings of the 34th International Conference on Machine Learning; 2017 Aug 6–11; Sydney, Australia. p. 136–45. [Google Scholar]

26. Schulman J, Wolski F, Dhariwal P, Radford A, Klimov O. Proximal policy optimization algorithms. arXiv:1707.06347. 2017. [Google Scholar]

27. Nemirovski A, Shapiro A. Convex approximations of chance constrained programs. SIAM J Optim. 2006;17(4):969–96. doi:10.1137/050622328. [Google Scholar] [CrossRef]

28. Ben-Tal A, El Ghaoui L, Nemirovski A. Robust optimization. Princeton, NJ, USA: Princeton University Press; 2009. 576 p. [Google Scholar]

29. Ames AD, Xu X, Grizzle JW, Tabuada P. Control barrier function based quadratic programs for safety critical systems. IEEE Trans Autom Control. 2017;62(8):3861–76. doi:10.1109/tac.2016.2638961. [Google Scholar] [CrossRef]

30. Ray A, Achiam J, Amodei D. Benchmarking safe exploration in deep reinforcement learning. arXiv:1910.01708. 2019. [Google Scholar]

31. Achiam J, Held D, Tamar A, Abbeel P. Constrained policy optimization. In: Proceedings of the 34th International Conference on Machine Learning; 2017 Aug 6–11; Sydney, Australia. p. 22–31. [Google Scholar]

32. Xu B, Oudalov A, Ulbig A, Andersson G, Kirschen DS. Modeling of lithium-ion battery degradation for cell life assessment. IEEE Trans Smart Grid. 2018;9(2):1131–40. doi:10.1109/tsg.2016.2578950. [Google Scholar] [CrossRef]

33. Smith K, Saxon A, Keyser M, Lundstrom B, Cao Z, Roc A. Life prediction model for grid-connected Li-ion battery energy storage system. In: Proceedings of the 2017 American Control Conference; 2017 May 24–26; Seattle, WA, USA. p. 4062–68. [Google Scholar]

34. Shi Y, Xu B, Wang Y, Zhang B. Using battery storage for peak shaving and frequency regulation: joint optimization for superlinear gains. IEEE Trans Power Syst. 2019;34(3):1899–908. doi:10.1109/pesgm.2018.8586227. [Google Scholar] [CrossRef]

35. Stellato B, Banjac G, Goulart P, Bemporad A, Boyd S. OSQP: an operator splitting solver for quadratic programs. Math Program Comput. 2020;12(4):637–72. doi:10.1007/s12532-020-00179-2. [Google Scholar] [CrossRef]

36. Smith J, Johnson K. Distributed computing in multi-agent systems: a survey of decentralized machine learning approaches. J Parallel Distrib Comput. 2024;180:104–20. [Google Scholar]

37. Maaruf M, Khan K, Khalid M. Robust control for optimized islanded and grid-connected operation of solar/wind/battery hybrid energy systems. Sustainability. 2022;14(9):5673. doi:10.3390/su14095673. [Google Scholar] [CrossRef]

38. Nguyen H, Tran L. Optimizing performance metrics with new distance and similarity measures using control parameters of linear Diophantine fuzzy sets. IEEE Trans Fuzzy Syst. 2023;31(5):1500–12. doi:10.1016/j.engappai.2025.112557. [Google Scholar] [CrossRef]

39. Qayyum M, Farooq D, Riaz M, Pamucar D. Preferences relative ordering by frequency inclusion technique (PROFIT) for optimizing performance evaluation. Appl Soft Comput. 2025;184(1):113807. doi:10.1016/j.asoc.2025.113807. [Google Scholar] [CrossRef]


Cite This Article

APA Style
Parvathareddy, S., Yahya, A., Amuhaya, L., Samikannu, R., Suglo, R.S. (2026). A Hybrid LSTM–FNN Framework for Safety-Constrained Energy Management in Mining Microgrids. Energy Engineering, 123(6), 10. https://doi.org/10.32604/ee.2026.079449
Vancouver Style
Parvathareddy S, Yahya A, Amuhaya L, Samikannu R, Suglo RS. A Hybrid LSTM–FNN Framework for Safety-Constrained Energy Management in Mining Microgrids. Energ Eng. 2026;123(6):10. https://doi.org/10.32604/ee.2026.079449
IEEE Style
S. Parvathareddy, A. Yahya, L. Amuhaya, R. Samikannu, and R. S. Suglo, “A Hybrid LSTM–FNN Framework for Safety-Constrained Energy Management in Mining Microgrids,” Energ. Eng., vol. 123, no. 6, pp. 10, 2026. https://doi.org/10.32604/ee.2026.079449


cc Copyright © 2026 The Author(s). Published by Tech Science Press.
This work is licensed under a Creative Commons Attribution 4.0 International License , which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.
  • 184

    View

  • 52

    Download

  • 0

    Like

Share Link