In this study, an optimization model containing a small-signal stability constraint is proposed to improve the microgrid’s stable operation. Besides, the optimization model considers the multiple conditions to guarantee the microgrid can operate in different conditions. However, the parameter optimization of the droop controller in this optimization model is a nonsmooth optimization problem. The heuristic algorithm is hard to obtain a robust optimal solution. Therefore, a Broyden-Fletcher-Goldfarb-Shanno combined with sequential quadratic programming (BFGS-SQP) method is proposed to tackle this weakness. This proposed method is a mathematical method that can obtain a robust solution during repeat simulation. A case study on the microgrid system demonstrates the effectiveness of the BFGS-SQP method.