# Dual PID Adaptive Variable Impedance Constant Force Control for Grinding Robot
## 3 Position-Based Adaptive Impedance Control
### Stability and Convergence Analysis  
To ensure the stability of the controller, the steady-state error of the force tracking converges to zero. Here is the proof. Substituting Equation (19) into Equation (18):  
\[k_{p}\Delta f(t)+k_{d}\Delta\dot{f}(t)=m\ddot{\bar{e}}(t)+b\dot{\dot{e}}(t)+b \Gamma(t-t_{s})-\sigma\bigg{(}\Delta f(t-t_{s})+\Delta\dot{f}(t-t_{s})+k_{i} \int_{0}^{t-t_{s}}\Delta f(\tau)d\tau\bigg{)} \tag{21}\]  
\[\text{Let }\hat{e}=e+\delta\dot{x}_{e},\Delta f(t)=f_{e}(t)-f_{d}(t),\]  
\[k_{p}(f_{e}(t)-f_{d}(t))+k_{d}\big{(}\dot{f}_{e}(t)-\dot{f}_{d}(t)\big{)}=m \big{(}\ddot{e}(t)+\delta\dot{x}_{e}(t)\big{)}+b\big{(}\dot{e}(t)+\delta\dot{ x}_{e}(t)\big{)}+b\Gamma(t-t_{s})-\]  
\[\sigma\bigg{(}\Delta f(t-t_{s})+\Delta\dot{f}(t-t_{s})+k_{i}\int_{0}^{t-t_{s} }\Delta f(\tau)d\tau\bigg{)}\]  
\[\text{where }e=x_{z}-x_{e},f_{e}=k_{e}(x_{e}-x_{z})=-k_{e}e,\dot{e}=-\frac{\dot{f}_{ e}}{k_{e}},\ddot{e}=-\frac{\ddot{f}_{e}}{k_{e}}.\]  
\[-m\frac{\ddot{f}_{e}(t)}{k_{e}}-b\frac{\dot{f}_{e}(t)}{k_{e}}+b\Gamma(t-t_{s}) -\sigma\bigg{(}\Delta f(t-t_{s})+\Delta\dot{f}(t-t_{s})+k_{i}\int_{0}^{t-t_{s} }\Delta f(\tau)d\tau\bigg{)}-k_{p}(f_{e}(t)-f_{d}(t))-\]  
\[k_{d}\big{(}\dot{f}_{e}(t)-\dot{f}_{d}(t)\big{)}=-m\delta\dot{x}_{e}(t)-b \delta\dot{x}_{e}(t)\]  
\[\text{Let }\hat{f}_{e}(t)=k_{e}\delta x_{e}(t),\delta x_{e}(t)=\frac{\dot{f}_{e}(t) }{k_{e}},\delta\dot{x}_{e}(t)=\frac{\dot{f}_{e}(t)}{k_{e}},\delta\dot{x}_{e}(t )=\frac{\dot{f}_{e}(t)}{k_{e}},\]  
\[m\big{(}\ddot{f}_{d}(t)-\ddot{f}_{e}(t)\big{)}+b\big{(}\dot{f}_{d}(t)-\dot{f} _{e}(t)\big{)}+k_{e}b\Gamma(t-t_{s})-\sigma k_{e}\bigg{(}\Delta f(t-t_{s})+ \Delta\dot{f}(t-t_{s})+k_{i}\int_{0}^{t-t_{s}}\Delta f(\tau)d\tau\bigg{)}-\]  
\[k_{p}k_{e}(f_{e}(t)-f_{d}(t))-k_{d}k_{e}\big{(}\dot{f}_{e}(t)-\dot{f}_{d}(t) \big{)}=m\Big{(}\ddot{f}_{d}(t)-\ddot{\bar{f}}_{e}(t)\Big{)}+b\Big{(}\dot{f}_{ d}(t)-\dot{\bar{f}}_{e}(t)\Big{)}\]  
\[\text{Let }\hat{e}=e+\delta\dot{x}_{e},\Delta f(t)=f_{e}(t)-f_{d}(t),\]0  
\[\text{Let }\hat{e}=e+\delta\dot{x}_{e},\Delta f(t)=f_{e}(t)-f_{d}(t),\]1  
\[\text{Let }\hat{e}=e+\delta\dot{x}_{e},\Delta f(t)=f_{e}(t)-f_{d}(t),\]2  
According to the dispersion principle, the \(n\)-th element in \(\Gamma\) can be expressed as:  
\[\text{Let }\hat{e}=e+\delta\dot{x}_{e},\Delta f(t)=f_{e}(t)-f_{d}(t),\]3  
\[\text{Let }\hat{e}=e+\delta\dot{x}_{e},\Delta f(t)=f_{e}(t)-f_{d}(t),\]4  
The characteristic equation in Equation (27) is:  
\[\text{Let }\hat{e}=e+\delta\dot{x}_{e},\Delta f(t)=f_{e}(t)-f_{d}(t),\]5Supposing \(n\) is large enough, it can be represented as \(\sum\limits_{n=1}^{\infty}e^{-nt_{s}s}=\frac{e^{-tss}}{1-e^{-tss}}\). Furthermore, when the sampling time \(t_{s}\) is small enough, Taylor expansion is used so that \(e^{-tss}\approx 1-t_{s}s\). The system characteristic Equation (28) is simplified as:  
\[\text{Let }\hat{e}=e+\delta\dot{x}_{e},\Delta f(t)=f_{e}(t)-f_{d}(t),\]6  
The Routh table is obtained according to Routh criterion:  
\[ \begin{array}{rl}s^{3}&t_{s}(m-\sigma k_{e}t_{s})\\ s^{2}&t_{s}(b+k_{d}k_{e}+\sigma k_{e})\\ s^{1}&\frac{k_{e}t_{s}\big{(}k_{p}-\sigma\big{)}(b+k_{d}k_{e}+\sigma k_{e})- \sigma k_{e}(m-\sigma k_{e}t_{s})(1+t_{s}k_{i})}{(b+k_{d}k_{e}+\sigma k_{e})} &0\\ s^{0}&\sigma k_{e}+\sigma k_{e}t_{s}k_{i}&0\end{array}  \tag{30}\]  
Then, the sufficient and necessary condition for the stability of the system is that all coefficients of the characteristic equation are positive and the first column of the Routh table is positive, so:  
\[\left\{ \begin{array}{rl}t_{s}(m-\sigma k_{e}t_{s})>0\\ \frac{k_{e}t_{s}\big{(}k_{p}-\sigma\big{)}(b+k_{d}k_{e}+\sigma k_{e})-\sigma k _{e}(m-\sigma k_{e}t_{s})(1+t_{s}k_{i})}{(b+k_{d}k_{e}+\sigma k_{e})}>0\\ t_{s}\big{(}k_{p}k_{e}-\sigma k_{e}\big{)}>0\\ \sigma k_{e}+\sigma k_{e}t_{s}k_{i}>0\end{array} \right. \tag{31}\]  
If the controller parameters are within the range given by Equation (31), the system is stable, and for stable systems, the steady-state error \(e_{ss}\) can be obtained.