The application of renewable energy is stimulating since the environmental pollution and the increase in demand for global energy consumption have become the main concerns of humanity. However, the intermittent nature of renewable sources could seriously affect the frequency stability of the system which needs to be solved. In this paper, the Virtual Synchronous Generator (VSG) based on battery/supercapacitor Hybrid Energy Storage System (HESS) is proposed to handle the stochastic power output of Photovoltaic (PV). First, the power allocation methods for HESS and its comparison are illustrated. Second, the comparison of the frequency deviation suppression strategies is presented. Moreover, as the adjustable parameters of VSG (J, D) is a key superior to the conventional synchronous generator; hence, a part of this paper will be introduced a new evolutionary algorithm called Backtracking Search Optimize Algorithm (BSA) to tune the parameters of the VSG in real time. To investigate the control performance, the standalone microgrid is modeled in the MATLAB/Simulink environment. Several case studies are conducted, and the results prove the improvement of the system frequency by attenuating the maximum overshoot of frequency deviation from 50.18 Hz to 50.03 Hz.