Evaluating Microgrid Control with Simscape Electrical
Overview
In this webinar, MathWorks and Hydro-Québec will discuss how modeling and simulation support the development of microgrid systems that contain renewable energy and energy storage. Through a worked example of a representative grid-connected microgrid, both grid-forming and grid-following operation will be considered. Various microgrid control modes will be demonstrated, including active- and reactive-power control, droop control, imbalance compensation and solar curtailment. Operation of the control modes will be demonstrated through appropriate test harnesses, that allow efficient evaluation of system response to be performed over a broad operational envelope.
About the Presenters
Patrice Brunelle, Scientist, Hydro Quebec, Canada
Patrice Brunelle is a Scientist with the Research Center of Hydro-Quebec. Over the last 20 years his work has centered around Power Systems and Power Electronic and he has been involved in the development of Simscape Electrical Specialized Power Systems (formally Power System blockset, and later on SimPowerSystems). Patrice holds a B.Sc. degree in Genie Unifié from the Universite du Quebec a Chicoutimi, Chicoutimi, Quebec, Canada and a M.Sc. degree in electrical engineering in 1994 from Universite Laval, Ste-Foy, Canada.
Graham Dudgeon, Principal Product Manager - Electrical Technology, MathWorks
Graham Dudgeon is principal product manager for electrical technology at MathWorks. Over the last two decades Graham has supported several industries in the electrical technology area, including aerospace, marine, automotive, industrial automation, medical devices, and power and utilities, with an emphasis on system modeling and simulation, control design, real-time simulation, machine learning, and data analytics. Prior to joining MathWorks, Graham was Senior Research Fellow at the Rolls-Royce University Technology Centre in Electrical Power Systems at the University of Strathclyde in Scotland, UK.
Recorded: 31 May 2022
Hello, everyone, and welcome to this webinar on Evaluating Microgrid Control with Simscape electrical. My name is Graham Dudgeon, and it is my great pleasure to be joined by my friend Patrice Brunelle who is a senior scientist at Hydro-Quebec Research Institute. Hello, Patrice. How are you, my friend?
Very well. Thanks, Graham. How about you?
I'm doing real good. All right. Let's kick on. So here's our agenda for today.
We'll begin with an overview, and then work through various operational modes that include grid farming, grid following, grid synchronization, and unbalanced compensation. We'll provide more context and detail on these modes, as we go through the presentation. Now, I'll pass over to Patrice who will provide our overview of the system. Patrice.
Thank you, Graham. OK. Here is the system that we'll be exploring today. It's a microgrid with a PV array, a Battery Energy Storage System that I will call BESS, and a load. The microgrid can operate in high length in mode or be connected to the main utility grid.
Our objective is to evaluate the functional correctness of the various control mode through simulation of appropriate operational scenarios. Note that you can find a version of this model on MathWorks File Exchange by searching for microgrid dynamic operation. It's an entry by my colleague Pierre Giroux, and if you don't own this model, you will be able to explore and simulate all the operational scenarios that we'll be discussing today.
All right. So when we're in Google, what we do is we take File Exchange, and then click on MATLAB Central MathWorks. And once we're in here, we've got access to all the community files that exist for the MathWorks community. So I'm going to take microgrids dynamic operation.
There's a number of other microgrid entries here by other members of the community, but microgrid dynamic operation, it's this one here by Pierre Giroux. So you click on that, and then you just click Download. And if you click Download, what will happen is you will get a zip file which you can then unpackage. And then you can get up and running and do everything that you're going to be seeing in this webinar today.
Let's take a look at the battery storage system in SO. The battery energy storage system is a 1-megawatt, 1-megawatt hour lithium ion system. It's connected to a two-level converter. The converter is modeled at a fidelity level known as switching function, meaning that the individual switches are not modeled.
And the PWM signals are average over the simulation signal time. This means we can maintain as much harmonic information as possible. BESS control can switch between grid forming, grid following, grid synchronization, and imbalance compensation, depending on the operational mode of the microgrid.
With the switching function fidelity level, we use a pulse averaging PWM generator. So what do we mean by that? Here, you see a PWM signal that has been generated from a 300 Hertz carrier wave and a 60 Hertz modulation wave. If my sample time is say 1 over 600 Hertz, indicated by the dashed line, you can see that I do not have an appropriate resolution to accurately capture the pulse transition.
What do we do with pulse averaging? We calculate the ratio of the pulse on time divided by the sample time, and that average value is then used in our next sample time. With this pulse averaging generator and the corresponding switching function converter model, a much higher simple time can be used for the model, while maintaining a high-fidelity simulation.
Here, we can see the array of control system we have implemented for the battery energy storage system. We won't spend time in this webinar looking in detail at the implementation of this control subsystem, but we would encourage you to download the model from File Exchange, so you may explore this subsystem in more detail at your leisure. We will, however, be describing the operational mode and show the simulation result in order to discuss the operational behavior we are seeing.
The solar power plant is a 1 megawatt rated system that is connected through a boost converter and three-level converter. The boost converter controls the power output of the solar panel, and its model as average model. This means that the duty cycle is fed directly into the converter, and the output voltage has no switching harmonics. The two-level converter is a switching function model of the same fidelity level as the BESS two-level converter.
BP control can switch between maximum power tracking, we used to say MPPT, and power curtailment, depending on the operational mode of the microgrid. The load. The load is a simple impedence with active and reactive power specify. We can connect and disconnect load number two to provide load shedding and load connection, as appropriate.
The utility grid is configured as a 120 kV to 25 kilovolt system. Connection to the microgrid is made through 25 kilowatts 600 volt transformer. The utility grid has a single-phase load on phase C, at the primary of the microgrid transformer. Can be connected to cause a system imbalance.
That completes our brief tour of the system architecture. Graham, would you like to set some context for a grid following control, before we explore the simulation results?
Absolutely, Patrice. Thanks. The bottom line is that an AC electrical power system cannot operate in a secure and stable manner without a well-regulated voltage and the well-regulated frequency. When we've established appropriate grid voltage and frequency, we say the grid is formed.
On an AC system, any control system that directly contributes to the control of voltage and/or frequency is referred to as a grid-forming controller. On a DC system, any controller that directly contributes to the control of DC voltage is a grid-forming controller. Group control, which I will summarize in a moment, is a form of grid-forming control which has the added benefit of facilitating effective power sharing between generation units.
Here is the basic architecture for droop control in an AC system. For frequency droop, we offset the frequency of reference by subtracting active power multiplied by a droop value. For voltage droop, we offset the voltage reference by subtracting reactive power multiplied by a droop value.
The frequency droop curve tells us what the system frequency is for any active power loading condition. For example, for a frequency droop value of 5%, if active power loading is 0.5 per unit, then the frequency will be 0.975 per unit. The gradient of the droop curve is the droop value.
The voltage droop curve tells us what the system voltage is for any reactive power loading condition. For example, for a voltage droop of 5%, if reactive power loading is 0.5 per unit, then the voltage is 0.975 per unit. Again, the gradient of the droop curve is the droop value.
If we have two sources, we can plot both frequency droop curves together to establish reactive power loading at any frequency level. Note that, regardless of loading, the power share ratio remains the same. In the animation you're seeing here, generator two has half the droop value of generator one, and so generator two provides twice the active power.
Similar to frequency droop, if we have two sources that are under voltage droop control, we can plot both voltage droop curves together to establish the reactive power loading at any voltage level. Note that, regardless of loading, the power-share ratio remains the same. In the animation that you're seeing here, generator two has half the droop value of generator one, and so generator two provides twice the reactive power.
With a solar power plant, for a given irradiance, there is a maximum power transfer that can be achieved. Maximum power transfer will occur when the internal impedance of the PV array matches the load impedance. A Maximum Power Point Tracking algorithm, or MPPT algorithm, adjusts the duty cycle of a boost converter, such that the load impedance presented to the PV array matches the internal impedance.
What we can see in this example figure is MPPT in action. There are a number of solar-cell-powered curves, colored blue, for a fixed temperature and varying radiance. The red line is the maximum power curve. The green dot is the power output, when using a maximum power point tracking algorithm, known as perturb and observe.
A perturb and observe algorithm attempts to minimize the gradient of the power output. As you can see, maximum power coincides with a power curve gradient of 0. I'll now pass back to Patrice who will discuss a grid forming and solar curtailment scenario in our microgrid model.
OK. In this scenario, the microgrid is islanded in the battery energy storage system operating grid-forming mode. It means that it directly controls voltage and frequency. To run the scenario in the model, we double click on the TestParam block, and select this number three from the dropdown list, before we simulate the model.
Here, we can see the simulation result for various power flows in the system. At 0.5 second, the microgrid is islanded, and the BESS control switches to grid-forming mode. At 1.5 seconds, a load shed occurs, and because we are still under MPPT control for the solar plant, the battery must absorb the excess solar power. At 2.5 seconds, the solar power controller is switched to curtailment mode, at which point the solar power is reduced to match the new loading condition, and battery active power returns to 0.
On the left, we can see how the duty cycle changed from MPPT mode to curtailment mode. Note that during curtailment, the duty cycle does not need to hunt for the maximum power point, and so we don't see the fluctuations in duty cycle that are evident in the MPPT mode. On the right, we see the PV voltage and current. Note that AC bolt rises, and the DC run reduces during curtailment. Now, I'll pass it back to Graham who will set the context for grid-following control. Graham?
Thanks, Patrice. So a control system and an AC electrical power system that directly controls active and/or reactive power set points is referred to as grid following. A control system on a DC electrical power system that directly controls DC power is referred to as grid following. An electrical power system cannot have only grid-following control systems. There must be a grid-forming control system that operates in conjunction with the grid-following control system.
OK. In this scenario, the microgrid is grid connected, and the battery energy storage system operates in grid-following mode. It means that it directly controls the active and reactive power. To run the scenario, we double click on the TestParam block, and select this one from the dropdown menu, before simulating the model.
Here, we can see the submission result from various power flows in the system. Note that the solar power changes throughout the scenario, due to the changing in irradiance. At 2 seconds, the BESS controller commands reactive power of 400 kilovolt ampere, and at 3.5 seconds, reactive power is reduced to 0. At 4 seconds, the battery charging is commanded with an active power reference of 500 kilowatt.
On the left, we can see how the PV duty cycle responds to the changing irradiance. The system remains in MPPT mode throughout this scenario. On the right, we see PV voltage and current. Note that, because voltage is relatively well regulated, PV current tracks the irradiance profile.
OK. Now, we'll move onto grid synchronization. Graham, would you like to set the context?
Absolutely, Patrice. So what I have here is a simple animation of two voltages at either side of a connector, which in this case is closed. If the voltages are of equal magnitude, frequency, and phase, then no current flows through the connector. However, if we start to phase shift the microgrid voltage relative to the utility grid voltage, then current starts flowing through the connector. The larger the phase shift, the larger the current.
Let's imagine we have this phase shift, but the connector is open. If we were then to close the connector, we would get a current in-rush, which is undesirable. What we need to do, prior to connection, is bring the two voltages into alignment in terms of magnitude, frequency, and phase.
Once we have the alignment, we can close the connector with minimal current in-rush. Grid-synchronization control is the process of measuring utility grid voltage and actively aligning the microgrid voltage magnitude, frequency, and phase with the utility grid voltage, prior to connection. Now, we'll consider a specific scenario. Patrice?
Yes. In this scenario, the microgrid is initially connected to the utility grid and operating in grid-following mode. The utility grid is then disconnected, and the microgrid switches to grid-forming mode. A grid-synchronization process then begins to align the microgrid voltage with the utility grid voltage. Once alignment reaches a defined threshold, then reconnection with the utility grid is made.
To run the scenario, we double click on the TestParam block, and select test two from the dropdown. This will configure the control system and loading and generation condition appropriately, prior to us running the simulation. Here, we see the simulated system respond for this scenario. At the top, we see the microgrid frequency and the utility grid frequency. Note that the utility grid frequency is maintained at 60 Hertz, while the microgrid frequency is subject to more variation.
In the middle, we see the voltage phase difference between the microgrid voltage and the utility grid voltage. When the microgrid is islanded, we see that the phase difference increases, as we are no longer synchronized. At 2 seconds, a synchronization signal is sent to the BESS, at which point it begins adjusting the phase of the macro voltage in order to reduce the phase difference. At 5 seconds, the phase difference is within tolerance, and the breaker is closed.
Now, let's look at the voltage with form in more detail. On the left, we see the phase shift between microgrid and utility grid voltage, following grid disconnection. On the right, we see that the phase of the voltages have been aligned, prior to connection at 0.5 seconds. Note that there is some discrepancy in voltage magnitude, but this is a normal situation. The key is to get the match within a certain tolerance in order to minimize current in-rush, before connection is made.
Here, we see the current flowing in the connection between the microgrid and utility grid, following resynchronization. Note, there is a tranger but it is significantly reduced from the tranger that would occur if a synchronization procedure was not performed. Next, we'll talk about unbalanced system. Graham, over to you.
Thanks, Patrice. Here, we can see a visual representation of a balanced system on the left and an unbalanced system on the right. In an unbalanced system, we can see variations in waveform magnitude, phase, or both. Unbalanced operation is undesirable, and we need a good way to analyze system imbalance, so we can assess the severity of an imbalance and also to drive appropriate control mechanisms to address an imbalance.
The way that we can effectively analyze system imbalance is through symmetrical components. Symmetrical components are used to express an unbalanced three-phase system as a combination of three balanced systems. Those three balanced systems are referred to as positive sequence, negative sequence, and zero sequence.
We're not going to cover the math of symmetrical components here. Plenty of textbooks are available that will cover that. It's better to show you what they are using animation and MATLAB.
Here's a visualization of symmetrical components for a balanced system. Let me orient you around what we're seeing, and we'll go column by column. The column on the left shows the sequence components. At the top is the positive sequence, the middle is the negative sequence, and the bottom is the zero sequence. Note that, for a balanced system, only positive sequence exists, and the positive sequence is equal to the original vectors.
The middle column is where we add the sequence vectors to reconstruct the original vectors. At the top is phase A reconstruction, the middle is phase B reconstruction, and the bottom is phase C reconstruction. Note that, because negative sequence and zero sequence are 0, then all we see in this middle column are the positive sequence vectors.
The final column is our original victors with phase A at the top, phase B in the middle, and phase C at the bottom. Note that the reconstructed vectors match the original vectors. So the middle column matches the right column.
Now, let's look at an unbalanced system. You can see in our left column that we now have a negative sequence. Also note that positive sequence is reduced in magnitude. As this example is not ground on neutral path, we've got no zero sequence.
In the middle column, we add the sequence vectors to reconstruct the original vectors. So in the middle, you can see phase A we're adding the positive and negative phase A vectors. That's A1 and A2. We add those together to get our original vector. We do the same for phase B, and phase C.
As you can see, those reconstructed vectors match our original vectors. Also note, the original vectors are very unbalanced in this particular case. So one way we can use sequence data is to provide a control input to correct system imbalance. Patrice, over to you.
Yes. OK. In this scenario, the microgrid is connected to the utility grid, and the microgrid is operating in grid-following mode. A single phase load is connected on the grid side, causing an imbalance in the microgrid voltage that manifests itself as negative signals. This compromises the supply to the microgrid load. The BESS switches to negative-sequence compensation in order to mitigate the microgrid voltage imbalance and, hence, provide a balanced power supply to the microgrid load.
Here is a measurement of negative sequence at the microgrid load. Negative-sequence compensation is activated at one second. You can see that the negative sequence is then reduced. Here, we see that microgrid voltage before and after negative-sequence compensation is activated. You can see that, after compensation is activated, the voltage magnitude are equalized.
So in summary, simulation is an invaluable tool for developing and testing microgrid control systems. They execute different operational modes. When evaluating system-level response, attention should be given to implementing the appropriate level of model fidelity, so that you focus only on necessary system physics and can perform simulations in a time-efficient manner.
Test harnesses can be developed that allow repeatable execution of the operational scenarios and facilitate sharing of engineering information and collaboration between different engineering teams.
So we hope you'll find this webinar useful. Patrice, thank you again for joining me today. It's been a great pleasure talking with you again.
Me too. Me too, of course. Thank you, Graham.
All right. Thank you, everybody. Bye-bye
Bye.