## 2 Methods  
### Real-Time Joint Stiffness Configuration Strategy  
The working environment of the robot can be divided into two kinds: working alone away from human bodies and working in the human-robot interaction environment. When the robot works far away from the human body, its movement will not cause subsequent harm, so the accuracy of the robot should be guaranteed when the robot performs tasks such as grasping or placing. When the robot works in the human-robot interaction environment, there is a risk of accidental collision with the human body, so it is necessary to take prevention and protection strategies to prevent the human body from being injured. According to the research of [PERSON] et al. [23; 24] on the collision data between cooperative robot and human bodies, the pain threshold of each part of the human body is about 150 N. When the human body feels pain, the energy transfer during human-robot collision [19; 20] is as follows:  
\[E=\frac{F_{c}^{2}}{2K}=\frac{1}{2}m_{T}v_{R}^{2} \tag{1}\]  
where, \(F_{c}\) is the force on the human body in human-robot collision; \(K\) is the stiffness of the human robot contact surface; \(m_{T}\) is the converted mass of the whole system in human-robot collision; \(v_{R}\) is the relative motion speed of the human and the robot, and the unit is m/s. \[m_{T}=\left(\frac{1}{m_{H}}+\frac{1}{m_{R}}\right)^{-1} \tag{2}\]  
where, \(m_{H}\) is the effective mass of human body, \(m_{R}\) is the effective mass of the humanoid manipulator. [PERSON] et al. [28] and others put forward the manipulator safety index (MSI), which is used to predict the injury of human-robot collision. The Equation is as follows:  
\[\text{MSI}=\Delta T\bigg{[}\frac{2}{g\Delta T}\bigg{(}\frac{m_{R}}{m_{R}+m_{ H}}\bigg{)}v_{R}A\bigg{]}^{2.5} \tag{3}\]  
where  
\[A=\left\{ \begin{array}{ll}\sin(w_{n}\frac{\Delta T}{2})&\text{if}\Delta T< \frac{T_{c}}{2}\\ 1&\text{if}\Delta T\geq\frac{T_{c}}{2}\end{array} \right. \tag{4}\]  
In addition, \(\Delta T\) is the time interval, and \(\Delta T\) is fixed as either 15 or 36 ms, and \(T_{c}\) is the duration of the collision, \(T_{c}=2\pi/w_{n}\); \(A\) and \(w_{n}\) are constants, and \(w_{n}=\sqrt{\frac{m_{R}+m_{H}}{m_{B}m_{H}}}K\); \(K\) is the same as in Equation (1). It can be seen that in human-robot collision, whether considering the pain threshold of the human body or the manipulator safety index, the safety of human body is related to the comprehensive surface contact stiffness \(K\) and the relative velocity \(v_{R}\) of human and robot. The larger the comprehensive surface contact stiffness \(K\) and the relative velocity \(v_{R}\), the greater the force of human-robot collision, and vice versa. Similarly, we know that the larger the comprehensive surface contact stiffness \(K\) and the relative velocity \(v_{R}\) in human-robot collision, the shorter the collision time. In order to reduce human injury in human-robot collision, it is necessary to increase the buffer time in collision. Therefore, the smaller the comprehensive surface contact stiffness \(K\) and the relative velocity \(v_{R}\) are, the safer the human body is. Thus, in the continuous motion of the robot, we can protect the human body from being injured in the human-robot collision by optimizing the comprehensive surface contact stiffness \(K\) and the relative velocity \(v_{R}\). In this case, both conditions are satisfied at the same time, that is, the force of the human-robot collision is not higher than the human bodyinjury thresholds, and the safety index MSI is less than \(\text{MSI}_{\text{max}}\). The conditional equation is as follows:  
\[\left\{ \begin{array}{l}F_{\epsilon}=\sqrt{Km_{T}v_{R}^{2}}\leq F_{\text{max}} \\ \text{MSI}\leq\text{MSI}_{\text{max}}\end{array} \right. \tag{5}\]  
where \(F_{\text{max}}\) is the maximum force that human can bear when human body is not injured in human-robot collision, \(F_{\text{max}}=150\)N; \(\text{MSI}_{\text{max}}\) is the maximum of the safety index, and \(\text{MSI}_{\text{max}}=10\).