A control architecture to coordinate distributed generators and active power filters coexisting in a microgrid