Force controlled surface following trouble

Hello,

We are trying to program a UR20 robot to perform a surface-following task on a slightly curved surface. To achieve this, we programmed the robot to follow a zig-zag pattern:

→ → → → →↓
↓← ← ← ← ←
→ → → → →↓
↓← ← ← ← ←
→ → → → →

We defined a tool frame where the z-axis is perpendicular to the surface being followed, and the x-axis is aligned with the tool’s motion. To maintain alignment between the tool and the surface, we use force/torque control on the Fz, Rx, and Ry components with the following targets:

  • Fz → 25 N
  • Rx → 0 Nm
  • Ry → 0 Nm

We use the following polytope program:
https://i.postimg.cc/9rr87qZF/Screenshot-from-2025-05-12-14-33-01.png

We adjusted the speed limits to 125 mm/s and 2 degrees/s.

The application involves significant friction, and the system has limited passive compliance. While we understand that this is a challenging control task, we have observed some unexpected behavior in the data from the /force_torque_sensor_broadcaster/wrench topic from the ROS 2 driver.

1) As an initial test, we wanted to verify whether gravity compensation is working correctly. For this, we examined the wrench data while the robot is out of contact.
https://i.postimg.cc/jLm8Qd46/home-force-mode.png

In this plot, the robot first moves to the home position, after which it enters force mode to align the tool with the surface. Throughout this sequence, the tool does not make contact. During the “home” phase, the external force is approximately zero, as expected. However, in the “force mode” phase, a force of around 4 N is observed. Although the tool moves slightly, we don’t believe this alone explains the force due to inertial effects. Is there another possible explanation for this non-zero force?

2) The following figure shows the wrench measurements for the controlled forces (left means the robot is moving left, and right means it is moving right):

In the top plot, the z-component of the contact force is shown. It generally tracks the target value of 25 N with acceptable accuracy. However, during direction changes, we observe some vibration-like behavior. What measures can we take to eliminate or at least reduce this effect? Additionally, we occasionally see the force becoming positive, indicating a pulling contact force toward the surface. How can this be explained?

As for the torques, the torque around the y-axis struggles to reach its target value. It appears to change sign when the motion direction changes. There appears to be no evident control action to enforce the desired torque in this component. What could be the reason for this, and is there anything we can do to improve it?

Thank you very much in advance. I look forward to your insights.

Kind regards,
Lander