Before describing the simulation results, let us examine the circuit schematic. The circuit schematic is spread over three spreadsheets - three_ph_source.csv, three_ph_load.csv and the compensator which can be either in spreadsheet comp_source.csv or in comp_inverter.csv. The circuit continues from one spreadsheet to the other using jump labels as connectors. The simulation parameters have been provided in circuit_inputs_sources.csv or in circuit_inputs_inverter.csv. Depending on whether the simulation must be run with an actual inverter or with controllable voltage sources, one of these spreadsheets has to be saved as circuit_inputs.csv. Each spreadsheet with circuit schematic has its own *_params.csv parameter spreadsheet file. In all aspects the simulation procedure is the same except that a large circuit can be broken into circuits over several spreadsheets.
The philosophy of operation of the compensator is as follows. A three-phase source supplies a three-phase load that draws both active and reactive power. The compensator must supply a part or all of the reactive power demanded by the load in order to reduce the burden on the source and also to improve the voltage regulation at the load bus. As this is a grid connected converter, the fundamental control element is the phase locked loop (PLL). The PLL locks on to the grid voltage and produces a phase angle waveform that matches the grid voltage fundamental frequency. This is used to transform the load currents to the synchronously rotating d-q reference frame. The compensator will now supply either all or part of the q component of the load current as this component is the current component that is in quadrature to the load bus voltage.
The performance of the PLL is shown below. The frequency is seen to stabilize to 377 rad/s in steady state which will be the angular frequency of a 60 Hz grid.
However, it can be seen that the PLL does not produce an output frequency close to the steady state value until around 0.1s. Therefore, as can be seen from comp_source.csv and comp_inverter.csv, there are disconnect switches connected between the compensator and the grid. These are kept open until 0.1s, to prevent large transients.
Let us examine how an ideal compensator made up of controllable voltage sources would perform. A closed loop current control is implemented in which the output current of the compensator is regulated in the synchronously rotating reference frame with a Proportional Integral (PI) controller. The output of the controller directly regulates the voltage of the sources that form the compensator. Refer to comp_source.csv for details on the circuit. The figure below shows the tracking of the controller.
From the figure, the red curve is the d component of the load current while the green curve is the q component of the current. As stated before, the compensator remains switched off until 0.1s. The reference currents of the compensator are - d component is zero while q component is equal to the q component of the load current. From the figure, it can be seen that at 0.1s, when the compensator is connected to the system, the d component of the compensator current remains zero while the q component becomes equal to the q component of the load current. Examine the figure below to see the tracking performance of the compensator.
The figure below shows the all the currents with respect to the load voltage. Only phase a waveforms of all these values are plotted to maintain clarity.
The pink waveform is the phase a load voltage while the green waveform is the phase a load current. At 0.1s, the compensator connects to the system and starts injecting a current which is the blue waveform. This current can be seen to be in quadrature to the load voltage as the compensator injects only the q component of the load current. After 0.1s, a red waveform appears and this is the phase a source current. Since the compensator now supplies the quadrature component of the load current, the source only supplies the in-phase component of the load current. The source current is seen to be in phase with the load voltage.
The above is exactly the desired performance of the compensator. Therefore, we can now proceed with replacing the controllable voltage sources with a three-phase inverter. This is in comp_inverter.csv.
The figure below shows the tracking performance of the compensator with a three-phase inverter. The result is similar to that before except for the switching ripple present due to the inverter operation. The transient performance at 0.1s when the compensator is connected is shown next.
The next figure below will show the currents with respect to the load voltage. As before, only phase a is plotted for clarity.
The result again is similar to the previous case as compensator supplies a current that is in quadrature with the load voltage. As the compensator supplies all of the reactive power demanded by the load, the source current is in phase with the load voltage as it only needs to supply the load active power demand. Both the compensator and source current contain switching frequency harmonics.
To show the flexibility of the compensator, let us consider a case where the compensator supplies all of the load current - both the quadrature component and the in-phase component of the load current. Since, the compensator supplies the entire load current, the source current is expected to be zero. The next figure is the tracking performance of the compensator in the synchronous reference frame.
As can be seen the compensator now supplies the entire load current. This can be seen when plotting all the current with the load voltage. As before, only phase a is plotted.
The source current can be seen to have only switching frequency harmonics. The next plot shows how the compensator supplies the entire load current.
This case is a simple extension of the grid connected inverter in current control mode. However, this is the first case where the circuit can be split into multiple spreadsheets. This helps to debug and develop the simulation. In future cases with multiple inverters, this facility will be particularly useful.