Islanded microgrids have low inertia due to a large penetration of non-inertial inverter based power sources. In such systems, the primary frequency controller (PFC) faces the issue of a higher rate of change of frequency (RoCoF) and large peak frequency deviation in case of a sudden change in load or generation loss. The frequency control becomes more challenging as the variation in the frequency of different sources is not synchronized. This paper proposes a model for frequency dynamics in an islanded microgrid comprised of both inverter based distributed generators (DGs) and synchronous generators (SGs). The model is developed considering the asynchronous variation of frequency among the SGs. Based on the developed model, a novel disturbance compensation-based PFC is proposed. The PFC controls the reference power of a battery energy storage system (BESS) which is operated in grid-following mode and compensates for the power imbalance in the microgrid. The performance of the proposed model and the PFC is verified using Typhoon real-time hardware-in-the-loop simulation.