Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5

Rounding value is not correctly populated in UR script file



I am using the UR10 robot with a curve following project and trying to get rid of the stop and go between waypoints by using rounding. When I set a rounding instruction in the program and "Generate robot program", the blend radius value shows up in the script file but is not populated as an argument in the movep command. I am currently using the "Universal Robots MoveP" post processor.

How do I get the blend radius to be taken as an argument by movep when I "Generate robot program"? I know the blending works because I uploaded the script onto the UR pendant and manually added the blend to each movep command in the script, which produces the desired behavior from the real robot.

Things I have tried:

  1. Updating robodk
  2. Using different post processors, such as "Universal Robots", "Universal Robots URP", and the one linked here. I ended up using the "Universal Robots MoveP" since that's what I think I need to properly add in the blend radius.
  3. Modifying the UR post processor according to this comment here and the wiki
  4. I believe there is a minimum distance between two points for the post processor to output a blend radius in the script file, not sure exactly what it is for UR. I think I have sufficient distance between my points (atleast 30mm). I've tried changing the rounding values in robodk from 1mm to 5mm but this still does not populate the blend radius argument in the movep command in the script file.
Image of program in robodk:


Script file generated when I click "Generate robot program":

def pick2():
 # Global parameters:
 global speed_ms    = 0.250
 global speed_rads  = 0.750
 global accel_mss   = 1.200
 global accel_radss = 1.200
 global blend_radius_m = 0.001
 global ref_frame = p[0,0,0,0,0,0]
 # Add any default subprograms here
 # For example, to drive a gripper as a program call:
 # def Gripper_Open():
 #   ...
 # end
 # Example to drive a spray gun:
 def SprayOn(value):
   # use the value as an output:
   DO_SPRAY = 5
   if value == 0:
     set_standard_digital_out(DO_SPRAY, False)
     set_standard_digital_out(DO_SPRAY, True)

 # Example to drive an extruder:
 def Extruder(value):
   # use the value as an output:
   if value < 0:
     # stop extruder
     # start extruder
 # Example to move an external axis
 def MoveAxis(value):
   # use the value as an output:
   DO_AXIS_1 = 1
   DI_AXIS_1 = 1
   if value <= 0:
     set_standard_digital_out(DO_AXIS_1, False)
     # Wait for digital input to change state
     #while (get_standard_digital_in(DI_AXIS_1) != False):
     #  sync()
     set_standard_digital_out(DO_AXIS_1, True)
     # Wait for digital input to change state
     #while (get_standard_digital_in(DI_AXIS_1) != True):
     #  sync()
 # Main program:
 # Program generated by RoboDK v5.4.1 for UR10e on 06/03/2023 13:45:32
 # Using nominal kinematics.
 blend_radius_m = 0.005
 speed_ms    = 0.200
 ref_frame = p[-0.469960, -0.758650, -0.028850, 0.000000, 0.000000, 0.000000]
 set_tcp(p[0.000000, 0.000000, 0.200000, 0.000000, 0.000000, 0.000000])
 movej([-2.198609, -2.258386, -1.559731, -2.575268, -2.400037, 6.265732],accel_radss,speed_rads,0,0)
 movep([-2.198609, -2.368639, -1.578502, -2.446253, -2.400037, 6.265732],accel_mss,speed_ms,0) # end trace
 set_standard_digital_out(3, True)
 movep([-2.132391, -2.296487, -1.730749, -2.353734, -2.276869, 5.480334],accel_mss,speed_ms,0)
 movep([-2.051512, -2.234336, -1.863052, -2.274042, -2.138953, 4.694936],accel_mss,speed_ms,0)
 movep([-1.954681, -2.181906, -1.975852, -2.206655, -1.985068, 3.909538],accel_mss,speed_ms,0)
 movep([-1.841846, -2.139582, -2.068023, -2.152218, -1.815160, 3.124139],accel_mss,speed_ms,0)
 movep([-1.715154, -2.108166, -2.137260, -2.112250, -1.631363, 2.338741],accel_mss,speed_ms,0)
 movep([-1.579675, -2.088618, -2.180841, -2.088740, -1.438802, 1.553343],accel_mss,speed_ms,0)
 movep([-1.443153, -2.081741, -2.196392, -2.083539, -1.245231, 0.767945],accel_mss,speed_ms,0)
 movep([-1.335217, -2.085721, -2.187596, -2.091812, -1.137642, -0.017453],accel_mss,speed_ms,0) # end trace
 speed_ms    = 1.000
 movep([-1.335217, -1.914836, -2.164645, -2.285631, -1.137642, -0.017453],accel_mss,speed_ms,0)
 # End of main program


Area of code with problem. As you can see the correct blend_radius_m variable is initialized per my program but it is not populated in the movep arguments (underlined in red)

Your movements are very small (smaller than 5 mm) and the post processor has an automatic filter to prevent using a blend radius larger than the movement. Old UR controllers need this check to prevent strange error messages.

You can disable this check by setting this variable in the post processor:
Hello Albert,

Thank you for your reply. I added "Blending_Check = False" to the "Universal Robots MoveP" post processor but that did not change anything unfortunately. I have copied the post processor code here.

Quote:# -*- coding: UTF-8 -*-
# Copyright 2015-2022 - RoboDK Inc. -
# This file loads the compiled version of the RoboDK post processor for:
#   Universal Robots MoveP robot controllers
# More information about RoboDK Post Processors and Offline Programming:
# ----------------------------------------------------

import sys
import os

#Needed to make the robodk generated code work
import math
from robodk import *

# Detect Python version and post processor
print("Using Python version: " + str(sys.version_info))
path_app = os.path.dirname(__file__).replace(os.sep,"/")
print("RoboDK Post Processor: " + path_app)

# Check if the post is compatible with the Python version
version_str = str(sys.version_info[0]) + str(sys.version_info[1])
path_library = path_app + '/v' + version_str
if not os.path.isdir(path_library):
    msg = "Invalid Python version or post processor not found. Make sure you are using a supported Python version: " + path_library
    msg += "\nSelect Tools-Options-Python and select a supported Python version"
    raise Exception(msg)

# Load the post processor
exec("from v" + version_str + ".Universal_Robots_MoveP import RobotPost as BasePost")

class RobotPost(BasePost):
    # Set to True to use MoveP, set to False to use MoveL
    USE_MOVEP = True    

    # If True, it will attempt to upload using SFTP. It requires PYSFTP (pip install pysftp. Important: It requires Visual Studio Community C++ 10.0)
    UPLOAD_SFTP = False    

    # default speed for linear moves in m/s
    SPEED_MS = 0.25    

    # default speed for joint moves in rad/s
    SPEED_RADS = 0.75    

    # default acceleration for lineaer moves in m/ss
    ACCEL_MSS = 1.2    

    # default acceleration for joint moves in rad/ss
    ACCEL_RADSS = 1.2    

    # default blend radius in meters (corners smoothing)
    BLEND_RADIUS_M = 0.001    

    # 5000    # Maximum number of lines per program. If the number of lines is exceeded, the program will be executed step by step by RoboDK
    MAX_LINES_X_PROG = 1000000000.0    

    # minimum circle radius to output (in mm). It does not take into account the Blend radius
    MOVEC_MIN_RADIUS = 1    

    # maximum circle radius to output (in mm). It does not take into account the Blend radius
    MOVEC_MAX_RADIUS = 10000    



if __name__== "__main__":
    exec("from v" + version_str + ".Universal_Robots_MoveP import test_post")

Also, I don't think any of the movements are less than 5mm? Please take a look at the image below with the UR10 robot and the curve it's supposed to be following. The distance between every point is greater than 5mm (the OD of the robot's J6 is 90mm for reference). Am I missing something here? Thank you!


Any update on my comment above? Thanks!
Can you attach your station, or the temporary python file generated in %TEMP%?
Please read the Forum Guidelines before posting!
Find useful information about RoboDK by visiting our Online Documentation.

Users browsing this thread:
1 Guest(s)