Distributed Energy Resources to Improve the Power Quality and to Reduce Energy Costs of a Hybrid AC/DC Microgrid

This chapter deals with microgrids ( μ Gs), i.e., a group of interconnected loads and dis- tributed energy resources that act as a single controllable entity with respect to the grid. The μ Gs can be classified into AC and DC μ Gs depending on the characteristics of the supply voltage, with both solutions characterized by advantages and challenges. Recently, hybrid AC/DC μ Gs have been developed with the aim to exploit the advan- tages of both AC and DC solutions. Hybrid μ Gs require being properly controlled to guarantee their optimal behavior, in both grid-connected and islanding mode. In this chapter, we propose an optimal control strategy for a hybrid μ G to be realized in an actual Italian industrial facility. The control strategy operates with the aim to simulta- neously minimize the energy costs and to compensate waveform distortions. The key result of the chapter consists in evidencing the technical and economic advantages of the proposed solution by means of real-time simulations of the hybrid μ G performed through Matlab/Simulink development tool in the different conditions (grid-connected and islanding mode).


Introduction
Nowadays distributed generators, storage systems, and controllable loads much more actively and simultaneously contribute to an optimal operation of the electrical distribution systems in the frame of the new concepts of smart grids (SGs) and microgrids (μGs).
In this exciting context, new technologies and services are being introduced to make the electrical networks more reliable, efficient, secure, and environmentally friendly. This chapter deals with μGs that CIGRÉ C6. 22 Working Group defines as electricity distribution systems containing loads and distributed energy resources that can be operated in a controlled, coordinated way either while they are connected to the main power network (grid-connected mode), or when operate in islanding mode [1].
As well known, μGs can be AC and DC μGs on the basis of the nature of the supplied voltage [2][3][4]. AC μGs have the advantage of utilizing existing AC technologies as well as DC μGs seem particularly suitable for supporting the current needs because most distributed generation sources, such as photovoltaic plants, fuel cells, and storage systems, generate DC power directly. Moreover, DC grids can also guarantee high power quality levels to AC sensible loads, even though this provision requires the presence of additional DC/AC converters.
Recently, hybrid AC/DC μGs have been developed with the aim to exploit the advantages of both AC and DC solutions and, in particular, to accelerate the integration process of DC power technologies into the existing consolidated AC systems [5][6][7][8][9][10].
As well known, several static converters are installed in the hybrid μGs, either to connect renewable generation and storage systems to the AC or DC grids, or as an interface between AC and DC grids. In this context, optimization strategies are required to perform the converters optimal control with the aim of efficiently operating the whole hybrid μG. These control strategies should take into account all goals and operating constraints of both DC and AC sections.
Motivated by the above requirements, in the following sections of this chapter, we propose an optimal control strategy for a hybrid μG to be realized in an actual Italian industrial facility. In particular, the static converters of the hybrid μG are controlled with the aim to simultaneously minimize the energy costs and to compensate waveform distortions, thus ensuring an optimal technical and economical behavior of the whole μG.
The remainder of the chapter is organized as follows. The electrical system of the actual Italian industrial facility is briefly recalled in Section 2, where also the structure of the proposed hybrid microgrid is shown. Section 3 deals with the proposed control strategy. Numerical applications are shown in Section 4, Section 5 provides our conclusions, and some data of the test system under study are explained in Appendix.

The electrical industrial system under study
The electrical industrial system under study was a hybrid AC/DC microgrid obtained by the modification of the existing LV distribution system of an actual Italian industrial facility where transformers are assembled. The simplified electrical scheme before the modification is reported in Figure 1. The existing facility's electrical distribution system is connected to the MV grid through a 20/0.4-630 kVA transformer and includes four low-voltage feeders; each feeder is dedicated to a different manufacturing process, i.e.: (i) tanks and boxes manufactory, (ii) assembly, (iii) winding and coils and (iv) test. An automatically switched 120 kVAr capacitor bank with 10 kVAr step is installed at bus 3 to guarantee a power factor at PCC (bus 2) equal to 0.95.
The data of the lines, transformers and loads are reported in Appendix.
The modifications on the existing electrical system of Figure 1 and the applied control strategy implemented in the centralized control system (CCS) are finalized (i) to improve the continuity and quality of the energy delivered to the loads and (ii) to optimize the exchange of energy between industrial plant and MV distribution grid.
The following modifications are effected ( Figure 2): (i) a DC micro grid (DCμG) is connected at AC bus 16 through an AC/DC grids interfacing converter; (ii) a Battery Energy Storage System (BESS) is installed at AC bus 3 through a DC/AC static converter; and (iii) a dispatchable micro-turbine is connected at AC bus 20 through an AC/AC static converter. 1 The DC micro grid (DCμG) consists of a photovoltaic (PV) plant equipped with a maximum power point tracker control system and connected to the DC grid through a DC/DC static converter and three sensitive AC loads (Folding walls island robot, Sandblasting machine and PLCs used to control the automation of the whole electromechanical process 2 ) moved from the original electrical scheme of Figure 1.
The sensitive loads are controllable in terms of start-up times; in particular, their working time intervals are obtained by a day-ahead scheduling aimed at achieving the minimization of the costs for the electricity purchase of the hybrid AC/DC μG [12]. 3 Figure 1. Electrical simplified scheme of the existing electrical distribution system of the industrial plant under study. 1 In the following we will use the term micro-turbine, BESS and PV generators to indicate the system constituted by the micro-turbine, BESS and PV panels together with their interfacing static converters. 2 These loads were chosen in accordance with the technical operators of the industrial facility on the basis of a deep study on the industrial process [11] 3 An Uninterruptible Power Supply (UPS) system is dedicated for PLC power backup to provide a soft shut-down of the load control devices in case AC μG out of service.
The above modifications lead to a hybrid μG, which includes AC buses (ACμG) and DC buses (DCμG).
The data of the newly added components are reported in Appendix.

The proposed control strategy
The proposed control strategy is based on the solution of optimization problems performed at fundamental and at harmonic frequencies, where the efficient operation of the DC and AC grids is guaranteed by a proper control of the static converters installed in the hybrid μG, either to connect micro-turbine and storage system to the AC grid, or as interface between AC and DC grids.
The control strategy allows the hybrid AC/DC μG to operate both in grid-connected and in islanding mode as described in details in the following subsections.

Grid-connected mode
When the hybrid μG is in grid-connected mode, the converters are controlled with the aim to simultaneously minimize: (i) the energy costs sustained for the electrical energy imported from the main distribution network and the production cost of the micro-turbine and (ii) the waveform distortions of the AC bus voltages.
The converter sizes have to be appropriately chosen to correctly perform both the required services.
Two different optimization models are formulated and solved by CCS to provide the reference signals for the energy cost minimization (reference signals at fundamental frequency) and for the waveform distortion compensation (reference signals at harmonic frequencies), as shown in Figure 3.

Energy cost minimization
At the fundamental frequency, the real-time operation of the hybrid AC/DC µG is optimized by controlling the active and reactive power of the BESS, the active and reactive power of the micro-turbine and the reactive power provided by the AC/DC grids interfacing converter. The reference signals for the converters, which minimize the total energy cost, are obtained solving a non-linear constrained optimization problem, such as: where f obj is the objective function and β h and γ k are the hth equality and the kth inequality constraints to be met, respectively. The vector x includes the state and control variables.
Dividing the day into N t time slots of the same duration Δt, the optimization problem in Eqs.
(1)-(3) is repeatedly solved at each ith time slot and its solution furnishes the reference signals needed at the successive time slot (i + 1)th for the controllers of micro-turbine, BESS and AC/DC grids interfacing converters.
Input and output data, the objective function and the constraints structure are listed in the following. 4 The input and output data of the optimization problem are: Input data: • the state of charge of the BESS at the end of the ith time slot and at the end of the day (i.e., at the end of time slot N t ). In particular, the value at the end of the ith time slot is obtained as result of the optimization problem in Eqs. (1)-(3) solved at the previous (i-1)th time slot; the value at the end of the day is fixed on the basis of the desired value at the beginning of the successive day; • the forecasted powers of the PV system and of the non-controllable loads, all provided by proper forecasting tools for all the time slots from (i + 1)th to N t [13][14][15]; • the power required by the controllable loads 5 ; • the energy charge; 4 It should be noted that a fixed value is assigned to the energy stored in the battery at the last time slot of the day (Nt), thus influencing the battery power profile over the whole day; then, the optimization problem becomes multi-period with the consequence that, at the i th time slot, objective function and constraints must be formulated along all the rest of the day (i.e., time slots included in {i+1,…, N t }). 5 The real time control procedure follows a day ahead scheduling procedure (performed off-line), as the one proposed in [12], finalized to schedule the powers of DCµG controllable loads.
• the charge and discharge periods of the BESS in ACµG which are fixed a-priori in function of the energy hourly tariff (typically, the discharge period is during the hours of peak energy tariff).
Output data: • the active and reactive power of the BESS and the corresponding State of Charge (SOC); • the active and reactive powers of the microturbines; • the reactive power of the interfacing power converter.
All the output data are calculated from the (i + 1)th time slot to the end of the day, but, obviously, only the values of the (i + 1)th time slot are sent to the controllers of the ACµG BESS, micro-turbine and AC/DC grids interfacing converter.
The objective function in Eq. (1) to be minimized is the daily total costs sustained by the industrial facility for the electrical energy. This cost is the sum of the cost for the energy imported from the MV electrical distribution grid and of the production cost of the microturbine. The objective function f obj (x) results in: In Eq. (4), P grid k is the active power furnished by the distribution grid at the kth time interval, Pr E,k and C mTG k are the energy charge and the production cost of the micro-turbine generator at the kth time interval, expressed as [16]: In Eq. (5), a mTG , b mTG and c mTG are the cost coefficients of the micro-turbine, P mTG 20, k is the power injected by the micro-turbine connected at busbar 20, u(k) is equal to 1 (if the micro-turbine is switched ON) or 0 (if the micro-turbine is switched OFF). The start-up cost is not considered in Eq. (5) [17].
The equality and inequality constraints related to the DCµG, the ACµG, and the AC/DC grids interfacing converter are illustrated in Tables 1-3, respectively.
With reference to the DCµG constituted by M DC buses ( Table 1), the equality constraints are the DC load flow Eq. (6), while the inequality constraints refer to limits on bus voltage magnitudes Eq. (7) and line currents Eq. (8).
In Eq. (6), P DC s, k is the active power injected in the sth DC bus at the kth time slot, V DC s, k is the sth bus voltage magnitude in the kth time slot, G sd is the s-d element of the conductance matrix. 6 6 The terms of the conductance matrix don't depend on the time interval, since no time variation of the DCµG topology is assumed.
In particular, P DC s, k with s = 2,…, M DC is the scheduled active power of the controllable loads at load busbars and the active power injected by PV generator. In particular, at busbars 2, 3 and 4 only loads are connected and their active powers are the ones reported in Table A. VI of Appendix (with minus sign) corresponding to the busbars 17, 9 and 22 of the actual industrial system shown in Figure 1; at bus 5, only PV generator is connected and the active power is equal to the value obtained by forecasted PV solar irradiance; at bus 1, the voltage V DC 1, k ¼ V DC sp , for each kth time slot, since AC/DC interfacing converter controls the DC voltage at the constant value V DC sp .
In Eq. (7), V DC sLB and V DC s UB are the lower and upper bounds of voltage amplitude of the sth DC bus. In Eq. (8), I DC l, k is the value of current flowing in the lth line during the kth time slot, L DC is the number of the DC grid lines and I DC l, max is the ampacity of the lth line.
With reference to the ACµG constituted by M AC buses ( Table 2), the equality constraints are the AC load flow in Eq. (9) and the balance equation of the energy stored in the BESS at the end of the day (Eq. (16)), while the inequality constraints refer to limits on bus voltage magnitudes (Eq. (10)), line currents (Eq. (11)), active and reactive power at PCC (Eq. (12)), MV/LV transformers apparent power (Eq. (13)), micro-turbine active and apparent power (Eqs. (14) and (15)), energy stored, charging/discharging powers and apparent power of BESS in the generic time slot (Eqs. (17)- (19)).
In Eq. (9), P AC s, k ðQ AC s, k Þ is the active (reactive) power injected in busbar s at the kth time slot; V s,k ϑ s,k are the magnitude and argument of the voltage of sth AC bus at the kth time slot, respectively, G s,j (B s,j ) is the s-j term of the conductance (susceptance) matrix. 7 The first busbar of the grid in Load flow equations Voltage magnitudes Line currents Table 1. DCµG's constraints. 7 The terms of the conductance and susceptance matrix don't depend on the time interval, since no time variation of the AC microgrid topology is assumed.

AC grid
Load flow equations Voltage magnitudes Line currents Micro-turbine Active and apparent power P mTG min uðkÞ ≤ P mTG 20, k ≤ P mTG max uðkÞ, BESS Energy stored at the end of the day Distributed Energy Resources to Improve the Power Quality and to Reduce Energy Costs of a Hybrid AC/DC… http://dx.doi.org/10.5772/intechopen.68766 Figure 1 is the slack busbar. Then, V AC 1, k ¼ V AC sp and ϑ 1,k = 0, for each kth time slot, where V AC sp is the fixed slack voltage magnitude. In particular, with reference to each kth time slot: • at the load bus bars, P AC s, k and Q AC s, k are the forecasted active and reactive powers of the non-controllable loads, whose rated powers are reported in Table A. VI; • at bus 3, P AC 3, k is the sum of the active power of the BESS ðP BESS 3, k Þ and the forecasted active power of the non-controllable load connected at bus 3 while Q AC 3, k is the sum of the reactive power of the BESS ðQ BESS 3, k Þ, the forecasted reactive power of the non-controllable load connected at bus 3 and the reactive power injected by capacitor bank; • at bus 20, P AC 20, k and Q AC 20, k are, respectively, the active ðP mTG 20, k Þ and reactive ðQ mTG 20, k Þ powers of the micro-turbine; • at bus 16, P AC 16, k and Q AC 16, k are the active and reactive power injected by the AC/DC grids interfacing converter; • at buses, where no generation or loads are connected, the P AC s, k and Q AC s, k values are zero.
In Eq. (10) Charging and discharging power in the generic time slot Apparent power at the PCC busbar during the kth time interval has to be positive since reactive power cannot be injected into distribution network. The power flows P AC 2À3, k and Q AC 2À3, k can be expressed in a simple way using state variables.
In Eq. (13), P tr , k and Q tr,k are the values of active and reactive power flowing through the transformer at the kth time interval which can be expressed in function of state variables; S TR is the size of transformer (630 kVA).
In Eq. (14), the active power produced by micro-turbine ðP mTG 20, k Þ is within a normal operating interval [P mTG min , P mTG max ].
In Eq. (15), Q mTG 20, k is the reactive power injected by converter of the micro-turbine and S mTG nom is its nominal apparent power.
In Eq. (16), E i is the energy stored in the BESS at the ith time interval, P BESS 3, k is the BESS power at the kth time slot, E in sp is the desired energy stored in the BESS at the end of the day that is equal to the desired energy at the beginning of the successive day, η bess is the battery efficiency in charging/discharging mode.
In Eq. (17), the upper value E ub sp is the battery size while the lower value E lb sp must be specified on the basis of the maximum allowable depth of discharge, thus preserving an adequate value of the battery lifetime [18]. E k-1 is BESS energy stored at the end of (k-1)th time slot.
In Eq. (18), P ch max and P dch max are the maximum power rates in charging and discharging modes; Ω dch,k and Ω ch,k are the set of time slots from (i + 1)th to N t th in which the BESS is allowed to discharge and charge, respectively.
is the reactive power injected by converter of the BESS and S BESS nom is its nominal apparent power.
With reference to AC/DC grids interfacing converter (Table 3), the equality constraints are the DC and AC voltage balance equation (Eq. (20)) and the DC and AC active power balance equation (Eq. (21)), while an inequality constraint (Eq. (22)) refers to a limit on apparent power flowing through the AC/DC grids interfacing converter.
In Eq. (20), m a,k is the amplitude modulation ratio of the PWM interfacing converter, V AC 16, k is the RMS voltage of the bus at AC side of converter and V DC 1, k is the voltage amplitude of the bus at DC side of converter (the first node of the DCµG) at the kth time slot. As before mentioned, V DC 1, k , for each kth time slot, is equal to V DC sp .
In Eq. (21), η rect (η inv ) is the converter efficiency in rectifier (inverter) operation of the power converter.
In Eq. (22), the active (P AC 16, k Þ and reactive (Q AC 16, k ) powers injected by the converter from DCµG to AC µG are limited by its size (S conv nom ) at the kth time slot.

Waveform distortion compensation
At harmonic frequencies, the centralized control system furnishes reference current signals that ACµG power converters have to be injected in order to compensate waveform distortions at AC busbars. These reference currents are obtained as the solution of an optimization problem in the frequency domain, based on the optimal control theory [19][20][21]. The optimization problem consists of minimizing the voltage harmonics at AC busbars without significantly oversizing of the converters employed for the compensation.
The Fourier transform U of the converters reference currents to be injected is obtained by minimizing the following system index: In Eq. (23), Y is the Fourier transform of the complex output vector y, which includes the harmonic voltages at all network buses and at all considered harmonic frequencies; Q and R are weight matrices and the symbol * indicates the complex conjugate.
The analytical Fourier transform of the vector of the injected currents U corresponding to the minimization of index of Eq. (23) is given by [20]: where Interfacing converter DC and AC voltage DC and AC active power Apparent power D is the vector of the disturbances (harmonic currents injected at buses where non-linear loads are present at all considered harmonic frequencies) and Φ ¼ ðjωI À AÞ À1 being I the identity matrix and Q factorized in Q = L*L.
The matrices A, B, C, and F are the system state equation matrices obtained from the following linear state space model, derived from the application of the Kirchoff's laws in the time domain to the ACµG [21]: where x is the state vector (inductor currents and capacitor voltages), d is the vector of the disturbances, u is the vector of the compensating currents injected by the converters for voltage harmonic compensation, and y is the output vector. A, B, C, and F depend on the parameters of the distribution network (matrices A and C) and on the busbars where the disturbing loads and the converters participating to system harmonic compensation are connected (matrices F and B).
It should be noted that the values of the element of vector D elements are estimated thanks to a disturbance-estimation algorithm based on a Kalman Filter [22,23].
It should be also noted that the values of the weight matrix Q elements depend on targets assigned to the waveform distortion compensation levels at the nodes, with the rule that the values of the weights are assigned greater in the busbars where particularly sensitive loads are connected (area compensation). The values of the weights of matrix R elements are assigned on the basis of targets on the rate of converter sizes used for the harmonic compensation: greater values of the R elements correspond to the smaller rate of the converter and vice versa [19]. With reference to the considered industrial study system, the converters installed at buses 3, 16 and 20 participate, using a part of their size, to harmonic compensation.

Islanding mode
In addition, the control strategy applied by CCS is able to disconnect the hybrid μG from the distribution network when abnormal conditions occur. We will consider the behavior of the AC/DC µG in the case of supply interruptions. In such conditions, local energy resources and loads are optimally controlled in order to guarantee high power quality levels to priority loads. As priority loads, we refer to electrical loads requiring high levels of continuity of supply.
In particular, in islanding mode, the so-called "Single Mater Operation" control strategy is adopted [24]. In fact, while in grid-connected mode all inverters installed into the hybrid μG operate in PQ mode (inverter is used to supply a given active P and reactive Q power set point), in islanding mode the BESS interface converter operates feeding the μG with predefined values of voltage and frequency (V-f control mode), as well as the remaining inverters, on the contrary, continue to operate in PQ mode.
As soon as the hybrid μG is in the islanding mode, all loads are disconnected except the priority loads whose power demand can be provided by the BESS and micro-turbine (the PV system is not considered in the power balance because its availability depends on the uncertain presence of the primary source). As an example, in the considered case study, the priority loads are assumed to be the sensitive loads connected to the DCµG. In this case, the maximum power required by the priority loads is 72 kW (corresponding to the power absorbed when all sensitive loads are working). Also in the worst conditions (long interruption arising when BESS charge is E lb sp = 102 kWh), the energy that should be generated by BESS and micro-turbine in 1 hour 8 (equal to 72 kWh) is significantly lower than the energy they can provide (equal to 132 kWh) . 9 Eventually, in islanding mode, the proposed control strategy starts to supply the priority loads. Anyway, according to a predefined list of load priorities, some of the disconnected loads can be reconnected taking into account of: (i) the available power from PV generator; (ii) the scheduled power required by sensitive loads; (iii) the maximum time fixed for the autonomous operation of the hybrid µG; and (iv) the value of the SOC of battery. The available energy for the islanding operation can be easily calculated from the knowledge of the SOC of battery, the forecasted PV power generation in the time intervals successive to the disconnection and the rated power of micro-turbine.

Numerical applications
A simulation of the hybrid micro grid of Section 2 using Matlab® Simulink® toolbox was implemented in order to show the feasibility of the proposed control strategy both in gridconnected and in islanding mode. Several case studies were performed, and, for sake of conciseness, the results relative to a typical working day are shown. In particular, in the following subsections, results are presented for the two considered operation modes, separately.
Remind that, in the grid-connected mode, the converters participating in the energy cost minimization problem are: (i) the BESS converter at bus 3; (ii) the AC/DC grids interfacing converter at bus 16; and (iii) the micro-turbine converter at bus 20. In particular, the AC/DC grids interfacing converter (micro-turbine) participates optimally exchanging only reactive (active) power with the ACµG. 8 The maximum time interval in islanding mode operation of hybrid µG was fixed to 60 minutes considering the mean value of the time duration of long interruptions in the area where the industrial facility is located. 9 We assume that in the worst conditions the PV production is not available and the SOC of battery is initially equal to its minimum value (20%). In these conditions, in order to supply the sensitive loads (72kWh), the micro-turbine provides 30kWh and the BESS has to furnish only 42 of the 102kWh available. This, however, determines a further discharge of the BESS and a final SOC equal to 11.76%, causing a reduction of the expected battery life. However, since 60 minutes long interruptions occur in distribution networks only few times during the battery life and taking into account that the worst conditions are infrequent, the actual life reduction of the BESS can be considered largely tolerable.
The converters participating in the harmonic compensation are: (i) the AC/DC grids interfacing converter at bus 16 and (ii) the micro-turbine converter at bus 20. Note also that sizes of the converters, shown in Table A. VIII, are chosen according to the aforesaid operating conditions. Specifically, while the 120 kVA of the BESS converter is fully utilized for the energy cost minimization, only 80 kVA of the AC/DC grids interfacing converter and 30 kVA of the microturbine converter are addressed for the same operation. The remaining 20 kVA of the AC/DC grids interfacing converter and 10 kVA of the micro-turbine converter are used for the harmonic compensation.

Grid-connected mode
The considered day was divided into 72-time slot of equal duration (20 min), and the inputs of the proposed control strategy for the energy cost minimization are: • The forecasted powers of the PV system and of the non-controllable loads, both obtained before each time slot for all the successive time slots of the considered day. As an example, • The scheduled power profile of the controllable loads, as illustrated in Figure 5; • The energy charge reported in Figure 6 [25]. This tariff is applicable to medium and small industrial customers and for service in the common areas of multi-family complexes. It was selected since it is characterized by a large spread between on peak and off peak prices; this is a necessary condition to make it possible a fruitful use of storage systems nowadays; • The SOC of the BESS at bus 3 equal to 43.36% at the beginning of the day. The same value is required also at the end of the considered day according to scheduling procedure.    The time behavior of the main quantities of interest is illustrated in the following relatively to the considered working day. Figure 7 shows the active (solid line) and reactive (dotted line) power profiles of the BESS converter. In Figure 8, the active (solid line) and reactive (dotted line) power profiles of the AC/DC grids interfacing converter are plotted. Figure 9 shows the reactive power supplied by the controllable capacitor bank. Eventually, in Figure 10, the active (solid line) and reactive (dotted line) power profiles at the PCC are reported. The active power of the micro-turbine is not reported since it always operates at a constant value of 30 kW.
From the analysis of Figures 7-10, the following considerations can arise: • the µG operates practically at unitary power factor all over the day ( Figure 10); the measured power factor of the industrial system (without the hybrid µG), instead, was 0.85 on average. Indeed, the forecasting error on PV power generation and on non-controllable load powers causes an operation of network slightly different to unity power factor and, as a consequence, the reactive power absorbed by the hybrid µG at the PCC is not exactly zero; • the reactive power furnished by BESS and capacitor bank is maximized in the hours corresponding to load peak power (Figures 7 and 9); • the active power provided by the BESS during the discharge from 12:00 to 14:00 is limited by the converter size (in this interval also reactive power is furnished by the converter); • the BESS discharge reduction at 16:20 and the residual BESS discharge at 17:20 are justified by the numerical deviation between the BESS set point and the corresponding simulation response (Figure 7). Distributed Energy Resources to Improve the Power Quality and to Reduce Energy Costs of a Hybrid AC/DC… http://dx.doi.org/10.5772/intechopen.68766  Anyway, the BESS totally discharges (i.e. the SOC reaches 20%) in the interval where the tariff is higher, maximizing in this way the economic benefit.
Note also that the reactive power production inside the µG allows not only the reduction of the power losses but also the maximization of the internal active power generation, determining the minimization of the objective function. In fact, an increasing of the mere internal active power production determines a corresponding decreasing of power factor at the PCC; therefore, a production of reactive power inside the hybrid grid is needed to guarantee an adequate power factor at the PCC.
In Figure 11, a comparison among the energy charge profile (dotted line) and the active power (solid line) of BESS converter (Figure 11a) and the active power of AC/DC grids interfacing converter (Figure 11b) is reported. Figure 12 shows a comparison among the energy charge profile (dotted line), the active power profile at the PCC of the hybrid µG (solid line) and of the actual industrial facility (dashed line).
The analysis of these last figures clearly evidences that: • to maximize the economic benefits, the maximum allowable discharge for the BESS arises in the hours of the maximum value of tariff; • the active power flowing from DC to AC µG is maximized in the hours of the maximum value of tariff, according to the day-ahead scheduling procedure that shifted the controllable loads far from the maximum tariff price and the PV generation available during those hours; Distributed Energy Resources to Improve the Power Quality and to Reduce Energy Costs of a Hybrid AC/DC… http://dx.doi.org/10.5772/intechopen.68766 • the active power at the PCC of hybrid µG increases respect to the value of the existing industrial facility when the tariff price is minimum, due to: (i) the BESS charge profile and  (ii) the shifting of the controllable loads; on the other hand, the active power at the PCC of hybrid µG decreases when the tariff price assumes higher values, due to: (i) the shifting of the controllable loads; (ii) the PV system production; and (iii) the BESS discharge profile.
The aforesaid observations justify the reduction, shown in Figure 13, of the hourly costs to be sustained by the hybrid µG (solid line) respect to the ones sustained by the existing industrial facility (dotted line). In particular: • from 00:00 to 04:00 and from 22:00 to 23:00, the hybrid µG has costs slightly greater than the existing industrial system, cause of the BESS charge; • from 06:00 to 07:00 and from 21:00 to 22:00, the hybrid µG has costs slightly greater than the existing industrial system, cause of the shifting of controllable loads; • from 10:00 to 18:00, the hybrid µG has cost significantly lower than the existing industrial system, cause of both the PV system production and BESS discharge; • from 18:00 to 21:00, the hybrid µG has costs lower than the existing industrial system, mainly cause of the micro-turbine operation, whose production costs are lower than the considered energy tariff, and also due to the PV system production.
Globally, the proposed procedure allows a daily reduction of the total costs for the energy purchase of about 26%. Figure 13. Hourly costs to be sustained by the industrial system with hybrid µG (solid line) and by the actual industrial system (dotted line).
With reference to the waveform distortion compensation, an analysis of the load currents in the existing industrial system revealed that main contributions to voltage distortions were due to the harmonic of order h = 5, 7, 11 and 13. So, the procedure described in Section 3.1.2 was applied only for the compensation of the aforesaid harmonic orders. The compensation action is applied in a working day using the AC/DC grids interfacing converter and the micro-turbine converter.
As illustrated in Section 3, the inputs needed to solve the minimization problem and to obtain the reference currents of converters (see Eq. (23)) are the estimated harmonic disturbances D and the Q and R matrices.
The loads producing waveform distortion are marked with an asterisk in Table A. VI. As an example, Figures 14 and 15 report the harmonic currents amplitudes injected by disturbing loads at the buses 23 and 33 during the time slot from 16:20 to 16:40.
The terms of the weight matrix R are obtained from the knowledge of the size of the converters dedicated to harmonic compensation, and giving priority to the compensation of the harmonic with the lowest orders. As an example, the value of R term related to the compensation of the 5th harmonic order is 0.59, while the value of R term related to the compensation of the 13th harmonic order is 0.23. The terms of weight matrix Q are set giving priority to the harmonic compensation for the feeder "tanks and boxes manufactory"; thus the elements of Q corresponding to nodes of this feeder are 50 times greater than those of the other feeders.

Islanding mode
To simulate islanding mode of operation of the hybrid μG, an interruption in the MV distribution network supplying the industrial facility was simulated. The interruption determines the switching from grid-connected mode to islanding mode. The control strategy described in Section 3.2 is applied; the BESS converter switches from P-Q control mode to V-f control mode Distributed Energy Resources to Improve the Power Quality and to Reduce Energy Costs of a Hybrid AC/DC… http://dx.doi.org/10.5772/intechopen.68766  since the RMS voltage at PCC becomes lower than 5% of nominal voltage [26], that is the threshold for the switching of the BESS converter control strategy. The remaining inverters, on the contrary, continue to operate in P-Q mode. The interruption arises at 6 h 25 0 1 00 of the working day analyzed in Section 4.1. As soon as the islanding condition arises, all loads of the hybrid μG are disconnected except the sensitive loads present in the DC μG. As illustrated in Figure 5, at 6 h 25 0 all sensitive loads are working and absorbing 72 kW, micro-turbine and photovoltaic generators produce 30 and 31 kW, respectively. BESS is characterized by a SOC of about 100%.
In Figure 19, the voltage profile at bus 3 versus time is reported. In Figure 20, the active power injected by BESS and AC/DC grids interfacing converters are shown. Figures 19 show how the proposed approach allows to supply the hybrid μG during the interruption with obvious advantages in terms of continuity of the supplied energy. Figure 20a shows the increasing of BESS active power from the value at 6 h 25 0 in grid-connected mode (see also Figures 7 and 11) to the value needed to supply the hybrid μG in islanded mode. In particular, this value, in the considered application, is related to the grid active power losses and active power required by the sensitive loads connected to DCμG reduced by the active power furnished by micro-turbine and PV system. As expected, the active power flowing in the AC/DC grids interfacing converter remains constant to the value of grid-connected mode (see also Figures 8 and 11).
In Figure 20b, reactive power variations from the values at 6 h 25 0 in grid-connected mode (see also Figures 7 and 8) to the values needed to provide the reactive power required by the hybrid μG in islanding mode is shown. In particular, since only the sensitive loads connected to DC μG are working, only reactive power losses are required and provided by BESS converter.
Note that the active and reactive power transients shown in Figure 20 are due to the switching of the BESS converter regulator from P-Q control mode to voltage control mode. Moreover, although the other converters in the hybrid µG continue to be controlled in P-Q mode, also their responses are influenced by the transient at bus 3.  Accordingly to the aim of the proposed procedure, all the distributed resources in the hybrid μG guarantee the continuity of supplying of sensitive loads.

Conclusions
A hybrid µG including two interconnected sections operating in DC and AC was considered starting from an existing Italian industrial facility. The DC section included non-dispatchable generation systems and controllable loads; the AC section included a BESS, a micro-turbine, non-controllable loads and non-linear loads.
A control strategy based on a real-time control, at both the fundamental frequency and harmonic frequencies, was applied. The control strategy required the solution of optimization problems and was aimed at minimizing the operation costs and improving the power quality levels.
The results of a numerical application relative to a typical working day are shown and demonstrated the effectiveness of the procedure in reducing the daily operating costs while guaranteeing higher values of the quality of the power supply.