With the use of distributed renewable energy sources that can be utilized locally to produce and feed electric power, the concept of microgrids (MGs) has emerged. The MGs have two operating modes: grid-connected and islanded mode [
1]. The issue of power balance between production and consumption, which is equivalent to the load and frequency control has been one of the major challenges in the islanded mode of operation [
2]. Imbalances between distributed generations (DGs) and loads in MGs create frequency fluctuation which leads to a decrease in power quality or even may put the system stability at risk [
3]. Furthermore, high penetration of renewable energies in MGs can bring uncertainties due to unpredictable environmental changes in terms of solar irradiance, temperature, wind speed, etc. [
4]. Therefore, a robust control technique is needed to guarantee the small-signal stability of MGs despite load or source changes. In the islanded mode of operation, the most usable controller is the PI corrector which is implemented in a two-loop hierarchical structure. Namely, power control is performed by an outer control loop with low bandwidth while an inner control loop with higher bandwidth than the outer loop is responsible for voltage and current control [
5]. The responsibility of the inner current and voltage controller loops is to track voltage and current reference values during disturbances as well as to damp output filter resonances [
6]. The aim of the outer loop is to guarantee active and reactive power-sharing with other DGs. Various types of power-sharing control strategies have been proposed in islanding operation of MGs [
7], e.g., master/slave control [
8], distributed control [
9], and droop control [
10]. Among them, the droop control strategy inspired by the behaviour of synchronous generators has more advantages such as the capability of applying in both modes of MG operations, needless communication lines among DGs, and plug-and-play functionality [
11].
Based on the type of common bus voltages, MGs are classified into AC [
12], DC [
13] and hybrid AC/DC [
14]. In the case of AC MGs, voltage-source inverters (VSI) are used as interfaces between the common bus voltage and the load. These VSIs have lower physical inertia in comparison with synchronous generators [
15] which means that their dynamic response is much faster. This fast dynamic response makes them vulnerable in front of different disturbances. Therefore, for the reliable operation of MGs, small-signal stability is required in a wide range of operations [
16]. The power quality and stability of MGs are affected by droop control coefficients and controllers’ parameters. In [
17], it is proved, by using root locus and sensitivity analysis, that the low-frequency eigenvalues of the MG are strictly sensitive to the droop controller parameters. Therefore, the selection of controllers’ coefficients needs careful attention [
18] to satisfy MG power quality conditions and smooth and stable operation during load changes. In addition, by optimally selecting these parameters, it is conceivable that the islanded MG can be stable in a wide range of operations with less voltage and frequency steady-state errors. Also, in [
19], even with similar parallel inverters and identical parameters, the uncertainty brought by different output impedances might destabilize the system. Different approaches have been presented in the literature to select the controllers’ coefficients [
20]. The most used ones are based on a trial and error approach which is time-consuming, especially in a complex MG and the tuned parameters are not the optimum ones. Furthermore, this approach does not provide a systematic guideline for the design of controllers’ coefficients in the MGs. Another approach is to design the controllers’ parameters in such a way that the dynamics of the outer loop be slower than that of the inner loop [
21]. Under this assumption, the inner and outer control loops can be separately designed. Normally, the bandwidth of the outer loop is limited to
of the inner loop [
22]. However, this approach has similar disadvantages to the trial and error method. The last approach to design the controllers’ coefficients is to employ optimization algorithms such as genetic algorithm (GA) [
23] and particle swarm optimization (PSO). They are widely used in the MGs for different areas, such as harmonic mitigation [
24] and optimal scheduling [
25]. The authors in [
26] used the PSO algorithm to optimally select the MG control parameters. In their approach, the problem constraints are not exactly specified which can jeopardize the stability of the MG. In addition, the objective function can only remove the steady-state error of the active power. In [
27] a two-layer PSO algorithm was used for parameter selection in the inverter side inductor current control theory framework. In that work, only the effect of PI controller parameters was investigated. However, the impact of power-sharing coefficients is also important and the choice of these parameters is critical [
28]. In [
29] an online intelligent method, based on the combination of fuzzy logic and PSO techniques, was proposed for the selection of PI parameters to control the MG frequency. In [
30] Grasshopper Optimization Algorithm (GOA) was used, and in [
31] PSO was used to tune the PI controller parameters. PSO was also used in [
32] to design triple-action controllers’ parameters for an islanded AC MG. In [
33], GA was used to design controller parameters in the secondary control level of an AC MG, and in [
34] a non-dominated sorting genetic algorithm-II was used to design the parameters for the fractional order PID controller. However, the performance of GA shows premature convergence in some cases [
35].
None of the above-mentioned references provides a universal and simple design approach to tune the controllers’ parameters which guarantees the small-signal stability in the whole range of operation. In this paper, regardless of the number of inverters, MG configuration, output line impedance, or types of loads, a straightforward design approach is presented. This can minimize designers’ efforts to the tuning MG controllers’ parameters when the output impedances, the number of inverters, and MG configuration may change. Since the VSIs are interfaced to a common bus voltage with huge coupling inductances and the distribution lines have resistive-inductive impedances, it can be concluded that the stable and optimal operation of each VSI can guarantee stable and optimal operation of the whole MG provided that interacting effects are neglected. Therefore, in the proposed design approach, the small signal analysis of a VSI is considered. A novel eigenvalues-based objective function is defined which involves stability criteria eliminating the need of performing sophisticated stability analysis and making the control design method simpler than traditional techniques. Power controller coefficients, PI current and voltage controller gains are determined through the optimization problem which is solved through different algorithms such as PSO, GA, and proposed PSO-GA intending to improve both system static and dynamic performances. The proposed combined PSO-GA uses both PSO and GA. The controllers’ coefficients can be determined off-line for the worst-case scenario of the operating point. In order to validate the proposed method, different case studies including load changes in the two-inverter system are simulated in the islanded mode of operation using PSIM© software. A comparative analysis among optimization algorithms is carried out for the different case studies. The main contributions of the paper are listed below.