Simulation of adaptive gain control via 2-D lookup table for isolated hybrid micro-grid system

Received Jun 7, 2021 Revised Mar 17, 2022 Accepted Apr 4, 2022 This paper presented a smartness 2-D lookup table (2-DLT) control by means of adaptation gain to develop a frequency controller and facilitate the powersharing requirements in an isolated micro-grid system. This intelligence of an expert controller adopts the scale of adaptation gain for estimating control design. Synchronous power generators are commonly used to provide power to distant and isolated regions where grid expansion is expensive due to economic and technical constraints. Load frequency control (LFC) technology challenges to guarantee the reliability and stability regarding the system. It is known that conventional control methods are unreliable due to frequency variation and sudden changes in the load or failure generation. Traditional control and criteria may not be appropriate for the new structural networks, such as micro-grid. In this work, the performance of the proposed 2-DLT controller is examined and compared to the classical proportional integral (PI) controller and artificial neural network (ANN). The simulation system is implemented and tested using MATLAB/Simulink.


INTRODUCTION
There are many economic benefits that can be gained by applying the micro-grid concept. A microgrid is defined as an independent low or medium voltage power network comprised of various distributed generators, energy storages and controllable loads [1]. In the micro-grid system, the sources can be non-inertia distributed generations (DG) interfaced through voltage source converter (VSC) or inertial DG such as synchronous generator (SG). The energy produced can be delivered to the local loads within the micro-grid structure or exported to the utility grid [2]. Synchronous power generators are commonly used to provide power to distant and isolated regions where grid expansion is expensive due to economic and technical constraints [3]. An important part of the synchronous generator is the load frequency control (LFC). This controller is suitably designed to respond to load fluctuations and set the frequency to a fixed value when operating in the island system. When a micro-grid operates in an islanded mode, local frequency control is always one of the main issues. Since micro-grid is in the vicinity of smart grid systems, it should facilitate control approaches [4]. The frequency of system voltage (50 Hz) is directly proportional to the speed of the traditional generation unit, which is droop speed control [5]. The classical control schemes of LFC have intrinsic problems that increase the frequency feedback gain and result in the instability of the LFC loop. In the literature, some control strategies were proposed for the LFC response. Liu et al. [6] the article proposes a secondary frequency control strategy for isolated micro-grid based on linear active disrupture rejection control (LADRC) technology. In Sanseverino et al. [7] the system frequency is introduced to the optimization problem. In particular, the frequencypower drop control (f-P) is taken into account and the maximum frequency deviation is restricted. These restrictions apply to the steady-state, but do not take into account the transition behavior. Khooban et al. [8] have introduced a general type II fuzzy system. The authors in this article focused only on the controller design without going into the details of inertial DGs dynamic models.
In the robust control scheme, the structural complexity and the reshaping of the system may be required. The conventional proportional integral (PI) control techniques for micro-grid utilize the timeconsuming try and error methods to calculate the control gains. However, in the event of sudden loads change, frequency deviation occurs and performance can be disappointing [9]. To avoid this problem, the intelligent control scheme uses soft computing technologies such as fuzzy logic control (FLC). As a result, FLC provides very satisfactory performance, without the need for a detailed mathematical model of the system as it only needs to incorporate the experts' knowledge into fuzzy rules [10]. FLC is utilized in [11]. However, it is difficult to develop a good (simulation) model for FLC, which can facilitate the fine-tuning of the controller. To improve this issue, new and more effective control methods such as 2-D lookup table (2-DLT) is proposed.
This work focuses on load frequency control in isolated micro-grid under disturbances, controlling the speed rotor of SG as a DG to control the frequency deviations and the power. In the proposed separate microgrid configuration consisting of multiple DG units. One is the inertial DG SG and the other is the converter interface DG (PV and battery), as shown in Figure 1. The hybrid micro-grid system under consideration comprises one synchronous generator, one PV array, one battery storage unit and loads. Then, the models are combined to form a complete model of a hybrid micro-grid system [12] and developed by MATLAB/Simulink environment. In general, the components of any generator are speed changer, speed governor, hydraulic amplifier and control valve. The output commends of the speed governor is . The speed governor has two inputs: change in the reference power setting, and change in the speed of the generator, . It is to be noted that a positive will result in positive , with using the Laplace transform as (1).
: Output of speed governor, : Reference power setting, : Speed of the generator, : Constant dimension. The output of a hydraulic actuator is ℎ . This depends on the position of the main piston, which in turn depends on the quantity of fuel flow in the piston.
Where is the hydraulic time constant. The generator constantly adjusts its output to keep up with changing demand . These adjustments are essentially instantaneous, certainly in comparison with the slow changes in turbine power . Therefore, we can set.
If load demand is increased the generation immediately increases by to match the new load.
The gain constant controls the integration rate and so the speed of response of the loop. For this signal ∆ ( ) is supplied to an integrator whose output controls the speed changer, as shown in Figure 2 share load and power between generators connected to a network system, it must provide speed control or drooping characteristics [13].

POWER SHARING
The generator field is provided by the static exciter and automatic voltage regulator (AVR). The output voltage of the synchronous generator remains constant using the excitation system. The main challenge of the excitation system is to provide the necessary excitation current to the synchronous machine within the permissible generator range and to automatically adjust the machine terminal voltage ( ) to a constant value.
Where is the Laplace operator and is the measurement time constant. The conventional droop control given as (6) and (7).
Where x=1, 2, 3 refers to DGs design, is the phase angle difference between output voltage and PCC voltage . In the event that line inductor is larger than the resistor, the aforementioned power flow can be simplified to the by ones (8) and (9).

PHOTOVOLTAIC AND ENERGY STORAGE
Inverters have a technological design, historically. However, these inverters are designed to be deployed in the distribution system [14]. Typically, the most basic electrical circuit involving photovoltaic solar cells is generally one where the current source is parallel with a diode. The dc signal is converted into an ac signal via power semiconductor devices. In general, energy storage can be used to temporarily reduce the load on the grid by absorbing energy during high power generation and releases energy when consumption is high (load variation).
In this work, battery storage system (BSS) can charge and discharge to help balance the power between photovoltaic generation and load demand [15]. When power generation exceeds demand, photovoltaic arrays charge BSS to store extra power. On the other hand, when the power generation falls below the demand, the BSS discharges the stored power and supplies it to the load. The generated AC signal at the output of the power electronics is not sinusoidal. Therefore, an LC filter is connected in series with the electronic power devices to get a sinusoidal output voltage with the least content of the harmonics. By transforming abc to dq0 on a set of three-phase signals.

NEURAL NETWORK (NN)-NARMA-L2
The field of neural networks (NN) and its applications for control systems has seen tremendous growth over the last few decades [16]. Some of the advantages of artificial neural networks are the ability to control processing, learning, and make generalizations about faults/noise in parallel [17]. NARMA-L2 control is a controller from the rearrangement of the plant mode; the controller is a neural network that is trained to control a plant so that it follows a reference model. One standard model that has been utilized to represent common discrete-time nonlinear systems is the NARMA-L2 model [18]. The major idea of this kind of neuro controller is to convert the non-linear system dynamics into linear dynamics by cancelling the non-linearity [19]. There are various kinds of neural network architectures available, including single layer feed forward network (SLFF), multi-layer feed forward network (MLFF), and cascade correlation architecture (CC). A network with an input layer, one or more hidden layers, and an output layer is referred to as a feed-forward network. In a feed-forward network, the signal moves in only one direction. A network with only one hidden layer is known as an SLFF, while a network with many hidden layers is called an MLFF. In the CC architecture, neurons receive system inputs and all outputs from the previous layer [20]. The identification block diagram of the NARMA-L2 model is shown in Figure 3.
From the control configuration viewpoint, the most recommended artificial neural network (ANN) based micro-grid control design can use the ANN system as an additional controller in parallel with the existing conventional simple controller such as PI, in order to improve the closed loop performance represented in Figure 4 [21]. In this work, the NARMA-L2 architecture is applied with the aid of the neural network toolbox of MATLAB software and several important are obtainable [22].

2-D LOOKUP TABLE AND FUZZY II NFERENCE
In particular, modern combustion engine control, an enormous number of one-and two-dimensional lookup tables are used [23]. The lookup table is derived based on the breakpoint data of inputs, the output, and the table data. A control output gain is used as a filter to tune the output of the lookup table to obtain different output values. The advantage of this work is that the fuzzy output is based on the estimation of one lookup table with two inputs and one output parameters, so the control is high accuracy and easy application especially in the power system containing some of the different DGs. To design a 2-DLT, the first step in constructing this is to define the inputs and outputs of the system. The input signal is the same as the output to track the errors. The gain is adjusted by selecting the appropriate required value in the table. In this case, a 2-DLT suitable for use with the PI controller is suggested. The scope of this section is limited explicitly to the 2-DLT used to control the rotor speed of the generator in island operation mode. The lookup table can be applied in different ways. For example, to store the state of sample support parameters or controller parameters such as gain, depending on the operation. 2-DLT calculates an approximation of the function of z= ( , ) for a given , , data points. The row and column indexes could be defined as 1-by-m of data point and 1-by-n of data point of vectors. While the table data is defined as an m-by-n matrix of a data point. It can be illustrated as the first input port mapped to the first table of dimension , and the second input port mapped to the second table of dimension . As shown in Figure 5, the first input identifies the first dimension (row) breakpoints and the second input identifies the second dimension (column) breakpoints. The lookup table uses many methods for the input values to generate output values. In this 2-DLT, the interpolationextrapolation method is employed.

Data sets and table data
Lookup tables can be regarded as the first order in the network. They comprise of a set of data or interpolation nodes placed on a multi-dimensional point of the network with each node consisting of two elements. The numerical data point heights are an estimation of the approximate nonlinear function in its data point position. All nodes are stored, for example, in the memory of the control unit. To generate the model, all data point positions are usually pre-consistent. The sizes of breakpoint data sets and table data, some concerns should be taken into consideration: i) memory system constraint limits the overall size of the lookup table; ii) lookup tables should use consistent dimensions so that the overall size of the table data indicates the size of each breakpoint dataset.
The dimensions of the lookup table are created by dynamically updating the dormant lookup table  which can be used to model time-varying systems with two inputs. Each breakpoint data set is an index of input values for a particular dimension of the lookup table. The array of table data serves as a sampled representation of a function evaluated at the breakpoint values.
The control surfaces can be approached through lookup tables to simplify the generated code and improve performance speed. 2-DLT can be applied by a set of the lookup table, one lookup table for both inputs defined in the fuzzy inference system (FIS). In this section, the task is to design and replace the PI controller for the plant. The plant is a two-input one-output system in discrete time, and the aim of controlling rotor speed is to make each breakpoint work with high efficiency and safety, at the same time to achieve good performance, which is based on breakpoints data (row and column breakpoints).
A FIS includes the knowledge and intelligence of an expert; in the system design which controls the process whose input and output relationships are determined through a set of fuzzy control rules, for instance, IF-THEN rules [25]. Fuzzy logic reasoning involves two kinds of information. The first regards the labels and membership functions devoted to the input and output variables. The exact choice of these represents one of the most critical stages in the model design. The lookup table technique based interpolation algorithm is so used in the applications of manufacturing and the industrial. Selecting the appropriate interpolation method is substantial to adjust the goal pose errors based on the pose errors of the neighboring grid points around the goal [26]. In this work, FIS consists of three stages. As shown in Figure 7, the first, fuzzification converts crisp value input to a linguistic variable using the breakpoint data sets retained in the knowledge base. In the second stage, the inference engine is assigned the mission of evaluating the input's degree of the breakpoint to the fuzzy output sets by employing the table data. Finally, the defuzzifier stage transforms the fuzzy output into a crisp value. The inference stage utilizes the data set input values to activate the inference table data and generate the fuzzy output value. With the aim to design a 2-DLT, a data collection and the development analysis has to be built. The first procedure in developing this is to identify the inputs and outputs of the system. The original inputs are speed error (e) and its derivative, which represents the change of speed error (∆ ) in pu. Both (e) and (∆ ) inputs are determined to meet the system response and to reduce the error effect, which is the essential problem of the island mode. These inputs where the speed controller settled is required in order to sustain the proper speed of synchronous generator ( ) while saving the required power to the rest of the micro-grid. The output of the original system was the speed rotor. This is the oversight that set the control desired speed of the synchronous generator to maintain the appropriate frequency.
The desired speed signal in this condition was determined by inputting the signal error of speed into the existing controller of the 2-DLT which then determined the appropriate synchronous generator speed. This speed is the feedback signal during the adaptation gain (Ka.g). In this controller, the two inputs of breakpoint sets (set 1 and set 2). These two inputs show the cell in the table data that will be updated following the new measurements.

PROPOSED MECHANISM CONTROL
A 2-DLT controller was proposed to replace the PI controller used to minimize error in the traditional PI speed controller. The strategy considers 2-DLT to improve the overall performance of hybrid micro-grid in islanding mode according to the nature of disturbances (load step change and fault). The 2-DLT controller block has two inputs (e and ∆ ) and one output. Therefore, it is easy to replace the PI system using a 2-DLT. To generate a 2-DLT from FIS, loop through the input, and the corresponding output values using the Interpolation-extrapolation method. The speed error and change of speed error could be defined as (16) and (17).
Where = 0 is the desired speed and = is the measured speed. The gains Ke, Kde and adaptation gain are used to normalize the SG response and to adjust the controller's sensitivity. The modification can be made for faster estimation that is resulting in calculating speed gains when simulating the model. As shown in Figure 8, which is a proposed 2-DLT closed-loop control system, the inputs are an error. The proposed 2-DLT has the tracking error signal as two inputs Ke, Ked and single output Ka.g adaptation gain. The lookup table is derived based on the table data; an adaptation gain is used to adjust the output of the lookup table to get different output values.
A feedback signal is obtained from the output of the system. The reference point is representing a speed signal ( ) of SG. The style of 2-DLT is (18).
Where , ,and are linguistic variables, A and B are breakpoint data sets on the universe of discourses and and f ( , ) is a mathematical function. For this proposed controller the configuration of a 2-DLT (data 3x3) is shown in Figure 9. The values use the input to generate the output values using the method of selecting the lookup table parameters. The above input and output values define the 2-D lookup table that is graphically shown in Figure 10. Figure 11 viewer is a three-dimensional plot of the control surface which will predict the outcome of any output variable depending on the values of two input variables. In this figure, it is shown the various values of speed error (e) and change of speed error (∆ ) signal of the synchronous generator that 2-DLT applied to predict the output, which is the speed in pu. The parameters and values, for simulation system controller, are shown in Table 1.

SIMULATION RESULTS
A 2-DLT was proposed to replace the PI controller used to minimize errors in traditional PI speed controllers. The choice of the values of the adaptation gains greatly affects the performance of the 2-DLT. The different responses were carried out by changes in the adaptation gain (5, 10, 15 and 20) as depicted in Figure  12 were tested for confirming the superiority of the 2-DLT response speed in the unit-step is applied. The adaptation gains are responsible to improve the transient performance of the speed response in terms of overshoot, settling time, rise time and steady-state for step speed response. It is evident from the results that the low adaptation gain (5), the actual speed has no oscillation, decreasing adaptation gains the output speed response improved towards matching the desired value of reference speed 0 .
As shown the error signal of speed in Figure 13 at load change, 2-DLT reduces the overshoot, undershoot and settling time to lowest value and also improves the system performance by decreasing the adaptation gain. However, the gain tuning is quite simple compared with tuning PI gains. System performance is good and stable in chosen a.g=5. Before the chosen 2-DLT, system performance is very poor and become unstable. So for an only suitable value of adaptation gain can be used to track the error closer to the disturbance. Figure 13 shows the effect of different adaptation gains on speed deviation with a 2-DLT controller in case of load change at t=1s. The performance of conventional PI and artificial intelligence controllers are examined and compared to the proposed controller. Two patterns of disturbances have been adopted, first is the impact of RL load (80-120 kW, 15-22 KVAR) in a step change of electrical load. Meanwhile, the micro-grid is subjected to a fault (three-phase line to a ground fault), which is the second problem to be examined for a period of 1 to 1.1s when connected with the load. Simulation results focus on the performance of the 2-DLT. The low damping powersharing leads to poor transient response and oscillating performance in the injection power with conventional PI and ANN controllers. Due to the transient response of the proposed 2-DLT, the transient response real power can be significantly suppressed, as shown in Figure 14. Figure 15 shows a case where the load rise at t=1s, a step-change in power demand is occurs and the micro-grid tracks the transient changes. All distributed generation in the proposed micro-grid system is equipped with rated power. It can be seen that the active power synchronization is precisely distributed as the load changes. In Figure 16, the proposed 2-DLT showed a promising improvement of the frequency deviation over a step response. From which the 2-DLT, has the best transient response than PI and ANN controllers. An explicit comparison response of load change with these three types of controllers, the enhancements of the transient responses of frequency for the proposed controller is shown in Figure 17. The significantly smooth and robust controller with 2-DLT after load changes, whereas the proposed controller considerably stable at a steady state when compared with PI and ANN controllers as illustrated in Figure 18. The rotor speed response is tracking the desired value in 1.015 seconds for the settling time and still. With the PI and ANN controllers, the performance of the system is poor and also having a high value of undershoots and overshoots with longer settling time. Figure 18 depicts an enlarged signal of rotor speed deviation for PI, ANN and 2-DLT controllers in case of step load changes at t=1 second.
The control strategy under consideration includes the island operating mode of the micro-grid in the event of a fault in the network. The effectiveness of the proposed 2-DLT is extended to 3-phase to ground fault in islanded hybrid micro-grid, which is the SG has assessed the frequency deviation when exposed to a fault. The three-phase to ground fault is created for a period of 1s to 1.1s, in which the fault is occurs at the distribution line on the load side.
The simulation results have shown that the proposed 2-DLT controller improves the LFC capability, which can be seen in the frequency fault case. It can be observed that the proposed controller is able to accommodate the frequency fault, leading to minor changes in the frequency of the islanded micro-grid. The fault analysis in the micro-grid is shown in Figure 19.
From Figure 20, it can be observed that when the micro-grid fault occurs, the oscillation also happened in the rotor speed for about 123 milliseconds. While high oscillation occurred for other controllers and taking a longer period to stabilize the rotor speed. Due to high fault tolerance of the proposed 2-DLT, an efficient and promising control has been shown and could increase the stability of the micro-grid when the fault occurs.

CONCLUSION
In this paper, 2-DLT via adaptive gain is proposed for load frequency control, an active power-sharing in independent micro-grid operation. The dynamic performance of the network is superior to the proposed 2-DLT control through the precision of the results. The proposed controller has improved settling time and overshoot performance of the micro-grid output. Simulations for two cases including load changes and 3-phase fault conducted for a micro-grid in islanded mode verified the effectiveness of the proposed control algorithm. Results showed that the 2-DLT considered provides desirable performance and improves the frequency deviation and output power variation.