Fuzzy-supervisory control of a hybrid system to improve contractual grid support with fuzzy proportional–derivative and integral control for power quality improvement

: This paper investigates on an additional active power compensation of a microgrid to a weak grid using fuzzy- supervisory control. This reduces the economic penalty of microgrid for going over-contract with the grid in terms of power demand. The objectives of this work are (a) to maximise grid support during periods of over-contract, (b) to minimise distortions and increase dynamic stability of dc link voltage and (c) to improve the total harmonic distortion (THD) of the dispatched power. The microgrid comprises of a wind energy conversion system (WECS) and Li-ion battery energy storage system (BESS). During variations in wind speed, power feed into the point of common coupling (PCC) depends upon deviations in the wind power, dc link voltage, violations in grid contract power and the state of charge (SOC) of the battery. The deviations in these inputs are utilised by the supervisory controller to compute additional power support to the grid, by discharging the battery. Performances of the fuzzy-supervisory controller are compared with a classical-supervisory controller with similar power dispatch parameters. Further, inverter currents are regulated using a fuzzy proportional-derivative and integral (FPD + I) controller to reduce distortions and improve dynamic response of the dispatched power.


Introduction
With a dearth in the fossil fuel reserve followed by an increase in power demand and carbon footprint of thermal generators, future power system is slowly getting dependent on the injection of renewable energy sources into the power grid. In some occasions, a multiple number of renewable energy generators as microgrids work integrated together to form a local power grid which is not enough stiff as the conventional power grid in terms of voltage and frequency stabilisation [1][2][3]. In other occasions, the locations of penetration of the renewable energy generators are far down line the distribution feeders, where local overloading of the lines in terms of active and reactive powers, during peak load periods may be chargeable with extra cost [4][5][6]. In such cases, often there is a scheduled power contract between the microgrid systems and the grid exceeding which leads to higher economic losses in way of power bills [7,8]. Therefore, for such grid-tied microgrids, power dispatch should be increased as far as possible to aid the grid for meeting the local power demand. From the literature it is observed that in grid-tied wind energy (WE)-based microgrid, the energy storage systems are generally used for dynamic power balance between source and load and not utilised for additional grid support during sudden deep fall in source power [9][10][11][12]. Consumption and utilisation of battery power in a hybrid system not only depends on the energy management strategy but also on source power prediction and load forecasting [13]. Furthermore, for enhanced power compensation from battery storage due to power mismatches between different microgrids battery is allowed a sustained discharge to minimise fuel consumption from diesel generator [14]. Instead the battery power may be used intermittently, based on environmental conditions and different local load demand. Such utilisation of the storage system may be a useful option especially for weak-grid system to minimise the power required from the grid while keeping the battery state of charge (SOC) within safe limit. Such minimisation of power drawn by the microgrid from the grid during fall in the source power also minimises violation of contract power between the grid and microgrid to supply local loads. Such a novel effort established in this paper also minimises economic penalty on the microgrid for going over-contract in power with the grid and has not been established earlier in the literature. In this paper, a battery energy storage system (BESS) is used for power compensation at the dc link as required by the supervisory controller, regulating the dc-link voltage V dc [12,[15][16][17][18][19]. In this paper, classical and fuzzy-supervisory controllers are used to take wise decisions to control charging/discharging of the battery based on wind-speed variation and amount of violation in grid contract power. This approach has never been dealt within the literature till date. The battery can be recharged during higher wind power and low load demand periods when the microgrid will go under-contract with the grid. In this work, the similar approach is established with classical and fuzzy-supervisory controllers for making decisions on power feed by the grid inverter. Various supervisory controllers are proposed in the literature for power management in both ac and dc microgrids. The purpose of such controllers is to decide on correct power references of associated converters in the microgrid system with uncertainties in the controller inputs. Such actions regulate high inrush currents, improve life of storage device and maintain dynamic power balance at the dc link [20][21][22][23]. Furthermore, the power injected by WE conversion system (WECS)-based microgrid remains contaminated with harmonics from the source side which degrades the power quality of the dispatched power [24,25]. Voltageoriented control (VOC) of the grid inverter is done to regulate inverter currents using both classical and fuzzy regulators [26,27]. It is found that fuzzy regulators being non-linear are better in tracking control and can reduce distortions in the output waveforms compared with their classical counterparts. Therefore, in this paper the use of FPD + I current regulators for VOC of the grid inverter with sinusoidal pulse width modulation (SPWM) pulse generation are used to improve power quality more than the classicalproportional-derivative-integral (CPID) regulators. The considered dc microgrid system comprises of a direct-driven permanent magnet synchronous generator (PMSG)-based WECS and a lithium (Li)-ion BESS to feed power into the point of common coupling (PCC) and to the local ac consumers between the microgrid and the grid. Maximum power is extracted from the wind turbine using fuzzy-maximum power point tracking (MPPT) algorithm. This choice is based on the proven track record of such intelligent controllers over classical controllers especially during rapid variations in source power [28,29]. A supervisory controller is used to decide on the additional amount of inverter power to be dispatched, P sup apart from the WECS extracted power during battery SOC above lower limit (SOC low ). Three levels of SOCs are considered whose choice depends on the battery characteristics, local load demand and grid contract power. These are, respectively, upper limit, SOC upp , the nominal value, SOC nom and SOC low . If SOC low < SOC < SOC nom and microgrid demand, P g >the contract power, P g c , battery discharges till SOC = SOC low . However, if with similar SOC status, P g ≤ P g c then the battery is charged. In this operational phase, power to be dispatched from the grid inverter, P inv dis is intelligently reduced by the proposed controller, so that the remaining power may charge the battery. When SOC nom ≤ SOC ≤ SOC upp , battery is discharged conditionally. The amount of the additional power to be absorbed from the battery depends on the amount of violation of P g c , ΔP g , due to the local load, dearth in WECS power due to fall in wind speed and the instantaneous error in the V dc from its reference value V dc ref . In this work, performances of classical and fuzzy-supervisory controllers are studied due to a considerable variation in wind speed. The transient P sup may reduce ΔP g for the chosen microgrid and also result in improved frequency stabilisation [3]. Furthermore, an expert supervisory controller can prevent severe SOC degradation and increase the working life span of the battery [14]. Additional active power dispatch at the PCC may also cause oscillations in V dc which needs to be regulated under all conditions. So, P sup should also be a function of the dc-link voltage error, ΔV dc . For classicalsupervisory controller, this power is chosen to possess an exponential relationship on its control inputs. This is because an exponential function returns a '1' for an input '0' and has a smooth non-linear trajectory. Therefore, P sup starts from a minimum value, which is ΔP g , and can extend up to 2ΔP g due to variations in ΔV dc and deviation in wind power, ΔP W from a chosen reference, P W ref .
P W ref is chosen midway of the extracted turbine power to reduce the period of sustained battery discharge during periods of high local loads and low wind speed. Maximum limit of P sup is restricted to 2ΔP g because as the power feed is conditional and intermittent, exceeding this limit injects high oscillations in V dc which hampers smooth power dispatch. Furthermore, the performances in dynamic stabilisation of V dc and improvement in distortions of the dispatched power with CPID controllers are compared with that of fuzzy PD + I (FPD + I) controllers for regulating inverter currents. The novelty of the work lies in: (i) achievement of maximum P sup with the proposed control particularly during high local demand and low wind power; (ii) achievement of minimum oscillations in V dc under all situations of power feed; and (iii) attainment of best quality power feed using the proposed FPD + I−VOC control for the inverter as compared with classical method. This paper, therefore, introduces a novel fuzzy-supervisory control to regulate inverter power based on fall in extracted wind power, amount of violation in contract power between the microgrid and the grid and SOC of the battery. For accurate regulation of enhanced battery power, three distinct levels of SOCs are considered for decisionmaking purpose based on the charging/discharging characteristics of the Li-ion battery. Furthermore, power extraction from the wind generator is done by independent control of deviations in extracted power and dc-link voltage using fuzzy-hill climb search (HCS) method. This independent control avoids any ambiguity in selection of future direction of motion of the operating point in case of no deviations in either or both the inputs.
The remaining part of this paper is organised as: Section 2 deals with the dynamical equations and modelling of system components, Section 3 deals with different control algorithms and controller configurations of the power conditioning interface between wind generator and the grid, Section 4 analyses the simulated results with discussion and finally Section 5 draws the conclusion of the work along with the limitations of the proposed method.

Dynamics and modelling of system components
We consider in this work a grid-tied dc microgrid system comprising of a WECS and a BESS feeds power to a variable local load, as shown in Fig. 1. The power from the WECS and the battery is injected into the common dc link which is later converted to ac using a single power inverter. To maintain a dynamic power balance and to stabilise the voltage across the dc-link capacitor, C dc , the inflow and outflow of dc power across the dc link must be equalised. Fig. 1 shows the mechanical shaft coupled in between the turbine and the PMSG, modelled as a one-mass drive train. This is because the rated angular speed of the PMSG is low which is obtained with higher number of rotor poles [24]. Such arrangement has less mechanical transmission power loss along the shaft and thus increases the efficiency of power transmission [25].

Wind ECS
The WECS comprises of a horizontal axis wind turbine, a mechanical coupling shaft modelled as a one-mass drive train, a PMSG with low rated speed and a switch-mode rectifier (SMR). The gross torque generated by the turbine depends on its design parameters, air density and the wind speed as shown in (1) [17,25]. The power coefficient C p is a measure of turbine efficiency as it absorbs wind power into shaft power. This C p depends on blade pitch angle, β and the tip-speed ratio, λ as shown in (2). Low operational speed of the generator increases the net electromagnetic torque, T em obtained with low losses in the form of torque due to viscous friction and moment of inertia as given below [12]: where where T t is the gross torque of the turbine, ρ is the air density [kg/m 3 ], A is the swept area of the turbine blades [m 2 ], R is the radius of the blade, v w is the wind speed [m/s], J is the moment of the inertia of the turbine generator system, B is the viscous friction coefficient and ω r is the rotor speed. The SMR in Fig. 1 is a cascade connection of an uncontrolled diode rectifier and a dc boost converter for the extraction of maximum energy from the wind turbine. The passive components of the boost converter are chosen to reduce the ripples in the dc power that is fed to the common dc link. The dynamical equations of PMSG and the dc boost converter are shown below [13,28]: where v sd , i sd and v sq , i sq are the direct (d)-axis and quadrature (qaxis voltages and currents, respectively, in the two axes rotor reference frame. R s and L s are the stator winding resistance and inductance, respectively. Φ r , P, L sd , L sq are the number of rotor poles, constant flux/pole, d-axis and q-axis stator inductances obtained from the flux linkages of the PMSG, respectively. V SMR and D are the input variable dc ripple voltage to the converter and the duty cycle of the converter, respectively.

Battery ESS
In spite of being expensive than the lead-acid batteries, Li-ion batteries possess much higher power density and energy density and can withstand several frequent charging/discharging cycles without degradation of life [10,12]. These features make it an attractive choice for hybrid energy systems and hybrid electric vehicles. For WECS-based microgrids connected to a strong grid, the maximum charge capacity of the battery may not be high, except for power management during faults, to prevent islanding of the microgrid from the grid [6]. However for a weak-grid system, this charge capacity should be wisely chosen based on the local peak load demand, the estimated wind profile and the tariff for violation in P g c . The electrical model of the Li-ion battery used in the work is based on the dynamics of battery current i b which in turn controls the battery voltage V b and the SOC of the battery as shown in (8)-(10), [11,19]. The battery current i b is limited within a certain bias [i b max , i b min ] which selects the operational region of the battery based on its charging/discharging characteristics and SOC ini is the initial SOC. Apart from the Li-ion battery, the BESS also consists of a twoswitch buck-boost converter to regulate the bidirectional power flow in stabilising V dc .

Variable local load system
The local load system to the microgrid comprises of four inductive loads [25]. Out of the four loads one load is constant L and the other three variable loads are L 1 , L 2 and L 3 . The variable loads are connected with logic switches which control their connection with the PCC. The applied load pattern with time is shown in Fig. 2a.

Fuzzy-MPPT of WECS
Maximum power extraction using HCS algorithm is generally used with classical control techniques but their performance in tracking actual optimum fails when the source power varies rapidly [29][30][31]. As for a WECS, the wind speed varies stochastically, so fast tracking of the optimum power point is a must. Earlier approaches of fuzzy-MPPT consider the slope of P W and the rotor speed ω r and its sampled change as inputs to the controller [32]. However, this technique cannot take independent decisions on the variability of WECS power with respect to ω r or V dc . In this work, simple independently varying inputs to the fuzzy-MPPT controller are considered and the output is decided based on the HCS algorithm [33]. The HCS algorithm alters the operating point in the same direction if change in power is positive and perturbs the independent variable in the same direction. Usually P W versus ω r is used for MPPT using HCS techniques for WECS. In this paper, the inputs to the fuzzy-MPPT controller considered are perturbations in the output power of SMR, ΔP w and ΔV dc and the output of the controller is the alteration in the duty cycle of the converter, ΔD' as shown in Fig. 2b. The choice of the inputs to the fuzzy-MPPT controller follows from the HCS algorithm which generates the direction of a future movement of the operating point along the P w versus V dc trajectory instead of P w versus ω r trajectory [25]. The movement of operating point is controlled by the duty cycle of the boost converter of WECS. So, the output of the controller is chosen as ΔD, which alters the effective duty cycle of the converter smoothly, as shown in Fig. 2b. Such a choice reduces oscillations in the wind injected power. Membership functions used for the inputs and the output are shown in Fig. 2c and the decision rule array is given in Table 1. This matrix shows that when ΔV dc is negative-big (NB) and ΔP w is positive-big (PB) or P-small (PS), the operating point on the P w versus V dc trajectory lies on the righthand side of the MPP and closer to the MPP and V dc is decreasing. Therefore, a mild action is taken to reduce V dc further to drag the operating point up the hill of the trajectory. Similar action is taken when ΔV dc is PB and ΔP w is NB or N-small (NS) when V dc is increasing.
If ΔV dc is NS and ΔP w is PB or PS, the operating point lies on the right-hand side of the MPP and away from it and V dc is decreasing. Thus, strong action is taken to reduce V dc and to drag the operating point fast uphill the trajectory. Similar action is taken if ΔV dc is PS and ΔP w is NB or NS. Opposite action in the output is required if ΔV dc is PB or PS to drag the operating point uphill as given the rule matrix. The linguistics for all fuzzy membership functions used are NB, NS, Z, PS, PM and PB which stands for negative-big, negative-small, zero, positive-small, positive-medium and positive-big, respectively. Triangular membership functions are used for all fuzzy controllers in this paper as they provide linear relationship between membership values and the crisp values. This provides fast and smooth variation in the control output. Thus, no preference is given to any section of crisp domain in terms of output membership values as done in non-linear Gaussian or sigmoid functions. Again, trapezoidal functions give preference to output maximum membership value over certain crisp domain. In this work, any crisp inputs are shared between more than one membership functions for more accurate defuzzified output. In the HCS method, ΔD is altered in the same direction if ΔP w > 0; otherwise, it is altered in the reverse direction for any change in ΔV dc . If ΔV dc or ΔP w equals to zero, then it implies a sudden change in the wind speed, which results in a jump of the operating point from one trajectory to the other. In this scenario, in order to avert any ambiguity about the drift of the operating point and choosing a wrong direction, alteration in ΔD is stopped. With the next immediate change in ΔV dc , the operating point will drift according to the HCS toward the maximum power. The prefix scaling of the inputs to the controller are adjusted to keep the variation within the whole support of the membership functions, i.e. [− 1 1]. Crisp value 'a', as shown in Fig. 2c, is the support of the central membership function 'Z' and is selected for different operating conditions of the source power and the load demand. This selection is based on the domain of definition of crisp values as given in Fig. 3b and the individual plots of the input errors. The value 'a' should be chosen such that maximum errors should link maximum number of membership functions thus producing a more accurate defuzzified figure. Such an action results in a more accurate control. For example, if majority of error inputs lies close to zero, then the value of a also should be small. The fuzzy membership for the inputs and output are shown in Fig. 3a.

Pitch control for wind turbine blades
As mentioned in Section 3.1, the fuzzy-MPPT controller is demonstrated in Fig. 2b. When the extracted power from the WECS exceeds the rated power of the turbine, the blade pitch angle β needs regulation to restrict this increase in power, according to the standard IEC 61400-2 [34]. The error in between the turbine rated power P t r and the instantaneous wind power P W is regulated using a PI regulator and a low-pass filter (LP) to decide on β as shown in Fig. 3b. The purpose of the LP filter is to improve tracking performance of the PI regulator. Here, a feed-forward   pitch control system is considered to deliver the adjusted and filtered pitch angle to the pitch actuator. The pitch angle may be regulated between its lower and upper limits which correspond to a maximum and minimum power capture, respectively, from the wind turbine.

Battery current control
The two-switch buck-boost converter operation enables bidirectional flow of power through the Li-ion battery. Current ripples introduced by switching transients are minimised by the passive inductor in the BESS circuit based on the switching dynamics of the battery circuit as given in (11) and (12). Here, S(D bb ) is the switching function of the converter which depends on the duty cycle of the converter, D bb . The BESS stabilises V dc by equalising currents at the C dc node governed by (13) for power dispatch from the grid inverter [35][36][37][38]. As seen from Fig. 3c, the purpose of the PI voltage regulator is to minimise the error in V dc , generating an appropriate battery current reference i b ref . The battery current i b is regulated using the double loop control strategy as shown in Fig. 3c [15,25]. As the performance of the PI current regulator affects the voltage loop regulation, tuning of the current regulator is more crucial. However, this regulation is restricted within the set bias of i b as mentioned earlier to control thermal runaway of the battery and to avoid development of hot spots in the passive network components and failures in converter switches where V b , i W and i L are the battery voltage, rectified current from SMR and the dc current drawn by the inverter, respectively. Using (13) and the powers associated with the common dc link as shown in Fig. 1V dc may be expressed in terms of these powers as shown in (14) Here, P b and P inv represent the battery power and the dc power to the inverter, respectively. The polarities of i b and P b are negative during the charging phase of the battery and are positive during the discharging phase. Generation of the duty cycle D bb is based on the compensation of V b , V b cc obtained from the battery current regulator as shown in Fig. 3c and in (15) [39]. In Fig. 3d, the FPD + I controller to control the grid inverter currents are shown.

Supervisory control for selection of the dispatched power
It is found from the literature that the supervisory control is a special distributed control architecture used to generate references of controllers to perform different objectives based on different criteria [20][21][22][23]. In this work, a novel fuzzy-supervisory controller is introduced and its performances are compared with a classicalsupervisory controller. The purpose of such a controller is to decide on the quantum of power to be dispatched through the grid inverter, P inv dis depending on different circumstantial conditions as shown in the flowchart of Fig. 4. In Fig. 4, control flowcharts of both the supervisory controllers are shown simultaneously. Both the controllers have same control inputs and limitations on power dispatch. The microgrid system has to minimise the economic losses, which it incurs due to a violation of P g c to feed its local loads. Therefore, for such systems, dynamic power management is done to feed extra power from the battery during peak local loads and recharge the battery during low demand. In this work, three levels of SOCs are considered for the proposed controller to make decisions which may vary depending on battery characteristics, peak local load and the P g c . These SOC levels are SOC low , SOC nom and SOC upp . If SOC nom ≤ SOC ≤ SOC upp and there is a violation of grid contract power (ΔP g > 0), then battery will discharge an additional power P sup which is added to P W . Such a dispatch also depends on the difference of the normalised deviations in V dc and the normalised difference of P W , ΔP W from a chosen reference P W ref . The choice of P W ref may vary on the profile of wind power ΔP g and SOC. To bring conformity between the outputs of the two supervisory controllers, which are allowed to vary within ΔP g and 2ΔP g and with smooth variations, an exponential function is chosen to supply P sup for the classical control. Under steady state of V dc , P sup should equal ΔP g but with transient variations in ΔV dc ,when V dc > 0, extra amount of transient power is dispatched out to regulate V dc faster. In case of fuzzy control, the crisp power coefficient 'k' is restricted within 0 and 1. Similarly, for the classical control the minimum and maximum values of the exponent 'm' are 0 and ln (2), respectively. In classical control two base values, one for ΔP W , which is ΔP W base and another for ΔV dc which is ΔV dc base are decided to bring the normalised variations in these quantities in the same comparison scale. When the normalised ΔP W > 0 and exceeds the normalised positive variation of ΔV dc to make the exponent 'm' < 0, then the effective exponent value 'k1' is fixed at zero because this will unnecessarily decrease P sup and when wind power is high the requirement for dynamic power support to the grid decreases. For fuzzy-supervisory control, 'k' is the crisp value of the fuzzy function µ(x) dependent on ΔP W , ΔV dc and the rate of change in ΔV dc , δ(ΔV dc ). The output of the fuzzy controller is perturbation in k, Δk which can have values of either polarity to restrict k within 0 and 1 according to the below equation: k n = k n − 1 + Δk n (16) where n is the time instant of observation. The decision on the magnitude of P sup depends on the variations of these considered quantities and the rule matrix of the fuzzy-supervisory controller as given in Table 2. The rules are so designed so as to provide prompt power support to the grid especially when ΔV dc is >0 and ΔP W is <0. The membership functions of the inputs, ΔV dc and ΔP w , and output of the fuzzy-supervisory controller are shown in Fig. 3c. For the other input δ(ΔV dc ) whose membership functions are similar to that of the fuzzy-MPPT controller shown in Fig. 2c with the range of crisp value from −0.3 to 0.3, unlike that of fuzzy-MPPT which is from −1 to 1. This is because a higher number of membership functions of δ(ΔV dc ) tracks accurately the vast variations in it. However, as numerical limits in this input is much smaller, its support is reduced based on its error plot from [−1 1] to [−0.3 0.3]. In Fig. 3a, A-C for the three triangular functions have different meanings for inputs and output as shown in Table 3. This table also shows the range of crisp values for the membership functions of different inputs and output indicated with a*, b* and c* as shown in Fig. 3a. If SOC low ≤ SOC ≤ SOC nom and the power drawn by the microgrid is on contract or under-contract (ΔP g ≤ 0) then P inv dis is reduced and the remaining P W is used to recharge the battery to SOC nom . This available power to the battery starts from a maximum of P W and decreases linearly as the battery gets charged. This linear variation is considered as the SOC variation is very slow and will not introduce ripples in the V dc . However, if the microgrid power absorption violates the grid contract (ΔP g > 0) due to its local load demand, then the dispatched power coefficient exponentially decays with the difference in the actual SOC and SOC low . If SOC < SOC low under any status of ΔP g , both the P sup and the P inv dis must be equal to zero for an emergent charging of the battery with maximum available power. This control scheme may be further extended to systems of higher rating by making suitable adjustments in both the classical and fuzzy-supervisory controllers. This is because the classical-supervisory controllers work on the pu values of ΔP W , SOC and ΔV dc . Alteration of their respective base values keeps the pu values on the same scale. For the fuzzysupervisory controllers, the prefix scaling of all input errors are to be accordingly adjusted as per the error plots obtained from classical control.

VOC of the inverter
The inverter currents are controlled using the well known decoupled vector control strategy with a synchronously rotating reference frame, where the direct (d) axis voltage is controlled aligned to the grid voltage using a phase-locked loop (PLL) controller [27,40] and the quadrature (q) axis voltage is neglected. The modulating signal is fed to a sinusoidal PW modulator pulse generator with a switching frequency of 2 kHz. The prime objectives of the control are: (i) increase in power dispatch and to reduce violation in the P g c , (ii) improvement of both voltage and current quality of the dispatched power by reducing distortions and (iii) stabilisation of inverter output voltage and frequency. The state equations representing the dynamics of the inverter are shown in (17) where v d , v q and i d , i q are the d and q axes voltages and currents of the inverter, respectively. R L and L L are the impedance components of the associated L-C-L-type low-pass harmonic filter. This choice of harmonic filter is to avoid additional cost and complexity of an active shunt filter to be connected at the PCC. As a series filter has its limitation to minimise source side current distortions, total harmonic distortion (THD) of inverter current is not as per international standard, IEEE-519. The prototype harmonic filter has a design impedance of 350 Ω and a bandwidth of 0.5 kHz. The duty ratios for the switching functions along the d and q axes are, respectively d d i and d q i . The total instantaneous current from the WECS and BESS injected into the dc link is i net and ω is the grid frequency obtained from the PLL. To decouple the cross-coupling effects of the two axes, as this can affect the dynamic performances of the converter, feed-forward decoupling voltage control terms, v d c and v q c are used to control the currents in their respective axes as shown in (18) The references for d and q axes currents are obtained from (19) which need to be tracked for required active power (P inv dis ) and   reactive power (Q inv dis ) compensations. Here, P inv dis is obtained from Fig. 4 and Q inv dis is the reactive power of the local load, respectively. The d-axis current reference comprises of two components i d1 ref and i d2 ref due to P inv dis and due to transient ΔV dc , respectively [25]. In (19), k p and k I are the gains of the PI constant of V dc regulator of the inverter. Tracking of the q-axis current reference i q ref ensures voltage stability of the inverter and unity power factor loading of the grid The CPID controllers for regulating i d and i q are first tuned for optimum performances and then the same gain values are used for the FPD + I current controllers. The FPD + I controller is shown in Fig. 3d. The rule matrix of the FPD + I controller is shown in Table 4 and the membership functions of inputs and the output are shown in Fig. 2c. Here, 'err' is the error input shown in Fig. 2d and 'er˙r' is the rate of change in it. The rules are so chosen so as to give similar importance to both the inputs. Severe action is taken is taken when both the variations are in the same sense while gentle action is taken when the inputs are in opposite sense. The choice of input scale factor 'GU' is chosen to arrest maximum deviation of error within the considered support of its fuzzy membership functions. Other gain constants gain of change in error input (GCE), gain of integral of error input (GIE) and GU of the regulator are computed from the corresponding gains values of the CPID.

Simulation results and analysis
The prime objective of the of the proposed fuzzy-supervisory control is to enhance active power support for the considered weak grid and to minimise financial burden on the WECS-BESS-based microgrid system for going over-contract, during transient periods of ΔP g > 0 and ΔV dc > 0 by discharging the battery and also to stabilise V dc in all situations. The performances of the proposed controllers for sudden dips in wind speed and simultaneous variations in power demand at the PCC are examined with respect to classical control methods. In Figs. 5a and b, the wind speeds variation and the corresponding rotor-speed variation of the PMSG are shown, respectively. The rotor speed stays within the rated speed of the direct-driven PMSG and tracks the optimum speed according to the HCS algorithm by the fuzzy-MPPT controller. A chosen deep fall in the wind speed tests the performance of the supervisory controller to dispatch additional power during such low wind speeds. Fig. 5c shows the perturbation in 'k' which gives the variation in P sup . From Table 2 it is evident that the output of fuzzy-supervisory controller, which tends to increase inverter power dispatch, regulating 'k' when ΔV dc is positive. As wind power falls below its threshold, P W ref , ΔP w < 0 and this is followed with a simultaneous increase in local load demand. In such a scenario P sup provided by the supervisory controller should be maximum. This can be observed from Fig. 5c. However, as wind power increases and violation in contract power ΔP g < 0, 'k' value decreases. In this section, a performance analysis of three different control combinations is studied. These are classical-supervisory control with CPID control of inverter abbreviated as CS + C, classical-supervisory control with FPD + I control of inverter abbreviated as CS + F and fuzzy-supervisory with FPD + I control abbreviated as FS + F. From Fig. 5d, the profile of V dc shows much lesser oscillation and improved stability in the voltage with FS + F method. The oscillations in V dc are seen to be highest with higher wind speed, for CS + C method and observed to be minimum with FS + F method. This result is comparable with what is obtained in [37] but for the proposed FS + F method, the oscillations in V dc are lesser both when P W exceeds or is less than P W ref . These oscillations in V dc impose voltage stress across the C dc and may result in its failure due to overheating. Fig. 6 shows the performance comparison amongst the three control combinations considered, in enhancing active power support and thus reducing violation of grid contract power by the microgrid. In Fig. 6a, power extraction from the battery is seen to be much higher for FS + F than the other two methods especially when wind power is below the considered threshold ΔP W base . During this period, simultaneously two events occur in the hybrid power system. These are maximum variations in local load and a deep fall in the wind speed. These two events culminate to maximise the violation of the contract power by the microgrid. Under such a scenario, requirement for power delivery of the microgrid into the weak grid is acute. Owing to its ability to extract higher power from the battery storage during this period, the proposed control combination is able to deliver the highest active power at the PCC as seen from Fig. 6b. This also results in the grid power requirement being minimum with this combination of FS + F as evident from Fig. 6c. Owing to absorption of maximum battery power with the proposed method SOC falls the most as seen in Fig. 6d during the period of simultaneous fall in wind power and an increase in the local load.
Thus, it is concluded that the proposed method can provide maximum active power support to the grid during extreme conditions of contract violation. Fig. 7 shows tracking control of different converter currents, only for the proposed, FS + F method. Fig. 7a shows the battery current, constrained within its bias, closely tracking its reference signal which is supplied from the voltage regulator of BESS, as shown in Fig. 2c. Fig. 7b shows the inverter d-axis current which actually tracks the average value of its continuously varying reference. This continuous variation in the d-axis reference current is obvious as the supervisory controller intermittently adds on power to the WECS extracted power followed from the control flowchart of the supervisory controller as shown in Fig. 4. Fig. 7c shows the inverter q-axis current tracking with comparatively larger oscillations, especially during transitions in load level. Such a response results due to high integral gain of the q-axis current regulator, reducing the value of which not only reduces the power dispatch but also increases inverter current distortions. Fig. 8 shows both the active and reactive power managements at the PCC by the grid inverter and the THD of voltage and current waveforms of the inverter dispatched power. From Fig. 8a, it is observed that reactive power demand of the local load is completely compensated by the grid inverter and reactive power from the weak-grid averages to zero. From Fig. 8b, the periods of over and under-contract of the microgrid power demand are seen, as the inverter dispatches enhanced power absorbed from the battery. Both the voltage and current qualities can be improved by reducing the THD of respective waveforms which averts chances of malfunction of sensitive loads connected

Conclusion
In this paper, an effort is made to enhance active power support to a weak-grid system by a dc microgrid. This is done using a novel fuzzy-supervisory control to decide on the extent of this grid support, based on several system conditions. These are violations of grid contract power between the microgrid and the grid, SOC of the battery, fall in wind extracted power from its threshold and deviation of dc-link voltage from its reference. Power extraction from the wind generator is done using fuzzy-HCS algorithm, where variations in extracted power and dc-link voltage are considered as independent inputs. Such an effort negates any ambiguity for any future movement of the operating point when any one or both of the inputs are zero. It is observed from the results that the proposed supervisory controller is able to extract more power from the battery by discharging it conditionally than a classical-supervisory controller can do. This is achieved after considering all dispatch parameters for the two supervisory controllers similar. High oscillations caused by intermittent withdrawals of additional power from the dc link by the grid inverter are also minimised with the proposed control improving dynamics of power flow and minimising voltage stress on the dc-link capacitor and inverter switches. Furthermore, the inverter current is controlled using fuzzy PD and integral control and performance in its power dispatch to improve power quality is compared with a linear PID controller. It is observed that the fuzzy-supervisory control along with the fuzzy control of inverter current is the best method in terms of maximising grid support, stabilising the dc-link voltage and also to dispatch best quality power compared with the other methods.

System parameters
See Table 6.