Frequency and voltage control of inverter-based microgrids