Submitted:
06 May 2025
Posted:
07 May 2025
You are already at the latest version
Abstract
Keywords:
1. Introduction
- Development of a Discrete-Event-Based PMS: The proposed PMS uses SCT to design a robust supervisory controller that handles critical microgrid functions, including voltage support in islanded mode and peak shaving in grid-connected mode.
- Implementation of Decentralized Supervisors: The PMS framework incorporates decentralized supervisory control, allowing for scalable and distributed management of DERs within the microgrid, thus enhancing system robustness and reducing computational complexity.
- Step-by-Step Implementation Guide: A detailed step-by-step methodology is provided, covering the entire process from defining discrete events, modeling microgrid components, synthesizing supervisory controllers, and finally realizing the proposed PMS in MATLAB Stateflow. This practical guide ensures that researchers and practitioners can replicate and adapt the proposed methodology to their specific microgrid configurations.
2. Supervisory Control Theory for Discrete Event Systems
2.1. Background of Discrete-Event Systems
2.2. Supervisory Control Theory of DES
2.3. Decentralized Supervisory Control
3. A framework for PMS design based on Supervisory Control Theory
- i)
- Define events for PMS modeling;
- ii)
- Model microgrid components;
- iii)
- Model microgrid requirements;
- iv)
- Synthesis of PMS decentralized supervisors;
- v)
- PMS supervisors realization in MATLAB Stateflow.
3.1. Define Events for PMS Modeling
3.2. Model Microgrid Components
3.3. Model Microgrid Requirements
3.4. Synthesis of PMS Decentralized Supervisors
3.5. PMS Supervisors Realization in MATLAB Stateflow
- For each state of the reduced decentralized supervisor , a corresponding state state_x must be defined in Stateflow state machine;
- Define the initial state state_ in Stateflow state machine;
- For each event , if define in MATLAB Stateflow an input variable , otherwise define and as an input and output variable in MATLAB Stateflow, respectively.
- For each state , uncontrollable event and state , define the transition state_state_;
- For each state , controllable event and and state , define the transition state_state_;
- Let , G be the plant model, a state of G and the set of states of . For each state of the supervisor, the output of the state machine is defined as follows. Define for all ; for all events disabled by supervisor in state x, otherwise (keeping the last value of the variable ).
4. Framework Application Case Study
4.1. Case Study Description
4.2. Local Controllers, Breaker and Measurement Description
4.2.1. PV System
4.2.2. BESS Model
4.2.3. Genset
4.2.4. Wind Turbine System
4.2.5. Non-Critical Load Breaker
4.2.6. SOC, Power and Voltage Measurements
4.3. Discrete Event System Plant Modeling


4.4. Modeling of Control Specifications
4.4.1. Specification - High SOC Management
4.4.2. Specification - Low SOC Management
4.4.3. Specification - POI Voltage Support Function
4.4.4. Specification - Peak Shaving Function
4.5. PMS Supervisors Realization in MATLAB Stateflow
5. Results and Discussions
- Peak shaving: In this operating mode, the power supplied from the utility grid to the microgrid is restricted to the contracted power, without compromising the energy to the loads. For this, the BESS is charged during periods of low demand, when the cost of electricity is lower compared to periods of high demand, and is discharged during periods of high demand.
-
Islanded Operation: The microgrid should have the capability to provide power to the loads in isolated mode, ensuring adequate voltage and frequency levels. The transition from grid-connected to islanded operation can occur as either a planned or unintended event. In the event of islanding, at least one source within the microgrid must regulate the voltage at POI to its nominal value and establish a reference frequency that matches the nominal frequency of the utility grid.
- Monitoring the voltage at the POI: The supervisors must ensure that the voltage is within the acceptable range of operation, sending operation commands to the different sources in the microgrid.
- Monitoring the SOC of the BESS: In order to prolong the life of the battery, it is important that it operates in a quasi-linear charge and discharge mode. To this end, the supervisors change the operating modes of the BESS.
5.1. Grid-Connected Operation
5.1.1. Peak Shaving (Scenario 1)
5.2. Islanded Operation
5.2.1. Monitoring the SOC of the BESS (Scenario 2)



5.2.2. Monitoring the Vrms at the POI (Scenario 3)
6. Conclusion
Acknowledgments
Appendix A. Values Used to Compare PMS Signals
| Variable | Value | Base |
|---|---|---|
| 0.9 p.u. | 5000 [kW] | |
| 0.25 p.u. | 5000 [kW] | |
| 0.92 p.u. | 13.8 [kV] | |
| 0.85 p.u. | 13.8 [kV] | |
| 80% | ||
| 40% | ||
| 20% |
| Components | ||
|---|---|---|
| PV system | 4,800.0 | 4,800.0 |
| Wind system | 5,700.0 | 5,415.0 |
| BESS | 8,400.0 | 8,400.0 |
| Genset | 5,960.0 | 5,364.0 |
| Total Generation Power | 24,860.0 | 23,979.0 |
| Load | ||
| Critical maximum | 5,420.0 | 4,607.0 |
| Critical minimum | 1,591.0 | 1,352.0 |
| Critical average | 1,000.0 | 850.0 |
| Non-critical | 2,000.0 | 2,000.0 |
References
- Ritchie, H.; Roser, M.; Rosado, P. Electricity production by source, World, 2022.
- Hirsch, A.; Parag, Y.; Guerrero, J. Microgrids: A review of technologies, key drivers, and outstanding issues. 2018, 90, 402–411. [Google Scholar] [CrossRef]
- Cagnano, A.; De Tuglie, E.; Mancarella, P. Microgrids: Overview and guidelines for practical implementations and operation. Applied Energy 2020, 258, 114039. [Google Scholar] [CrossRef]
- Olivares, D.E.; Mehrizi-Sani, A.; Etemadi, A.H.; Cañizares, C.A.; Iravani, R.; Kazerani, M.; Hajimiragha, A.H.; Gomis-Bellmunt, O.; Saeedifard, M.; Palma-Behnke, R.; et al. Trends in microgrid control. IEEE Transactions on smart grid 2014, 5, 1905–1919.
- Jamal, S.; Tan, N.M.; Pasupuleti, J. A review of energy management and power management systems for microgrid and nanogrid applications. Sustainability 2021, 13, 10331. [Google Scholar] [CrossRef]
- Chen, M.; Xiao, X.; Guerrero, J.M. Secondary restoration control of islanded microgrids with a decentralized event-triggered strategy. IEEE Transactions on Industrial Informatics 2017, 14, 3870–3880. [Google Scholar] [CrossRef]
- Diaz, N.L.; Luna, A.C.; Vasquez, J.C.; Guerrero, J.M. Centralized control architecture for coordination of distributed renewable generation and energy storage in islanded AC microgrids. IEEE Transactions on power Electronics 2016, 32, 5202–5213. [Google Scholar] [CrossRef]
- Bhaduri, R.; Rahul Saravana, G.; Vaskar, C. Supervisory controller for power management of microgrid using hybrid technique. Transactions on Electrical and Electronic Materials 2020, 21, 30–47. [Google Scholar] [CrossRef]
- Karimi, Y.; Oraee, H.; Golsorkhi, M.S.; Guerrero, J.M. Decentralized method for load sharing and power management in a PV/battery hybrid source islanded microgrid. IEEE Transactions on Power Electronics 2016, 32, 3525–3535. [Google Scholar] [CrossRef]
- Saleh, M.; Esa, Y.; Mohamed, A. Centralized control for DC microgrid using finite state machine. In Proceedings of the 2017 IEEE Power & Energy Society Innovative Smart Grid Technologies Conference (ISGT). IEEE, 2017, pp. 1–5.
- Liu, X.; Zhao, M.; Wei, Z.; Lu, M. The energy management and economic optimization scheduling of microgrid based on Colored Petri net and Quantum-PSO algorithm. Sustainable Energy Technologies and Assessments 2022, 53, 102670. [Google Scholar] [CrossRef]
- Mishra, J.; Behera, P.K.; Pattnaik, M.; Babu, B.C. A multi-agent petri net model power management strategy for wind–solar-battery driven DC microgrid. Sustainable Energy Technologies and Assessments 2023, 55, 102859. [Google Scholar] [CrossRef]
- Wonham, W.M.; Cai, K.; et al. Supervisory control of discrete-event systems, 2019.
- Afzalian, A.A.; Niaki, S.A.N.; Iravani, M.R.; Wonham, W. Discrete-event systems supervisory control for a dynamic flow controller. IEEE Transactions on Power Delivery 2008, 24, 219–230. [Google Scholar] [CrossRef]
- Hu, H.x.; Li, H.h.; Jiang, Y.; Zheng, Y.q.; Huang, S.p.; Sheng, Y.F. Fault diagnosis based on discrete event system for power grid. In Proceedings of the The 27th Chinese Control and Decision Conference (2015 CCDC). IEEE, 2015, pp. 2668–2672.
- Kharrazi, A.; Mishra, Y.; Sreeram, V. Discrete-event systems supervisory control for a custom power park. IEEE Transactions on Smart Grid 2017, 10, 483–492. [Google Scholar] [CrossRef]
- Rodríguez, M.R.; Delpoux, R.; Piétrac, L.; Dai, J.; Benchaib, A.; Niel, E. Supervisory control for high-voltage direct current transmission systems. IFAC-PapersOnLine 2017, 50, 12326–12332. [Google Scholar] [CrossRef]
- Mahfouz, M.; Iravani, R. Autonomous Operation of the DC Fast-Charging Station. IEEE Transactions on Industrial Electronics 2021. [Google Scholar] [CrossRef]
- Ghasaei, A.; Zhang, Z.J.; Wonham, W.M.; Iravani, R. A Discrete-Event Supervisory Control for the AC Microgrid. IEEE Transactions on Power Delivery 2020, 36, 663–675. [Google Scholar] [CrossRef]
- Cassandras, C.G.; Lafortune, S. Introduction to discrete event systems; Springer, 2008.
- Su, R.; Wonham, W. Supervisor Reduction for Discrete-Event Systems. Discrete Event Dynamic Systems 2004, 14, 31–53. [Google Scholar] [CrossRef]
- Manitoba Hydro International Ltd.. Photovoltaic Example: Written for PSCAD v4.6. Manitoba Hydro International Ltd., 2018. Revision 1.
- Yazdani, A.; Iravani, R. Voltage-sourced converters in power systems: modeling, control, and applications; John Wiley & Sons, 2010.
- Wu, D.; Tang, F.; Dragicevic, T.; Vasquez, J.C.; Guerrero, J.M. Autonomous Active Power Control for Islanded AC Microgrids With Photovoltaic Generation and Energy Storage System. IEEE Transactions on Energy Conversion 2014, 29, 882–892. [Google Scholar] [CrossRef]
- Zhong, Q.C.; Weiss, G. Synchronverters: Inverters That Mimic Synchronous Generators. IEEE Transactions on Industrial Electronics 2011, 58, 1259–1267. [Google Scholar] [CrossRef]
- Nguyen, P.L.; Zhong, Q.C.; Blaabjerg, F.; Guerrero, J.M. Synchronverter-based operation of STATCOM to Mimic Synchronous Condensers. In Proceedings of the 2012 7th IEEE Conference on Industrial Electronics and Applications (ICIEA); 2012; pp. 942–947. [Google Scholar] [CrossRef]
- Zhong, Q.C.; Nguyen, P.L.; Ma, Z.; Sheng, W. Self-Synchronized Synchronverters: Inverters Without a Dedicated Synchronization Unit. IEEE Transactions on Power Electronics 2014, 29, 617–630. [Google Scholar] [CrossRef]
- Wang, Y.; Wen, M.; Chen, Y. A simplified model of Type-4 wind turbine for short-circuit currents simulation analysis. IET Generation, Transmission & Distribution 2022, 16, 3036–3049. [Google Scholar]
- Hackathon – SEPOC 2021. Available at: https://2021.sepoc.com.br/hackathon/. Accessed on: 11th June 2023.
- Photovoltaics, D.G.; Storage, E. IEEE standard for interconnection and interoperability of distributed energy resources with associated electric power systems interfaces. IEEE Std 2018, 1547, 1547–2018. [Google Scholar]
| 1 | From now on, we call Z the automaton representation of a supervisor S. |



























| State: | Disable events |
|---|---|
| 1: | , |
| 2: | , , |
| 3: | |
| 4: |
| Model | State | Events | Description |
|---|---|---|---|
| G1: PV | 1: MPPT 2:Curtailment |
X: Y: |
The PV system can operate in MPPT mode (state 1) or in curtailment mode (state 2). The events are enabled or disabled by the supervisors, depending on the operation of the system. |
| G2: BESS Operation | 1: BESS Standby 2: BESS Charging 3: BESS Discharging |
U: W1: V: W2: |
Operation mode of BESS is represented by a three-state automaton with four events. The BESS operating model is designed for taking into account charging, discharging and standby mode without power injection. |
| G3: Genset | 1: Genset at standby mode 2: Genset at nominal mode |
X: Y: |
The Genset is modeled with two states and two events. Event represents the injection of its nominal ative power considering a power factor of , while event indicates that the generator have to inject its minimum power, depending on the voltage and frequency of the grid. |
| G4: WT | 1: WT at Constant Power Factor 2: WT at Support voltage |
X: Y: |
The WT system can operate as a P-Q bus (state 1) working in the MPPT control, and as a providing voltage support function (state 2). |
| G5: Noncritical load Breaker | 1: Load connected 2:Load disconnected |
X: Y: |
The breaker that disconnects nonessential loads is modeled with two states and two events. Where state 1 is noncritical load connected and state 2 load disconnected. |
| G6: Peak shaving command | 1: Disable Peak Shaving 2: Enable Peak Shaving |
X: Y: |
The peak shaving mode is activated or deactivated by command, to do this, it is modeled with two states and two events. |
| Model | State | Events | Description |
|---|---|---|---|
| G7: BMS | 1: SOC 2: SOC 3: SOC 4: SOC |
X1,X2,X3: Initialization of BMS U: V: W: Y: |
Monitoring the maximum and minimum SOC of the BESS:When the SOC is above , the PV goes into curtailment mode and when the SOC returns below , the PV returns into MPPT mode. If SOC is below , the noncritical load is disconnected. When the SOC drops below , the Genset must inject its nominal power. |
| G8: Pgrid | 1: 2: 3: |
X1,X2: Initialization of Pgrid U: V: W: |
Monitoring the grid’s active power: The grid’s power must not exceed the contracted value. If , the BESS goes into discharge mode. If , the BESS goes into charging mode. Otherwise, BESS is in stamdby mode. |
| G9: Vrms | 1: 2: 3: |
,: Initialization of U: V: W: V: |
Monitoring the POI’s RMS voltage: The voltage must not drop below , as required by the grid code. To ensure this, the WT and genset provide voltage support. When the voltage (Vrms) at the POI is above , the WT remains in constant power factor mode. If the voltage drops below , the WT switches to voltage support mode. If the voltage drop persists, the Genset also comes into operation to provide additional voltage support. |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2025 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 (http://creativecommons.org/licenses/by/4.0/).