# Dual PID Adaptive Variable Impedance Constant Force Control for Grinding Robot
## 2 Modeling of Grinding System and Suppression of Contact Force Overshoot  
A grinding robot system is established, as shown in Figure 1. A 7-Axis Franka Emika Panda robot is used; a Dynpick 6-Dof force sensor (Type: WEF-6A200-4-RC24, the force measurement range is \(\pm\)200 N and the moment measurement range is \(\pm\)4 Nm. Manufacturer: WACOH-TECH. City: Tokyo. Country: Japan. ), an analog IO module (Type: NET6043-S, 8-Channel 0-10V analog input module with resolution of 16-Bit. Manufacturer: HKTECH. City: Zhengzhou. Country: China.) and a grinding tool are installed at the end of the robot. As shown in Figure 2, with the robot and the workpiece set as a spring-damp-mass system, the contact process between the robot and the workpiece can be divided into three stages [50]. Figure 2a shows that the robot does not have contact with the workpiece, and Figure 2b shows the critical point of contact between the robot and the workpiece; the contact force is 0 N, and Figure 2c shows the full contact between the robot and the workpiece. In Figure 2d, From 0 to \(t_{1}\) the contact force between the robot and the environment is 0. From \(t_{1}\) to \(t_{2}\), after a collision process, the contact force tends to be stable, but the collision process is short and nonlinear. Figure 1: Robot grinding force control system. Figure 2: Contact behavior between robot and external environment. (**a**) No contact. (**b**) Critical point of contact. (**c**) The contact state. (**d**) The contact force during the contact process. From Figure 2d, it can be found that the oscillation of the robot from the free state to the contact state is inevitable. Smooth adjustment of the robot grinding force will improve the stability and grinding quality. According to the design principle of ADRC, a nonlinear tracking differentiator (NTD) is used to smooth the step signal of the desired force signal in the transition stage. The control mode is shown in Figure 3.  
Consider a two-order integrator series system:  
\[\left\{ \begin{array}{l}\dot{x}_{1}=x_{2}\\ \dot{x}_{2}=u,|u|\leqslant r\end{array} \right. \tag{1}\]  
where \(x_{1}\) is the target transition signal, \(x_{2}\) is the differential signal of the transition signal, \(r\) is the model parameter, and \(r>0\). If the control rate of the control parameter \(u\) is set as a nonlinear function, a nonlinear tracking differentiator can be obtained:  
\[u(x_{1},x_{2})=-r\,\text{sign}\bigg{(}x_{1}+\frac{x_{2}|x_{2}|}{2r}\bigg{)} \tag{2}\]  
Considering that the control period of the grinding robot is 1 ms, NTD in discrete form is adopted:  
\[\left\{ \begin{array}{l}\text{fh }=\text{ }\text{flan }(x_{1}(k)-v_{0}(t),x_{2}(k),r,h)\\ x_{1}(k+1)=x_{1}(k)+t_{s}x_{2}(k)\\ x_{2}(k+1)=x_{2}(k)+t_{s}\text{fln}\end{array} \right. \tag{3}\]  
where \(t_{s}\) is sampling time. The final function is as follows:  
\[\left\{ \begin{array}{l}d=rh^{2}\\ a_{0}=hx_{2}\\ y=x_{1}+a_{0}\\ a_{1}=\sqrt{d(d+8|y|)}\\ a_{2}=a_{0}+\text{sign}(y)(a_{1}-d)/2\\ a=(a_{0}+y)\,\text{f}\text{g}(y,d)+a_{2}(1-\text{f}\text{g}(y,d))\\ \text{flan }=-r\big{(}\frac{d}{d}\big{)}\,\text{f}\text{g}(a,d)-r\,\text{ sign}(a)(1-\text{f}\text{g}(a,d))\end{array} \right. \tag{4}\]  
where \(\text{f}\text{g}(x,d)=(\text{sign}(x+d)-\text{sign}(x-d))/2\), \(h\) is the filter factor, and \(h\) is slightly larger than the sampling time \(t_{s}\). To verify the NTD smoothing effect, we set the parameters of the impedance controller to \(m=1\) kg, \(b=50\) N\(/\)(m/s), and \(k=50\) N\(/\)m. The external environment stiffness was set to 2000 N\(/\)m. In NTD, \(r=500,h=0.01\), and the simulation time was 4 s. In Figure 4a, the 0-2 s desired force is \(-3\) N, and the 2-4 s desired force is \(-5\) N. In Figure 4b, after NTD smoothing, the overshoot of the force is significantly reduced.