Frequently Asked Question
Press "Ctrl + F" to find the keyword of your interest.
If you wish to have a direct link access to the video timestamps, please follow these instructions.
Found this video helpful? Why not take the whole HIL Specialist course? A Certificate is waiting for you for free at HIL Academy.
Would you or your organization benefit from having these videos narrated in your native language? Contact us and let us know if you wish to contribute.
Hello again and welcome!
In this lesson, we will look at microgridmodel optimization.
In the Application Examples module, we lookedat a fully functional terrestrial microgrid
model built using switching DER components.
That example also demonstrated the abilityof a microgrid controller to handle microgrid
islanding events, using either a diesel gensetor a battery energy storage system to form
Now, in this lesson, we will look at thatsame terrestrial microgrid model rebuilt using
generic DER components.
By doing that, you can optimize the model'shardware utilization so that it can run on
HIL 4-series devices, even though the originalmodel was designed for 6-series devices.
In addition, we will maintain the same functionalitiesof the microgrid controller, while also exploring
some of the additional features of genericcomponents on a system level.
If you need a quick refresher on the DER componentslibrary, as well as the advantages and disadvantages
of the legacy and generic DER components,please refer back to the lessons in the Distributed
Energy Resources module.
Now let's open the model using Example Explorer.
Go to microgrid, microgrid example), terrestrialmicrogrid generic, and select the Terrestrial
microgrid example using generic components.
Let's open this example by clicking the "Openmodel" button.
As mentioned before, thanks to the use ofgeneric DER components, this microgrid model
can run on a 4-series device, while the modelwith switching DER components requires a 6-series
This is possible for two reasons.
First, the diesel genset generic componentused in this model does not require any machine
solver resources compared to its legacy counterpart.
Second, generic components utilize less resourcesfrom the standard processing cores, and you
can fit up to 3 DERs per core.
This particular model is divided in 3 SPCs,instead of the 4 SPCs used in the microgrid
model with switching components.
Therefore, if you look at the configurationtable for a HIL404 device, you can see that
any configuration from 1 to 5 could be used.
The predefined choice in this example is torun the model using HIL404 configuration 1.
Let's now check what are some of the differencesbetween this microgrid model and the model
with switching components.
First, remember that the generic DER componentshave embedded transformers that can be enabled
by checking the box "include transformer".
Therefore, the external three-phase transformersused in the switching model are no longer
Now, let's talk about the core coupling componentsused to divide the circuit into different
In this model, two TLM core couplings areused, embedded in the RL sections.
Compared to the ideal transformer-based corecouplings used in the switching model, the
TLM couplings have the advantage of beingsymmetrical, not introducing any topological
conflict in the model.
In addition, TLM couplings include their owninductance and capacitance, which is a useful
feature in microgrid models such as this one,where the RL sections are used to emulate
You can find more information about the differenttypes of core coupling in the Electrical circuit
partitioning lesson of the HIL Fundamentalscourse.
You can also check the IEEE33 bus system examplein the Example Explorer to better understand
how to model a power system using TLM couplings.
All functionalities of the microgrid controllerremain the same in comparison with the model
using switching components.
Nevertheless, some modifications had to bemade to adapt the interface of the controller
to the generic DER components.
This can be better seen if you look underthe mask of the DER's user interface subsystems.
Among the modifications in the controllerinterface, you can see that the reference
values for voltage, frequency, active power,and reactive power are now normalized, since
the inputs of the generic component's UI expectsvalues in PU.
In addition, it is important to point outthat, by default, the Diesel Genset and the
Battery ESS generic components can operatein three modes: grid-following, isochronous,
This means that grid-forming mode can be engagedhere using the voltage and frequency droop
algorithms embedded in these generic components.
This is not possible with the switching componentmicrogrid model.
To take advantage of that, the logic of theBattery ESS User Interface was modified to
include operation in droop mode when the batteryis the grid-forming DER of choice.
We will see this in more detail when we runthe model and demonstrate microgrid operation.
To do so, let's compile and load the modelusing the fourth generation HIL404 device,
as mentioned before.
You can open the SCADA panel file found inthe model directory and run the simulation.
If you are running this simulation in VirtualHIL mode, you may notice that this model can
run close to real-time, which isn't the casewhen the switching DER component microgrid
model runs in Virtual HIL.
This is possible since generic componentsare signal processing-based components, which
can run on your computer's CPU much fasterthan the more complex switching components.
Let's explore this SCADA panel.
You can see that we have several group widgetsthat control different elements in the model.
On the top-left side, we have the microgridcontroller group.
Here, you can choose if the grid-forming DERwill be the battery inverter or the diesel
genset, change the operation mode from grid-tiedto islanded, enable the microgrid central
controller, turn on or off the interruptibleload, and enable or disable each one of the
DERs in the model.
You have also LEDs indicating the status andoperation modes.
For every DER, you have gauges in the panelroot displaying the most important information,
such as power, voltage, and frequency.
Also, you can access the DER interfaces usingthe corresponding sub-panels.
The same is true for the variable load interface.
If you enter in the battery interface, forinstance, you can control the references for
different operation modes, droop coefficients,limits for the state of charge, protection
limits, grid codes, and so on.
Let's begin with the scenario where all DERs,the interruptible load, and the variable load
are disabled, just as we did in the switchingDER microgrid lesson.
The utility grid is now supplying the constantimpedance load.
As you can see in the Point of Common Couplingmonitor, the active power from the grid in
this condition is around 660 kW, while thereactive power is around 80 kVA.
If you compare these values to the ones obtainedwith the microgrid model using switching DER
components, you will notice that the powersupplied by the utility grid is lower.
This happens mainly because this model usesthe transformers embedded in the DERs, which
does not include the same losses associatedwith external transformers.
Let's now enable the variable load with anactive power reference of 50%, which is equivalent
to 225 kW.
To compensate this load increase, you cansee now that the power supplied from the grid
increases to around 890 kW.
You can now turn on the battery inverter,which is set by default in the interface with
an active power reference of 200 kW.
As mentioned before, the microgrid centralcontroller in this model sets the battery
energy storage system to operate in droopmode if the battery is the grid-forming DER
Therefore, besides providing the requiredpower reference, the battery also provides
reactive power in order to regulate the terminalvoltage.
Let's enable the other three DERs.
The wind power plant is set to inject itsnominal power into the microgrid, (wait 1
sec) the PV power plant is set with a curtailmentof 50%, (wait 1 sec) and the diesel genset
is set to operate in grid following mode witha power reference of about 600 kW.
Once all DERs are running, we can see thatthe microgrid is injecting around 480 kW into
the utility grid.
Now, by changing the appropriate combo boxin the microgrid controller group, you can
test intentional islanding events in differentconditions.
Remember that, according to the microgridcontroller logic, the active and reactive
power flowing through the PCC is first zeroedand then the intentional islanding is enabled.
This can be seen in the active and reactivepower offsets graphs.
Let's do this test choosing the battery inverteras the grid-forming DER.
The microgrid is now in islanded mode, disconnectedfrom the utility.
The Battery energy storage system is formingthe grid and is operating in droop mode, according
to the logic programed in the micro controller.
Let's change the operation back to grid-tiedmode.
Notice that now the operation mode of thebattery changes from droop to isochronous
This is done to take advantage of the PCCmonitor synch check, which provides the voltage
and frequency references to synchronize themicrogrid with the utility grid.
Once the phasors of the voltages are aligned,as shown in the PCC monitor, the microgrid
is reconnected to the utility grid.
Notice that after being re-connected to thegrid, the battery switches back to droop mode,
as it was operating before the islanding.
Another possibility for the intentional islandingtest is to choose the Diesel genset as the
When doing that, according to the microgridcontroller logic, the operation mode of the
battery changes to grid following, injectingpower according to the references set in the
Let's run the intentional islanding test,but with the diesel genset forming the grid.
You can once again see the power offsets,which now present slower dynamic responses
when compared to the battery, which is expected.
When running this model, you can see thatCPU utilization is always satisfactory.
The same would be true if you chose to runit on a HIL606 device.
In fact, you could include more DERs on aHIL606 then on a HIL404 given the larger number
of SPCs available.
If you try to run this model on HIL402 or604 devices, you will notice that it can be
compiled, as long as you go to the signalprocessing settings and set the code and data
sections to be placed in the external memory.
However, since generic components utilizesignal processing heavily, they require more
resources from the user CPU than the switchingcomponents.
Therefore, although this model successfullycompiles on these devices, when running the
simulation, you would experience the riseof the CIO flag in the SCADA panel, indicating
that the signal processing computation timeexceeded the allocated time slot.
When you are building your own model, oneof the ways to overcome this is by increasing
the execution rate of the signal processingcomponents.
This was not done here in order to keep theexact same microgrid controller and execution
rates as in the switching model.
Finally, it is worth mentioning that you canalso choose to build your microgrid model
using average DER components.
This would allow you to fit a microgrid modelsimilar to the one presented here on a 4 series
device using 3 cores, while having unlockedDER components that can be modified as you
wish, as is the case of the model using switchingcomponents.
Of course, choosing which type of componentto use when building your microgrid model
depends on the objectives and requirementsof your simulation, as well as on the hardware
resources that you have available.
That is all for this lesson.
Make sure to try this model in our ExamplesExplorer.
Thank you for your attention.