Universal Robots Forum

Force_mode / freedrive

Hi everyone,
I am testing the usage of force_mode via TCP connection using Python.
As you can see below I am sending this command to the robot with a wrench_task being a zero (1x6) vector. I would expect robot to stay stationary and behave like in a free drive mode.
The robot stays stationary for a few seconds but then very slowly starts changing its position.

Any suggestions on why such behavior takes place?

force_mode(task_frame=[0, 0, 0, 0, 0, 0], selection_vector=[1, 1, 1, 1, 1, 1],
                                wrench=list(wrench_task), f_type=2, limits=[2, 2, 1.5, 1, 1, 1])

Hi @RobotNoob,

Please make sure the payload and center of gravity(CoG) is configured correctly. On the e-Series you should make use of the zero_ftsensor() before enabling force mode.


1 Like

Thank you for your help :slight_smile:

@Ebbe @ajp

I am trying to implement a robot control method that uses force_mode but in real time.
I want to have a loop that calculates desired wrench with a timestep of 0.002 sec (500HZ) and to feed it into a force_mode in real time to change the position of the robot.
Can I use the force_mode command thats already implemented on the robot? or it doesnt allow for real-time update?

Hi @RobotNoob,

Yes, you can use the built in force_mode for that. I have attached a small sample for robot movement in force_mode
admittance_mode.script (949 Bytes) admittance_sample.urp (3.2 KB)

1 Like

Thank you very much, I have implemented something similar i.e. impedance control but via RTDE.
In my example, the robot.set_force_remote is a force_mode implementation but in RTDE.
I am running a while loop and solving the impedance equation which spits out the wrench in the next time step (125hz so dt=0.008)
The issue I have is that once I run the code, the force mode uses only the wrench obtained from the first iteration and is not being updated by the new values of the wrench at the following time steps, therefore robot instead of moving to the desired location, moves like it has only one value of wrench as an input.

Do you have any ideas why that could happen?