{'fraction_non_alphanumeric': 0.029637647543941034, 'fraction_numerical': 0.01773104479150559, 'mean_word_length': 4.371539313399778, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 2, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 10, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Nonlinear Control of an AC-connected DC MicroGrid

New connection constraints for the power network (Grid Codes) require more flexible and reliable systems, with robust solutions to cope with uncertainties and intermittence from renewable energy sources (renewables), such as photovoltaic arrays. A solution for interconnecting such renewables to the main grid is to use storage systems and a Direct Current (DC) MicroGrid. A"Plug and Play"approach based on the"System of Systems"philosophy using distributed control methodologies is developed in the present work. This approach allows to interconnect a number of elements to a DC MicroGrid as power sources like photovoltaic arrays, storage systems in different time scales like batteries and supercapacitors, and loads like electric vehicles and the main AC grid. The proposed scheme can easily be scalable to a much larger number of elements.


I. INTRODUCTION
Renewable energy is the key for locally producing clean and inexhaustible energy to supply the world's increasing demand for electricity. Photovoltaic (PV) conversion of solar energy is a promising way to meet the growing demand for energy, and is the best fit in several situations [1]. However, its intermittent nature remains a real disability that can create voltage (or even frequency in the case of islanded MicroGrids) instability for large scale grids. In order to answer to the new constraints of connection to the network (Grid Codes) it is possible to consider storage devices [2], [3]; the whole system will be able to inject the electric power generated by photovoltaic panels (or other renewables) to the grid in a controlled and efficient way. As a consequence, it is necessary to develop a strategy for managing energy in relation to the load and the storages' constraints. Direct Current (DC) microgrids are attracting interest thanks to their ability to easily integrate modern loads, renewable sources and energy storages [4], [5], [6], [7] since most of them (like electric vehicles, batteries and photovoltaic panels) are naturally DC: therefore, in this paper a DC microgrid composed by a source, a load, two storages working in different time scales, and their connecting devices is considered. These microgrids need to interact with the already existing infrastructure, that is an Alternate Current (AC) grid: in this work connection of the DC microgrid with a main AC grid is described, and the dedicated interconnecting power device is considered.
The utilized approach is based on a "Plug and Play" philosophy: the global control will be carried out at local level by each actuator, according to distributed control paradigm. The controller is developed in a distributed way for stabilizing each part of the whole system, while performing power management in real time to satisfy the production objectives and assuring the stability of the interconnection to the main grid.
Control techniques for converters are a well known research field [8], [9], [10]: nevertheless, it is common practice to consider the hypothesis to have full controllability of the system [11], [12] while in reality, due to technical reasons, this will probably not be true. For example, realistic DC/DC converters have an additional variable (a capacitor) on the source side [13]. When this capacitor is controlled, another one (the grid side capacitor) is left uncontrolled. As explained in [14], this remaining dynamics is usually neglected by the assumption that it is connected (and implicitly stabilized) by an always stable strong main grid. Removing this assumption to consider a realistic grid implies that this dynamics needs to be taken into account when studying grid stability. In [14] the authors provide a rigourous stability analysis for a realistic DC MicroGrid. This work regards the connection of the aforementioned DC grid to an AC one, evaluating dynamics interaction when fulfilling request of a desired amount of active and reactive power from the AC grid. Stability conditions are evaluated for the interconnected case. The adopted control strategy is shown to work both in islanded mode than in grid-connected mode: the AC grid is seen as a controllable load, while the load directly connected to the DC grid is uncontrolled (it can be constant or timevarying, both problems are relevant [15], [16]). This paper is organized as follows. In Section II the model of the AC connected DC MicroGrid is introduced. Then in Section III the adopted control laws are introduced and stability requirements are proven to be satisfied. Section IV provides simulation results, while in Section V conclusions are offered.

II. MICROGRID
The reference framework is depicted in Figure 1, where the DC microgrid connected to the main AC is represented. The targets would be to assure voltage stability in the DC grid while correctly feeding power to the load; if possible, power is also provided to the main grid regulating both active and reactive power. To each component of the microgrid (PV array, battery, supercapacitor) a DC/DC converter is connected: their dynamical models are described in the following, as well as the AC/DC converter that connects the DC grid to the AC one.
The whole control objective is split in several tasks; the first one is to extract the maximum available power from the photovoltaic array. This maximum power production is obtained calculating the duty cycle in order to fix the voltage of the capacitor directly connected to the PV array to a given reference.
The focus then moves to the storage systems and their connection to the DC network. In this paper, two kinds of storage are considered: a battery, which purpose is to provide/absorb the power when needed, and a supercapacitor, which purpose is to stabilize the DC grid voltage in case of disturbances. DC/DC bidirectional converters are necessary to enable the two modes of functioning (charge and discharge). The battery is assimilated as a reservoir which acts as a buffer between the flow requested by the network and the flow supplied by the production sources, and its voltage is controlled by the DC/DC current converter. With this structure, the DC grid is able to provide a continuous supply of good quality energy. The model introduced in [17] is here used for the supercapacitor.
Considering the availability of power, it can be provided to the main AC grid. An AC/DC converter is dedicated to manage the interconnection of the two grids; its purpose is to provide a desired amount of power to the AC grid, regulating both active and reactive power.
The converters present in this system must, in a distributed way, keep the stability of the mixed DC/AC network interconnecting all parts. The final management system can be configurable and adaptable as needed.

A. Assumptions
In this paper two main assumptions are made: the first one is the existence of a higher level controller which provide references to be accomplished by the local controllers [18]; the second one is about a proper sizing of each component of the microgrid in order to have feasible power balance. Assumption 1: A higher level controller provides references for the local controllers: these references change every fixed time interval T and concern the amount of power needed for the next time interval and the desired voltage value for the DC grid. The time interval T is decided by the high level controller according to the computational time needed for calculations. These references are about the desired voltage to impose to the PV array and to the battery to obtain the needed amount of power, V * 1 and V * 4 respectively, the desired voltage value for the DC grid, V * 9 , and the desired currents to have a proper amount of active and reactive power to provide to the AC grid, I * d and I * q . The references must be able to take into account a proper charge/discharge rate power for the supercapacitor.
Assumption 2: The sizing of the photovoltaic array is performed according to total energy needed into a whole day, and the sizing of the battery and the supercapacitor are performed according to the energy balance in a T time step, needed for selecting a new reference.

B. Grid modeling
Here the circuital representation and the mathematical models are given, based on power electronics averaging technique for the DC/DC converters [19], [20], while the model for the AC/DC converter is given by [21], [22].
The resulting DC MicroGrid system is the composition of circuits in Figure 1, generating the model introduced in the Figure 1. The considered framework: the red area describes the DC/DC boost converter connected to the PV array, while the yellow one the DC/DC bidirectional one connected to the battery. The DC/DC buck converter connecting the supercapacitor is in the blue area, while the AC/DC converter connecting the DC grid to the AC one is in the grey area. The uncontrollable load is in the green area, while the capacitor representing the DC grid in the violet one. following: where C 1 , C 2 , C 4 , C 5 , C 7 , C 9 , C 10 , R 1 , R 2 , R 01 , R 02 , R 4 , R 5 , R 04 , R 05 , R 7 , R 07 , R 08 , R 10 , R 11 , R L , L 3 , L 6 , L 8 , L 11 , are known positive values of the capacitors, resistances and the inductor. V P V > 0, V B > 0 are constant positive values of the PV array and the battery voltages, while V S is a slowing time varying positive value known at each time t representing the voltage of the supercapacitor. v ld ≥ 0 and v lq ≥ 0 are the AC relative voltages, while ω is the frequency of the AC grid. The control inputs in u are the duty cycles of the converters.
We can now refer the references to the state variables: the voltage value V * 1 to impose the maximum power tracking provides a reference x * 1 for dynamics x 1 , while V * 4 and V * 9 refer to x * 4 and x * 9 . The references I * d and I * q (relative to the desired active and reactive powers provided to the AC grid) for the currents are related to the dynamics x 11 and x 12 , x * 11 and x * 12 respectively.

III. CONTROLLERS
Considering the hypothesis in Section II-A, given the constant values of the resistance R L , voltages x * 1 and x * 4 that allow power balance in steady-state with respect to the demanded currents x * 11 and x * 12 at the desired voltage grid x * 9 , it is possible to state that: Theorem 1: Control inputs u 1 , u 2 , u 3 , u 4 , u 5 exist such that the system in (2) is asymptotically stable in closed loop around the equilibrium point x e ; Proof: The proof is based on a composition of Lyapunov functions, a methodology described in [23]. Indeed the control inputs where the α i , i = 1, 3, 4, 6, 11, 12, are integral terms assuring zero error in steady state and the positive gains K i , K i , K α i , i = 1, 3, 4, 6, 11, 12, are properly chosen, provide a Proportional Integral (PI) control action that feedback linearizes the dynamics x i , i = 1, 3, 4, 6, 11, 12, providing asymptotic stability. Then it is possible to calculate positive definite Lyapunov functions V 1,3 , V 4,6 , V 11,12 , such that their time derivative are negative definite. The Lyapunov function for the entire system is therefore selected as where V 7,8 and V 2,5,9,10 need to be described. We start from the last one, that describes the interconnection among the subsystems: According to the calculation of its time derivative, the dynamics x 7 can be used as control variable to obtain a negative semidefinite derivative; indeed, we can properly select a reference z 7 for x 7 such thaṫ V2,5,9,10 To prove asymptotic stability the set Ω is considered: it is the largest invariant set of the set E of all points where the Lyapunov function is not decreasing. Ω contains an unique point; then applying LaSalle's theorem, asymptotic stability of the equilibrium point can be established.
To impose the reference z 7 backstepping technique is used: a reference z 8 for the dynamics x 8 is selected in order to force the dynamics of x 7 to track the reference z 7 , and a proper control law u 3 is calculated for the convergence of x 8 to z 8 . The following Lyapunov function can be used to determine the control law: With the control law defined in the following the considered Lyapunov function in (24) has a negative definite time derivative: Then the Lyapunov function V in (20) has the following time derivative that ensures asymptotic stability: V =V 1,3 +V 4,6 +V 11,12 +V 7,8 +V 2,5,9,10 ≤ 0 (30) Remark 1: In accordance to the equilibria in (6), the power balance requirement is satisfied. The value of z 7 in steady-state can be written as where the values of x * 2 , x * 5 and x * 10 depends on the given equilibrium values and on the control inputs. At the equilibrium, the following condition is satisfied: Condition (32) describes the power balance when all the "bricks" fit their target to provide/take the right amount of power; implicitly, it can be stated that x * 7 = x * 9 . Theorem 1 refers to an unconstrained problem: due to the physics of the devices and of the meaning of the controllers, all the control inputs are bounded. The bounds we must consider are: u 1 ∈ [0, 1], u 2 ∈ [0, 1], u 3 ∈ [0, 1], u 2 4 + u 2 5 ≤ 1 (see [8], [9]).
The domain of operation for the state variables is restricted (e.g. ≤ V S ). However in [14] we proved that the set of initial states such that the above defined input constraints are satisfied, for any evolution of the controlled system, contains the equilibrium in its interior.

IV. SIMULATIONS
In this section we present some simulations that show the results obtained using the proposed control inputs. Matlab has been used for obtaining such simulations. The values of the parameters are depicted in Tables I.
The simulation target is to correctly feed a load while maintaining the grid stability, which means to ensure no large variation in the DC grid voltage. The load is composed by an uncontrollable part, which is a resistance, and a controllable one, which is the AC grid. The simulation time is twenty seconds. The fixed value x * 9 for the DC grid voltage is selected

Parameter Value
Parameter Value C 1 100 mF L 3 33 mH C 2 10 mF R 01 10 mΩ R 1 100 mΩ R 02 10 mΩ R 2 100 mΩ C 4 100 mF C 5 10 mF R 04 10 mΩ R 4 100 mΩ R 05 10 mΩ R 5 10 mΩ L 6 33 mH C 7 10 mF L 8 3.3 mH R 07 10 mΩ R 08 10 mΩ R 7 100 mΩ C 9 0.1 mF R 10 100 mΩ L 11 3.3 mH R 11 10 mΩ . as x * 9 = 1000 V . The secondary controller provides the references to be reached each time interval (1 second); during that period the introduced control laws bring the devices to operate in the desired points. Figure 2 depicts the uncontrollable load; it is possible to see its piecewise constant behavior until the simulation time of twelve seconds, when it starts to be timevarying. Figure 3 describes the currents related to the power demanded by the AC grid; the current related to reactive power is always kept to zero reference, while the active one is demanded in a time window of eleven seconds after three seconds. The choice to send zero reactive power is due to the fact that the remuneration of power production is solely based on active power; selection of providing both of them is feasible if needed, and is the case when fully controlling frequency and voltage of the AC MicroGrid.
The considered simulation framework contains different situations: as we have already seen, the load has step variations and a time varying part. Furthermore, disturbances acting on the PV voltage are considered (see Figure 4). Moreover, the case where the references do not fulfill the energy balance without the power provided by the supercapacitor is considered: there the supercapacitor will need to provide power during all the time window, and its reservoir will change over the time, as depicted in Figure 5. Here we considered the voltage of the battery not to be affected by the current behavior; indeed a constant value is used to represent it because the battery is supposed to be sized in such a way that it is not affected by current dynamics over a time of twenty seconds. The resulting current generated by the supercapacitor is then introduced in Figure 7; it is mainly due to the necessity of the supercapacitor to ensure DC grid voltage stability around the equilibrium value of x * 9 when there is a mismatch due to the transient or disturbances, but in the second half of the simulation it is also providing the power needed to compensate power mismatch due to wrong reference choice by the higher level controller. Indeed, in accordance to the values of the load, the references x * 1 and x * 4 are obtained for the power balance target; if they are not sized for the power demand, the supercapacitor has also the described role.
As depicted in Figure 6, the C 1 and C 4 capacitor voltages reach the desired values during the considered time step. Two different situations for the controllers are faced because the devices need two different treatments; we need from the PV array to start providing the highest level of power as soon as possible, while the battery needs to have a smooth behavior to preserve its life-time. The resulting voltage dynamics on the grid connected capacitors C 2 , C 5 , C 10 , are modified by the current flow generated by the sources; all the dynamics are stable, as shown in Figure 8. Their evolution is influenced by the value of the DC grid voltage, which is the capacitor C 9 : its value over time is depicted in Figure 9. To satisfy stability constraints, in response to the load variations and to the missing power coming from the PV and the battery, the voltage of the capacitor C 7 reacts balancing the energy variation. It is possible to verify that the worst spikes correspond to a very high variations in the grid dynamics, but nevertheless they are less than 10% of the values.  Figure 11. The control input u 3 . Figure 10 describes the current coming from the PV and the one related to the charge/discharge mode of the battery: these dynamics are dependent on the voltages and related to them. The control input for the DC/DC converter connected to the supercapacitor is depicted in Figure 11: its variation depends on the variations of voltage V S (see Figure 5) and of the load (see Figures 3 and 7).
Finally, we can state that the desired target to maintain DC grid voltage stability while providing a certain amount of power to a load composed by a controllable part and an uncontrollable one is ensured with the proposed control laws. The simulation describe result validity in a range of situations.
V. CONCLUSIONS In this paper the connection of a DC microgrid with the main AC grid is addressed. A DC grid composed by a renewable source and two kinds of storages, acting as energy and power reservoirs, is considered to solve the problem of correctly feeding a load; such load is composed by an uncontrollable part and a controllable one, which is the power provided to the AC grid. The modeling of the resulting grid composed by the dedicated connected devices is presented and control laws are obtained to properly satisfy requirements of voltage stability and power balance. Formal conditions are introduced to describe the problem and rigorous analysis are carried out to obtain stability results. Simulations show that the proposed control action successfully fits the desired target to feed the load while keeping the voltage of the DC grid at a desired value.