1. Introduction
The upsurge of renewable energy sources and the escalating need for sustainable, reliable energy systems have spurred a profound interest in battery storage technologies [
1]. Batteries stand as a potent solution to the challenges posed by the integration of renewables like solar and wind power into the grid [
2]. Furthermore, they play a pivotal role in critical facets of energy management, including demand response, peak shaving, and grid stabilization [
3].
In this context, the effective control of battery energy storage systems (BESSs) emerges as a primary factor in enhancing the overall performance and dependability of energy systems. Advanced methods that optimize the operation of battery storage systems within energy management systems (EMSs) hold the potential to significantly enhance grid efficiency and reliability [
4]. Efficient and reliable battery storage management holds paramount importance for several compelling reasons, given its pivotal role in mitigating various challenges in modern power systems and facilitating the integration of renewable energy resources [
5].
Optimization-based control of BESSs can bolster grid stability by furnishing services like frequency regulation [
6], voltage support, and spinning reserve [
7]. This aids in maintaining operational parameters within acceptable bounds and diminishes the likelihood of power outages and equipment failures. BESSs can adeptly handle the variability of renewable sources like wind and solar power by storing surplus energy during periods of high generation and releasing it during low generation periods [
2,
8]. Efficient battery storage management proves instrumental in optimizing the benefits of such systems and facilitating the increased penetration of renewables in the energy mix.
The effective control of BESSs contributes to the reduction in peak demand by storing energy during off-peak times and discharging it during peak periods [
3]. This peak shaving capability alleviates stress on grid infrastructure, defers investments in new generation capacity, and lowers overall electricity costs for consumers. Efficient battery storage management amplifies the demand response programs by offering additional grid flexibility [
9]. This allows for better alignment of electricity consumption with available generation capacity, potentially leading to reduced greenhouse gas emissions and lower system costs.
The application of MPC for BESS control can also help reduce the variability of wind power and forecast errors, which pose challenges and security issues in power systems. The authors of [
10] proposed a method to size a BESS for improved wind farm integration, incorporating operational constraints into MPC. By analyzing the average fluctuation rate with different BESS capacities and defining a dispatch fluctuation rate, the most economical BESS size was determined and demonstrated on a wind farm in Fujian, China.
In terms of optimal control, Model predictive control (MPC) has gained popularity in recent years. MPC is a versatile control strategy extensively used across engineering applications, as documented in [
11]. MPC continuously solves optimization problems, making it suitable for the control of systems with complex dynamics, input and output constraints, and unpredictable disturbances.
Despite numerous adaptations of model predictive control (MPC), significant limitations prevent its widespread application, particularly in controlling multivariable systems with fast dynamics, such as BESSs. These systems present substantial demands on computational and memory resources, creating challenges for hardware implementation. Another disadvantage of MPC would be the inability to consider time-varying system parameters [
12]. Consequently, there remains a substantial demand for the development and deployment of an MPC-like control approach that ensures nearly optimal performance on inexpensive, low-power embedded hardware [
13].
Various techniques have been proposed to decrease the computational burden of conventional MPC. One approach involves solving the optimal control problem offline, wherein the optimal control law is precomputed for all feasible initial conditions, a methodology known as explicit MPC [
14]. Explicit MPC preserves optimality while eliminating the need for real-time optimization. Practical challenges associated with hardware synthesis of explicit MPC controllers were investigated in [
15], while [
16] offers an overview of alternative approaches aiming to maintain MPC controller optimality without online optimization. For instance, [
17] explores the use of neural networks to design an explicit linear feedback law. Nonetheless, such methods typically sacrifice optimality and lack stability guarantees. Additionally, generating sufficient data for neural network training still necessitates the evaluation of a large set of optimal control problems.
In [
18], a novel MPC strategy is introduced, especially tailored for BESSs, with a specific emphasis on grid operator objectives. The primary aim is to minimize the equivalent cost. Simulation results affirm the strategy’s effectiveness in smoothing power fluctuations, ensuring optimal BESS operation for extended longevity. The authors of [
19] introduced a state-of-charge (SoC) feedback-based battery control approach. This strategy allocates real-time power and energy for individual battery units, accounting for constraints on power fluctuation rates and the maximum allowable charge/discharge power for each unit.
In [
20], a dynamic SoC recovery reference-based control approach for BESSs participating in secondary frequency regulation was introduced. The MPC method is employed to determine the optimal frequency regulation and SoC maintenance simultaneously. Additionally, fuzzy control is integrated to establish the SoC recovery reference value, ensuring that the SoC remains within an optimal range. The drawbacks of the MPC design framework are the substantial computational and memory demands.
This paper considers the control of load demand and power from a BESS. The formulation of BESS control involves Boolean-type constraints. To tackle this challenge, a specialized MPC framework for systems with such constraints is employed. However, this type of optimization problem is classified as a mixed-integer problem and requires dedicated mathematical solvers that are typically inaccessible or licensed for commercial use, making MPC impractical for computationally restricted industrial hardware.
To overcome this challenge, we introduce a stochastic, nearly optimal approximation of MPC with Boolean-type constraints. This approach depends on the random generation of control inputs known as random shoots (RSs). The RS-based methods center on the random generation of control sequences, followed by assessments for feasibility to ensure constraint adherence and performance evaluation. Upon runtime completion, the feasible random sequence with the best performance index is chosen. If the optimization problem is convex, runtime and solution suboptimality can be estimated beforehand [
21]. Moreover, RS also solves problems with discontinuous prediction models, cost functions, or non-convex constraints.
Over the past two decades, stochastic methods like the the random shooting-based (RS) approach have garnered attention in controller design [
21,
22,
23]. The RS method introduces randomized algorithms for a broad range of controller design problems. Details on these algorithms for controller synthesis using statistical learning theory are available in [
23]. Additionally, a generalized approach to solving convex optimization problems through randomized algorithms was proposed in [
21], offering close-to-optimal solutions within a limited number of iterations.
Similar to neural-network-based MPC, RS offers a suboptimal solution without stability guarantees. However, unlike neural-network-based MPC, it does not require solving of optimal control problems to extract the training data, making it suitable for implementation on embedded platforms used in industrial applications and Industrial Internet of Things (IIoT) services.
This work proposes a lightweight implementation of close-to-optimal RS-based control, aiming to combine the benefits of MPC’s optimal control evaluation with RS-based approximation’s library-free, easy-to-implement algorithm. This approach promises straightforward and fast control implementation. The proposed method is verified for BESS control, including distinct scenarios that highlight the possibility of balancing between suboptimality and computational efficiency, showcasing the versatility of the random shooting-based approach. This solver-free methodology proves particularly valuable in settings with strict computational constraints, offering potential for innovative control strategies. In essence, it allows for new ways of effective energy storage system management.
The paper is structured as follows. After the Introduction, exploring the problem domain, this paper outlines the methodology used to address the research objectives in
Section 2. This section outlines the principles of MPC, including its application to systems with Boolean-type constraints and stochastic approximation, i.e., the random-shooting-based method. The results of the case study are presented in
Section 3, including system configuration, optimization of battery energy storage control, and various simulation scenarios. Subsequently,
Section 4 provides an analysis of the results, comparing them with those obtained by existing methods and identifying both strengths and limitations. Finally, in
Section 5, we summarize the paper, highlighting key insights and the application range of the proposed methods.
2. Methods
This paper introduces an approach, free from solvers, to evaluate model predictive control (MPC) in systems with Boolean-type constraints. This method arises from the recognition that solving MPC with Boolean-type constraints necessitates a mixed-integer solver, which can be a bottleneck in practical applications including BESSs. Moreover, there is a common need for rapid and efficient evaluation a suboptimal yet feasible control sequences even on computationally restricted hardware, which is often considered with BESSs. The random shooting-based methodology for systems with Boolean-type constraints mirrors the conventional MPC-based approach. It involves generating random control sequences and subsequently checking their feasibility to ensure they satisfy the constraints.
2.1. Model Predictive Control
Model predictive control (MPC) is a sophisticated control strategy widely employed in various engineering applications, as detailed in [
11]. MPC operates by solving an optimization problem at each time step. This allows MPC to effectively handle systems with complex dynamics, constraints on inputs and outputs, and uncertain disturbances. This strategy is centered around optimizing control inputs while adhering to specified constraints. The goal of solving the optimization problem is to generate a series of optimal control inputs at each control step. This determination of optimal control inputs relies on a prediction of the system’s future behavior. This control methodology allows for the incorporation of constraints on output, state, and input variables. The optimization problem addressed by the model predictive controller discussed in this study is formally described as follows:
The system’s states are denoted as
, and and control inputs are represented by the manipulated variable
, where
and
are the number of system states and inputs, respectively). The system states and control inputs are constrained within intervals defined by their respective minimal and maximal values, denoted as
and
. In a broader sense, these constraints can also take the form of any convex sets. The decision variables are composed of vectors
and
, consisting of individual predictions of states and optimal control inputs. The MPC exclusively employs the first optimized control input (
), subject to the receding horizon implementation based on a prediction horizon (
N) and the current measured state (
). In Equation (1), quadratic penalties are frequently considered. In general, the state update Equation (1b) can be either linear in the case of a linear model or nonlinear in the case of a nonlinear model. This choice enables the formulation of the MPC problem as a quadratic programming (QP) problem. However, similar outcomes can be achieved by employing 1-norm and ∞-norm-based penalizations in Equation (1), resulting in a linear programming (LP) problem (refer to [
24] for further details).
2.2. Model Predictive Control for Systems with Boolean-Type Constraints
The purpose of this paper is to control BESS systems with boolean-type constraints. Systems with discrete constraints are a subclass of hybrid systems, which are dynamic systems characterized by the presence of continuous states, discrete states, and event variables. Essentially, these systems exhibit a combination of time-driven and event-driven behaviors. The designed controller must affect both the time-driven and event-driven aspects, potentially handling signals that are either continuous or discrete in nature. Hybrid systems offer an effective approach for representing complex, large-scale industrial processes. The general optimization problem for systems with Boolean-type physical constraints can be structured as follows:
Considering MPC for systems with Boolean-type constraints, the control inputs have the following structure: , where and are the Boolean-type and discrete states, respectively. The system states are constrained within bounded intervals defined by and . The continuous and discrete control inputs are bounded by , and . Note that these types of optimization problems are classified as mixed-integer problems and require a dedicated solver.
2.3. Stochastic Approximation of MPC Problem
The MPC design framework, as discussed in
Section 2.1, faces a significant challenge related to the demanding computational and memory requirements. Furthermore, the MPC framework relies on the existence and availability of mathematical solvers, which are almost never open-source for commercial use. This proves impractical for the commonly used embedded hardware in the industry. To address this issue, a stochastic, nearly optimal approximation of MPC control is introduced. This method is based on random generation of control inputs i.e., random shoots (RSs), hence its name: random shooting-based control. The RS-based methods rely on generating control sequences randomly. These sequences are assessed for feasibility, ensuring constraint satisfaction, and their performance is evaluated. At the end of the runtime, the feasible random sequence with the best performance index is selected, and its first element is applied in the system-receding horizon fashion similar to the MPC framework. While this chosen sequence may not be optimal, it remains feasible, ensuring safe operation. The degree of suboptimality diminishes as more control sequences are generated. For convex optimization problems, it is possible to estimate the runtime and suboptimality in advance (see [
21]). In the case of nonlinear optimization, the evaluation of the suboptimality level is not straightforward and is highly case-dependent.
This method’s versatility extends to solving problems with nonlinear or discontinuous prediction models or cost functions, as well as non-convex constraints, as it allows for exploitation of the structure of the optimization problem. The fundamental principles of the RS-based control are summarized in Algorithm 1. Algorithm 1 is also visualized using a flow chart in
Figure 1.
This approach generates a randomized sequence of feasible control inputs, selecting the one with the best performance index (). This performance index can be compared to the minimum cost function value in (1). It achieves this by considering a large number of randomly generated sequences of control inputs. Generally, the chosen control sequence () is suboptimal compared to the exact MPC solution in (1).
In Algorithm 1, i serves as a counter for random shoots, r represents feasible random shoots, binary indicates feasibility, and is the maximum number of feasible random shoots. The remaining variables in Algorithm 1 are consistent with those in the MPC problem in (1).
However, it is important to note that implementing Algorithm 1 comes with a drawback: it does not guarantee the existence of
feasible random shoots within a given sampling time (
), meaning achieving the required level of suboptimality is not assured. In fact, in the worst case, a feasible control input (
) may not be found. Moreover, in terms of recursive feasibility, Algorithm 1 does not guarantee the discovery of a feasible solution in the subsequent control step.
Algorithm 1 Random shooting-based approximation of the MPC problem. |
- Require:
system state measurement , number of feasible random shoots, maximal number of random shoots , MPC problem ( in (1) - Ensure:
sequence of control inputs: - 1:
; ; , // Initialize random shooting - 2:
while and
do - 3:
, , , // Reset variables - 4:
for do - 5:
if then - 6:
// Random shoot - 7:
// Penalty update - 8:
// System state update - 9:
else - 10:
// Primal infeasible - 11:
break - 12:
if then - 13:
// Update primal feasibility counter - 14:
if then - 15:
// Update approximated solution - 16:
// Update reference penalty - 17:
return
|
2.4. Stochastic Approximation of Model Predictive Control for Systems with Boolean-Type Constraints
This paper introduces a solver-free, random shooting-based approach for evaluating model predictive control (MPC) in systems with Boolean-type constraints, as defined in (2). This approach stems from the recognition that solving the problem in (2) typically requires a mixed-integer solver, which can be a bottleneck in practical applications. Additionally, there is often a need for swiftly and efficiently evaluating a suboptimal yet feasible control sequence.
The random shooting-based method for systems with Boolean-type constraints follows a similar procedure to its conventional counterpart outlined in Algorithm 1. Control sequences are randomly generated and subsequently assessed for feasibility to ensure compliance with constraints. The sequence with the best performance index is selected. While this chosen sequence may not be optimal, it remains feasible, ensuring safe operation.
The fundamental principles of random shooting-based control are summarized in Algorithm 2. This approach generates a randomized sequence of feasible control inputs, distinguishing between discrete control inputs () and Boolean control inputs (). It selects the combination with the best performance index () over the prediction horizon. Although the chosen control sequence () is suboptimal compared to the exact MPC solution in (1), it provides a practical and efficient alternative.
In Algorithm 2, the parameters
i,
r,
, and
align with the variables in Algorithm 1 and in the optimal control problem (2). This method offers a valuable solution for systems with Boolean-type constraints, allowing for efficient evaluation without the need for specialized solvers, thus overcoming a significant practical limitation in MPC applications.
Algorithm 2 Random shooting-based approximation of the MPC problem for systems with Boolean-type constraints. |
- Require:
system state measurement , number of feasible random shoots, maximal number of random shoots , MPC problem - Ensure:
sequence of control inputs: - 1:
; ; , // Initialize random shooting - 2:
while and
do - 3:
, , , // Reset variables - 4:
for do - 5:
if then - 6:
// Random shoot - 7:
// Random shoot - 8:
- 9:
// Penalty update - 10:
// System state update - 11:
else - 12:
// Primal infeasible - 13:
break - 14:
if then - 15:
// Update primal feasibility counter - 16:
if then - 17:
// Update approximated solution - 18:
// Update reference penalty - 19:
return
|
3. Results
The presented case study involves the control of load demand and power from a BESS. The optimal control problem for the BESS is detailed in
Section 3.2. This formulation also includes Boolean-type constraints. To address this type of problem, we must utilize an MPC framework tailored for systems with such constraints, as discussed in
Section 2.2. Additionally, we propose a computationally efficient, solver-free alternative called random shooting-based approximation of MPC for systems with Boolean-type constraints, as outlined in
Section 2.4.
Random shooting-based approaches are known for their stochastic nature and remarkable adaptability in addressing diverse control challenges by allowing the user to exploit the structure of the optimization problem. In this case study, we explore this adaptability by analyzing the proposed approach described in
Section 2.4 in three distinct control scenarios and comparing them subject to the optimal approach in
Section 2.2. These scenarios not only demonstrate its ability to establish a balance between computational complexity and suboptimality level but also showcase the advantages of this lightweight, solver-free alternative to traditional MPC.
3.1. System Configuration
In this case study, the performance of simulations carried out was largely influenced by both the software and hardware configurations used. For the software setup, we utilized MATLAB R2023a on a Windows 11 Home operating system. For optimization tasks, the GLPK-GLPKMEX-CC solver from YALMIP was employed. The computational efficiency was ensured by the hardware setup, which featured a 12th Gen Intel(R) Core(TM) i7-12700H processor at 2.30 GHz and 32.0 GB RAM.
3.2. Optimal Control Problem of the Battery Energy Storage System
In this case study, we consider a microgrid consisting of a battery energy storage system. The created microgrid is connected to the power grid, using which it can the exchange energy depending on the amount of produced or required power. The aim is to cover the desired load by using the power delivered from the power grid and BESS. The optimal solution is found by solving the optimization problem defined in general form as
where
denotes the power bought from the grid. Notations
and
represent load demand and power from the BESS, respectively. The parameter
denotes prices for buying from the power grid, and
and
represent the charge and discharge power, respectively. The values
and
specify the boundaries for the battery’s state of charge, marking the lowest and highest levels, respectively.
3.3. Control Setup and Simulation Scenarios
In the simulations, we defined several key parameters to guide our control strategies. The state of charge (SoC) was set between specific limits: and . The initial value was . The power output from the battery, denoted as , was constrained within the range of and . For the battery itself, we established a fixed capacity of and a predetermined efficiency of . The prediction horizon, represented by N, was set for 24 h, while the control horizon extended over 48 h. The power demand, labeled as , quantified the power consumption in kW for a small county from 1 January 2021 to 3 January 2021. In parallel, the vector, detailing electricity prices, matched the timeline of .
3.3.1. Scenario 1—Fast
In this scenario, the objective was to tune the proposed Algorithm 2 to minimize the average computational time required to evaluate the sequence of control inputs. This objective is achieved by restricting the Algorithm 2 to identify just five feasible solutions, i.e., . Consequently, the algorithm operates at a significantly higher speed, a benefit accompanied by a trade-off in solution suboptimality. This trade-off entails an expected increase in suboptimality compared to the optimal solution, as the algorithm’s focus shifts toward computational efficiency over optimal control performance. Note that the provided solution is still a feasible one, subject to the constraints defined in (3).
Figure 2 shows the results of Algorithm 2, where
. The initial graph portrays the
vector. Following this, the second graph shows the optimal trajectory of
,
, and
as computed by the approach outlined in
Section 2.2. In the third graph, the results of Algorithm 2, where
, are shown.
Figure 3 depicts the state of charge (SoC) trajectory of the battery throughout the simulation.
3.3.2. Scenario 2—Balanced
In the “Balanced” scenario, Algorithm 2 is configured to explore a finite number of control input combinations, offering a trade-off between computational efficiency and solution quality. To achieve this balance, we set the total number of tested input combinations to . This design decision introduces an element of variability in the number of feasible solutions found, as the algorithm adapts to the problem’s complexity. The number of feasible solutions varies across each sampling period in which Algorithm 2 is employed. On average, 1572 were found to be feasible.
As a result, there is a significant probability of identifying a sufficient number of feasible combinations, ensuring a relatively short computation time. This scenario strikes a balance between computational time and suboptimality. A lower suboptimality rate compared to the first scenario is expected but with a slightly increased average computational time. By carefully tuning Algorithm 2, a balance between control performance and computational efficiency is established.
Figure 4 presents the simulation results in an analogous manner to the previous scenario.
3.3.3. Scenario 3—Reliable
In the “Reliable” scenario, Algorithm 2 is tailored to ensure the computation of a predefined number of feasible solutions (
). This holds the promise of reducing suboptimality rates when compared to Scenario 1, where only five feasible solutions were explored. However, it comes at a computational cost, as the algorithm must diligently search for these feasible solutions. The number of required feasible solutions is set to
, which differentiates it from the “Balanced” scenario, where
represented the overall number of examined input combinations with 1572 feasible solutions. Despite the increased computational time, this factor is of lesser concern, since the sampling time interval is set at one hour. The extended computational time is inconsequential in this case. Compared to
Figure 5, the
Figure 6 illustrates the simulation results in a manner consistent with the previous scenarios.
Figure 7 illustrates the battery’s (SoC) trajectory over the simulation duration, underscoring the notable congruence in performance between the conventional MPC and random shooting techniques.
Table 1 provides a comprehensive overview of quantified results, offering performance metrics for the proposed method (
Section 2.4) in different setups and the optimal method (
Section 2.2). The parameter
presents the average computational time required for the computation of the control inputs. The value of
represents the closed-loop cost function in (
2a) summed over the control span of 48 h. In the
column, we observe the number of feasible solutions found, while in the case of Scenario 2, we present an average number of feasible solutions, as it varies across each sampling period. Suboptimality provides an essential measure of how closely each method approaches the optimal solution. The symbol “†” denotes the inapplicability of the criterion.
4. Discussion
In this case study, two distinct control methodologies were employed to calculate the load demand and battery power of the BESS, as described in (3). The resulting control trajectories were analyzed in terms of their performance and computational complexity. The first methodology implemented an optimal strategy: MPC with Boolean-type constraints (
Section 2.2). This deterministic method accurately computes the solution to the optimization problem in (2). The second implemented strategy adopted the random shooting-based approximation of MPC with Boolean-type constraints (
Section 2.4). Unlike the deterministic MPC-based approach, this method generates a sequence of random control inputs, subsequently evaluating their feasibility against the system constraints. The stochastic nature of this methodology inherently results in a suboptimal solution, a consequence of its probabilistic approach.
Table 1 provided an analysis of quantified results, offering a comparison of the performance and computational complexity of the proposed method (
Section 2.4) in different setups and the optimal method (
Section 2.2). The proposed method was tested with respect to three distinct scenarios. The adaptability of the method relies mainly on two parameters of the proposed Algorithm 2:
and
. By tuning these two criteria, the user can strike a balance between the desired level of suboptimality and the permissible level of computational complexity. An example of computationally efficient evaluation of Algorithm 2 would be Scenario 1, where the evaluation of a feasible solution was approximately five times faster than the evaluation of an optimal solution.
This benefit came with the price of an increased suboptimality level, which was approximately 10%. Scenario 2 was more balanced, aiming to achieve a feasible solution with a reasonable level of suboptimality while expending a reasonable computational effort. The evaluation of a feasible solution is now slower than the optimal method, but the suboptimality of the solution is only 5%. In Scenario 3, the aim was to achieve a suboptimality level below 5%, but the price for this was an increased evaluation time of 145 ms.
The purpose of the different scenarios was to showcase the versatility and adaptability of this method by balancing performance, i.e., suboptimality and computational complexity. Arguably, the random shooting methodology, while inherently stochastic, offers several advantages. First and foremost, its non-reliance on traditional optimization solvers significantly streamlines the computational process, making it well-suited for environments with strict computational demands such as embedded hardware or where solver integration is complex. Additionally, the method allows for the exploitation of the optimization problem, potentially uncovering effective control strategies that deterministic approaches might overlook or might not be able to incorporate.