Distributed control of inverter-based lossy microgrids for power sharing and frequency regulation under voltage constraints