This application note (PDF!) from TI details the design of Single Phase PLL: Grid connected applications require an accurate estimate of the grid angle to feed power synchronously tothe grid. This is achieved using a software phase locked loop (PLL). … Read more