Add External Force/Torque to UR3 robot

Typically: "How do I... ", "How can I... " questions
Post Reply
boyuchenuob
Posts: 10
Joined: 17 Apr 2023, 10:49

Add External Force/Torque to UR3 robot

Post by boyuchenuob »

Hi,

I am attempting to simulate applying external force to the end-effector of UR3 robot. For this task, I've employed the sim.addForceAndTorque function, and applied the torque specifically to the z-axis of the robot's last link, all the while keeping the robot in the position dynamic mode.

However, I've encountered an intriguing phenomenon for which I can't figure out the cause. When I set the torque value to 10, the robot begins to revolve at a consistent angular speed. However, if the value is less than 10, the robot remains stationary, whereas, when the value is greater than 10, the robot's speed of revolution increases progressively. I am wondering about the physics settings underlying this behaviour. And does this phenomenon mirror the real-world scenarios?

I have attached the script I used in the child script. Looking for an explanation. Thank you very much.

Kind regards,
Boyu

Code: Select all

function sysCall_init()
    connectionHandle = sim.getObject('/UR3/connection')
    link6Handle = sim.getObject('/UR3/link6')

end

function sysCall_cleanup()

end

function sysCall_actuation()

    local force = {0, 0, 0} 
    local torque = {0, 0, 10} 
    sim.addForceAndTorque(link6Handle, force, torque)
    
    -- Get the force sensor measurements
    local result, forceVector, torqueVector = sim.readForceSensor(connectionHandle)
    
    if result > 0 then
        print("Force: ", table.unpack(forceVector))
        print("Torque: ", table.unpack(torqueVector))
    else
        print('No contact force')
    end
    
end

boyuchenuob
Posts: 10
Joined: 17 Apr 2023, 10:49

Re: Add External Force/Torque to UR3 robot

Post by boyuchenuob »

Hi,

Further to my question. I realized that the phenomenon is because I set the motor to dynamic position mode, in which the lower-level robot controller could resist a certain amount of external force/torque.

For my task, I would like to make the robot only react to the external force while compensating the effect of gravity. To achieve this, I believe that the robot joint should be set to dynamic force mode. I am also aware that it requires inverse dynamics calculation, which is very problematic. I am wondering if there is any demo or simply way to do that? Please give me a hand. Thank you.

Kind regards,
Boyu

coppelia
Site Admin
Posts: 10336
Joined: 14 Dec 2012, 00:25

Re: Add External Force/Torque to UR3 robot

Post by coppelia »

Hello,

force/torque control indeed required inverse dynamics. It is used internally, but not exposed.
Maybe have also a look at this page, which offers some resources in that direction (even if based on an old version of CoppeliaSim).

Cheers

boyuchenuob
Posts: 10
Joined: 17 Apr 2023, 10:49

Re: Add External Force/Torque to UR3 robot

Post by boyuchenuob »

Hi,

Thank you for the reply.

Could you please send the link for the webpage again? I could not see it in the chat box.

Cheers.

Kind regards,
Boyu

coppelia
Site Admin
Posts: 10336
Joined: 14 Dec 2012, 00:25

Re: Add External Force/Torque to UR3 robot

Post by coppelia »

Sorry, forgot this link

Cheers

Post Reply