# Modeling and Simulation of Autonomous DC Microgrid with Variable Droop Controller
## 3 Proposed Variable Droop Controller for DC Microgrid
#### Design of Variable Droop Coefficient  
The equivalent circuit of a PEC in the proposed system where each converter is represented as a source with voltage \(V_{1}\) and a series droop resistor \(R_{d}\) is shown in Figure 6. Here, the bus voltage \(V_{DC}\) is expressed as in Equation (4).  
\[V_{o}=V_{1}-I_{L}\cdot r_{d} \tag{4}\]  
\(\delta\) indicates the voltage deviation at the DC bus when a load is applied and is given in Equation (5). The equation representing the \(P-V\) droop characteristics for a DC microgrid is given in Equation (6).  
\[\delta=I_{L}\cdot r_{d} \tag{5}\]  
\[V_{DC}=V_{NL}-kP_{DC}, \tag{6}\]  
where \(V_{NL}\) is the voltage of the bus without load. \(P_{DCmax}\) is the rated power of the source and \(V_{min}\) is the minimum voltage corresponding to \(P_{DCmax}\) and \(k\) is the slope of the droop characteristics accounted as the negative droop coefficient. \(P_{DC}\) and \(V_{DC}\) correspond to the operating point at any instant. \(P_{0}\) and \(V_{0}\) represent the nominal operating point. From Equation (6),  
\[k=\frac{V_{NL}-V_{min}}{P_{DCmax}} \tag{7}\]  
The droop coefficient is obtained as  
Figure 5: Illustration of the variable droop control principle.  
Figure 6: Generalized equivalent circuit model of a converter with series droop resistance.  
\[k=\frac{305-295}{5000}=0.002 \tag{8}\]  
Corresponding to \(P_{DCmax}\), \(I_{DCmax}\) can be found as  
\[I_{DCmax}=\frac{P_{DCmax}}{V_{min}}=17A \tag{9}\]  
and the droop resistor value is 0.588, obtained by substituting the values in  
\[R_{D}=\frac{305-295}{17}=0.588 \tag{10}\]  
The L and C values are obtained from the filter section design of the converter.  
The load dynamics can be accounted by modifying this as Equation (11).  
\[\delta(t)=I_{L}(t)\cdot r_{d}(t) \tag{11}\]  
The instantaneous value of \(\delta\) is denoted as \(\delta(t)\). \(r_{d}(t)\) and \(I_{L}(t)\) represent the values of the load current and the droop resistor at any instant. Differentiating both sides with respect to time, Equation (12) is obtained.  
\[\frac{d}{dt}\delta(t)=I_{L}(t)\cdot\frac{d}{dt}r_{d}(t)+r_{d}(t)\cdot\frac{d} {dt}I_{L}(t) \tag{12}\]  
\(\delta(t)\) is to be minimized for maximum dynamic stability. Hence, equating Equation (12) to zero, Equations (13) and (14) are obtained.  
\[I_{L}(t)\cdot\frac{d}{dt}r_{d}(t)=-r_{d}(t)\cdot\frac{d}{dt}I_{L}(t) \tag{13}\]  
\[\frac{d}{dt}r_{d}(t)=-\frac{r_{d}(t)}{I_{L}(t)}\cdot\frac{d}{dt}I_{L}(t) \tag{14}\]  
Integrating Equation (13) with respect to time, Equation (15) to Equation (17) are obtained.  
\[\int_{0}^{t}\frac{d}{dt}r_{d}(t)\,dt=-\int_{0}^{t}\frac{r_{d}(t)}{I_{L}(t)} \cdot\frac{d}{dt}I_{L}(t)\,dt \tag{15}\]  
\[r_{d}(t)-r_{d}(0)=-\int_{0}^{t}\frac{r_{d}(t)}{I_{L}(t)}\cdot\frac{d}{dt} \cdot I_{L}(t) \tag{16}\]  
\[r_{d}(t)=r_{d}(0)-\int_{0}^{t}\frac{r_{d}(t)}{I_{L}(t)}\cdot\frac{d}{dt}I_{L} (t)\,dt \tag{17}\]  
\(r_{d}(0)\), the initial value of \(r_{d}(t)\) is set as 0.5. To minimize \(\delta(t)\) a proportional controller is implemented in the voltage control loop. Enhanced DC bus voltage regulation is attained since the value of \(r_{d}\) changes according to the value of the load current. The hysteresis controller is realized in a MATLAB Simulink, R2018 A, with a nonlinear comparator having a dead band of \(\pm\)5 A, so that a high speed of response for the converter is achieved with accuracy.