A distributed optimization-based secondary control framework is aimed to be developed to optimally utilize the distributed energy resources in an islanded microgrid to enhance the stability of the network. The control system is motivated to handle the interactions among the distributed energy resources, as they maintain the voltage and frequency of the microgrid within the specification, keep the power balanced and shared among them, and at the same time improve the power quality of the network.