System Modelling, Controller Design, And Stability Analysis Of Grid-Forming Inverters