Phase locked loop:
Required for synchronization to the grid
d-q control of the inverter
The regulation controls the injection of power
We impose Q = 0, it would also be possible to drive Q to control the stability of the voltage at the connection point to the grid.