Nowadays environmental concerns and fossil fuel limitations, as well as economic benefits and technical issues such as reliability lead conventional distribution networks to smart microgrids, where the renewable energy resources are merged with the grids. Nevertheless, the systems face new challenges due to the intermittent nature and uncertainties in the distributed generations, which cause frequency fluctuations in the microgrid. The photovoltaic cells are the main part of the contemporary microgrids. Although the photovoltaic (PV) systems depend on solar irradiance, and temperature and are affected by the partial shading phenomenon they could contribute to improving the microgrid frequency stability with a proper control scheme. In this paper, the frequency control strategy is designed for a hybrid stand-alone microgrid, which is robust against load disturbances, variations in weather conditions, and uncertainties in the microgrid parameters. The proposed intelligent control scheme relies on the Recurrent Adaptive Neuro Fuzzy Inference System (RANFIS). The Whale Optimization Algorithm (WOA) is employed to optimize the RANFIS controller structure and generate the parameters of membership functions. In this multi-objective optimization, the objectives are settling time (ST), overshoot (Osh), and Integral Square Error (ISE). The simulation results verify the high robustness and performance of the proposed RANFIS controller, compared to other controllers, during various operational circumstances, as well as the sporadic behavior of renewable energy resources (RES) such as fluctuations in solar radiation and certain uncertainties in the microgrid parameters.