Articles Download Go to Main Site

Universal Robots A/S
Energivej 25
DK-5260 Odense S

T: +45 8993 8989
sales@universal-robots.com

 
  • Articles
  • Download
  • Forum
  • myUR
  • Go to Universal Robots Main Site
  • Support
  • Articles
  • URScript: Dynamic Force Control

URScript: Dynamic Force Control

Last modified on Dec 20, 2022

Example is valid for:                                              

CB2 Software version: 1.8.16941                          
CB3 Software version: 3.2.19293                         
Note that older or newer software versions may behave differently.

This example can be used for both CB2 and for CB3

 

All moves grouped under the FORCE wizard on the Polyscope, are bound by the force parameters specified in the force command. In order to control the force parameters dynamically at runtime you will have to get into UR scripting.

 

Scripting Syntax

The function to set the force is: 

force_mode(Feature, Compliance, Force, Type, Limits) 
where,

Feature is the reference frame,

Compliance defines the compliant axes,

Force specifies the force along each axes of the Feature, and

Limits specifies the position deviation limits for compliance all specified as poses shown in the example below.

Example:  

force_mode( tool_pose(), [0, 0, 1, 0, 0, 0], [0.0, 0.0, 10.0, 0.0, 0.0, 0.0], 2, [0.1, 0.1, 0.15, 0.17, 0.17, 0.17])

The Polyscope equivalent of the Force settings in the above example would look similar to the screen shot below.

Dfc1

In the above example,

Feature Frame is the Tool frame (tool_pose(): dropdown on top left in Polyscope) 

Compliant axis is Z-axis ([0, 0, 1, 0, 0, 0])   

Force is 10N along Z axis ([0, 0, 10.0, 0, 0, 0])

Type is 2 for Simple or Frame (1 for point, 3 for Motion) (dropdown on top right on Polyscope)

Limits is 100mm along x and y (because non-compliant) 150mm/s along z (because compliance added) and 10degrees about Rx, Ry and Rz (rotational twist)

In order to dynamically change the force you will need to change the Force variable. You would call this function as a thread when you want to get into Force mode and terminate it when you no longer want to run in force mode.

Example:

    thread Force_properties_calculation_thread_1():

      while (True):

        force_mode(tool_pose(), [0, 0, 1, 0, 0, 0], [0.0, 0.0, 10.0, 0.0, 0.0, 0.0], 2, [0.1, 0.1, 0.15, 0.17, 0.17, 0.17])

        sync()

      end

    end

    global thread_handler_1 = run Force_properties_calculation_thread_1()

    $ "Waypoint_1"

    movej([-1.6007, -1.7271, -2.203, -0.808, 1.5951, -0.031], a=1.39, v=1.04)

    $ "Waypoint_2"

    movej([-1.6, -1.45, -1.69, -1.58, 1.59, -0.031], a=1.39, v=1.04)

    $"Waypoint_3"

    movej([-1.6, -1.52, -2.01, -1.20, 1.59, -0.031], a=1.39, v=1.04)

    kill thread_handler_1

    end_force_mode()

 

Force Control settings on POLYSCOPE

 Df2

 Features

  • Specify force control relative to coordinate system
  • Specify force control relative to motion
  • Define force in single axis or multiple axes
  • Limit tool velocity in compliant axes
  • Easy testing using the freedrive button (Teach Test + Freedrive)

 

Specifications

  • Force precision            ± 10 N
  • Torque precision          ± 5 Nm
  • Position precision        ± 5 mm
  • Orientation precision   ± 0.5 °
logo

Product

  • UR3e Robot
  • UR5e Robot
  • UR10e Robot
  • UR16e Robot
  • UR20 Robot
  • UR+ Products
  • PolyScope

Company

  • About us
  • Contact us
  • Careers We're hiring
  • UR merchandise

Training / Resources

  • Academy
  • Technical Resources
  • Articles
  • FAQ

Insights

  • Blog
  • Case stories
  • Content library
  • News centre
  • Podcast
  • Webinars & Events

Get in touch

  • Ask an Expert
  • Schedule a no-cost assessment
  • Find a distributor
  • Customer support

Connect with us

  • LinkedIn
  • Facebook
  • Twitter
  • YouTube
  • Instagram
  • Universal Robots A/S
  • Energivej 25
  • DK-5260 Odense S
  • T: +45 89 93 89 89
  • sales@universal-robots.com
  • Copyright @ Universal Robots 2023
  • Cookie policy
  • Privacy policy
  • Universal Robots A/S
  • Energivej 25
  • DK-5260 Odense S
  • T: +45 89 93 89 89
  • sales@universal-robots.com

Copyright © Universal Robots 2023

Cookie policy
Privacy policy