In the inverter-based AC microgrids, damping is critical to maintain stability and reduce the impact of disturbances-induced fluctuations. A higher damping coefficient can reduce the range of oscillations and make the system less exposed to voltage and frequency fluctuations. To maximize the damping benefits, it is necessary to find the optimal damping coefficient for the microgrid. In this paper, the control system of a virtual synchronous generator (VSG) is updated with the proposed structure inspired by the complete block diagram of the synchronous generator. The coefficients affecting the damping are adjusted robustly against parametric uncertainties using the Kharitanov's theorem. Then, using the firefly algorithm, the optimal values of control system parameter are calculated. Finally, it is shown that compared to the previous works, the damping coefficient is improved and in addition to the robust stability, the desired performance is also obtained.