# Leveling Control of Hillside Tractor Body Based on Fuzzy Sliding Mode Variable Structure
## 3 Leveling System Model and Controller Design  
### Construction of Mathematical Model of Body Leveling Hydraulic System  
The electro-hydraulic servo system of the proposed hillside tractor auto-leveling mechanism is a four-way-valve-controlled asymmetric hydraulic-cylinder position tracking system. Considering the internal and external leakage of the system, the control principles of the four leveling cylinders can be set to be identical, and a power model of the left rear leveling cylinder system can be expressed using the following three equations.  
Valve flow equation,  
\[q_{L}=k_{q}x_{v}-k_{e}p_{L} \tag{3}\]  
where \(k_{q}\) is the flow gain of the valve, m\({}^{2}\)/s; \(k_{e}\) is the flow pressure coefficient, m\({}^{3}\)/(s\(\cdot\)Pa); \(x_{v}\) is the valve core displacement, m, and \(p_{L}\) is the load pressure, N.  
Flow equation of the hydraulic cylinder,  
\[q_{L}=q_{1}=A_{1}\dot{y}+\frac{V_{t}}{4\beta_{e}}\dot{p}_{L}+C_{lp}p_{L}+C_{f} p_{s} \tag{4}\]  
where \(q_{1}\) is the flow rate of the rodless chamber of the hydraulic rod, m\({}^{3}\)/s, \(A_{1}\) is the area of the rodless chamber of the hydraulic cylinder, m\({}^{2}\), \(y\) is the displacement of the hydraulic rod piston, m, \(\beta_{e}\) is the equivalent elastic modulus of the oil, N/m\({}^{2}\), \(V_{t}\) is the total effective volume of the hydraulic cylinder, m\({}^{3}\), \(C_{lp}\) is the total effective leakage coefficient, and \(C_{f}\) is the total additional leakage coefficient.  
Force balance equation of the hydraulic rod,  
\[A_{1}p_{1}-A_{2}p_{2}=m\ddot{y}+B_{p}\dot{y}+ky+F_{L} \tag{5}\]  
where \(A_{2}\) is the rod chamber area of the hydraulic cylinder, m\({}^{2}\), \(m\) is the mass of the piston and the load converted to the piston, kg, \(B_{p}\) is the viscous damping coefficient of the piston rod and the load, N\(\cdot\)s/m, \(k\) is the spring stiffness for the load, N/m, and \(F_{L}\) is an arbitrary load force, N.  
The dynamic characteristics of the valve-controlled hydraulic cylinder can be completely described using these three basic equations. By applying Laplace transformation and derivation simplification, the transfer function of the displacement of the leveling hydraulic cylinder \(Y(s)\) and the displacement of the proportional valve spool \(X_{v}(s)\) is,  
\[G_{4}(s)=\frac{Y(s)}{X_{v}(s)}=\frac{\frac{k_{q}}{\lambda_{1}}}{s(\frac{1}{w_ {h}^{2}}s^{2}+\frac{2k_{h}}{w_{h}}s+1)} \tag{6}\]  
where \(\zeta_{h}\) is the system damping ratio and \(\omega_{h}\) is the natural frequency of the system.  
The state equation of the system must be considered in designing a fuzzy sliding mode controller. For a system with input signals \(r\) and output signals \(y\), the deviation of the system will be \(e=r-y\), and the error vector of the system can be defined as,  
\[E=\begin{bmatrix}e_{1}&e_{2}&e_{3}\end{bmatrix}^{T}=\begin{bmatrix}r-y&\dot{ r}-\dot{y}&\ddot{r}-\ddot{y}\end{bmatrix}^{T} \tag{7}\]  
According to the system model state space equation,  
\[\left\{\begin{array}{l}y=x_{1}\\ \dot{x}_{1}=x_{2}\\ \dot{x}_{2}=x_{3}\\ \dot{x}_{3}=-w_{h}^{2}x_{2}-2\zeta_{h}w_{h}x_{3}+K_{h}w_{h}^{2}u\\ \end{array}\right. \tag{8}\] \[\left\{\begin{array}{l}y=x_{1}\\ \dot{x}_{1}=x_{2}\\ \dot{x}_{2}=x_{3}\\ \dot{x}_{3}=-w_{h}^{2}x_{2}-2\zeta_{h}w_{h}x_{3}+K_{h}w_{h}^{2}u\\ \end{array}\right.\]The error state equation can be written as,  
\[\dot{E}=\begin{bmatrix}0&1&0\\ 0&0&1\\ 0&-w_{h}^{2}&-2\xi_{h}w_{h}\end{bmatrix}E+\begin{bmatrix}0\\ 0\\ K_{h}w_{h}^{2}\end{bmatrix}u+\begin{bmatrix}0\\ 0\\ \ddot{r}+2\xi_{h}w_{h}\ddot{r}+w_{h}^{2}r\end{bmatrix} \tag{9}\]