This example explores a closed-loop inverter. No grid is present, which simplifies things. But, since the controller is implemented in the synchronous (dq) reference frame, a synchronization source needs to exist. This is implemented with the saw tooth generator, which emulates the output of the PLL.
As can be seen in the following figure, one can now comfortably specify the setpoint for the output current of the inverter:
Having the posibility to separately control the current in each dq axis enables one to control the power factor (i.e. the phase lag between the voltage and the current) as well as the amplitude of the current.
In this example, the equivalent synchronization signal is plotted to see this phase shift as the setpoints change. Notice how, when the q component of the current is 0, the d component is equal to the peak current.