# Development and Performance Verification of Frequency Control Algorithm and Hardware Controller Using Real-Time Cyber Physical System Simulator

^{1}

^{2}

^{3}

^{4}

^{*}

## Abstract

**:**

## 1. Introduction

## 2. Development of Co-Simulation “A1GridSim”

#### 2.1. Centralised Power Plant (CPP) Model

#### 2.2. Energy Management System (EMS) Model

_{2}trading price ${C}_{Co2}$ and the CO

_{2}emission coefficient ${K}_{emi}$:

**Theorem**

**1.**

- 1.
**Control Economic/Environmental Dispatch**- Import cvxpy as cp
- Import numpy as np
**def Control_ED**(n,${P}_{load}$, ${P}_{max}$, ${P}_{min}$, $\alpha $, $\beta $, $On$):- ${P}_{CED.i}$= cp.variable(shape=n, nonneg=True)
- ${\lambda}_{i}$= cp.variable(shape=n, nonneg=True)
- ${P}_{max.i}$= cp.parameter(shape=n)
- ${P}_{min.i}$= cp.parameter(shape=n)
- ${\alpha}_{i}$= cp.parameter(shape=n)
- ${\beta}_{i}$= cp.parameter(shape=n)
- $O{n}_{i}$= cp.parameter(shape=n)
- ${P}_{max.i}$.value = np.array(${P}_{max}$)
- ${P}_{min.i}$.value = np.array(${P}_{min}$)
- ${\alpha}_{i}$.value = np.array($\alpha $)
- ${\beta}_{i}$.value = np.array($\beta $)
- $O{n}_{i}$.value = np.array($On$)
- Constraints = list()
- Constraints.append($\sum}_{i=0}^{n}{P}_{CED.i}={P}_{load$)
- Constraints.append(${P}_{CED.i}\le {P}_{max.i}\times O{n}_{i}$)
- Constraints.append$({P}_{CED.i}\ge {P}_{min.i}\times O{n}_{i}$)
- Constraints.append(${\lambda}_{i}\le 2{\alpha}_{i}{P}_{CED.i}+{\beta}_{i}$)
- Object = cp.Minimize(max(${\lambda}_{1},{\lambda}_{2},\cdots ,{\lambda}_{n-1},{\lambda}_{n}$))
- Prob = cp.Problem(Object, Constraints)
- Prob.solve()

- Return${\lambda}_{i}$.value,${P}_{CED.i}$.value

- 2.
**Tracking Economic/Environmental Dispatch****def Traking_ED**(${P}_{load}$, ${\lambda}_{i}$, $\sum}_{i=0}^{n}{P}_{CED.i$):- If ${P}_{load}-{\displaystyle \sum}_{i=0}^{n}{P}_{CED.i}>0$:
- ${P}_{TED.i}=\left({P}_{load}-{\displaystyle {\displaystyle \sum}_{i=0}^{n}}{P}_{CED.i}\right)\times \frac{{\lambda}_{i}}{{{\displaystyle \sum}}_{i=0}^{n}{\lambda}_{i}}$$elseif$ ${P}_{load}-{\displaystyle \sum}_{i=0}^{n}{P}_{CED.i}<0$:
- ${P}_{TED.i}=\left({P}_{load}-{\displaystyle {\displaystyle \sum}_{i=0}^{n}}{P}_{CED.i}\right)\times \frac{\frac{1}{{\lambda}_{i}}}{{{\displaystyle \sum}}_{i=0}^{n}\frac{1}{{\lambda}_{i}}}$Return ${P}_{TED.i}$.value

#### 2.3. Dynamic Frequency Model

#### 2.4. BESS System Model

## 3. Software in the Loop Simulation for BESS System

#### 3.1. Verification of Dynamic Frequency Model

#### 3.2. Performance Verification of the BESS System for PFC

#### 3.3. Analysis of Impact on Physical Response Delay Time between FRC and PCS

## 4. Hardware in the Loop Simulation for BESS System

#### 4.1. Configuration of the HILS System for Response Performance Evaluation

#### 4.2. Result of BESS’s Response Performance Evaluation by HILS

## 5. Summary Results

## 6. Conclusions

## Author Contributions

## Funding

## Institutional Review Board Statement

## Informed Consent Statement

## Conflicts of Interest

## Abbreviations

${P}_{PFC.i}$ | Power demand of generator about primary frequency control | MW |

${P}_{rated.i}$ | Rated power of generator | MW |

${\omega}_{rated.i}$ | Rated rotating speed of generator | rad/s |

${\omega}_{i}$ | Rotating speed of generator | rad/s |

${K}_{droop}$ | Droop coefficient of generator | %/100 |

${H}_{i}$ | Inertia constant of generator | s |

${S}_{rated.i}$ | Rated capacity of generator | MVA |

${P}_{Mech.i}$ | Mechanical power of generator | MW |

${P}_{Elec.i}$ | Electrical power of generator | MW |

${P}_{AGC\_Demand}$ | Total AGC demand in power system | MW |

$ACE$ | Area control error | MW |

$B$ | Control gain of AGC | MW/Hz |

$\Delta f$ | Deviation of frequency | Hz |

${P}_{AGC.i}$ | AGC demand of generator | MW |

${K}_{ramp.i}$ | Ramp rate of generator | %/100 |

${P}_{base.i}$ | Base point of generator by tertiary frequency control | MW |

${H}_{i}\left({P}_{base.i}\right)$ | Heat rate equation of generator | MBtu/MWh |

${F}_{Eco}\left({P}_{base.i}\right)$ | Fuel cost equation of generator by EcoLD mode | $/h |

${F}_{Env}\left({P}_{base.i}\right)$ | Fuel cost equation of generator by EnvLD mode | $/h |

$F{C}_{i}$ | Cost of fuel used by generator | $ |

${C}_{Co2}$ | CO_{2} trading price | $ |

${K}_{emi}$ | CO_{2} emission coefficient | %/100 |

${\lambda}_{i}$ | Incremental fuel cost equation of generator | $ /MWh |

${P}_{max.i}$ | Maximum power of generator | MW |

${P}_{min.i}$ | Minimum power of generator | MW |

$O{n}_{i}$ | Start up state of generator | - |

${P}_{i}$ | Power of generator | MW |

${P}_{CED.i}$ | Power demand of generator by CED | MW |

${P}_{TED.i}$ | Power demand of generator by TED | MW |

${f}_{rated}$ | Rated frequency of power system | Hz |

${f}_{sys}$ | Frequency of power system | Hz |

${K}_{L}$ | Load constant of power system | MW/0.1Hz |

${P}_{Load}$ | Power consumption | MW |

$\phi $ | Change of frequency | Hz |

$\delta $ | Change of electric power | MW |

${K}_{F}$ | Proportional gain of power system | Hz/MW |

${T}_{F}$ | Frequency time constant | s |

${T}_{\mathrm{Nadir}}$ | Time for reaching the nadir frequency at frequency transient state | s |

${f}_{initial}$ | Initial frequency before frequency transient state | Hz |

${f}_{nadir}$ | Nadir frequency at frequency transient state | Hz |

${\Delta \mathrm{f}}_{\mathrm{Nadir}}$ | Frequency deviation between initial frequency and nadir frequency | Hz |

$RoCo{F}_{average}$ | Average rate of change of frequency | Hz/s |

$RoCo{F}_{BESS}$ | Rate of change of frequency at BESS response point | Hz/s |

$GF{R}_{max}$ | Maximum governor free response | MW |

${T}_{recovery}$ | Time to recover from transient state | s |

$\Delta {P}_{trn}$ | Deviation of electric power in transient state | pu |

$\Delta {f}_{trn}$ | Deviation of electric frequency in transient state | pu |

${P}_{Gen}{}^{t}$ | Total generation power in power system at time t | MW |

${P}_{Gen}{}^{t=0}$ | Total generation power in power system at initial time | MW |

${P}_{Load}{}^{t}$ | Total load in power system at time t | MW |

${P}_{Load}{}^{t=0}$ | Total load in power system at initial time | MW |

${f}_{sys}{}^{t}$ | Frequency at time t | Hz |

${f}_{sys}{}^{t=0}$ | Frequency at initial time | Hz |

${K}_{sys}$ | Power grid constant | pu |

## References

- Tremblay, O.; Dessaint, L.-A. Experimental validation of a battery dynamic model for EV applications. World Electr. Veh. J.
**2009**, 3, 289–298. [Google Scholar] [CrossRef] [Green Version] - Zhang, Y.; Lyden, S.; de la Barra, B.L.; Haque, M.E. Optimization of Tremblay’s battery model parameters for plug-in hybrid electric vehicle applications. In Proceedings of the 2017 Australasian Universities Power Engineering Conference (AUPEC), Melbourne, VIC, Australia, 19–22 November 2017; pp. 1–6. [Google Scholar]
- Surya, S.; Channegowda, J.; Datar, S.D.; Jha, A.S.; Victor, A. Accurate battery modeling based on pulse charging using MATLAB/Simulink. In Proceedings of the 2020 IEEE International Conference on Power Electronics, Drives and Energy Systems (PEDES), Jaipur, India, 16–19 December 2020; pp. 1–3. [Google Scholar]
- Xia, Q.; Yang, D.; Wang, Z.; Ren, Y.; Sun, B.; Feng, Q.; Qian, C. Multiphysical modeling for life analysis of lithium-ion battery pack in electric vehicles. Renew. Sustain. Energy Rev.
**2020**, 131, 109993. [Google Scholar] [CrossRef] - Fan, X.; Zhang, W.; Wang, Z.; An, F.; Li, H.; Jiang, J. Simplified battery pack modeling considering inconsistency and evolution of current distribution. IEEE Trans. Intell. Transp. Syst.
**2020**, 22, 630–639. [Google Scholar] [CrossRef] - Dubarry, M.; Baure, G.; Pastor-Fernández, C.; Yu, T.F.; Widanage, W.D.; Marco, J. Battery energy storage system modeling: A combined comprehensive approach. J. Energy Storage
**2019**, 21, 172–185. [Google Scholar] [CrossRef] - Tan, R.H.; Tinakaran, G.K. Development of battery energy storage system model in MATLAB/Simulink. Int. J. Smart Grid Clean Energy
**2020**, 9, 180–188. [Google Scholar] [CrossRef] - Rancilio, G.; Lucas, A.; Kotsakis, E.; Fulli, G.; Merlo, M.; Delfanti, M.; Masera, M. Modeling a large-scale battery energy storage system for power grid application analysis. Energies
**2019**, 12, 3312. [Google Scholar] [CrossRef] [Green Version] - Jo, H.; Choi, J.; Agyeman, K.A.; Han, S. Development of frequency control performance evaluation criteria of BESS for ancillary service: A case study of frequency regulation by KEPCO. In Proceedings of the 2017 IEEE Innovative Smart Grid Technologies–Asia (ISGT–Asia), Auckland, New Zealand, 4–7 December 2017; pp. 1–5. [Google Scholar]
- Sanduleac, M.; Toma, L.; Eremia, M.; Boicea, V.A.; Sidea, D.; Mandis, A. Primary frequency control in a power system with battery energy storage systems. In Proceedings of the 2018 IEEE International Conference on Environment and Electrical Engineering and IEEE Industrial and Commercial Power Systems Europe (EEEIC/I&CPS Europe), Palermo, Italy, 12–15 June 2018; pp. 1–5. [Google Scholar]
- Stein, K.; Tun, M.; Matsuura, M.; Rocheleau, R. Characterization of a fast battery energy storage system for primary frequency response. Energies
**2018**, 11, 3358. [Google Scholar] [CrossRef] [Green Version] - Bang, H.; Aryani, D.R.; Song, H. Application of battery energy storage systems for relief of generation curtailment in terms of transient stability. Energies
**2021**, 14, 3898. [Google Scholar] [CrossRef] - Meng, Y.; Li, X.; Liu, X.; Cui, X.; Xu, P.; Li, S. A Control Strategy for Battery Energy Storage Systems Participating in Primary Frequency Control Considering the Disturbance Type. IEEE Access
**2021**, 9, 102004–102018. [Google Scholar] [CrossRef] - Izadkhast, S.; Cossent, R.; Frías, P.; García-González, P.; Rodríguez-Calvo, A. Performance Evaluation of a BESS Unit for Black Start and Seamless Islanding Operation. Energies
**2022**, 15, 1736. [Google Scholar] [CrossRef] - Abayateye, J.; Corigliano, S.; Merlo, M.; Zimmerle, D. BESS Primary Frequency Control Strategies for the West Africa Power Pool. Energies
**2022**, 15, 990. [Google Scholar] [CrossRef] - Schiapparelli, G.P.; Massucco, S.; Namor, E.; Sossan, F.; Cherkaoui, R.; Paolone, M. Quantification of primary frequency control provision from battery energy storage systems connected to active distribution networks. In Proceedings of the 2018 Power Systems Computation Conference (PSCC), Dublin, Ireland, 11–15 June 2018; pp. 1–7. [Google Scholar]
- Zhu, D.; Zhang, Y.-J.A. Optimal coordinated control of multiple battery energy storage systems for primary frequency regulation. IEEE Trans. Power Syst.
**2018**, 34, 555–565. [Google Scholar] [CrossRef] - Toma, L.; Sanduleac, M.; Baltac, S.A.; Arrigo, F.; Mazza, A.; Bompard, E.; Musa, A.; Monti, A. On the virtual inertia provision by BESS in low inertia power systems. In Proceedings of the 2018 IEEE International Energy Conference (ENERGYCON), Limassol, Cyprus, 3–7 June 2018; pp. 1–6. [Google Scholar]
- Choi, W.Y.; Kook, K.S.; Yu, G.R. Control strategy of BESS for providing both virtual inertia and primary frequency response in the Korean Power System. Energies
**2019**, 12, 4060. [Google Scholar] [CrossRef] [Green Version] - Pinthurat, W.; Hredzak, B. Decentralized Frequency Control of Battery Energy Storage Systems Distributed in Isolated Microgrid. Energies
**2020**, 13, 3026. [Google Scholar] [CrossRef] - Obaid, Z.A.; Cipcigan, L.; Muhssin, M.T.; Sami, S.S. Control of a population of battery energy storage systems for frequency response. Int. J. Electr. Power Energy Syst.
**2020**, 115, 105463. [Google Scholar] [CrossRef] - Amin, M.R.; Negnevitsky, M.; Franklin, E.; Alam, K.S.; Naderi, S.B. Application of battery energy storage systems for primary frequency control in power systems with high renewable energy penetration. Energies
**2021**, 14, 1379. [Google Scholar] [CrossRef] - Manbachi, M.; Sadu, A.; Farhangi, H.; Monti, A.; Palizban, A.; Ponci, F.; Arzanpour, S. Real-time co-simulation platform for smart grid volt-VAR optimization using IEC 61850. IEEE Trans. Ind. Inform.
**2016**, 12, 1392–1402. [Google Scholar] [CrossRef] - Mana, P.T.; Schneider, K.P.; Du, W.; Mukherjee, M.; Hardy, T.; Tuffner, F.K. Study of microgrid resilience through co-simulation of power system dynamics and communication systems. IEEE Trans. Ind. Inform.
**2020**, 17, 1905–1915. [Google Scholar] - Adewole, A.C.; Tzoneva, R. Co-simulation platform for integrated real-time power system emulation and wide area communication. IET Gener. Transm. Distrib.
**2017**, 11, 3019–3029. [Google Scholar] [CrossRef] - Garau, M.; Ghiani, E.; Celli, G.; Pilo, F.; Corti, S. Co-simulation of smart distribution network fault management and reconfiguration with lte communication. Energies
**2018**, 11, 1332. [Google Scholar] [CrossRef] [Green Version] - Suzuki, A.; Masutomi, K.; Ono, I.; Ishii, H.; Onoda, T. Cps-sim: Co-simulation for cyber-physical systems with accurate time synchronization. IFAC Pap.
**2018**, 51, 70–75. [Google Scholar] [CrossRef] - Cao, Y.; Shi, X.; Li, Y.; Tan, Y.; Shahidehpour, M.; Shi, S. A simplified co-simulation model for investigating impacts of cyber-contingency on power system operations. IEEE Trans. Smart Grid
**2017**, 9, 4893–4905. [Google Scholar] [CrossRef] - Jin, T.-H.; Chung, M.; Shin, K.-Y.; Park, H.; Lim, G.-P. Real-time dynamic simulation of Korean power grid for frequency regulation control by MW battery energy storage system. J. Sustain. Dev. Energy Water Environ. Syst.
**2016**, 4, 392–407. [Google Scholar] [CrossRef] [Green Version] - ProTRAX, Energy Solutions. Available online: https://energy.traxintl.com/protrax (accessed on 27 June 2022).
- Turbine-Governor Models: Standard Dynamic Turbine-Govorner System in NEPLAN Power System Analysis Tool; NEPLAN AG: Küsnacht, Switzerland, 2015.
- Araújo, P. Dynamic Simulations in Realistic-Size Networks. Master’s Thesis, Universidade Técnica De Lisboa, Lisboa, Portugal, 2010. [Google Scholar]
- PSS/E 34 Model Library; Siemens, PTI: New York, NY, USA, 2015.
- ProTRAX Analyst’s Instruction Manual; Version 7.2; TRAX International: Virginia, VA, USA, 2014.
- Korea Power Exchanger, Electric Power Statistics Information System: Generator Detail Contents. Available online: http://epsis.kpx.or.kr/epsisnew/selectEkfaFclDtlChart.do?menuId=020600 (accessed on 10 June 2021).
- Kundur, P. Power system stability. In Power System Stability and Control; Grigsby, L.L., Ed.; CRC Press: Boca Raton, FL, USA, 2007. [Google Scholar]
- Kothari, D.P.; Nagrath, I. Modern Power System Analysis; Tata McGraw-Hill Education: New York, NY, USA, 2003. [Google Scholar]
- Lim, G.-P.; Han, H.-G.; Chang, B.-H.; Yang, S.-K.; Yoon, Y.-B. Demonstration to operate and control frequency regulation of power system by 4MW energy storage system. Trans. Korean Inst. Electr. Eng. P
**2014**, 63, 169–177. [Google Scholar] [CrossRef] [Green Version] - Han, J.B.; Kook, K.S.; Chang, B. A study on the criteria for setting the dynamic control mode of battery energy storage system in power systems. Trans. Korean Inst. Electr. Eng.
**2013**, 62, 444–450. [Google Scholar] [CrossRef] [Green Version] - Yun, J.Y.; Yu, G.; Kook, K.S.; Rho, D.H.; Chang, B.H. SOC-based control strategy of battery energy storage system for power system frequency regulation. Trans. Korean Inst. Electr. Eng.
**2014**, 63, 622–628. [Google Scholar] [CrossRef] [Green Version]

**Figure 4.**Optimum generator unit commitment curve by load; (

**a**) Economic load dispatch (EcoLD); (

**b**) Environmental load dispatch (EnvLD).

**Figure 5.**The 24-h Simulation result of electric power supply and demand by base-point tracking mode (December 2019); (

**a**) Economic load dispatch (EcoLD); (

**b**) Environmental load dispatch (EnvLD).

**Figure 8.**Comparison of history and simulation frequency for verification; (

**a**) Frequency transient state until recovering to rated frequency; (

**b**) Frequency transient state until nadir frequency point.

**Figure 9.**Result of frequency transient state simulation by case study; (

**a**) Frequency; (

**b**) RoCoF; (

**c**) BESS Power; (

**d**) GF response.

**Figure 10.**Curve about deviation of power and frequency by case study; (

**a**) Power grid constant at entire period; (

**b**) BESS response point; (

**c**) Nadir frequency point; (

**d**) Quasi−steady state point; (

**e**) Overshooting point.

**Figure 11.**Main results of transient characteristic trajectory analysis considering the effect of physical response delay time; (

**a**) Power grid constant at nadir frequency point; (

**b**) Nadir frequency; (

**c**) Average RoCoF; (

**d**) GF Response at starting BESS; (

**e**) Maximum GF Response.

**Figure 13.**Result of FRC’s response performance evaluation by Iba Analyzer in Non-gong substation; (

**a**) Entire period; (

**b**) BESS response starting point.

NP | TP | TP | CC | PSH | |
---|---|---|---|---|---|

Fuel Type | Nuclear | Coal | Heavy Oil | LNG | Water |

Rated capacity (GW) | 23.25 | 35.74 | 2.95 | 32.48 | 3.7 |

Number (EA) | 24 | 65 | 13 | 63 | 12 |

Efficiency (%) | 33.0~39.0 | 33.0~42.0 | 32.0~33.0 | 42.0~54.0 | 76.0~82.0 |

Inertia Constant (s) | 6.0~9.0 | 4.0~7.0 | 4.0~5.0 | 3.0~6.0 | 2.0~4.0 |

Turbine speed (RPM) | 1800 | 3600 | 3600 | 3600 | 300~600 |

Droop (%) | - | 5~9 | 4~6 | 6~8 | 3~4 |

Dead band (Hz) | - | ±0.0~±0.038 | ±0.01~±0.03 | ±0~±0.06 | ±0.02~±0.033 |

Ramp rate (%MW/min) | - | 0.7~3.1 | 1.1~2.3 | 2.6~16.0 | 22.0~32.0 |

Heat rate (MBtu/MWh) | 9200~10,700 | 8000~10,900 | 11,000~11,200 | 6400~8500 | - |

NP | TP Bituminous | TP Anthracite | CC LNG | TP Heavy Oil | |
---|---|---|---|---|---|

Fuel Cost ($/MWh) | 4.96 | 44.17 | 53.35 | 72.46 | 141.11 |

Emission Factor | - | 0.8867 | 0.8867 | 0.3889 | 0.6588 |

No BESS (Case1) | 140 ms (Case2) | 160 ms (Case3) | 180 ms (Case4) | |
---|---|---|---|---|

${f}_{initial}$ | 59.9914 | 59.9914 | 59.9914 | 59.9914 |

${T}_{nadir}$ | 3.04 | 2.84 | 2.82 | 2.80 |

${f}_{nadir}$ | 59.8401 | 59.8954 | 59.8952 | 59.8951 |

$\Delta {f}_{nadir}$ | 0.1599 | 0.1046 | 0.1048 | 0.1049 |

$RoCo{F}_{average}$ | 0.05259 | 0.0368 | 0.0372 | 0.0375 |

$RoCo{F}_{BESS}$ | - | −0.0510 | −0.0505 | −0.0500 |

$GF{R}_{max}$ | 893.86 | 535.02 | 538.72 | 539.11 |

${T}_{recovery}$ | 105.1 | 150.2 | 150.2 | 150.2 |

Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations. |

© 2022 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).

## Share and Cite

**MDPI and ACS Style**

Jin, T.-H.; Shin, K.-Y.; Chung, M.; Lim, G.-P.
Development and Performance Verification of Frequency Control Algorithm and Hardware Controller Using Real-Time Cyber Physical System Simulator. *Energies* **2022**, *15*, 5722.
https://doi.org/10.3390/en15155722

**AMA Style**

Jin T-H, Shin K-Y, Chung M, Lim G-P.
Development and Performance Verification of Frequency Control Algorithm and Hardware Controller Using Real-Time Cyber Physical System Simulator. *Energies*. 2022; 15(15):5722.
https://doi.org/10.3390/en15155722

**Chicago/Turabian Style**

Jin, Tae-Hwan, Ki-Yeol Shin, Mo Chung, and Geon-Pyo Lim.
2022. "Development and Performance Verification of Frequency Control Algorithm and Hardware Controller Using Real-Time Cyber Physical System Simulator" *Energies* 15, no. 15: 5722.
https://doi.org/10.3390/en15155722