This paper describes a study on the application of superconducting magnetic energy storage (SMES) and grid code compliance to a wind and photovoltaic (PV) generation system. When a grid operates under instantaneous outage or surge condition, the distributed generation systems such as wind and PV systems must remain connected to the grid during a certain period of time. Therefore, the distributed generation system should be able to operate under abnormal conditions, such as reactive power or current fluctuations, which can damage the system and critical loads. The SMES can significantly enhance the dynamic security of such distributed power systems due to its high energy density and quick response characteristics. In this paper, the SMES control strategies for a wind and PV generation system during a fault ride through condition are examined, and the dynamic performance of SMES is evaluated by a case study based on the PSCAD/EMTDC simulation.