Open access peer-reviewed chapter

Consensus Control of Distributed Battery Energy Storage Devices in Smart Grids

Written By

Javad Khazaei and Dinh Hoa Nguyen

Submitted: 19 June 2019 Reviewed: 16 July 2020 Published: 17 February 2021

DOI: 10.5772/intechopen.93409

From the Edited Volume

AI and Learning Systems - Industrial Applications and Future Directions

Edited by Konstantinos Kyprianidis and Erik Dahlquist

Chapter metrics overview

539 Chapter Downloads

View Full Metrics


One of the major challenges of existing highly distributed smart grid system is the centralized supervisory control and data acquisition (SCADA) system, which suffers from single point of failure. This chapter introduces a novel distributed control algorithm for distributed energy storage devices in smart grids that can communicate with the neighboring storage units and share information in order to achieve a global objective. These global objectives include voltage regulation, frequency restoration, and active/reactive power sharing (demand response). Consensus theory is used to develop controllers for multiple energy storage devices in a cyber-physical environment, where the cyber layer includes the communication system between the storage devices and the physical layer includes the actual control and closed-loop system. Detailed proof of designs is introduced to ensure the stability and convergence of the proposed designs. Finally, the designed algorithms are validated using time-domain simulations in IEEE 14-bus system using MATLAB software.


  • consensus control
  • battery energy storage
  • smart grids
  • distributed control
  • droop control

1. Introduction

Integration of highly distributed renewable energy sources has introduced significant challenges to the resiliency and efficiency of the smart grid systems. This is mainly due to uncertain behaviors of these renewable energy sources and their dependency to weather conditions [1, 2]. Battery energy storage has been introduced as a solution to solve the intermittency and uncertain behaviors of renewable energy sources in smart grids. The energy storage is normally connected to the electric power system through a voltage source converter and by controlling the charge/discharge rate of the storage units, output power regulation of renewable energy sources can be achieved [3, 4].

Currently, energy storage units are distributed throughout the grid. Given the centralized structure of supervisory control and data acquisition (SCADA) system, it cannot meet the requirements of highly distributed renewable energy and storage devices of future smart grid systems. In addition, the centralized controllers suffer from single point of failure and are not a suitable choice for energy storage control when the grid resiliency is significantly important [5, 6, 7]. As an example, an energy storage device which is permanently out of energy is not able to use its power capability to support the load until a charge event is scheduled. Moreover, any charge discrepancies will result in battery degradation due to the increased depth of discharge.

Distributed control of distributed energy storage units has recently been introduced [8, 9, 10, 11]. For example, a coordinated control is proposed for low voltage distribution networks in [8], which mitigates voltage fluctuations in a distribution feeder using distributed storage units. As another example, the voltage regulation issue of distribution feeders is resolved using a droop-based distributed controller to cooperatively charge/discharge the storage units to regulate the feeder voltage considering the state of charge of the batteries [9]. In Hammad et al. [10], a virtual inertia-based distributed controller is designed for transient stability of a power system using distributed storage units. The authors then used a feedback linearization control algorithm to evaluate the proposed virtual inertia and its effectiveness in stability of the system.

Consensus control of energy storage units has also recently been proposed as an emerging technique for synchronization of distributed storage devices [12, 13, 14, 15, 16, 17, 18, 19, 20]. In Khazaei and Miao [13], the authors introduced a state of charge balancing algorithm for distributed storage devices in AC microgrids using consensus theory and validated the results using a real-time simulator. In Guan et al. [15], a dynamic consensus approach was introduced to balance the discharge rate of energy storage devices in AC microgrids. The proposed model achieved power regulation by adjusting the virtual resistance of voltage-controlled inverters. A novel distributed controller was designed for load management in distribution networks using distributed battery storage systems. The proposed methodology used limited communications to coordinate multiple storage units with solar power energy penetration. The authors also have significantly studied the consensus design for storage devices for power sharing and energy synchronization [13], power sharing of heterogeneous storage units with droop control [14], voltage and frequency regulation of storage devices in smart grids [16], output power regulation of double-fed induction generator-based wind farms [19], and power sharing of storage devices with different droop schemes [20].

This chapter summarizes the findings of the authors in the distributed control design of energy storage devices in smart grids to provide ancillary services including: (1) voltage regulation, (2) primary frequency support, (3) equal active power sharing between storage units based on their capacities, (4) equal reactive power sharing based on storage capacity, and finally, and (5) controlling the load in both islanded and grid-connected modes. Time-domain simulations on a modified IEEE 14-bus system are performed to validate the effectiveness of the proposed designs.

The rest of the paper is as follows: Section 2 covers the battery energy storage model. Consensus design for heterogeneous storage units is considered in Section 3. Section 4 includes multiple case studies to validate the designs, and Section 5 concludes the chapter.


2. Battery energy storage model

A basic schematic of an energy storage device, which is connected to the grid through a DC/AC converter and an LCL filter is illustrated in Figure 1. The energy storage control uses the well-known synchronous reference frame control, where three cascaded control loops are adopted. The main objective is to control the active and reactive demand using a droop control method in dq reference frame. The droop control receives active and reactive power measurements from a sensor installed at the point of common coupling (PCC) as

Figure 1.

Control structure of a battery energy storage system.


where Pmi and Qmi are measured active and reactive powers, respectively. In addition, vod,voq,iod, and ioq are measured converter voltages and currents at the point of common coupling, as illustrated in Figure 1. The measurements will then pass through a low-pass filter,


where αp and αq are the bandwidths of the low-pass filters. The AC-side dynamics of the ith energy storage system in dq frame is expressed as:


where vod and voq are dq voltages at the point of common coupling (PCC), vid and viq are the dq frame converter output voltages, and iid and iiq are the dq reference frame currents flowing from the PCC to the converter.

2.1 Inner current controller

The most inner control loop in the energy storage system is the current controller, which is in charge of regulating the converter current in a decoupled manner. The inputs to this controller come from the voltage controller and are the reference dq frame current setpoints. Two proportional integral controllers are utilized which regulate the d and q axis currents with feedforwarded loops. Dynamics of the current controller for ith battery storage system are presented as [14]:


where vidref and viqref are reference converter voltages to be sent to the pulse width modulation (PWM) controller, kp and ki are the PI regulator gains, and τ is the time constant of the low-pass filter for voltage measurement. The controller computational delay and pulse width modulation (PWM) switching are modeled by τs which can be ignored for simplicity [14].

2.2 Voltage control

Voltage controller receives inputs from the droop controller and provides reference currents for the inner current control loops. Similar to the current controller, two PI regulator are used for the voltage controller. Dynamics of the voltage control loop can be modeled by [14]:


where vodref,voqref are dq frame reference converter voltages, vod,voq are the dq frame measured voltages at the PCC passed through a low-pass filter, and iod, ioq are the dq frame converter output currents. In addition, τv is the time constant of the filter that is used in voltage controller.

2.3 Droop control

Droop control is used when multiple converters are installed in parallel to support the load based on their capacities. The principle of the droop control is based on the fact that a converter with higher capacity should share more load compared to a converter with lower capacity. This will be taken care of by designing droop gains properly. The droop controller receives measurements from active and reactive powers at the point of common coupling and provides reference voltage and frequency to that shape the reference voltages in dq frame for the voltage controller loop such that


The droop controller sends the reference voltage magnitude and frequency setpoints of the converter to the voltage controller. Dynamics of the droop controller can be expressed by:


where ωi is frequency setpoint of ith battery storage, ωinom is the nominal frequency to be developed using the consensus theory, DiP is the active power droop gain, Vinom is the nominal voltage magnitude of the ith storage to be designed by consensus control, and DiQ is the reactive power droop gain. The droop gains can be found by:


The droop control design is similar to the primary frequency and voltage control of synchronous generators, where the voltage and frequency will not be regulated to their nominal values. To restore the voltage and frequency to their nominal values, a distributed controller is designed in this work using a consensus theory. The proposed controller receives signals from neighboring storage devices and modifies the nominal frequency/voltage in the droop equations to regulate the voltage and frequency to their setpoints.


3. Heterogeneous consensus design

The main objective of this section is to supplement a secondary controller to the droop controller of the storage devices. The controller receives information from neighboring storage units and shares the power between storage devices to regulate the voltage and frequency of the system at the point of common coupling. Furthermore, a virtual leader is considered, which can be assigned to one energy storage in the system, or a few storage devices. The leader will have the setpoints of the voltage and frequency in the system and will share the information with its neighboring storage units. To develop such a control design, the battery energy storage model needs to be developed. In our recent work, a simplified battery energy storage model was developed. The model accounts for the dynamics of the droop controller and active power/energy relationship of the battery. Such model can accurately incorporate the dynamics of energy storage devices in smart grids. Dynamics of the energy storage devices can be represented by [14]:


To develop such simplified model, it is assumed that dynamics of voltage controller and current controller are much faster than the droop controller, therefore, their dynamics can be ignored. In the above model, uiP is the input for distributed active power sharing, and DiP reflects the heterogeneity of batteries. To achieve equal power sharing, DiPPi should be regulated among batteries so that a battery with higher capacity (lower droop gain, DiP) contributes more to the power sharing. To minimize the number of communication links between the storage devices, this paper regulates the nominal voltage and frequency of neighboring storage units. In this method, there will be no need to receive measured voltage and frequency signals from neighboring storage units and the control design only requires the nominal frequencies ωjnom and nominal voltages Vjnom of its neighboring storage devices.

To provide voltage and frequency regulation as well as active/reactive power sharing, new distributed inputs can be designed using consensus theories. These inputs include V̇inom=uiV, Q̇i=uiQ, and ω̇inom=uiω. The overall dynamics of the ith energy storage device is then formulated as [14]:


In the next section, control design to develop these new inputs will be elaborated in detail.

3.1 Graph theory

Some preliminary information on graph theory is needed in order to design the controllers. The multi-agent system theory is considered for designing the controller inputs so that each battery energy storage unit is considered as an agent that can communicate with neighboring agents. It is also assumed that the communication network of the system is an undirected graph G that has a vertex set of V and an edge set of E. Each vertex represents an energy storage system and the interconnection between storage systems k and j is represented by element kjE.

The neighboring set of energy storage number k is expressed by NkjV:kjE. In addition, akj is an element of the adjacency matrix A of G, i.e. akj=1 if kjE and akj=0 if kjE. Finally, D is the degree matrix that is derived by D=diagdkk=1,,n, where dkjNkakj. It is noted that, the Laplacian matrix L associated to G can be formulated by L=DA. The leader is in charge of sending setpoints to energy storage units. The leader is represented by sub-index 0 and its neighboring storage units are denoted by N0. Then a0i=1 if iN0, while a0i=0 if iN0.

3.2 Consensus control design

Let ωref and Vref be the reference frequency and voltage magnitude of energy storage devices. These references serve as external commands to force the frequency and voltage magnitude of storage devices to converge precisely to the expected values. In other words, they are virtual leaders while the frequency and voltage magnitude of batteries are the followers. In this sense, the consensus design is proposed as follows,


Note here that the controller gains for the active power and frequency are the same, and similarly the controller gains for the reactive power and voltage magnitude are also the same. The structure of the proposed distributed primary and secondary voltage/frequency controller is illustrated in Figure 2.

Figure 2.

Structure of the proposed distributed controller.

3.3 Consensus proof

Let P˜iDiPPi and Q˜iDiQQi, then the closed-loop model of BESS with the consensus design (18) is


First, we introduce the proof for consensus of the active powers and reactive powers of storage devices. It can be easily observed from Eq. (19) that the dynamics of the proportional active powers P˜i and reactive powers Q˜i have the same form. Moreover, the consensus of the proportional active powers P˜i will lead to the consensus of batteries’ energy levels Ei, if the initial state of charge of the batteries is the same. Therefore, we only present the proof for the consensus of the active powers P˜i. The dynamics of P˜i is self-contained and in form of a first-order differential equation, and hence, its solution can be easily found to be


where P˜0 is the vector of initial proportional active powers of batteries. Since L is a symmetric matrix, eC2Lt is also a symmetric matrix. Let URN×N be an orthogonal matrix derived from diagonal matrix L. Subsequently, it can be easily seen that


since λ2,,λN are positive eigenvalues of L once G is connected. On the other hand, Udiag100UT=1N/N0N0NUT=1N1NT/N since the eigenvector associated with the zero eigenvalue of L is 1N. Therefore, we obtain from (21) and (20) that


which means that the average consensus is achieved for batteries’ proportional active powers. As mentioned above, similar proof can be utilized to get the consensus of batteries’ proportional reactive powers.

Next, we present the proof for the consensus of the voltage magnitude and frequency of batteries to their references Vref and ωref. For brevity, only the proof for the consensus of nominal frequency ωinom is given, while the proof for the consensus of nominal voltage magnitude Vinom can be derived similarly because their equations are in the same form as seen in (19).

Let us denote




Denote D0diaga0ii=1,,N. Consequently, we obtain from (23) that


Assume that the communication graph G among followers is connected and at least one follower is connected to the leader, i.e. D0 is not a zero matrix, then it was shown in [20] that all eigenvalues of the matrix C2L+C0ωD0 have positive real parts for any C2>0 and C0ω>0. Thus, it can be immediately concluded that the system (24) is stable, i.e. limtω̂t=0. This is equivalent to the consensus of battery frequency to the reference frequency ωref. Same analysis holds for the consensus of the nominal voltage magnitude.


4. Case studies

To validate the proposed designs, IEEE 14-bus benchmark is used. The system represents an approximation of U.S. utility system around 1962. The benchmark includes five generation units and 11 loads. Parameters of the test system were adopted from [21]. The system was modified for the current study. The generator dynamics were replaced by the battery energy storage dynamics. The system was modeled in MATLAB Simulink and a combination of MatPower and MatDyn toolboxes are used for dynamic simulation of the proposed control algorithms [22]. The MatPower toolbox was used for power flow and initial conditions of the system, where MatDyn was used for dynamic simulations and control design. The authors have extensively studied integration of battery energy storage units to IEEE benchmark cases using MatDyn toolbox in their previous publications [9, 10]. The consensus controllers then are supplemented to the model as inputs. The schematic of the modified IEEE 14-bus system used for the simulations in this study is illustrated in Figure 3. Parameters of the storage units are included in the Appendix section.

Figure 3.

Modified IEEE 14-bus system with five energy storage units.

The communication structure of the system under investigation is illustrated in Figure 4. As it can be observed, the communication graph of the system is undirected and minimum number of communication links is needed to ensure the convergence of the proposed algorithms. Furthermore, the leader is incorporated in battery energy storage number 2. The leader can be designed in any storage number as one leader is sufficient to ensure the functionality of the proposed control design.

Figure 4.

Communication graph of the system.

4.1 Constant power control

In the first case, the performance of the designed voltage and frequency controller is tested when a constant load is applied to the system. The secondary controller ensures sharing the active and reactive powers between the storage units based on their capacities as well as voltage/frequency regulation. Simulation results for this case study are illustrated in Figure 5. For this case study, the leader is activated by setting C0ω=1 and C0V=1. The overall load in the system (summation of loads in all busses) is SD=0.5+j0.5 p.u. It can be shown that the active/reactive power sharing (first subplot) is achieved after 15 s, and the voltage and frequency are regulated to their reference setpoints (1 p.u.) after 15 s. The designed controller can synchronize the operation of storage units in the system very fast.

Figure 5.

Primary frequency response to a constant load.

4.2 Primary frequency response

In the second case, the primary active and reactive power sharing is the main objective. The batteries should share the load power equally using the primary droop concept. The leader will be deactivated in this case enforcing consensus gains C0ω and C0V to zero. This will result in a primary voltage and frequency response, where the battery storage units will share the load active and reactive power demand, but the voltage and frequency will deviate from the nominal value. Similar to the first case study, the system starts with a 0.5+j0.5 p.u. load and a load change event is scheduled to increase the demand to 1+j1 p.u. after 20 s. Simulation results are illustrated in Figure 6. It is shown that the batteries can equally share the active and reactive power of the load even after the load event at 20 s. To support the active power increase in the demand, the frequency will drop and the batteries will settle in a lower frequency (0.91 p.u.). Furthermore, since the load active power has increased after 20 s, the voltage will also drop and settle to new synchronized value (0.94 p.u.).

Figure 6.

Primary frequency response to a dynamic load change.

4.3 Secondary frequency response

The third case, the performance of the secondary voltage and frequency controller during a load change event is studied. The system starts with 0.5+j0.5p.u. load and the load increases to 1+j1p.u. after 20 s. The secondary distributed controller is reactivated by tuning C0ω and C0V to 1, as illustrated in Figure 7. It is observed that the load sharing is successfully achieved among the storage units. In addition, the voltage and frequency are regulated to 1 p.u. in less than 3 s after the load change.

Figure 7.

Secondary frequency controller response to a dynamic load change.

4.4 Severe load change

In the last case, the performance of the proposed power sharing and voltage/frequency restoration algorithms in handling a severe load change is examined. The system initiates with 0.5+j0.5p.u. load and a load change of 1 p.u. is applied after 20 s. This means the total load increases to 1.5+j1.5p.u. after 20 s. As it can be observed in Figure 8, the proposed distributed controller can equally share the active and reactive load change while regulating the voltage and frequency. It should be noted that the frequency drops to 0.75 p.u. after the load change, but it is quickly recovered within a few seconds. Similarly, the voltage drops to 0.6 p.u. after the load change, but it is recovered within 2 s. This case study showed that the proposed controller can successfully operate under severe load changes.

Figure 8.

Response of the system under severe dynamic load change.


5. Conclusion

This chapter proposed a novel distributed controller that can synchronize the operation of distributed energy storage units in smart grids. By minimizing the communication links between the neighboring storage units, the storage units share information (voltage/current readings) with their neighbors to share the active/reactive demand based on their capacities. Furthermore, a virtual leader is designed and supplemented to one storage unit to regulate the voltage and frequency and to provide secondary frequency response to the system. Results showed the effectiveness of the proposed algorithms in equally sharing the active power and reactive power of load during constant power load, and load change events. Furthermore, the secondary controller could successfully regulate the voltage and frequency of the system during constant load, load change, and severe load change events.


6. Future work

Future studies will focus on: (1) hardware validation of proposed approaches and (2) expansion of the developed controllers to solar and wind energy applications.


Conflict of interest

The authors declare no conflict of interest.



Parameters of the system are shown in Table 1.

Nominal power100 MW
Nominal voltage132 kV
DiP [p.u.][1 1.2 1.5 2 1.6]
DiQ [p.u.][1 1.1 1.25 1.45 1.5]
C00.5 p.u.
C1, C2, C30.1, 0.4, 0.2 p.u.

Table 1.

Parameters of the system.


  1. 1. Alaa M, Egon O, Andreas S, Nedzad H, Danny M. Challenges in integrating distributed energy storage systems into future smart grid. In: IEEE International Symposium on Industrial Electronics. 2008. pp. 1627-1632. Available from: [Accessed: 27 September 2019]
  2. 2. Jones LE. Renewable Energy Integration: Practical Management of Variability, Uncertainty, and Flexibility in Power Grids. Academic Press; 2017. Available from: [Accessed: 27 September 2019]
  3. 3. Khanh NH, Bin SJ, Zhu H. Distributed demand side management with energy storage in smart grid. IEEE Transactions on Parallel and Distributed Systems. 2015;26(12):3346-3357. Available from: [Accessed: 27 September 2019]
  4. 4. Ehsan R, Saeed S, Roose Leon R, Marc M. Energy management at the distribution grid using a battery energy storage system (BESS). International Journal of Electrical Power & Energy Systems. 2016;77:337-344. Available from: [Accessed: 27 September 2019]
  5. 5. Antoniadou-Plytaria KE, Kouveliotis-Lysikatos IN, Georgilakis PS, Hatziargyriou ND. Distributed and decentralized voltage control of smart distribution networks: Models, methods, and future research. IEEE Transactions on Smart Grid. 2017;8(6):2999-3008. Available from: [Accessed: 27 September 2019]
  6. 6. Lai J, Zhou H, Lu X, Yu X, Hu W. Droop-based distributed cooperative control for microgrids with time-varying delays. IEEE Transactions on Smart Grid. 2015;7(4):1775-1789. Available from: [Accessed: 27 September 2019]
  7. 7. Wang Y, Tan KT, Peng XY, So PL. Coordinated control of distributed energy-storage systems for voltage regulation in distribution networks. IEEE Transactions on Power Delivery. 2015;31(3):1132-1141. Available from: [Accessed: 27 September 2019]
  8. 8. Zeraati M, Golshan MEH, Guerrero JM. Distributed control of battery energy storage systems for voltage regulation in distribution networks with high PV penetration. IEEE Transactions on Smart Grid. 2016;9(4):3582-3593. Available from: [Accessed: 27 September 2019]
  9. 9. Liu W, Gu W, Yuan X, Zhang K. Fully distributed control to coordinate charging efficiencies for energy storage systems. Journal of Modern Power Systems and Clean Energy. 2018;6(5):1015-1024. Available from: [Accessed: 27 September 2019]
  10. 10. Hammad E, Farraj A, Kundur D. On effective virtual inertia of storage-based distributed control for transient stability. IEEE Transactions on Smart Grid. 2017;10(1):327-336. Available from: [Accessed: 27 September 2019]
  11. 11. Xing L, Mishra Y, Tian YC, Ledwich G, Su H, Peng C, et al. Dual-Consensus-Based Distributed Frequency Control for Multiple Energy Storage Systems. IEEE Transactions on Smart Grid: Early Access; 2019. Available from: [Accessed: 27 September 2019]
  12. 12. Chaghooshi AF, Pamies-Juarez L, Guyot C. Dual-consensus-based distributed frequency control for multiple energy storage systems. U.S. Patent Application No. 15/626,061. 2018. Available from: [Accessed: 27 September 2019]
  13. 13. Khazaei J, Miao Z. Consensus control for energy storage systems. IEEE Transactions on Smart Grid. 2016;9(4):3009-3017. Available from: [Accessed: 27 September 2019]
  14. 14. Khazaei J, Nguyen DH. Multi-agent consensus design for heterogeneous energy storage devices with droop control in smart grids. IEEE Transactions on Smart Grid. 2017;10(2):1395-1404. Available from: [Accessed: 27 September 2019]
  15. 15. Guan Y, Meng L, Li C, Vasquez JC, Guerrero JM. A dynamic consensus algorithm to adjust virtual impedance loops for discharge rate balancing of AC microgrid energy storage units. IEEE Transactions on Smart Grid. 2017;9(5):4847-4860. Available from: [Accessed: 27 September 2019]
  16. 16. Khazaei J, Nguyen DH, Thao NGM. Primary and secondary voltage/frequency controller design for energy storage devices using consensus theory. In: IEEE 6th International Conference on Renewable Energy Research and Applications (ICRERA). 2017. pp. 447-453. Available from: [Accessed: 27 September 2019]
  17. 17. Wang D, Meng K, Gao X, Chen G, Luo F, Dong ZY. Consensus-driven distributed control of battery energy storage systems for loading management in distribution networks. In: IEEE International Conference on Smart Grid Communications. 2016. pp. 699-704. Available from: [Accessed: 27 September 2019]
  18. 18. Xie W, Xia X. Distributed energy dispatch of electrical energy storage systems using consensus control approach. IFAC-PapersOnLine. 2018;51(13):229-234. Available from: [Accessed: 27 September 2019]
  19. 19. Khazaei J, Nguyen DH. Distributed consensus for output power regulation of DFIGs with on-site energy storage. IEEE Transactions on Energy Conversion. 2018;34(2):1043-1051. Available from: [Accessed: 27 September 2019]
  20. 20. Nguyen DH, Khazaei J. Cooperative control for distributed energy storage systems with different droop schemes. In: IEEE PES GTD Grand International Conference and Exposition Asia (GTD Asia). 2019. pp. 102-107. Available from: [Accessed: 27 September 2019]
  21. 21. Milano F. An open source power system analysis toolbox. IEEE Transactions on Power Systems. 2005;20(3):1199-1206. Available from: [Accessed: 27 September 2019]
  22. 22. Cole S, Belmans R. MatDyn: A new matlab-based toolbox for power system dynamic simulation. IEEE Transactions on Power Systems. 2011;26(3):1129-1136. Available from: [Accessed: 27 September 2019]

Written By

Javad Khazaei and Dinh Hoa Nguyen

Submitted: 19 June 2019 Reviewed: 16 July 2020 Published: 17 February 2021