## 2 Materials and Methods
### Structure of the Fuzzy Controller  
An important feature of fuzzy systems is their robustness under conditions when the system parameters are uncertain. The disturbance attenuation problem of fuzzy large-scale systems was shown in [18]. The robustness of the designed fuzzy controller with complexity reduced was shown in [19]. The grid division of the input space and the overlapping sector should be properly designed [20], and therefore ensure a smooth transition of the measurement point between the sectors of the input space. In fuzzy control, the stability of the system operation can be checked by means of a state phase analysis known as the geometric method [20]. This method reveals how robust the controller can be with an appropriate set of database parameters, especially the premises of the rules. The sliding control ensures the existence of sliding motion, which results in constancy with regard to parameter changes [20]. The sliding law of a fuzzy controller is a combination of sliding control and fuzzy logic. The robustness of fuzzy regulators is a consequence of the proven resistance of the sliding regulator. Another example of a controlled AGC system is the cascade connection of a PGA amplifier with a VGA. In this structure, the PGA amplifier matches the measured signal to the input VGA. The signal from the shunt output terminals at 1 A current is 125 \(\upmu\)V and is amplified by the input amplifier to 0.1 V. then, it is amplified by the PGA with a constant factor of 8 \(v/v\) to the level of 0.8 V, while the \(VGA\) amplifier with a set gain of 13 dB amplifies the signal to the value of 3.57 V. The measured signal is matched to 80% of the dynamic range of the ADC. The main problem with this AGC solution is that the two integrated circuits are controlled by an algorithm consisting mainly of conditional instructions, which extend the gain control time. The SR (skew rate) coefficient for this structure of AGC can be determined from the formula \(\min\{SR_{OA},SR_{PGA},SR_{VGA}\}\). A significant disadvantage of the AGC solutions described above is the changing gain every 2 dB or as a function of \(2^{n}\), which makes it impossible to generate a gain signal in a continuously way. The bandwidth is dependent on the gain set by the amplifiers. An additional error in the system comes from the settling time from the amplifier. The use of two programmable circuits allows for better adjustment of the measurement signal to the dynamic range of the ADC. A detailed description of the proposed fuzzy controller is given in [16; 20; 21; 22; 23; 24; 25; 26]. The input/output signals are as follows:  
1. For the module (implemented Mamdani-type inference): 1. input: \(\left[ \begin{array}{cc}\mathrm{V_{oIV}}\left(\mathrm{nT_{s}}\right)^{*}& \frac{180}{\pi}\mathrm{arctan}\left\{\left[\mathrm{V_{oIV}}\left(\mathrm{nT_{ s}}\right)^{*}\right]^{\prime}\right\}\end{array} \right]^{\mathrm{T}}\) - output: \(\mathrm{A_{id}}^{*}\), - rule: \[\mathrm{R_{I}^{(i)}}:\mathrm{if}\overbrace{\left(\mathrm{V_{oIV}}\mathrm{ is~{}N_{A}^{(i)}}\right)}^{\mathrm{premise}}\mathrm{AND}\underbrace{\left(\mathrm{V_{oIV}^{\prime} \mathrm{is~{}N_{B}^{(i)}}}\right)}_{\mathrm{II-simply~{}premise}}\mathrm{ THEN}\underbrace{\left(\mathrm{A_{d}~{}is~{}N_{C}^{(i)}}\right)}_{\mathrm{antecendent}}\] (1)  
where V\({}_{\mathrm{oIV}}\)(nT\({}_{s}\))* is the instantaneous value of the voltage sample from power inverter measurement current circuit at a discrete time nT\({}_{s}\); \(n\) is the sample number, T\({}_{s}\) is the sample interval; \({}^{\prime}\) is the derivative operator of the I\({}^{\mathrm{th}}\) order; * is the crisp value; T is the vector transposition; \(A_{d}\)* is the output signal of the fuzzy controller, representing the desired gain value; N\({}_{A}^{(i)}\), N\({}_{B}^{(i)}\) are the linguistic names of input fuzzy sets (A, B); N\({}_{C}^{(i)}\) is the linguistic names of input fuzzy set (C); I is the number of rule.