# Design of a Predictive RBF Compensation Fuzzy PID Controller for 3D Laser Scanning System
## 4 Design of RFPID and PRFPID  
### RFPID Controller Description  
There is unknown nonlinear friction torque in the Lidar pitching motion system, which is difficult to account for using the simple feedback compensation method. Neural networks are a significant branch of intelligent control, which have self-learning and adaptive capabilities. A neural network system can be used to approximate the friction torque to achieve adaptive neural network compensation. As shown in Figure 7, the RBF neural network is used to approximate the unknown and nonlinear friction torque based on the FPID in the previous section. In this way, it can be utilized to compensate for the friction torque in the control law. Thus, the nonlinear influence caused by friction torque can be eliminated. Figure 6: Fuzzy controller. For the system mathematical model in (1), \(F_{\text{f}}(t)\) is a friction torque based on the Stribeck friction model, whose coefficients are unknown. \(F_{\text{f}}(t)\) cannot be calculated by the model, but it can be obtained by the RBF neural network through error training. The RBF neural network is designed to fit the unknown nonlinear part. The algorithm of the RBF neural network is  
\[ \begin{split}& c=\left[c_{\text{i}}\right]\\ & h_{\text{j}}=\exp\left(\frac{-\left|\kappa-c_{\text{j}}\right|^{2 }}{2\delta^{2}}\right)\\ & f_{\text{R}}=W^{\text{T}}h\end{split}  \tag{4}\]  
where \(x\) is network inputs which are the error, the rate of error change and the integral of the error, \(i\) is the number of network inputs, \(j\) is the number of hidden layer nodes in the network, \(c\) is the central value of the hidden node Gaussian function, \(\delta\) is a normalized constant of the hidden node, \(h\) is the output of the Gaussian function and \(W\) is the weight of the neural network. The relationship between the network output and actual friction torque is  
\[\frac{F_{\text{f}}}{\text{J}}=f_{\text{R}}+\varepsilon=W^{\text{T}}h+\varepsilon \tag{5}\]  
where \(\varepsilon\) is the network approximation error. The PID control law based on RBF compensation is designed as  
\[u_{2}^{\star}=\frac{\text{JR}}{\text{K}_{\text{u}}\text{K}_{\text{m}}}\bigg{[} f_{\text{R}}-\frac{\text{Grcos}\theta}{\text{J}}+\ddot{\theta}_{\text{d}}+k_{ \text{p}}e+k_{\text{i}}\int e\text{d}t+k_{\text{d}}\dot{e}\bigg{]} \tag{6}\]  
By substituting (6) into (1), the closed-loop dynamic equation of the system can be obtained as  
\[\left\{ \begin{array}{l}\dot{E}=\mathbf{A}\mathbf{E}+\mathbf{b}\left[f_{\text{R}}-\frac{F _{\text{f}}}{\text{J}}\right]\\ E=\left[\begin{array}{c}\int e\text{d}t\\ e\\ \dot{e}\end{array}\right],\mathbf{A}=\left[\begin{array}{ccc}0&1&0\\ 0&0&1\\ -k_{\text{i}}&-k_{\text{p}}&-k_{\text{d}}\end{array}\right],\mathbf{b}=\left[ \begin{array}{c}0\\ 0\\ 1\end{array}\right]\end{array} \right. \tag{7}\]  
where \(e\) is the error of system output, \(k_{\text{p}}\), \(k_{\text{i}}\) and \(k_{\text{d}}\) are respectively the proportional coefficient, integral coefficient and derivative coefficient and \(\mathbf{A}\) and \(\mathbf{b}\) are the corresponding coefficient matrix. The optimal weight parameter of the neural network is  
\[\mathbf{W}^{\star}=\underset{W\Omega}{\text{argmin}}\left[\text{sup}\bigg{|}f_{ \text{R}}-\frac{F_{\text{f}}}{\text{J}}\bigg{|}\right] \tag{8}\]  
Figure 7: RBF compensation fuzzy PID controller (RFPID) control system. **Note:** RBF = radial basis function  
where \(\Omega\) is the set of \(W\). Thus, the minimum approximation error \(\omega\) is defined as  
\[\omega=f_{\mathbb{R}}(x|\mathbf{W}^{*})-\frac{F_{\mathrm{f}}}{\mathrm{J}} \tag{9}\]  
According to (7) and (8), the final closed-loop dynamic equation of the system is  
\[\dot{\mathbf{E}}=\mathbf{A}\mathbf{E}+\mathbf{b}\Big{[}\Big{(}\mathbf{W}-\mathbf{W}^{*}\Big{)}^{ \mathrm{T}}\mathbf{h}+\omega\Big{]} \tag{10}\]  
Based on (10), the adaptive law of \(\mathbf{W}\) is determined to minimize the system error.