# Design of a Predictive RBF Compensation Fuzzy PID Controller for 3D Laser Scanning System
## 3 Design of FPID
### Fuzzy Adaptive Controller Description  
Fuzzy control is a type of rule-based control, which directly adopts language control rules. Since it does not require establishing an accurate mathematical model of the controlled object, the fuzzy control accuracy is often unsatisfactory. In this paper, it is combined with a PID controller to adjust the three PID parameters to enhance the performance of the controller. The input variables are \(e\) and \(ec\), and \(k_{\mathrm{p}}\), \(k_{\mathrm{i}}\) and \(k_{\mathrm{d}}\) are output variables. Thus, the Mamdani two-input, three-output fuzzy controller is designed. The fuzzy operators are shown in Table 1.  
Firstly, the basic domains of the input variables are determined, as [\(-\mathrm{x_{e}}\), \(\mathrm{x_{e}}\)], [\(-\mathrm{x_{ec}}\), \(\mathrm{x_{ec}}\)]. The quantization factors \(\mathrm{k_{1}}\), \(\mathrm{k_{2}}\) are introduced to transform the input variables from their basic domain to the domain of the corresponding fuzzy set, as [\(-\mathrm{n_{e}}\), \(\mathrm{n_{e}}\)], [\(-\mathrm{n_{ec}}\), \(\mathrm{n_{ec}}\)]. The transformation relationship is \(\mathrm{k_{1}}=\mathrm{n_{e}}/\mathrm{x_{e}}\), \(\mathrm{k_{2}}=\mathrm{n_{ec}}/\mathrm{x_{ec}}\). The output variables are in the domain of the fuzzy set, as [\(-\mathrm{n_{p}}\), \(\mathrm{n_{p}}\)], [\(-\mathrm{n_{i}}\), \(\mathrm{n_{i}}\)] and [\(-\mathrm{n_{d}}\), \(\mathrm{n_{d}}\)]. They must be converted into an acceptable domain of the controlled object. Hence, proportional factors of \(\mathrm{k_{3}}\), \(\mathrm{k_{4}}\) and \(\mathrm{k_{5}}\) are introduced. Similarly, the basic domains of output variables are [\(\mathrm{x_{p1}}\), \(\mathrm{x_{p2}}\)], [\(\mathrm{x_{i1}}\), \(\mathrm{x_{i2}}\)] and [\(\mathrm{x_{d1}}\), \(\mathrm{x_{d2}}\)]. According to the basic domains of output variables, the controller directly uses the fuzzy algorithm to adjust the PID parameter values. The transformation relationships are \(\mathrm{k_{3}}=2\mathrm{n_{p}}/(\mathrm{x_{p2}}-\mathrm{x_{p1}})\), \(\mathrm{k_{4}}=2\mathrm{n_{f}}/(\mathrm{x_{i2}}-\mathrm{x_{i1}})\) and \(\mathrm{k_{5}}=2\mathrm{n_{d}}/(\mathrm{x_{d2}}-\mathrm{x_{d1}})\). The input and output variables are selected as [\(-3\), \(3\)], [\(-3\), \(3\)], [\(-0.3\), \(0.3\)], [\(-3\), \(3\)], [\(-3\), \(3\)] and the fuzzy language set is expressed as [NB NM NS ZO PS PM PB]. Then the proper membership functions are set. Different shapes of the membership functions will cause different influences on the control performance. A low-resolution membership function should be selected for large errors, and a high-resolution membership function should be selected for errors that are close to zero. The triangular membership function and the sigmoid membership function are adopted respectively, which are shown in Figure 5. \begin{table}
\begin{tabular}{c c c c c} \hline \hline
**And Method** & **Or Method** & **Implication** & **Aggregation** & **Defuzzification** \\ \hline min & max & min & max & centroid \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Fuzzy operators. Figure 5: _Cont._Fuzzy rules are the core of the fuzzy controller, which describe the fuzzy relationships between PID parameters and \(e\), \(ec\). The effect of the PID parameters on the system performance is shown in Table 2.  
According to Table 2, the PID parameters can be obtained to satisfy the different \(e\) and \(ec\). Combined with the general rules in fuzzy adaptive PID control [37], the specific fuzzy rules are shown in Tables 3-5.