The random nature of the power of renewable energy sources, such as photovoltaic and wind turbine systems, can damage the quality of the system's power and efficiency. Especially when the grid is independent and is like a separate system. This random nature of the power of renewable energy sources can lead to severe problems, such as alternative frequency and power fluctuation. This alternative frequency and power fluctuation can cause system inconstancy and performance efficiency drop problems. Tackling with problems such as high penetration of renewable energy sources, need to compensate the power fluctuations and the system frequency stabilization. Recent developments in energy and technology storage and power electronics have made the application of energy storage techniques as a suitable solution for micro grids. It is useful to choose and use the energy storage and control of the equipment to solve the stated problems. In this study, according to the control methods used in the reference literature and based on the scientific principles of these methods, a control method is proposed which can be used to introduce a general application for the battery hybrid energy storage system - a superconductor which has the ability to compensate for reactive power at the same time as reducing the output power fluctuations of distributed grid systems in a micro grids including linear load, solar energy system and wind turbine in which the dispersal distributed turbine generation system has output power fluctuations. Finally, using the Imperialist Competitive Algorithm method, an optimal value for the inductor in this set is found. To test the efficiency of the proposed control method and optimize the superconductor inductor, simulation is performed in the MATLAB software environment.