## 3 Adaptive Fuzzy Controller for the Hydraulic Manipulator
### Adaptive Fuzzy Logic System  
In practice, the manipulator works under the presence of payload variation, uncertainties, or unmodeled parameters that affect the dynamic manipulator. The controller normally is structured so that the manipulator can work stably within a permissible range. Out of this range, the system is unstable. This issue can be solved by using the high gain method with the large value of feedback gains which will cover the range of the uncertainties. In this way, for instance, disturbances or noise is amplified as well, or the chattering phenomenon appears [52] that make robot oscillate during the working process, degrades the performance of the system, and may lead to instability. Then to obtain accurate tracking performance and satisfy the work condition, the fuzzy logic control whose rules depended on the control objective is designed. First, to reflect the effect of the payload, let us rewrite the Equation (21):  
\[x_{3d}=J(x_{1})^{-1}\Big{(}C_{0}(x_{1},x_{2})x_{2s}+G_{0}(x_{1})+M_{0}(x_{1}) \dot{x}_{2s}-K_{1}^{*}s_{1}-\eta\text{sign}(s_{1})\Big{)} \tag{36}\]  
where \(K_{1}^{*}=K_{1}+K_{m}\), and \(K_{m}\) are the positive definite matrices. \(K_{1}\) and \(\eta\) are adjusted based on the motion of the tracking error and its changing rate whereas \(K_{m}\) is directly depended on the payload attached at the end-effector so that the control signal can adopt the performance. The linguistic fuzzy rules are defined in the following form:  
\[ \begin{split}\text{IF }e(t)\text{ is }A_{1}^{i=1,2,\ldots,N}\text{ and }\dot{e}(t)\text{ is }A_{2}^{i=1,2,\ldots,N}\\ \text{THEN }K\text{ is }B^{i=1,2,\ldots,N}.\end{split}  \tag{37}\]  
where N is the total number of rules, \(K\) represents for the tuned gains feedback, \(A_{1,2}^{i}\) and \(B^{i}\) are the linguistic variables of the fuzzy sets characterized by fuzzy membership functions. The fuzzy control rules can be represented as the mapping of the input linguistic variables \(e(t)\) and \(\dot{e}(t)\) to the output linguistic variable \(K\). The input linguistic variable characterized by seven membership functions (NB (Negative Big), NM (Negative Medium), NS (Negative Small), Z (Zero), PS (Positive Small), PM (Positive Medium), PB (Positive Big)) are employed for the control strategy such that the stability of the system can be guaranteed as stable. The membership functions of the two input linguistic variables \(e(t)\) and \(\dot{e}(t)\) and the output linguistic variable \(K\) are described in Figures 5 and 6, (VVS (Very Very Small), VS (Very Small), S (Small), M (Medium), B (Big), VB (Very Big), VVB (Very Big)); the control strategy is described in Table 1[38]. In this study, triangular membership functions are considered as shown in Figures 5 and 6. The value of \(\eta\) is calculated as:  
\[\eta=K_{1}/1000 \tag{38}\]The second part of the fuzzy logic system is attached for adjusting gain to satisfy the changing of the payload. Based on the change in acceleration because of a sudden change in inertia, the torque induced on each link is changed, thus leading to the variation in the state error. Then, the scaling gains affected by the load torque is designed to adapt to the system working operation. \[K_{m}=Fuzzy(\text{payload}) \tag{39}\]  
Under the presence of the external load, the compensated torque generated by the secondary fuzzy logic system is attached to boost the control signal. In this research, we consider that the external payload attached to the end-effector will beget the external torque. The force then is identified by using a non-linear disturbance observer [41; 42]. Then we suggest a method to estimate the external payload for the compensator. In such a way that the trackability issue incurred from loading external mass is improved. The mass of the payload is assumed to be distributed in the interval from 4 to 50 kg. Then the load torque is observed and added to compensate the control input signal.