## 4 Improved Control Method
### Compound Disturbance Compensation Controller  
The compound disturbance compensation controller consists of two parts: a feedforward compensation part, which is based on the major disturbance model, and a residual disturbance observer based on the nonlinear disturbance observer (NDOB). For the electromechanical system that includes the harmonic drive, friction nonlinearity \(F_{f}(t)\) is the main disturbance in \(F_{m}(t)\). It is the sum of the friction at the rotor end, friction in the harmonic drive, and friction at the load end that has a direct influence on the velocity loop. The effective method to reduce the nonlinear friction negative effect is the friction feedback compensation based on the model. We use the arctangent function and the viscous model to describe the nonlinear friction, which is continuous and derivable [8].  
\[\begin{cases}F_{f}(t)=A_{c1}\arctan(\gamma V_{in}(t))/\pi+K_{v1}V_{in}(t),\ V_{in}(t) \geq 0\\ F_{f}(t)=A_{c2}\arctan(\gamma V_{in}(t))/\pi+K_{v2}V_{in}(t),\ V_{in}(t)<0\\ \end{cases} \tag{42}\]  
\(\gamma\) is used as a large constant, \(V_{in}(t)\) denotes the angular velocity, and \(A_{c1}\) and \(A_{c2}\) denote the positive and negative coulomb friction magnitudes, respectively. \(K_{v1}\) and \(K_{v2}\) denote the viscous friction magnitudes in the positive and negative direction, respectively. In this study, the friction feedforward compensation method is used, which is from the command of the control system.  
For the analysis above, the total disturbance compensation based on the friction feedforward and the residual disturbance observer is as follows,  
\[u_{o}(t)=F_{f}(t)+\hat{\tau}_{d}(t) \tag{43}\]  
where \(F_{f}(t)\) is obtained by Equation (42). We also use the angular velocity command \(r_{v}(t)\) instead of \(V_{in}(t)\), where \(\hat{\tau}_{d}(t)\) is the estimation of \(\tau_{d}(t)\) and \(\tau_{d}(t)\) is the residual disturbance after the friction feedforward compensation.  
\[\tau_{d}(t)=F_{m}(t)-F_{f}(t) \tag{44}\]  
Assuming that the friction feedforward compensation \(F_{f}(t)\) negates the main disturbance, the dynamics model (13) can be described as follows,  
\[\mathbf{J}\ddot{\Theta}(t)+\mathbf{B}\dot{\Theta}(t)+\mathbf{K}\Theta(t)= \mathbf{p}(t)-\mathbf{d}(t) \tag{45}\]  
where \(\mathbf{d}(t)=[0\ \tau_{d}(t)\ N\tau_{d}(t)]^{T}\) represents the residual disturbance vector. An NDOB can be designed by using the known dynamics model of a SISP as follows [40],  
\[\mathbf{\hat{d}}(t)=\mathbf{z}(t)-L\dot{\Theta}(t) \tag{46}\]  
where \(\mathbf{\hat{d}}(t)=[0\ \hat{\tau}_{d}(t)\ N\hat{\tau}_{d}(t)]^{T}\) is the estimation vector of \(\mathbf{d}(t)\), \(L\) is the NDOB gain, and \(\mathbf{z}(t)\) represents the auxiliary vector, which can be determined from the following expression.  
\[\dot{\mathbf{z}}(t)=L\mathbf{J}^{-1}(\mathbf{p}(t)-\mathbf{B}\dot{\Theta}(t) -\mathbf{K}\Theta(t)-\mathbf{\hat{d}}(t)) \tag{47}\]  
\(L\) is selected in the trade-off between the disturbance compensation and noise sensitivity. The larger the parameter is, the stronger the anti-disturbance ability is. However, the influence of noise is more significant in the real system. Therefore, we can adjust this parameter according to the bandwidth of the sensor and the system requirements.