Active Power Compensation of Microgrid Connected Systems