## 2 Materials and Methods
### Design of the Variable-Parameter Sliding Mode Position Controller  
A control block diagram of the position, speed, and current three-loop control system is shown in Figure 3. Taking the PMSM as an example, the \(i_{4}=0\) control strategy is adopted. The main purpose of this paper is to investigate the robustness of the sliding mode position controller (outer loop) to parameter variations. To achieve this, it is necessary to ensure that the inner loops are minimally affected by parameter changes, thereby eliminating their influence on the robustness of the system's position control. Therefore, a fuzzy logic controller, known for its strong robustness and fast dynamic response, is employed in the speed loop. Figure 1: The remote conductivity control system of the fertigation machine. In the dq coordinate system, the mathematical model of the PMSM is shown in Equation (1), which describes the dynamic behavior of the motor in terms of stator voltages, currents, and rotor position. This model is based on the commonly adopted formulation presented in [32], which provides a detailed derivation of PMSM dynamics under field-oriented control assumptions. \[ \begin{array}{l}u_{d}=R_{s}(i_{d}^{*}-i_{d})+L_{d}\frac{\mathrm{d}(i_{d}^{*}-i_ {d})}{\mathrm{d}t}-\omega_{r}L_{q}(i_{q}^{*}-i_{q})\\ u_{q}=R_{s}(i_{q}^{*}-i_{q})+L_{q}\frac{\mathrm{d}(i_{q}^{*}-i_{d})}{\mathrm{d}t }+\omega_{r}L_{d}(i_{d}^{*}-i_{d})+\omega_{r}\psi_{f}\\ T_{e}=\frac{3}{2}p(\psi_{f}i_{q}+(L_{d}-L_{q})i_{d}i_{q}]\\ \int\frac{\mathrm{d}\omega_{r}}{\mathrm{d}t}=T_{e}-T_{L}-B_{m}\omega_{m}-T_{f} \mathrm{sgn}(\omega_{m})\\ \omega_{e}=\mathrm{d}\theta/\mathrm{d}t\end{array}  \tag{1}\]  
Figure 3: The closed-loop control system diagram. (SPMSM: surface permanent magnet synchronous motor). Note: id and \(\mathrm{iq}^{*}\) denote the reference (command) values for d-axis and q-axis currents, generated by outer-loop controllers (e.g., speed loop), to regulate motor torque and field orientation. Figure 2: Implementation diagram of remote conductivity control system for integrated water and fertilizer machine (APP: mobile application and PLC: programmable logic controller). In the equation, \(u_{q}\) and \(u_{d}\) represent the quadrature and direct-axis components of the stator voltage, respectively; \(i_{q}\) and \(i_{d}\) represent the quadrature and direct-axis components of the stator current, respectively; \(i_{q}\) and \(i_{d}\) represent the reference values of the d-axis and q-axis currents, respectively; \(L_{d}\) and \(L_{q}\) represent the direct and quadrature synchronous inductances, respectively; \(Rs\) is the stator winding resistance; \(\omega_{r}\) is the electrical angular velocity; \(\omega_{m}\) is the mechanical angular velocity, where \(\omega_{r}=p^{\alpha}\omega_{m}\) and \(p\) is the pole pair number; \(\psi_{f}\) is the excitation flux of the permanent magnet; \(B_{m}\) is the viscous friction coefficient; \(\theta\) is the mechanical position angle of the motor rotor; \(j\) is the system's moment of inertia; \(T_{e}\) is the electromagnetic torque; \(T_{L}\) is the load torque; and \(T_{f}\) is the friction torque. The state variables of the PMSM system are selected as follows:  
\[\left\{ \begin{array}{l}x_{1}=\theta_{\text{ref}}-\theta\\ x_{2}=\dot{x}_{1}=\dot{\theta}_{\text{ini}}-\omega_{\text{m}}\end{array} \right. \tag{2}\]  
In the equation, \(\theta_{\text{ref}}\) is the position reference value and \(\theta_{\text{ini}}\) is the instantaneous position error, which is the difference between \(\theta_{\text{ref}}\) and \(\theta\) at the instant when the reference undergoes a step change. The sliding mode surface of the system is designed as follows:  
\[s=cx_{1}+x_{2}=0 \tag{3}\]  
In the equation, \(c\) is the sliding mode surface parameter, which is a positive constant. To enhance the quality of the reaching phase in sliding mode control, this paper adopts exponential reaching law, as follows:  
\[\dot{s}=-\varepsilon\text{sgn}(s)-qs \tag{4}\]  
In the equation, \(\varepsilon\) and \(q\) are positive constants.