Conventionally, the operation and stability of power systems have been governed by the dynamics of large synchronous generators (SGs) which provide the inertial support required to maintain the resilience and stability of the power system. How-ever, the commitment of the UK to drive a zero-carbon economy is accelerating the integration of renewable energy sources (RESs) into the power system. Since the dynamics and operation of RESs differs from SGs, the large-scale integration of RESs will significantly impact the control and stability of the power system.This thesis focuses on the design of grid-friendly control algorithms termed virtual synchronous machines (VSMs), which mimic the desirable characteristics of SGs. Although several VSM topologies have been proposed in literature, most of them require further modifications before they can be integrated into the grid. Hence, a novel VSM algorithm for permanent magnet synchronous generator based wind turbines has been proposed in this thesis.The proposed VSM performs seamlessly in all operating modes and enables maxi-mum power point tracking in grid-connected operation (assuming strong grid), load following power generation in islanded mode and fault ride-through during faults. To ensure optimal performance of the VSM in all operating modes, a comprehensive stability analysis of the VSM was performed in the event of small and large per-turbations. The result of the analysis was used to establish design guidelines and operational limits of the VSM.This thesis further evaluates the impact of VSMs on the power systems low-frequency oscillations (LFOs). A detailed two-machine test-bed was developed to analyze the LFOs which exists when VSMs replace SGs. The characteristics of the LFO modes and the dominant states was comprehensively analyzed. The LFO modes which exists in an all-VSM grid was also analyzed. Further, the role of the power system stabilizers in an all-VSM grid was comprehensively evaluated. An IEEE benchmark two-area four-machine system was employed to validate the results of the small-signal analysis.The analysis and time-domain simulations in this thesis were performed in the MAT-LAB/SIMULINK environment.