## 3 Results and Analysis
### Accuracy of AGC  
Determining the measurement error and uncertainty is very important. The estimated errors in this case show the possible measurement spread. Thanks to this analysis, it is possible to reduce the error of the correction system, by finding the element that most affects it. This analysis is used to estimate the safe range within which the signal can be amplified, and therefore not exceed the measurement range. The main reason for not considering AGC systems containing a PGA amplifier is the lack of continuity in the generation of gain factor, as presented in Figure 2b, \(A_{PGA}\). For this reason, the measurement uncertainty related to the AGC structure was determined based on a microprocessor containing the fewest possible analog electronic elements, which increases its accuracy. In simplified form, the structure from Figure 3b can be presented as shown Figure 7. \begin{table}
\begin{tabular}{c c c c} \hline
**Input** & **PGA** & **PGA + VGA** & **Fuzzy AGC** \\
**Voltage** & **Unused** & **Unused** & **Unused** \\
**VoiV (V)** & **Transition** & **Transition** & **Transition** \\ \hline
0.1 (sh = 1 A) & 655 & 349 & 2 \\
0.2 (sh = 2 A) & 655 & 349 & 312 \\
0.5 (sh = 5 A) & 0 & 15 & 11 \\
0.7 (sh = 7 A) & 983 & 52 & 50 \\
1.5 (sh = 12 A) & 819 & NOT\_P & 327 \\ \hline \end{tabular}
\end{table} 
Table 1: Errors in the measurement system using a 12-bit ADC converter supplied with a reference voltage of 5 V. (PGA, gain can be programmed by 2\({}^{\text{n}}\) with a max value 4096 and VGA, gain range 2-32 dB with 1 dB step, \(\text{R}_{\text{sh}}=125\) u\(\Omega\), and OA = 800 V/V). Table 2 shows the most important individual errors for the AGC systems shown in Figure 7.  
The data given in least significant bits (LBS) in Table 2 are converted into volts using the formula _Error in (V) = Error in LBS*(V_ref/2 number of bits)_. The measured value depends on the measurement function: _f = AGC (V1 = V_oiv_, _V2 = V_outADC_, _V3 = A_DSP_, _V4 = V_DAC2_) (see Figure 7). To calculate the limiting error in the considered AGC structure, the error of propagation should be used with a confidence level \(p=0.95\) given by the relationship:  
\[\Delta_{AGC}=\sqrt{\sum_{j=1}^{N}\left(\frac{\partial f}{\partial X_{j}} \right)^{2}\Delta_{x_{j}}^{2}} \tag{2}\]  
where \(f\) is the measurement function, \(\Delta xj\) is the individual limiting errors of the electronic component included in the AGC structure, \(\frac{\partial f}{\partial X_{j}}\) is the sensitivity factor of the function to changes in the input quantity \(X_{j}\). The limiting errors (variable in Equation (2)) are given by the relationship [30]:  
\[\Delta_{X_{j}}=\sqrt{\sum_{i=1}^{N}\Delta_{e_{i}}{}^{2}} \tag{3}\]  
where \(e_{i}\) is the errors appearing in electronic devices. According to Equation (3), it is possible to determine the processing error (root sum square (RSS)) of the ADC converter from the AGC structure (see Figure 7), which can be written as [30]:  
\[\Delta_{ADC}=\sqrt{(\Delta_{V_{\infty}})^{2}+(gain)^{2}+(INL)^{2}} \tag{4}\]  
where \(\Delta_{V_{\infty}}\) is offset voltage, \(gain\) is gain error, and \(INL\) is integral nonlinearity. The limiting error of the fuzzy logic controller was determined by \(\mathrm{e_{1}}=\left(\frac{1}{\mathrm{m}}\right)\times\sum_{i=1}^{\mathrm{m}}\)\(\left|\mathrm{A_{system}}-\mathrm{A_{model}}\right|\)[31, 32] (where \(m\) is the number of data) and equals 0.05. For the operational amplifier, DAC errors are determined based on Equations (2) and (3) and catalogue data. The limit error of fuzzy AGC was determined and presented in Figure 8. \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Error of op Amp** & **Error of ADC 12-bit** & **Error of FLC** & **Error of DAC 12-bit** \\ \hline \multirow{3}{*}{\(\Delta Amp\)} & \(\Delta Vos\) [V] & & \(\Delta Vos\) [LSB] \\  & _Gain_ [LSB] & _e1_ & _Gain_ [LSB] \\  & _INL_ [LSB] & & _INL_ [LSB] \\ \hline \hline \end{tabular}
\end{table} 
Table 2: AGC system errors. Figure 7: Measurement circuit of AGC based on an MCU processor [29].