If we close the loop on position, we have no control over force. If we close the loop on the force, we have no control over the position. So, how to achieve simultaneous control of position and force? Just like our human hands. Therefore, the concept of impedance control is born, that is, we use a position closed loop to control the end of the robotic arm, but the end has a certain stiffness and will show force characteristics when in contact with the outside world. This stiffness can be achieved through mechanical design, such as the flexible joint SEA. It can also be implemented from control algorithms, such as impedance/admittance control.

We collectively call it “impedance control”; generally, impedance control is a way to directly control force (current); admittance control is to control force by controlling position; whether it is impedance control or admittance control, the impedance characteristics can be adjusted. It’s just that impedance control cannot simulate high stiffness, and admittance control cannot simulate low stiffness. Moreover, this limitation does not come from theory, but is caused by different control quantities, errors and delays in sensor measurement in engineering.

Theoretical analysis: The contact between any objects can be equivalent to two “damping mass spring” models. For example, if a person cleans the glass, the spring stiffness K of the glass can be considered to be infinite (no elasticity). The human hand stiffness K needs to be relatively small (elastic), so that it can adapt to the glass surface and complete the wiping work; for another example, when cutting meat with a knife, the stiffness K of the meat can be considered to be very small, and the stiffness of the knife can be considered to be very large, so that let the meat change with the movement of the knife; in the real world, the stiffness of our contact with the outside world is often not fixed, but changes. For example, when shooting basketball, the hand is more flexible when it first touches the ball. Let the hand move with the ball, and then the hand will become rigid, allowing the ball to move with the hand. The control of this stiffness is the person’s active control of his own arm. We also hope that the robot will handle force control tasks when can have this ability to freely control stiffness. why is this “damped mass spring” model needed? When cleaning glass, wouldn’t it be enough to apply a constant force to the glass? Imagine what would happen if the robot arm applied a constant force F to a piece of glass and then suddenly removed the glass?

Obviously, the manipulator will lose control and move in the direction of F at the fastest speed; but with the “damping mass spring (BMK)” model, when the three parameters of MBK are properly adjusted, the manipulator will return with smooth movement. The origin of the virtual spring; in this case, we control the contact between the manipulator and the environment by controlling four parameters at the end of the manipulator: virtual mass M, virtual damping B, virtual stiffness K, virtual spring origin x0; control this With four parameters, we can make the robotic arm present various force characteristics to the outside world to meet the needs of polishing, precision assembly, collaborative interaction, etc.

Now our goal is clear. We need to design a BMK model to control the robotic arm. What to do next? Woolen cloth? Let’s analyze it according to Figure 9-6, where f is the external force applied to the system, xdot is the velocity, and xdotdot is the acceleration. This is a typical second-order system. The following formula describes the motion of the system:

That is, given the known MBK and the measured external force, speed, and position, we can find the current required acceleration; this acceleration is the quantity we want to control; then how to control the acceleration? Since we are a discrete system, we get the position by integrating xd twice.

Therefore, in the end we can realize this model by controlling the position It is reasonable; then since the position x must be controlled in the end, why not directly convert the formula into a position expression at the beginning? Because there is an acceleration term in the expression of the position, the acceleration term needs to be measured. Usually, the position information in the servo system is obtained by the encoder, And the encoder can only obtain position feedback, And its speed feedback is through the differentiation of the position. is obtained, And the acceleration is obtained by differentiating the velocity. At this time, due to two differentials, the obtained acceleration information is often very noisy and is not suitable for use. It can be seen that our method, in fact, is controlled by the force is controlled by position, commonly known as “admittance control”; in fact, there is another commonly used method, which is to directly control the force, commonly known as “impedance control”, but this requires feedback from the joint force sensor and dynamic construction. The module needs to be able to directly control the current loop of the servo driver, and the implementation cost is relatively high, which will not be described here.

## one example:

The controller’s position loop program has a 3ms period and includes an admittance control module

The admittance control module is as follows:

//x-axis admittance model xdd = (fx0 - Bx*vx_now - Kx*(xnow-xbase))/Mx; //Integrate acceleration to get velocity xd = xd + xdd; //y-axis admittance model ydd = (fy0 - By*vy_now - Ky*(ynow-ybase))/My; //Integrate acceleration to get velocity yd = yd + ydd; //Include the position offset of the admittance model to obtain the new x-axis and y-axis position xt = xd + xnow; yt = yd + ynow;

Calculate the admittance model of the x and y axes respectively, and update the position offset to the new target position.

Among them, fx0 is the external force in the x-axis direction in the Cartesian coordinate system, Bx is the damping value in the x-axis direction, vx_now is the instantaneous speed of the end in the x-axis direction, Kx is the stiffness in the x-axis direction, xnow is the end in the x-axis Instantaneous position, xbase is the virtual impedance origin of the x-axis, and Mx is the mass value in the x-axis direction.

The acceleration is calculated through the admittance model. Since this module is in the same period as the position loop, in discrete mathematics, the integral can be simplified to addition (similar to PID, if you don’t understand, you can Baidu it yourself)

So, how to get fx0? I used a six-dimensional force sensor at the end and performed coordinate transformation on the force on the sensor to obtain the external forces fx0 and fy0 on the x-axis and y-axis.

How to get vx_now? First, the joint speed is obtained from the driver, and through the Jacobian transformation, the end x-axis and y-axis speeds are obtained.

How to get xnow? First, the joint position is obtained from the driver, and through forward kinematics calculation, the x and y axis positions of the end are obtained.

So, something like this:

We assume that the end of the manipulator is a damped mass spring system. When an external force acts, we use the model to calculate what the acceleration, velocity, and position of this virtual MBK system should be. Finally, simulate an MBK system by directly tampering with the position ring.

Moreover, you can see that the MBK system for the x and y axes is decoupled and calculated independently. Since my experimental manipulator only has the ability to move in the xy-axis plane, only the x and y axes are considered. A general six-degree-of-freedom manipulator should have six degrees of freedom for x, y, z, rx, ry, and rz respectively. MBK decoupling with several degrees of freedom.