In a microgrid with multiple sources, it is possible to control these sources in a number of ways. The previous example titled "Three phase inverter in current control mode interfaced to a three phase inverter in voltage control mode" (click here) is an example of such a microgrid. In that case, the source in voltage control mode forms the grid and becomes the master while the source in current control mode becomes the slave. The advantage of this configuration is that chances of instability are minimal. However, if the master fails the entire microgrid fails.
In contrast, the case being presented here is a microgrid where both sources are masters and both form the grid. The advantage is that the failure of one of them does not bring the microgrid down. However, with both sources forming the grid, the question is how do they share the load in the microgrid? Since these sources will be inverters, they have to be controlled to emulate synchronous generators. This means giving the inverters an inertia and therefore a droop control law that changes the output frequency with the active power being supplied by the source. Additionally, to emulate the magnetic circuit of the generators, a droop control law is included that changes the voltage magnitude of the source with the reactive power supplied.
Each source is modeled as a ControllableVoltageSource in the circuit. Each source has an embedded control - the outer loop being the droop control that generates the frequency and voltage magnitude and therefore the references for the three-phase voltage to be generated.
The load is increased at 1s to show how the increased load is shared between the sources. Let us consider source 1 to have double the capacity of source 2. Therefore the droop control gain of source 1 is 5e-6 rad/(W-s) while the droop control gain of source 2 is 1e-5 rad/(W-s). As the frequency of the system has to be common for both sources, this would mean at steady state, source 1 will supply twice as much active power as compared to source 2. The reactive power droop control gains of both sources are equal and are 1e-5 V/VAR.
The first result shows the load currents over the period of a 10s simulation. The load transient is at 1s, and the currents are seen to drastically increase. The plots of the currents are in a number of different colours as the output data file is split up into time intervals of 2s. Therefore, Gnuplot plots each file with a different set of colours. A closeup of the currents towards the end of the simulation shows they are balanced and sinusoidal.
The next figure shows the frequency generated by the droop control gains. The source with the larger capacity will experience the smaller decrease in frequency during transients while the source with smaller capacity will exhibit larger changes in frequency. Therefore, larger frequency deviations will result in larger phase angle lags. The source with the larger capacity will lead the source with smaller capacity during the load increase and therefore will supply a larger percentage of the load active power demand.
The next two figures show the currents supplied by source 1 and source 2. As seen source 1 supplies a larger current than source 2.
The next figure shows the phase a voltages of the two sources. Only a single cycle has been shown to be able to show the phase angle difference between the sources at steady state. As previously mentioned, since the sources are separated by a very small impedance, a very small phase angle difference is needed to able to ensure active power sharing.
This result shows how two sources can be simulated while forming a microgrid. One of the reasons for choosing this example is that this was the topic of my PhD. I spent several years designing controllers for isolated microgrids controlled in a decentralized manner using droop control laws. The simulation took several hours for a 10s simulation on my laptop. However, as before, I was able to run four simulation cases simultaneously on my laptop. Another distinct advantage of splitting the output files is that one can see the progress of the simulation by plotting each file and refreshing it whenever you want to check an update. Also, at the end, you could plot the entire result by adding all the files in a single plot command.