A Photovoltaic-Based DC Microgrid System: Analysis, Design and Experimental Results

Due to the exhaustion of fossil energy, the utilization of renewable energy resources is developing quickly. Due to the intermittent nature of the renewable energy resources, the energy storage devices are usually adopted in renewable power generation system to enhance the system reliability. In this paper, the photovoltaic-based DC microgrid (PVDCM) system is designed, which is composed of a solar power system and a battery connected to the common bus via a boost converter and a bidirectional buck/boost converter, respectively. As the photovoltaic (PV) panels might operate in a maximum power point tracking (MPPT) mode or constant voltage mode, meanwhile, the power can flow between the battery and the load bidirectionally. Therefore, for the sake of optimizing power utilization in the PVDCM system, a control strategy making the system able to switch from one operating mode to another smoothly and automatically is proposed in this paper. Moreover, the small-signal modeling method based on averaged state-space is no more applicable in this study, thus the nonlinear analysis method with discrete-time mapping model is adopted for stability analysis. Based on the stability analysis, the closed-loop parameters are designed to make sure the whole system can operate properly in all operating modes. The control strategy and stability analysis based on the nonlinear analysis method in the closed-loop design are verified by experiment results.


Introduction
The non-renewable energy resources, including coal, petroleum, natural gas, etc., are gradually becoming exhausted, the development and proper utilization of the renewable energy resources is thus very urgent [1][2][3][4]. Therefore, due to the environmental and economic incentives, renewable energy generation is gaining lots of attention nowadays, such as solar power, wind power, fuel cell power, tidal power, etc. [5][6][7]. Among them, photovoltaic (PV) systems are now experiencing fast development. However, due to the intermittent feature of solar energy, which is closely related to the weather conditions and geographic locations, a PV system that is only composed of solar energy might be unreliable [1,3,8,9]. In order to solve this problem, an approach integrating the energy storage devices to the PV system i.e., the batteries and ultracapacitors, is usually employed [2]. The PV-based system can be connected to the main grid nearby as supplementary power to improve the reliability of the main grid. However, the extensive interconnection of the converter-based PV system to the main grid can lead to lots of dynamic interactions and may cause different kinds of unstable issues [10,11]. The PV system can also operate in standalone mode for local applications in remote non-electrified regions [10,12,13], such as in the desert, on mountains, etc. Constructing small-scale standalone PV-based system which can power the surrounding loads in those regions is much more cost-effective than extending the switching between the different operating modes smoothly and automatically. A control strategy for a dual-input buck and buck-boost converter with two input sources was proposed in [29], which is also applicable to multiple dual-input converters [30]. However, two control loops will interact with each other all the time when two input sources power the loads simultaneously. To solve this problem, an improved control strategy is proposed in [1]. However, that cannot handle the bidirectional power for the battery here as there are no energy storage devices in those systems.
Another challenge is the stability issue of the closed-loops, which is much more complicated for the system with multiple operating modes than the system with a single operating mode because the multiple control loops are always coupled with each other, and it's necessary to consider the stability conditions for all possible operating modes. The often used small-signal modeling method based on the state-space averaging method [26,28] is no longer applicable in the PVDCM system. The reason is that the multiple control loops are coupled with each other in each operating mode. The authors in [29] gave a method that designed the regulators in one operating mode first, in which there were no control loops coupling effects, then substituted the designed parameters into other operating modes and checked if the system was stable or not. If the system was stable, the estimating procedure was ended, but if not, the controller parameters of regulators were adjusted until the stability requirements were satisfied. This method may fail many times before finding a correct solution and it needs to be designed again when the operating condition is changed. Despite this, this method is no longer applicable when the control loops are coupled in all operating modes. In [30], a decoupling matrix is introduced to design the regulators of the coupled control loops, but this method becomes invalid in a system with multiple operating modes, because the decoupling matrixes might be different for each operating mode. Then, it's difficult for closed-loop designing-oriented. Alternatively, the small signal method with the eigenvalues analysis is performed in [21,26,27]. However, this small-signal modeling method based on the averaged state-space can only capture and analyze the low-frequency instability of the system, i.e., below half of the switching frequency [31], but cannot be used to analyze high frequency stability issues, such as subharmonic oscillation [32]. Then, a proper dynamic model for stability analysis of the PVDCM system is demanded.
In general, the PVDCM system based on the switched power converters with the closed-loop control is a nonlinear time-discontinuous system, then many modeling methods for the DC converters can also be used here. To summarize that, one way to model the dynamics of this kind of system is by applying the averaging theory to transform the converter system into a time-continuous system, as in [31,32], which includes the simplest state-space averaging method. Despite that, more general averaging methods, such as Krylov-Bogoliubov-Mitropolsky [33] and multi-frequency averaging [34] are also developed to consider the switching ripple effects. However, it is still questionable at a high frequency range because it loses the high frequency information by averaging. Many strange phenomena cannot be explained with these models, such as the phase delay of the loop gain [35] and the subharmonic oscillation in the peak current control loop [32]. The former one is explained later by the multi-frequency small signal models [35], and [32] studies of the subharmonic oscillation by adding the sample-and-hold effect to the modified averaged model. However, this method fails to predict the beat frequency instability between different converters [36]. To solve this problem, the harmonic state-space (HSS) models with multi-input-multi-output forms are proposed based on the linear time period theory [37]. The HSS model succeeds in analyzing the beat frequency oscillation and it can predict high frequency oscillations. The main disadvantages of the HSS models are that the matrix model order is very high to achieve an accurate prediction and the general Nyquist criteria are inevitably used. All of these modeling methods are based on linearized systems, and analyze the stability issues in the frequency domain. Another way to model the dynamics of the switched-converters based system is the nonlinear analysis method in the time domain, including the averaging model and discrete-time model [38]. This nonlinear analysis method is mainly used to investigate the nonlinear phenomena in power electronic circuits, such as the bifurcation and chaos phenomena. The averaging model in time domain, by averaging the state variables over one switching period, can only analyze the low frequency bifurcation [38,39]. The discrete-time model can give almost complete information about the system's dynamics, which is capable of predicting the instability in a wide range of frequencies, even amongst the chaos [38,40]. This paper is going to design and make sure PVDCM system is stable in a wide range of frequency, the nonlinear analysis method based on a discrete-time mapping model is thus adopted. This paper is organized as follows: Section 2 will first describe the PVDCM system with multiple operating modes, and then the energy management strategy is proposed; Section 3 presents the nonlinear stability analysis with a discrete-time mapping model, based on which the stability boundaries under different combination of compensation parameters are graphically derived in Section 4; in Section 5, the experiment results are given to verify the effectiveness of the energy management strategy and the nonlinear stability analysis method for designing the closed-loop parameters; lastly, conclusions are given in Section 6. Figure 1 shows the main topology of the studied PVDCM system, which is composed of the PV panels and the battery. The PV panels power the DC load on the DC bus via a boost converter and the battery is connected to the DC bus through a bidirectional buck/boost converter. The boost converter regulates the power of the PV panels, while the bidirectional buck/boost converter controls the charging and discharging procedures of the battery. When the maximum power of the PV panels is insufficient for the load, then the PV panels operate in MPPT mode and the battery provides the complementary power to the load, which also needs to control the bus voltage. If the power of the PV panels become larger than the load, the excessive power will be provided to the battery. Under this condition, if the charge current or charge voltage of the battery achieves the maximum value recommended by the manufacturers, the charging procedure of the battery requires to be controlled. Meanwhile, the PV panels need to quit MPPT control and start to take care of the DC bus voltage. Therefore, according to the power supplied by the PV panels, the battery states and the load conditions, the PVDCM is able to operate in multiple operating modes, as shown in Table 1. Here, P m is the maximum output power of the PV panels, P o is the load requirement power, v bat and i bat are the battery voltage and current, respectively. I bmax is the recommended maximum charge current for the battery, while V bmin and V bmax are the allowed minimum and maximum battery voltage, respectively. Electronics 2020, 9, x FOR PEER REVIEW 4 of 17 the system's dynamics, which is capable of predicting the instability in a wide range of frequencies, even amongst the chaos [38,40]. This paper is going to design and make sure PVDCM system is stable in a wide range of frequency, the nonlinear analysis method based on a discrete-time mapping model is thus adopted. This paper is organized as follows: Section 2 will first describe the PVDCM system with multiple operating modes, and then the energy management strategy is proposed; Section 3 presents the nonlinear stability analysis with a discrete-time mapping model, based on which the stability boundaries under different combination of compensation parameters are graphically derived in Section 4; in Section 5, the experiment results are given to verify the effectiveness of the energy management strategy and the nonlinear stability analysis method for designing the closed-loop parameters; lastly, conclusions are given in Section 6. Figure 1 shows the main topology of the studied PVDCM system, which is composed of the PV panels and the battery. The PV panels power the DC load on the DC bus via a boost converter and the battery is connected to the DC bus through a bidirectional buck/boost converter. The boost converter regulates the power of the PV panels, while the bidirectional buck/boost converter controls the charging and discharging procedures of the battery. When the maximum power of the PV panels is insufficient for the load, then the PV panels operate in MPPT mode and the battery provides the complementary power to the load, which also needs to control the bus voltage. If the power of the PV panels become larger than the load, the excessive power will be provided to the battery. Under this condition, if the charge current or charge voltage of the battery achieves the maximum value recommended by the manufacturers, the charging procedure of the battery requires to be controlled. Meanwhile, the PV panels need to quit MPPT control and start to take care of the DC bus voltage. Therefore, according to the power supplied by the PV panels, the battery states and the load conditions, the PVDCM is able to operate in multiple operating modes, as shown in Table 1. Here, Pm is the maximum output power of the PV panels, Po is the load requirement power, vbat and ibat are the battery voltage and current, respectively. Ibmax is the recommended maximum charge current for the battery, while Vbmin and Vbmax are the allowed minimum and maximum battery voltage, respectively. From Table 1, it can be seen that if Pm < Po and the battery is over-discharged, the whole system will be shut down. Despite this, the PVDCM has three normal operating modes as follows: From Table 1, it can be seen that if P m < P o and the battery is over-discharged, the whole system will be shut down. Despite this, the PVDCM has three normal operating modes as follows:

PVDCM System Description
• Operating Mode M 1 -when P m < P o , the solar power is insufficient, the PV panels are thus operating in MPPT mode controlled by the boost converter, while the battery supplies the complementary power via the bidirectional buck/boost converter working in boost mode to regulate the DC bus voltage v o , the inductor current i Lb2 is positive (the reference direction is shown as in Figure 1). Figure 2a shows the energy flow and the corresponding control requirements of M 1 , in which d 1 and d 2 are the duty cycles of Q 1 and Q 2 , respectively, Q 3 is always complementary to Q 2 . When P m > P o , the excessive power will be stored in the battery. Under this condition, if i bat < I bmax , it is unnecessary to control i bat , so the control system is the same as that in Figure 2a. The corresponding power flow is described in Figure 2b, which compared to Figure 2a, only the direction of i Lb2 is reversed.

•
Operating Mode M 2 -when P m > P o and i bat reaches the maximum charge current limit I bmax , i bat is required to be controlled so as to protect the battery. Thus, the bidirectional buck/boost converter operates in buck mode to control i bat . Meanwhile, the PV panels have to quit MPPT control mode and to regulate the dc bus voltage, as shown in Figure 2c.

•
Operating Mode M 3 -when P m > P o and v bat achieves the maximum battery voltage limit V bmax , the bidirectional converter will operate in buck mode to control v bat . At the same time, the boost converter still regulates v o , as shown in Figure 2d.

Pm < Po
Operating Mode M1-when Pm < Po, the solar power is insufficient, the PV panels are thus operating in MPPT mode controlled by the boost converter, while the battery supplies the complementary power via the bidirectional buck/boost converter working in boost mode to regulate the DC bus voltage vo, the inductor current iLb2 is positive (the reference direction is shown as in Figure 1). Figure 2a shows the energy flow and the corresponding control requirements of M1, in which d1 and d2 are the duty cycles of Q1 and Q2, respectively, Q3 is always complementary to Q2. When Pm > Po, the excessive power will be stored in the battery. Under this condition, if ibat < Ibmax, it is unnecessary to control ibat, so the control system is the same as that in Figure 2a. The corresponding power flow is described in Figure 2b, which compared to Figure  2a, only the direction of iLb2 is reversed.

•
Operating Mode M2-when Pm > Po and ibat reaches the maximum charge current limit Ibmax, ibat is required to be controlled so as to protect the battery. Thus, the bidirectional buck/boost converter operates in buck mode to control ibat. Meanwhile, the PV panels have to quit MPPT control mode and to regulate the dc bus voltage, as shown in Figure 2c.

•
Operating Mode M3-when Pm > Po and vbat achieves the maximum battery voltage limit Vbmax, the bidirectional converter will operate in buck mode to control vbat. At the same time, the boost converter still regulates vo, as shown in Figure 2d.

Proposed PVDCM Control Strategy
First, the PV converters are required to be able to realize the MPPT algorithm for the sake of making full use of solar energy. A schematic diagram of the MPPT control for the PV panels is shown in Figure 3, which regulates PV output voltage v pv or output current i pv to be equal to the voltage or current reference corresponding to the maximum power point. Here, i pv is chosen to be adjusted. Therefore, when the system reaches a steady state, the PV panels current reference I pvref will respond to the maximum power point through an MPPT algorithm. In this paper, the Perturb and Observe Algorithm (POA) [7,9] is adopted. The fundamental idea of this algorithm is to impose a small step to I pvref at a fixed interval, and calculate the output power of the PV panels to check whether it becomes larger or not, then to determine altering directions of the small step for I pvref , so that I pvref is capable of changing toward the maximum power point.

Proposed PVDCM Control Strategy
First, the PV converters are required to be able to realize the MPPT algorithm for the sake of making full use of solar energy. A schematic diagram of the MPPT control for the PV panels is shown in Figure 3, which regulates PV output voltage vpv or output current ipv to be equal to the voltage or current reference corresponding to the maximum power point. Here, ipv is chosen to be adjusted. Therefore, when the system reaches a steady state, the PV panels current reference Ipvref will respond to the maximum power point through an MPPT algorithm. In this paper, the Perturb and Observe Algorithm (POA) [7,9] is adopted. The fundamental idea of this algorithm is to impose a small step to Ipvref at a fixed interval, and calculate the output power of the PV panels to check whether it becomes larger or not, then to determine altering directions of the small step for Ipvref, so that Ipvref is capable of changing toward the maximum power point. On the other hand, the DC voltage needs to be controlled all the time, the charge current and charge voltage for the battery should be controlled properly. By combining the analysis and control requirements in Section 2.1, for the sake of ensuring the PVDCM can operate in multiple modes stably and switch between different modes smoothly, an energy management control system is designed in this paper, and demonstrated in Figure 4. Here, Ks is the sampling coefficient for inductor current iLb1, vof is the feedback output voltage and vof = Hof vo, while vbatf = Hbf vbat is the feedback battery voltage, and where Hof and Hbf are the sampling coefficients for vo and vbat, respectively.
The compensation ramp, Vp, which is further explicitly shown in Figure 5, is applied to extend the stability region of the peak current control method. Besides, with an additional diode Dc and a resistor R connected to the ground, the boost converter control loop can switch from the current control method realizing the MPPT algorithm to a dual control loop to regulate vo. Then, the boost converter switching between MPPT mode and constant voltage mode is achieved by turning Dc on and off automatically. For the bidirectional converter, whether it operates in boost mode or buck mode, Q2 is always the primarily controlled switch. Meanwhile, diode D1, D2, and D3 are introduced as selecting switches. By comparing the error signals, ve1, ve2, and ve3, the corresponding diode with the highest voltage is on while the other two diodes are off. Here, when the bidirectional converter works in buck mode, for instance, vbat is controlled, the controlled relationship will be vbat = vo (1 − d2). Hence, a negative logic is inserted to both the charge voltage and charge current control loops.
Based on the proposed energy management control method, the operating principle of PVDCM is described as follows: • Operating mode M1-when the PVDCM operates in M1, ipv (here also denotes as iLb1) is controlled by a peak current control loop to implement the MPPT algorithm. Meanwhile, the bidirectional converter operates in boost mode to regulate vo through a voltage control loop. Here, ve1 > 0, and ve2 < 0, ve3 < 0 due to the charge current and charge voltage not reaching the limited value. Accordingly, D1 is on, and D2 and D3 are off, the modulation signal vc of the "PWM Comparator2" is vc = ve1. Under this condition, since ve1 > 0, the diode Dc is thus turned off, and Iref = Ipvref. When Pm becomes larger than Po, the excessive energy will charge the battery automatically due to the dc voltage is controlled by the bidirectional converter. On the other hand, the DC voltage needs to be controlled all the time, the charge current and charge voltage for the battery should be controlled properly. By combining the analysis and control requirements in Section 2.1, for the sake of ensuring the PVDCM can operate in multiple modes stably and switch between different modes smoothly, an energy management control system is designed in this paper, and demonstrated in • Operating Mode M2-when Pm is much larger than Po, the excessive energy from the PV panels makes ibat reach Ibmax, the charge current loop is thus triggered and ve2 increases until it is larger than ve1, then D2 is turned on and D1 is turned off, and the bidirectional converter switches from boost mode to buck mode to control the charge current. Therefore, the DC voltage is not controlled during this transient interval. However, at the same time, the power delivered to the battery is controlled to a limit level so that much more power will be delivered to the load, which will lead to an increase in vo, and ve1 will decrease via the output voltage regulator. When ve1 falls below 0, diode Dc is turned on, then Iref = ve1 + Ipvref. With the adjustment of the MPPT algorithm, Ipvref will continue to increase, and ve1 will continue to decrease. In order to end this process, an upper limit Imax needs to be set for Ipvref in the MPPT algorithm, which should be slightly larger than the output current of the maximum power point for the PV panels in all conditions. During the execution process, if Ipvref exceeds Imax, Ipvref = Imax will be kept fixed, the MPPT algorithm is then disabled. Therefore, when the above adjustment process reaches steady state again, the PV panels exit the MPPT mode, and the boost converter controls vo through an outer voltage control loop and an inner current control loop. According to the analysis, the system can switch from M1 to M2 smoothly. If Pm decreases or Po increases, the system will switch from M2 to M1, which is the reverse process of the above analysis.

•
Operating Mode M3-whenever Pm > Po, as long as vbat reaches Vbmax, the charge voltage control loop is triggered, as vbatf increases, then ve3 increases. During the period ve3 < ve2, the battery is charged with the constant charge current Ibmax through charge current control loop, so vbatf still increases, ve3 increases until ve3 > ve2, D3 is on and D2 is off, and the charge voltage control loop begins to take care of the battery and control it to operate at a constant voltage. Then the system switches to M3 automatically.
From the above description, it can be known that the output voltage control loop and the MPPT control share the same inner control part, and meanwhile the output voltage control loop and the charge control loop share the same "PWM Comparator2", these control loops don't work at the same time but can switch smoothly with the chosen devices, i.e., Dc, D1, D2, and D3. Therefore, this control system is smart and flexible as it can switch between different operating modes smoothly. It should be noting that, to make sure the system can start correctly, the soft start circuits should be used, which can make the duty cycle of the main controlled switches increase slowly until the steady state is achieved.  The compensation ramp, V p , which is further explicitly shown in Figure 5, is applied to extend the stability region of the peak current control method. Besides, with an additional diode D c and a resistor R connected to the ground, the boost converter control loop can switch from the current control method realizing the MPPT algorithm to a dual control loop to regulate v o . Then, the boost converter switching between MPPT mode and constant voltage mode is achieved by turning D c on and off automatically. For the bidirectional converter, whether it operates in boost mode or buck mode, Q 2 is always the primarily controlled switch. Meanwhile, diode D 1 , D 2 , and D 3 are introduced as selecting switches. By comparing the error signals, v e1 , v e2 , and v e3 , the corresponding diode with the highest voltage is on while the other two diodes are off. Here, when the bidirectional converter works in buck mode, for instance, v bat is controlled, the controlled relationship will be v bat = v o (1 − d 2 ). Hence, a negative logic is inserted to both the charge voltage and charge current control loops.

The Discrete-Time Model
The discrete-time model for the operating mode M1 is established as an example in this section, and the analysis and modeling procedure are similar for the other two operating modes, which is thus ignored here. In our study, we assume that the switching frequency of the two converters is the same and the trailing edge modulation is applied to "PWM Comparator2" in Figure 4. Suppose the two converters operate in continuous current mode, the states of diode Dpv and switch Q3 are thus in complementary to the states of switches Q1 and Q2 all the time. Consequently, during one switching period, the system alters among three switch states and the sequence takes as follows: (1) Q1 and Q2 both are turned on; (2) Q1 is on while Q2 is off (when d1 ≥ d2) or Q1 is off while Q2 is on (when d1 ≤ d2); (3) Q1 and Q2 both are turned off. Here, according to the system parameters in Table 2, d1 ≥ d2 is adopted. Then, the state equations of the main circuit, as shown in Figure 1, are derived as where q1 and q2 are the switching functions of Q1 and Q2, respectively, which are given as  Based on the proposed energy management control method, the operating principle of PVDCM is described as follows: • Operating mode M 1 -when the PVDCM operates in M 1 , i pv (here also denotes as i Lb1 ) is controlled by a peak current control loop to implement the MPPT algorithm. Meanwhile, the bidirectional converter operates in boost mode to regulate v o through a voltage control loop. Here, v e1 > 0, and v e2 < 0, v e3 < 0 due to the charge current and charge voltage not reaching the limited value. Accordingly, D 1 is on, and D 2 and D 3 are off, the modulation signal v c of the "PWM Comparator2" is v c = v e1 . Under this condition, since v e1 > 0, the diode D c is thus turned off, and I ref = I pvref . When P m becomes larger than P o , the excessive energy will charge the battery automatically due to the dc voltage is controlled by the bidirectional converter.

•
Operating Mode M 2 -when P m is much larger than P o , the excessive energy from the PV panels makes i bat reach I bmax , the charge current loop is thus triggered and v e2 increases until it is larger than v e1 , then D 2 is turned on and D 1 is turned off, and the bidirectional converter switches from boost mode to buck mode to control the charge current. Therefore, the DC voltage is not controlled during this transient interval. However, at the same time, the power delivered to the battery is controlled to a limit level so that much more power will be delivered to the load, which will lead to an increase in v o , and v e1 will decrease via the output voltage regulator. When v e1 falls below 0, diode D c is turned on, then With the adjustment of the MPPT algorithm, I pvref will continue to increase, and v e1 will continue to decrease. In order to end this process, an upper limit I max needs to be set for I pvref in the MPPT algorithm, which should be slightly larger than the output current of the maximum power point for the PV panels in all conditions. During the execution process, if I pvref exceeds I max , I pvref = I max will be kept fixed, the MPPT algorithm is then disabled. Therefore, when the above adjustment process reaches steady state again, the PV panels exit the MPPT mode, and the boost converter controls v o through an outer voltage control loop and an inner current control loop. According to the analysis, the system can switch from M 1 to M 2 smoothly. If P m decreases or P o increases, the system will switch from M 2 to M 1 , which is the reverse process of the above analysis. begins to take care of the battery and control it to operate at a constant voltage. Then the system switches to M 3 automatically.
From the above description, it can be known that the output voltage control loop and the MPPT control share the same inner control part, and meanwhile the output voltage control loop and the charge control loop share the same "PWM Comparator2", these control loops don't work at the same time but can switch smoothly with the chosen devices, i.e., D c , D 1 , D 2 , and D 3 . Therefore, this control system is smart and flexible as it can switch between different operating modes smoothly. It should be noting that, to make sure the system can start correctly, the soft start circuits should be used, which can make the duty cycle of the main controlled switches increase slowly until the steady state is achieved.

The Discrete-Time Model
The discrete-time model for the operating mode M 1 is established as an example in this section, and the analysis and modeling procedure are similar for the other two operating modes, which is thus ignored here. In our study, we assume that the switching frequency of the two converters is the same and the trailing edge modulation is applied to "PWM Comparator2" in Figure 4. Suppose the two converters operate in continuous current mode, the states of diode D pv and switch Q 3 are thus in complementary to the states of switches Q 1 and Q 2 all the time. Consequently, during one switching period, the system alters among three switch states and the sequence takes as follows: (1) Q 1 and Q 2 both are turned on; (2) Q 1 is on while Q 2 is off (when d 1 ≥ d 2 ) or Q 1 is off while Q 2 is on (when d 1 ≤ d 2 ); (3) Q 1 and Q 2 both are turned off. Here, according to the system parameters in Table 2, d 1 ≥ d 2 is adopted. Then, the state equations of the main circuit, as shown in Figure 1, are derived as where q 1 and q 2 are the switching functions of Q 1 and Q 2 , respectively, which are given as The proportional integral (PI) regulators are used for output voltage controller, charge current controller, and charge voltage controllers, and the transfer function is given by here, k p is the proportional gain and τ i is the integral time constant. Besides, k pj and τ ij (j = 1, 2, 3) are the parameters for "Regulator1", "Regulator2", and "Regulator3" in Figure 4, respectively. In M 1 , the boost converter works with MPPT control scheme, I ref = I pvref . Nevertheless, the bidirectional converter operates in boost mode to control v o . Accordingly, v c = v e1 , so v c fulfills Consequently, the state variable vector of The corresponding state equations for the three switch states are described by where n = 1, 2, 3 are corresponding to switch state (1)-(3), respectively. The voltage vector E 1 is given as E 1 = [V pv V ocbat V ore f ] T , and A n and B n are expressed as The sampled state variables at the starting and ending instants of the nth switching period are denoted as x n = x(nT s ) and x n + 1 = x((n + 1)T s ), respectively. Then, the solution can be derived for each state equation in (5), i.e., where I represents the unity matrix, φ j (ξ) is the transfer matrix, which is expressed as In order to complete the discrete-time map, the relationship between the duty cycles and the state variables should be found. During the period of Q 1 being on, i Lb1 increases, when it reaches I ref , Q 1 will be turned off. Therefore, the switching function for Q 1 can be derived as where C 1 = [0 − Ks 0 0 0]. As demonstrated in Figure 5, the compensation slope m c can be calculated with m c = V p /T s . In the output voltage control loop, v c is compared with the ramp signal, which is given by where V L and m ramp are the lower threshold and rising slope of the ramp signal, respectively. Essentially, Q 2 is turned on if v c > v ramp , and otherwise it is turned off. Therefore, the switching function for Q 2 is obtained as here C 2 = [0 0 0 0 1]. Now, an accurate discrete-time model can be derived by combining Equations (10), (12) and (14). Assuming the equilibrium point is denoted as x e . By taking x n + 1 = x n = x e , s 1 = 0 and s 2 = 0, the equilibrium point x e and stable-state duty cycles D 1 and D 2 can be obtained. Then, the Jacobian of the equilibrium point for the discrete-time model is evaluated as All the eigenvalues of the Jacobian can be got according to solve the characteristic equation as follows λI − J(x e ) = 0.
If all the eigenvalues are inside the unit circle, the system is stable. But if any eigenvalue is outside the unit circle or on the unit circle, then the system will become unstable.
It should be noted that usually the PV microgrids also provide power to the constant power load, not only the pure impedance load as in this paper. If a constant power load is adopted, the dc bus voltage is also required to be controlled for many applications, so the control strategies can be the same as those in this paper. But, the discrete-time model needs to be changed. For example, the load resistor R L is changed to a constant power load P cpl , then the first state equation in (1) should be changed to and the corresponding A n in (6) is changed to here, V oe 2 is the steady state DC voltage, which will be calculated later at the equilibrium point. The other procedures are similar.

The Stability Boundaries of PVDCM
In this study, the system parameters of PVDCM are specified as shown in Table 2, based on which the system stability boundaries are found with the discrete-time model. Generally speaking, the parameters of the PI controllers and slope compensation V p are significant parameters to be determined. As we know, k p is required to be large enough to reduce the steady-state error, while τ i should be small enough to improve the system dynamic response. However, if k p is too large or τ i is too small, instability will occur. Therefore, we need to find the stability boundaries for these controller parameters under the worst operating conditions, with V pv , I pvref , I o , and V ocbat serving as space parameters. Here, the operating modes M 1 and M 2 are taken as an illustration at the most time, to help us find the worst operating condition firstly, then the stable region of the controller parameters are derived.
In order to find the worst operating condition of the output voltage control loop for the bidirectional converter, k p2 = 1, τ i2 = 50 µs, and V p = 0.1 are kept constant to make sure the charge current control loop and the peak current control loop are stable. Corresponding to the parameters specified in Table 2, the explicit stability boundaries demonstrated in Figure 6 are obtained by the discrete-time model established in Section 3, where B 12 is operating mode boundary between M 1 and M 2 .

The Stability Boundaries of PVDCM
In this study, the system parameters of PVDCM are specified as shown in Table 2, based on which the system stability boundaries are found with the discrete-time model.
Generally speaking, the parameters of the PI controllers and slope compensation Vp are significant parameters to be determined. As we know, kp is required to be large enough to reduce the steady-state error, while τi should be small enough to improve the system dynamic response. However, if kp is too large or τi is too small, instability will occur. Therefore, we need to find the stability boundaries for these controller parameters under the worst operating conditions, with Vpv, Ipvref, Io, and Vocbat serving as space parameters. Here, the operating modes M1 and M2 are taken as an illustration at the most time, to help us find the worst operating condition firstly, then the stable region of the controller parameters are derived.
In order to find the worst operating condition of the output voltage control loop for the bidirectional converter, kp2 = 1, τi2 = 50 μs, and Vp = 0.1 are kept constant to make sure the charge current control loop and the peak current control loop are stable. Corresponding to the parameters specified in Table 2, the explicit stability boundaries demonstrated in Figure 6 are obtained by the discrete-time model established in Section 3, where B12 is operating mode boundary between M1 and M2. By observing Figure 6, some conclusions can be drawn as follows:  By observing Figure 6, some conclusions can be drawn as follows: • The system will become unstable with the PI parameters change. As k p1 gets larger or τ i1 gets smaller, it's much easier for the output voltage control loop to lose its stability.

•
As the output voltage regulator is shared in M 1 , M 2 , and M 3 , the system stability is always affected by the parameters k p1 and τ i1 (in mode M 2 and M 3 are similar), which have narrower stable regions in M 1 than that in the other two operating modes. Consequently, they need to be designed in operating mode M 1 . • V pv and I pvref are related to the PV panels, which also have influence on the stability and also determine the worst operating condition for the voltage control loop in operating mode M 1 . The parameters V pv and I pvref become the smaller in M 1 , the system operating condition will become worse.
For the sake of length constraint, some stability boundaries are ignored here. With the similar analysis, it can be known that V ocbat is smaller, which also makes the the output voltage control loop become unstable more readily. What is worse, when V pv decreases, the stable region of the peak current control loop will also shrink.
At present, when the system works in the worst operating conditions in the operating mode M 1 , the stability boundaries of "Regulator1" and slope compensation V p are derived in Figure 7. From Figure 7a, it can be seen that if V p > 0.08 V, the stability of the peak current control loop can be guaranteed all the time. It can be found that, from Figure 7b, τ i1 should be larger than 1.1 ms to maintain the output voltage control loop stable when k p1 = 1 (In this paper, τ i1 is selected as 1.2 ms). current control loop will also shrink.
At present, when the system works in the worst operating conditions in the operating mode M1, the stability boundaries of "Regulator1" and slope compensation Vp are derived in Figure 7. From Figure 7a, it can be seen that if Vp > 0.08 V, the stability of the peak current control loop can be guaranteed all the time. It can be found that, from Figure 7b, τi1 should be larger than 1.1 ms to maintain the output voltage control loop stable when kp1 = 1 (In this paper, τi1 is selected as 1.2 ms). In order to simplify the discussion, the derivation processes of the stability boundaries for "Regulator2" and "Regulator3" are omitted here, as they are similar to the above analysis. The final results of parameters are given as kp2 = 1, τi2 = 10 μs, kp3 = 10, τi3 = 22 μs.

Experimental Validation
In order to verify the effectiveness of the energy management strategy and the nonlinear analysis method based on the discrete-time model, a 240 W prototype is established in the laboratory, as shown in Figure 8. The specifications of the PVDCM system are the same as that in Table 2, where the normal battery voltage Vbat is 36 V, which is composed of three 12 V battery modules, and the IRFP4668PbFs are adopted as the switches Q1 ~ Q3, and the 60APU02PbF is used as power diode D.
When Vpv = 31 V with different Ipvref and Vocbat, the stable-state experiment waveforms at full load in three operating modes are exhibited in Figure 9a-d. In Figure 9a-c, the waveforms from the top to the bottom are the DC bus voltage vo, the drive signals for Q1 and Q2, VGS1 and VGS2, the two inductor currents iLb1 and iLb2, respectively. In Figure 9d In order to simplify the discussion, the derivation processes of the stability boundaries for "Regulator2" and "Regulator3" are omitted here, as they are similar to the above analysis. The final results of parameters are given as k p2 = 1, τ i2 = 10 µs, k p3 = 10, τ i3 = 22 µs.

Experimental Validation
In order to verify the effectiveness of the energy management strategy and the nonlinear analysis method based on the discrete-time model, a 240 W prototype is established in the laboratory, as shown in Figure 8. The specifications of the PVDCM system are the same as that in Table 2, where the normal battery voltage V bat is 36 V, which is composed of three 12 V battery modules, and the IRFP4668PbFs are adopted as the switches Q 1~Q3 , and the 60APU02PbF is used as power diode D.  When V pv = 31 V with different I pvref and V ocbat , the stable-state experiment waveforms at full load in three operating modes are exhibited in Figure 9a-d. In Figure 9a-c, the waveforms from the top to the bottom are the DC bus voltage v o , the drive signals for Q 1 and Q 2, V GS1 and V GS2 , the two inductor currents i Lb1 and i Lb2 , respectively. In Figure 9d, the waveforms from the top to the bottom are v o , v bat , i Lb1 , and i Lb2 , respectively. From Figure 9a, when I pvref = 0.53 A (current sampling coefficient K s = 0.1), the equivalent PV panels' power is smaller than the load, i.e., p pv < P o , thus the battery provides the complementary power to the load, here, i Lb2 > 0, corresponding to the power flow in M 1 as in Figure 2a. In Figure 9b, when I pvref = 1.1 A, p pv > P o , excessive power is provided to the battery, and the measured average value I Lb2 is −2.5 A, so I Lb2 < 0, corresponding to the power flow in M 1 as shown in Figure 2b (only the inductor current is reversed compared to the previous mode in M 1 ). It can be seen from Figure 9c, when I pvref = 2 A, theoretically the average value of i Lb1 can reach 20 A, but the actual average value is measured to be 12.2 A. This is because the charge current is controlled and I Lb2 = −3 A, the PV panels change from the MPPT mode to the constant voltage mode, corresponding to the power flow in M 2 as shown in Figure 2c. Under the same condition, if V bat reaches 40 V, the charge voltage control loop will be triggered and the charge current will decrease, as demonstrated in Figure 9d, corresponding to the power flow in M 3 as shown in Figure 2d. Based on the above analysis, it can be concluded that the PVDCM system can operate stably in all three operating modes.  To further examine the dynamic responses and the operating mode switching procedures, the load stepping up from 10% load to full load and then stepping down to 10% load are implemented, the experimental results are shown in Figure 10, where v o and v bat are only given the AC components. From Figure 10a, it can be observed that when the PV panels' maximum power P m = 105 W, which is not enough to power the full load but is much larger than 10% load, then excessive power will be provided to the battery and the charge current is smaller than I bmax . Therefore, the PVDCM is working in M 1 before and after the load changes, only the battery exits from providing power to the load and is charged. Here, the PV panels are operating in MPPT mode with I Lb1 kept constant, and the output power is almost constant, which agrees with the theoretical design. In Figure 10b, P m = 600 W, the PVDCM are always working in M 2 with an I Lb2 which doesn't change, the power provided by the PV panels varies to keep power balanced, while the battery is always in a constant current charging mode with charge current of 3 A. In Figure 10c, P m = 600 W, the battery is basically full-charged at this time, so the PVDCM is working in M 3 all the time, the power provided by the PV panels varies to supply the load before and after the load changes, while the battery is in a constant voltage charging mode and the charge current is relatively small. When the load changes, the operating mode also switches, the corresponding experimental waveforms are shown in Figure 10d,e. In Figure 10d, when the load steps up to full load and then steps down to 10% load, the system will switch from M 2 to M 1 automatically, and then switch back to M 2 again. From it, it can be seen that both I Lb1 and I Lb2 varies to keep power balanced when the load changes. Figure 10e shows that the system will switch from mode M 3 to M 1 automatically, and then switch back to M 3 again when the load steps up and steps down. panels varies to keep power balanced, while the battery is always in a constant current charging mode with charge current of 3 A. In Figure 10c, Pm = 600 W, the battery is basically full-charged at this time, so the PVDCM is working in M3 all the time, the power provided by the PV panels varies to supply the load before and after the load changes, while the battery is in a constant voltage charging mode and the charge current is relatively small. When the load changes, the operating mode also switches, the corresponding experimental waveforms are shown in Figure 10d,e. In Figure 10d, when the load steps up to full load and then steps down to 10% load, the system will switch from M2 to M1 automatically, and then switch back to M2 again. From it, it can be seen that both ILb1 and ILb2 varies to keep power balanced when the load changes. Figure 10e shows that the system will switch from mode M3 to M1 automatically, and then switch back to M3 again when the load steps up and steps down. The above experimental results come from the stable system which is designed based on the stability boundaries in Section 5. To further verify the stability analysis, the controller parameters are chosen in the unstable region are tested. Such as τ i1 should be larger than 1.1 ms to maintain the output voltage control loop stable from Figure 7, and τ i3 > 8.7 µs and V p > 0.08 V should be guaranteed in M 3 to keep the system stable. Here, τ i1 = 0.8 ms in M 1 and τ i3 = 4.7 µs, V p = 0 V in M 3 are performed in Figure 11, the other controller parameters are kept the same as the stable operation in Figure 9; Figure 10. From Figure 11a, it can be clearly seen that a low frequency oscillation occurs as τ i1 is too small and in the unstable region in Figure 7. Figure 11b exhibits the coexistence of a low frequency oscillation and subharmonic oscillation, as a small τ i3 mainly affects the low frequency stability and V p has a great influence on the high frequency stability.
All the above experiment results demonstrate that when the power supplied by the PV panels and the load have variations, the PVDCM system is capable of switching among the three operating modes smoothly, and indicating that the energy management strategy proposed in this paper and the nonlinear analysis method in the closed-loop design are effective. stability boundaries in Section 5. To further verify the stability analysis, the controller parameters are chosen in the unstable region are tested. Such as τi1 should be larger than 1.1 ms to maintain the output voltage control loop stable from Figure 7, and τi3 > 8.7 μs and Vp > 0.08 V should be guaranteed in M3 to keep the system stable. Here, τi1 = 0.8 ms in M1 and τi3 = 4.7 μs, Vp = 0 V in M3 are performed in Figure 11, the other controller parameters are kept the same as the stable operation in Figure 9; Figure 10. From Figure 11a, it can be clearly seen that a low frequency oscillation occurs as τi1 is too small and in the unstable region in Figure 7. Figure 11b exhibits the coexistence of a low frequency oscillation and subharmonic oscillation, as a small τi3 mainly affects the low frequency stability and Vp has a great influence on the high frequency stability. All the above experiment results demonstrate that when the power supplied by the PV panels and the load have variations, the PVDCM system is capable of switching among the three operating modes smoothly, and indicating that the energy management strategy proposed in this paper and the nonlinear analysis method in the closed-loop design are effective.

Conclusions
In order to make sure the PVDCM system can switch between different modes smoothly and automatically, a control strategy with optimized power utilization is proposed in this paper, and the principle of this strategy is explicitly described. Then, in order to guarantee the system stable under all required conditions, the stability analysis based on the nonlinear analysis method with a discretetime mapping model is adopted to design the closed loop parameters. With the discrete-time model, the stability boundaries of different parameters are derived, which first is used to find the worst operating condition for each control loop and then the stable region can be derived under the worst operating conditions. The controller parameters then can be chosen in the stable region to ensure the PVDCM system can operate stably in all operating modes. Finally, a prototype is built in the laboratory, the experimental results verify the effectiveness of the proposed energy management strategy and the stability analysis based on the nonlinear analysis method used in the closed-loop design.
In the future, more works need to be completed. First, the critical and quantitative comparison between the proposed method in this paper and the other presented methods are worth studying. Second, more complicated DC microgrids need to be covered. Such as the system multiple integrated renewable energy resources simultaneously, the system with multiple energy storage devices and so on. Second, the control strategy for the complicated system will be studied and try to provide a

Conclusions
In order to make sure the PVDCM system can switch between different modes smoothly and automatically, a control strategy with optimized power utilization is proposed in this paper, and the principle of this strategy is explicitly described. Then, in order to guarantee the system stable under all required conditions, the stability analysis based on the nonlinear analysis method with a discrete-time mapping model is adopted to design the closed loop parameters. With the discrete-time model, the stability boundaries of different parameters are derived, which first is used to find the worst operating condition for each control loop and then the stable region can be derived under the worst operating conditions. The controller parameters then can be chosen in the stable region to ensure the PVDCM system can operate stably in all operating modes. Finally, a prototype is built in the laboratory, the experimental results verify the effectiveness of the proposed energy management strategy and the stability analysis based on the nonlinear analysis method used in the closed-loop design.
In the future, more works need to be completed. First, the critical and quantitative comparison between the proposed method in this paper and the other presented methods are worth studying. Second, more complicated DC microgrids need to be covered. Such as the system multiple integrated renewable energy resources simultaneously, the system with multiple energy storage devices and so on. Second, the control strategy for the complicated system will be studied and try to provide a unified control method for the standalone application and grid-connected application. Third, the stability issue should be further addressed and compared with different modeling methods.
Author Contributions: Conceptualization, methodology, software, validation, formal analysis, investigation, resources, data curation, writing-original draft preparation, visualization, supervision, project administration, and funding acquisition, X.X.; writing-review and editing, Y.Y., X.X. All authors have read and agree to the published version of the manuscript.