Doosan Robot M0609 Programming Manual
Doosan Robot M0609 Programming Manual

Doosan Robot M0609 Programming Manual

Hide thumbs Also See for Robot M0609:
Table of Contents

Advertisement

Quick Links

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the Robot M0609 and is the answer not in the manual?

Questions and answers

Summary of Contents for Doosan Robot M0609

  • Page 2: Table Of Contents

    Table of Contents Preface ................29 Copyright ........................29 1. DRL Basic Syntax ............30 Indent ........................30 Comment......................31 Variable name..................... 32 Numeric value ....................33 String........................34 String ....................................34 +, * ....................................35 Indexing & slicing ................................. 35 list .........................
  • Page 3 trans(pos, delta, ref, ref_out) ................48 posb(seg_type, posx1, posx2=None, radius=0) .......... 50 fkin(pos, ref) ......................51 ikin(pos, sol_space, ref) ................... 53 addto(pos, add_val=None) ................55 set_velj(vel) ......................56 set_accj(acc) ....................... 57 set_velx(vel1, vel2) .................... 58 set_velx(vel) ......................59 set_accx(acc1, acc2) ..................60 set_accx(acc) .....................
  • Page 4 ..................... 148 get_desired_posj() ................... 149 get_desired_velj() .................... 150 get_current_posx(ref) ..................151 get_current_tool_flange_posx(ref) ............... 153 get_current_velx(ref) ..................154 get_desired_posx(ref) ..................155 get_desired_velx(ref) ..................156 get_current_solution_space() ............... 157 get_current_rotm(ref) ..................158 get_joint_torque() .................... 159 get_external_torque() ..................160 Doosan Robotics Programming Manual (ver.1.6)
  • Page 5 get_tool_force(ref) ................... 161 get_solution_space(pos) ................162 get_orientation_error(xd, xc, axis) ............... 163 4. Other Settings and Safety-related Commands ..164 get_workpiece_weight() ................. 164 reset_workpiece_weight() ................165 set_tool(name) ....................166 set_tool_shape(name) ..................167 set_singularity_handling(mode) ..............168 5. Force/Stiffness Control and Other User-Friendly Features ................
  • Page 6 ) ........................225 set_analog_output(ch, val) ............................. 226 get_analog_input(ch) ............................... 227 TP Interface ....................... 228 tp_popup(message, pm_type=DR_PM_MESSAGE, type=0) ..............228 tp_log(message) ............................... 230 tp_progress(cur_progress, total_progress) ......................231 tp_get_user_input(message, input_type) ......................232 Thread ........................ 234 Doosan Robotics Programming Manual (ver.1.6)
  • Page 7 thread_run(th_func_name, loop=False) ......................234 thread_stop(th_id) ..............................236 thread_pause(th_id) ..............................237 thread_resume(th_id) ............................... 238 thread_state(th_id) ..............................239 Integrated example ..............................240 Others ........................ 242 wait(time) ..................................242 exit() ....................................243 sub_program_run(name) ............................244 6.4.3 drl_report_line(option) ............................... 246 6.4.4 set_fm(key, value) ..............................247 6.4.5 7.
  • Page 8 8. External Communication Commands ..... 283 Serial ........................283 serial_open(port=None, baudrate=115200, bytesize=DR_EIGHTBITS, parity=DR_PARITY_NONE, stopbits=DR_STOPBITS_ONE) ................. 283 serial_close(ser) ................................. 285 serial_state(ser) ................................286 serial_set_inter_byte_timeout(ser, timeout=None) ..................287 serial_write(ser, tx_data) ............................288 serial_read(ser, length=-1, timeout=-1) ....................... 289 serial_get_count() ............................... 291 serial_get_info(id)................................ 292 Doosan Robotics Programming Manual (ver.1.6)
  • Page 9 Combined Example ..............................293 Tcp/Client ......................294 client_socket_open(ip, port) ............................ 294 client_socket_close(sock) ............................295 client_socket_state(sock) ............................296 client_socket_write(sock, tx_data) ........................297 client_socket_read(sock, length=-1, timeout=-1) ..................... 298 Integrated example ..............................300 Tcp/Server ......................302 server_socket_open(port) ............................302 server_socket_close(sock) ............................. 303 server_socket_state(sock) ............................304 server_socket_write(sock, tx_data) ........................
  • Page 10 ....................346 vs_result() ......................347 Integrated example 1 (DR_VS_COGNEX, DR_VS_SICK) ......348 Integrated Example 2 ..................349 10. Doosan Vision(SVM) Command ......351 svm_connect (ip= "192.168.137.5", port=20) ..........351 svm_disconnect () ................... 352 svm_set_job (job_id) ..................353 Doosan Robotics Programming Manual (ver.1.6)
  • Page 11 svm_get_robot_pose (job_id) ............... 354 svm_get_vision_info (job_id) ................ 355 svm_get_variable (tool_id, var_type) ............356 svm_get_offset_pos (posx_robot_init, job_id, tool_id) ......358 svm_set_init_pos_data(Id_list, Pos_list) ............ 359 svm_set_tp_popup (svm_flag) ..............360 svm_set_led_brightness(value) ............361 svm_get_led_brightness() ..............362 svm_set_camera_exp_val(value) ............363 svm_set_camera_gain_val(value) ............. 364 svm_set_camera_load(job_id) ............365 Intergrated example (SVM) ..............
  • Page 12 ..................388 flange_serial_write(tx_data) ................389 flange_serial_read() ..................390 Doosan Robotics Programming Manual (ver.1.6)
  • Page 13  DRL Basic Syntax Function Description Indent This function is used to separate each code block. This function is used to provide an additional description of the code. Comment The comments do not affect the source code since they are excluded from code processing.
  • Page 14 This function calls the name of the TCP registered in the Teach set_tcp(name) 2.14 Pendant and sets it as the current TCP. 2.15 set_ref_coord(coord) This function sets the reference coordinate system. 2.16 movej The robot moves to the target joint position (pos) from the current joint Doosan Robotics Programming Manual (ver.1.6)
  • Page 15 Function Description position. The robot moves along the straight line to the target position (pos) 2.17 movel within the task space. 2.18 movejx The robot moves to the target position (pos) within the joint space. The robot moves along an arc to the target pos (pos2) via a waypoint 2.19 movec (pos1) or to a specified angle from the current position in the task...
  • Page 16 This function activates alter motion. mit_dPOS_per) alter_motion([x,y,z,rx,r 2.44 This function excutes alter motion as input pose. y,rz]) 2.45 disable_alter_motion() This function deactivates alter motion.  Auxiliary Control Commands Function Description get_control_mode() This function returns the current control mode. Doosan Robotics Programming Manual (ver.1.6)
  • Page 17 Function Description get_control_space() This function returns the current control space. get_current_posj() This function returns the current joint angle. get_current_velj() This function returns the current joint velocity. get_desired_posj() This function returns the current target joint angle. This function returns the current target joint velocity. get_desired_velj() This function returns the pose and solution space of the get_current_posx(ref)
  • Page 18 (ref). The user can set the new cartesian coordinate system using 5.10 set_user_cart_coord position (pos) and reference coordinate system (ref). 5.11 set_user_cart_coord The user can set the new cartesian coordinate system using x1, Doosan Robotics Programming Manual (ver.1.6)
  • Page 19 Function Description x2, and x3. The user can set the new cartesian coordinate system using u1 5.12 set_user_cart_coord and v1. This function changes the position (pos) and reference overwrite_user_cart_coord 5.13 coordinate system (ref) of the preset cartesian coordinate system with the requested ID (id). The user can get the position and reference coordinate system get_user_cart_coord 5.14...
  • Page 20 This function sets the channel mode of the controller analog 6.1.16 mod ) input. This function outputs the channel value corresponding to the 6.1.17 set_analog_output(ch, val) controller analog output. This function reads the channel value corresponding to the 6.1.18 controller analog input. get_analog_input(ch) Doosan Robotics Programming Manual (ver.1.6)
  • Page 21: Sin(X)

    Function Description tp_popup(message, This function provides a message to users through the Teach 6.2.1 pm_type=DR_PM_MESSAGE, Pendant. type=0) This function records the user-written log to the Teach 6.2.2 tp_log(message) Pendant. tp_progress(cur_progress, This function provides a message to users through the Teach 6.2.3 total_progress) Pendant.
  • Page 22: Atan2(Y, X)

    This function transforms a rotation vector to a Euler angle (zyz). 7.25 rotvec2rotm([rx,ry,rz]) This function transforms a rotation vector to a rotation matrix. This function returns the pose corresponding to T1*T2 assuming 7.26 htrans(posx1,posx2) that the homogeneous transformation matrices obtained from Doosan Robotics Programming Manual (ver.1.6)
  • Page 23: Get_Distance(Posx1, Posx2)

    Function Description posx1 and posx2 are T1 and T2, respectively. get_intermediate_pose(posx1 This function returns posx located at alpha of the linear 7.27 ,posx2,alpha) transition from posx1 to posx2. This function returns the distance between two pose positions in 7.28 get_distance(posx1, posx2) [mm].
  • Page 24 This function reads data from the client. length=-1, timeout=-1) add_modbus_signal (ip, port, name, reg_type, index, value=0, 8.4.1 This function registers the Modbus signal. slaveid=255) add_modbus_rtu_signal (slaveid=1, port=None, 8.4.2 This function registers the ModbusRTU signal. baudrate=115200, bytesize=DR_EIGHTBITS, parity=DR_PARITY_NONE, Doosan Robotics Programming Manual (ver.1.6)
  • Page 25 Function Description stopbits=DR_STOPBITS_ONE, name, reg_type, index, value=0) del_modbus_signal (name) 8.4.3 This function deletes the registered Modbus signal. set_modbus_output(iobus, val) This function sends the signal to an external Modbus 8.4.4 system. set_modbus_outputs(iobus_list, This function sends the multiple signals to the digital contact val_list) 8.4.5 points of the external Modbus digital I/O unit.
  • Page 26 The coordinate of the robot is calculated using the vs_get_offset_pos(vision_posx coordinate values, measured in the vision system. _meas, vs_pos=1) This function sets the feature for the vision system to vs_request(cmd) request 9.10 This function retrieves the processing result of the vision vs_result Doosan Robotics Programming Manual (ver.1.6)
  • Page 27 Function Description system.  Doosan Vision(SVM) Commands Function Description svm_connect (ip= 10.1 This function establishes communication with the SVM. "192.168.137.5", port=20) 10.2 This function terminates the connection to the SVM. svm_disconnect() This function loads the Vision task corresponding to the 10.3...
  • Page 28: Application Commands

    = DR_STOPBITS_ONE) flange_serial_close()오류! 참조 12.3 This function closes a flange serial communication port. 원본을 찾을 수 없습니다. 12.4 flange_serial_write (tx_data) This function records the data (data) to a flange serial port Doosan Robotics Programming Manual (ver.1.6)
  • Page 29 Function Description flange_serial_read(timeout=Non 12.5 This function reads the data from a flange serial port.
  • Page 30: Preface

    The copyright and intellectual property rights of the contents of this manual are held by Doosan Robotics. It is therefore prohibited to use, copy, or distribute the contents without written approval from Doosan Robotics. In the event of abuse or modification of the patent right, the user will be fully accountable for the consequences.
  • Page 31: Drl Basic Syntax

    1Chapter DRL Basic Syntax DRL Basic Syntax Caution The syntax of DRL is the same as the syntax of Python which means that DRL does not include all the syntax and features of Python. DRL only supports the information described in this manual. Indent ▪...
  • Page 32: Comment

    • A statement following "#" is recognized as a comment. • A block that begins with ’’’ and ends with ’’’ is recognized as a comment. ▪ Example 1.1.1.7 # Comment example 1 ’’’ 1.1.1.8 1.1.1.9 Comment example 2 ’’’ Doosan Robotics Programming Manual (ver.1.6)
  • Page 33: Variable Name

    1Chapter DRL Basic Syntax Variable name ▪ Features • Variable is used to express the data value and can consist of letters, numbers, and underscores (_). The first character cannot be a number. • Letters are case sensitive. • An error occurs if the variable name is the same as a reserved word or interpreter internal function name.
  • Page 34: Numeric Value

    ▪ Example 1.1.1.10 10, 0x10, 0o10, 0b10 1.1.1.11 3.14, 314e-2 x = 3-4j int_value = 10 hexa_value = 0x10 octa_value = 0o10 binary_value = 0b10 double_value = 3.14 double value = 314e-2 complex_value = 3-4j Doosan Robotics Programming Manual (ver.1.6)
  • Page 35: String

    1Chapter DRL Basic Syntax String String ▪ Features All character strings are in Unicode. • Escape characters \n: New line \t: Tab \r: Carrage return \0: Null string \\: back slash(\) in string \’: single quote mark in string \": double quote mark in string •...
  • Page 36: Indexing & Slicing

    String #expected result: s tp_log("string"[1:3]) #expected result: tr +, * ▪ Example "Doosan"+ "Robotics" ➔ "DoosanRobotics" "Doo"* 3 ➔ "DooDooDoo" Indexing & slicing ▪ Example " Doosan" [0] ➔ "D" " Doosan" [1:4] ➔ "oos" Doosan Robotics Programming Manual (ver.1.6)
  • Page 37: List

    1Chapter DRL Basic Syntax list ▪ Features • The items in a list can be changed and ordered. • A list can be indexed and sliced. • append, insert, extend, and + operators • count, remove, and sort operators ▪ Example colors = ["red", "green", "blue"] tp_log(colors[0]+","+colors[1]+","+colors[2])
  • Page 38: Tuple

    = dict(a = 1, b = 3, c = 5) colors = dict() colors["cherry"] = "red" ages = {'Kim':35, 'Lee':38, 'Chang':37} tp_log("Ages of Kim = " + str(ages['Kim'])) #expected print result: Ages of Kim = 35 Doosan Robotics Programming Manual (ver.1.6)
  • Page 39: Function

    1Chapter DRL Basic Syntax Function ▪ Features • Declaration: A function begins with def and ends with colon (:). • The beginning and ending of a function is specified by an indentation of the code. • The interface and implementation are not separated. However, they must have been defined before they are used.
  • Page 40: Scoping Rule

    # Error: can't find simple_pi in circle_area simple_pi = 3.14 def circle_area(r): return r*r*simple_pi # simple_pi should be declared as global if it is used in circle_area_ok def circle_area_ok(r): global simple_pi return r*r*simple_pi tp_log(str(circle_area(3.0))) #expected result: 28.26 Doosan Robotics Programming Manual (ver.1.6)
  • Page 41: Parameter Mode

    1Chapter DRL Basic Syntax Parameter mode ▪ Features DRL provides 3 types of parameter modes: Default parameter values, Keyword parameters and Arbitary parameters ▪ Example def fn_Times(a = 10, b = 20): return a * b #Example - Default parameter value tp_log(str(fn_Times(5))) #expected result: 100 #Example - Keyword parameter...
  • Page 42: Pass

    "white", "black") pass ▪ Features The ‘pass’ is used when an operation is not executed. ▪ Example while True: pass #pass means empty statement, so while statement continues to run. tp_log("This line never reached") Doosan Robotics Programming Manual (ver.1.6)
  • Page 43 1Chapter DRL Basic Syntax ▪ Features ‘if’ is a conditional statement. It can use "elif" and "else" according to whether the condition of the "if" syntax is true or false. ▪ sentense if <conditional statement>: <syntax> if <conditional statement 1>: <Syntax 1>...
  • Page 44: While

    ▪ syntax while <conditional statement>: <syntax> ▪ Example sum = 0 cnt = 1 while cnt < 10: sum = sum+cnt cnt = cnt+1 tp_log("sum = " + str(sum)) #expected result: #sum = 45 Doosan Robotics Programming Manual (ver.1.6)
  • Page 45: For

    1Chapter DRL Basic Syntax ▪ Features 'for' repeats an operation within the specified repeating range. ▪ syntax for <item> in <sequential object S>: <syntax> ▪ Example for i in range(0, 3): # i는 0 -> 1 -> 2 x= x + 1 sum = 0 for i in range(0, 10): sum = sum + i...
  • Page 46: Else In A Loop

    "break" function in the middle of executing a loop. ▪ Example L = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 } for i in L: if i % 2 == 0: continue else: tp_log("exit without break") Doosan Robotics Programming Manual (ver.1.6)
  • Page 47: Motion-Related Commands

    2Chapter Motion-related Commands Motion-related Commands posj(q1=0, q2=0, q3=0, q4=0, q5=0, q6=0) ▪ Features This function designates the joint space angle in coordinate values. Parameters ▪ Default Data Type Description Value 1-axis angle or float list angle list or posj posj 2-axis angle float float...
  • Page 48: Posx(X=0, Y=0, Z=0, W=0, P=0, R=0)

    = posx(400, 300, 500, 0, 180, 0) x3 = posx([350, 350, 450, 0, 180, 0]) #x3=posx(350, 350, 450, 0, 180, 0) x4 = posx(x2) #x4=posx(400, 300, 500, 0, 180, 0) movel(x2, v=100, a=200) ▪ Related commands movel()/movec()/movejx()/amovel()/amovec()/amovejx() Doosan Robotics Programming Manual (ver.1.6)
  • Page 49: Trans(Pos, Delta, Ref, Ref_Out)

    2Chapter Motion-related Commands trans(pos, delta, ref, ref_out) ▪ Features • Input parameter(pos) based on the ref coordinate is translated/rotated as delta based on the same coordinate and this function returns the result that is converted to the value based on the ref_out coordinate.
  • Page 50 DR_userTC1 = set_user_cart_coord(uu1, vv1, pos) #user defined coordinate system x1_userTC1 = posx(30, 20, 100, 0, 180, 0) #posx on user coordinate system x9 = trans(x1_userTC1, [0, 0, 50, 0, 0, 0], DR_userTC1, DR_BASE) movel(x9, v=100, a=100, ref=DR_BASE) Related commands ▪ posx()/addto() Doosan Robotics Programming Manual (ver.1.6)
  • Page 51: Posb(Seg_Type, Posx1, Posx2=None, Radius=0)

    2Chapter Motion-related Commands posb(seg_type, posx1, posx2=None, radius=0) ▪ Features • Input parameters for constant-velocity blending motion (moveb and amoveb) with the Posb coordinates of each waypoint and the data of the unit path type (line or arc) define the unit segment object of the trajectory to be blended.
  • Page 52: Fkin(Pos, Ref)

    DR_BASE DR_BASE : base coordinate  DR_WORLD : world coordinate ▪ Return Value Description posx Task space point ▪ Exception Exception Description DR_Error (DR_ERROR_TYPE) Parameter data type error occurred DR_Error (DR_ERROR_VALUE) Parameter value is invalid Doosan Robotics Programming Manual (ver.1.6)
  • Page 53 2Chapter Motion-related Commands Exception Description DR_Error (DR_ERROR_RUNTIME) C extension module error occurred ▪ Example q1 = posj(0, 0, 90, 0, 90, 0) movej(q1,v=10,a=20) q2 = posj(30, 0, 90, 0, 90, 0) x2 = fkin(q2, DR_WORLD) # x2: Space coordinate at the edge of the robot (TCP) corresponding to joint value q2 movel(x2,v=100,a=200,ref=DR_WORLD) # Linear motion to x2 Related commands...
  • Page 54: Ikin(Pos, Sol_Space, Ref)

    Below No Flip Righty Below Flip Righty Above No Flip ▪ Return Value Description posj Joint space point Exception ▪ Exception Description DR_Error (DR_ERROR_TYPE) Parameter data type error occurred DR_Error (DR_ERROR_VALUE) Parameter value is invalid Doosan Robotics Programming Manual (ver.1.6)
  • Page 55 2Chapter Motion-related Commands Exception Description DR_Error (DR_ERROR_RUNTIME) C extension module error occurred DR_Error (DR_ERROR_STOP) Program terminated forcefully ▪ Example x1 = posx(370.9, 719.7, 651.5, 90, -180, 0) q1 = ikin(x1, 2) # Joint angle q1 where the coordinate of the robot edge is x1 (second of 8 cases) # q1=posj(60.3, 81.0, -60.4, -0.0, 159.4, -29.7) (M1013, tcp=(0,0,0)) movej(q1,v=10,a=20)
  • Page 56: Addto(Pos, Add_Val=None)

    = addto(q1, [0, 0, 0, 0, 45, 0]) movej (q2, v=10, a=20) # The robot moves to the joint (10, 20, 30, 40, 95, 60). q3 = addto(q2, []) q4 = addto(q3) Related commands ▪ posj() Doosan Robotics Programming Manual (ver.1.6)
  • Page 57: Set_Velj(Vel)

    2Chapter Motion-related Commands set_velj(vel) ▪ Features This function sets the global velocity in joint motion (movej, movejx, amovej, or amovejx) after using this command. The default velocity is applied to the globally set vel if movej() is called without the explicit input of the velocity argument. ▪...
  • Page 58: Set_Accj(Acc)

    ) which is the global acceleration. movej(Q1, vel=20, acc=40) # The joint motion acceleration to Q1 is 40(deg/sec ) which is the specified acceleration. set_accj(30.55) set_accj([30, 40, 30, 30, 30, 10]) ▪ Related commands set_velj()/movej()/movejx()/movesj()/amovej()/amovejx()amovesj() Doosan Robotics Programming Manual (ver.1.6)
  • Page 59: Set_Velx(Vel1, Vel2)

    2Chapter Motion-related Commands set_velx(vel1, vel2) ▪ Features This function sets the velocity of the task space motion globally. The globally set velocity velx is applied as the default velocity if the task motion such as movel(), amovel(), movec(), movesx() is called without the explicit input of the velocity value. In the set value, vel1 and vel2 define the linear velocity and rotating velocity, relatively, of TCP.
  • Page 60: Set_Velx(Vel)

    # The task motion linear velocity to P2 is 30(mm/sec) which is the global velocity. movel(P1, vel=20, acc=40) # The task motion linear velocity to P1 is 20(mm/sec) which is the specified velocity. set_velx(10.5) # Decimal point input is possible. ▪ Related commands set_accx()/movel()/movec()/movesx()/moveb()/move_spiral()/amovel()/amovec()/ amovesx()/amoveb()/amove_spiral() Doosan Robotics Programming Manual (ver.1.6)
  • Page 61: Set_Accx(Acc1, Acc2)

    2Chapter Motion-related Commands set_accx(acc1, acc2) ▪ Features This function sets the acceleration of the task space motion globally. The globally set acceleration accx is applied as the default acceleration if the task motion such as movel(), amovel(), movec(), movesx() is called without the explicit input of the acceleration value. In the set value, acc1 and acc2 define the linear acceleration and rotating acceleration, relatively, of the TCP.
  • Page 62: Set_Accx(Acc)

    # The task motion linear acceleration to P2 is 60(mm/sec ) which is the global acceleration. movel(P1, vel=20, acc=40) # The task motion linear acceleration to P1 is 40(mm/sec ) which is the specified acceleration. ▪ Related commands set_velx()/movel()/movec()movesx()/moveb()/move_spiral()/amovel()/amovec()/amove sx()/amoveb()/amove_spiral() Doosan Robotics Programming Manual (ver.1.6)
  • Page 63: Set_Tcp(Name)

    2Chapter Motion-related Commands set_tcp(name) ▪ Features This function calls the name of the TCP registered in the Teach Pendant and sets it as the current TCP. ▪ Parameters Parameter Default Data Type Description Name Value name string Name of the TCP registered in the TP. Return ▪...
  • Page 64: Set_Ref_Coord(Coord)

    DR_USER1 = set_user_cart_coord(uu1, vv1, pos) # Sets the user coordinate system. set_ref_coord(DR_USER1) # Sets DR_USER1 of the user coordinate system to the global coordinate system. movel([0,0,0,0,0,0],v=100,a=100) # The global coordinate system is used if the Doosan Robotics Programming Manual (ver.1.6)
  • Page 65 2Chapter Motion-related Commands reference coordinate system is not specified. # Moves to the origin point and direction of the DR_USER1 coordinate system. movel([0,200,0,0,0,0],v=100,a=100) # Moves to the (0,200,0) point of the DR_USER1 coordinate system. ▪ Related commands fkin()/ikin()/movel()/movejx()/movec()/movesx()/moveb()/amovel()/amovejx()/ amovec()/amovesx()/amoveb()
  • Page 66: Movej

    If the time is specified, values are processed based on time, ignoring vel and acc.  If the time is None, it is set to 0.  If the radius is None, it is set to the blending radius in the blending section and 0 otherwise. Doosan Robotics Programming Manual (ver.1.6)
  • Page 67 2Chapter Motion-related Commands Caution If the following motion is blended with the conditions of ra=DR_MV_RA_DUPLICATE and radius>0, the preceding motion can be terminated when the following motion is terminated while the remaining motion time determined by the remaining distance, velocity, and acceleration of the preceding motion is greater than the motion time of the following motion.
  • Page 68 # when the distance from the Q1 space position is 200mm. movej(Q2, v=30, a=60, ra= DR_MV_RA_OVERRIDE) # Immediately terminates the last motion and blends it to move to the Q2 joint angle. ▪ Related commands posj()/set_velj()/set_accj()/amovej() Doosan Robotics Programming Manual (ver.1.6)
  • Page 69: Movel

    2Chapter Motion-related Commands movel ▪ Features The robot moves along the straight line to the target position (pos) within the task space. ▪ Parameters Parameter Data Type Default Value Description Name posx posx or position list list (float[6]) float velocity or None vel (v) None...
  • Page 70 Refer to the following image for more information. Doosan Robotics Programming Manual (ver.1.6)
  • Page 71 2Chapter Motion-related Commands ▪ Return Value Description Success Negative value Failed ▪ Exception Exception Description DR_Error (DR_ERROR_TYPE) Parameter data type error occurred DR_Error (DR_ERROR_VALUE) Parameter value is invalid DR_Error (DR_ERROR_RUNTIME) C extension module error occurred DR_Error (DR_ERROR_STOP) Program terminated forcefully Example ▪...
  • Page 72: Movejx

    DR_WORLD: world coordinate  None  DR_TOOL: tool coordinate  user coordinate: User defined Movement basis  DR_MV_MOD_ABS DR_MV_MOD_ABS: Absolute  DR_MV_MOD_REL: Relative Reactive motion mode  DR_MV_RA_DUPLICATE DR_MV_RA_DUPLICATE: duplicate  DR_MV_RA_OVERRIDE: override Solution space Doosan Robotics Programming Manual (ver.1.6)
  • Page 73 2Chapter Motion-related Commands Note  Abbreviated parameter names are supported. (v:vel, a:acc, t:time, r:radius)  _global_velj is applied if vel is None. (The initial value of _global_velj is 0.0 and can be set by set_velj.)  _global_accj is applied if acc is None. (The initial value of _global_accj is 0.0 and can be set by set_accj.) ...
  • Page 74 DR_MV_RA_OVERRIDE, sol=2) # Immediately terminates the last motion and blends it to move to the joint angle # when the TCP edge is at the P2 position. ▪ Related commands posx()/set_velj()/set_accj()/get_current_posx()/amovejx() Doosan Robotics Programming Manual (ver.1.6)
  • Page 75: Movec

    2Chapter Motion-related Commands movec ▪ Features The robot moves along an arc to the target pos (pos2) via a waypoint (pos1) or to a specified angle from the current position in the task space. ▪ Parameters Parameter Data Type Default Value Description Name posj...
  • Page 76 Refer to the following image for more information. Doosan Robotics Programming Manual (ver.1.6)
  • Page 77 2Chapter Motion-related Commands ▪ Return Value Description Success Negative value Error ▪ Exception Exception Description DR_Error (DR_ERROR_TYPE) Parameter data type error occurred DR_Error (DR_ERROR_VALUE) Parameter value is invalid DR_Error (DR_ERROR_RUNTIME) C extension module error occurred DR_Error (DR_ERROR_STOP) Program terminated forcefully...
  • Page 78 # and then executes the next motion at a distance of 100mm from the P4 position. movec(P2, P1, ra=DR_MV_RA_OVERRIDE) # Immediately terminates the last motion and blends it to move to the P1 position. ▪ Related commands posx()/set_velx()/set_accx()/set_tcp()/set_ref_coord()/amovec() Doosan Robotics Programming Manual (ver.1.6)
  • Page 79: Movesj

    2Chapter Motion-related Commands movesj ▪ Features The robot moves along a spline curve path that connects the current position to the target position (the last waypoint in pos_list) via the waypoints of the joint space input in pos_list. The input velocity/acceleration means the maximum velocity/acceleration in the path, and the acceleration and deceleration during the motion are determined according to the position of the waypoint.
  • Page 80 = posj(25, 50, 40, 100, 30, 10) # Defines dq3 (q3=q2+dq3) as the relative joint angle of q2 dq4 = posj(-20, -40, -20, -70, -40, 10) # Defines dq4 (q4=q3+dq4) as the relative joint angle of q3 Doosan Robotics Programming Manual (ver.1.6)
  • Page 81 2Chapter Motion-related Commands dq5 = posj(-10, 10, 10, 40, -10, 30) # Defines dq5 (q5=q4+dq5) as the relative joint angle of q4 dqlist = [dq1, dq2, dq3, dq4, dq5] # Defines the list (dqlist) which is a set of q1-q5 as the relative waypoints. movesj(dqlist, vel=30, acc=100, mod= DR_MV_MOD_REL ) # Moves the spline curve that connects the relative waypoints defined in the dqlist...
  • Page 82: Movesx

     DR_WORLD: world coordinate  None  DR_TOOL: tool coordinate  user coordinate: User defined Movement basis  DR_MV_MOD_ABS DR_MV_MOD_ABS: Absolute  DR_MV_MOD_REL: Relative Velocity option  DR_MVS_VEL_NONE: None vel_opt DR_MVS_VEL_NONE  DR_MVS_VEL_CONST: Constant velocity Doosan Robotics Programming Manual (ver.1.6)
  • Page 83 2Chapter Motion-related Commands Note  Abbreviated parameter names are supported. (v:vel, a:acc, t:time)  _global_velx is applied if vel is None. (The initial value of _global_velx is 0.0 and can be set by set_velx.)  _global_accx is applied if acc is None. (The initial value of _global_accx is 0.0 and can be set by set_accx.) ...
  • Page 84 # Definition of relative coordinate dx5 to x4 (Homogeneous transformation of dx5 based in x5= x4) dx6 = posx(800, -100, -100, 0, 0, 0) # Definition of relative coordinate dx6 to x5 (Homogeneous transformation of dx6 based in x6= x5) Doosan Robotics Programming Manual (ver.1.6)
  • Page 85 2Chapter Motion-related Commands dxlist = [dx1, dx2, dx3, dx4, dx5, dx6] # Defines the list (dxlist) which is a set of dx1-dx6 as the waypoints. movesx(dxlist, vel=[100, 30], acc=[200, 60], mod= DR_MV_MOD_REL, vel_opt=DR_MVS_VEL_NONE) # Moves the spline curve that connects the waypoints defined in the dxlist # with a maximum velocity of 100, 30 (mm/sec, deg/sec) # and maximum acceleration of 200(mm/sec ), and 60(deg/sec...
  • Page 86: Moveb

    DR_BASE: base coordinate  DR_WORLD: world coordinate  None  DR_TOOL: tool coordinate  user coordinate: User defined Movement basis  DR_MV_MOD_ABS DR_MV_MOD_ABS: Absolute  DR_MV_MOD_REL: Relative Doosan Robotics Programming Manual (ver.1.6)
  • Page 87 2Chapter Motion-related Commands Note  Abbreviated parameter names are supported. (v:vel, a:acc, t:time)  Up to 50 arguments can be entered in posb_list.  _global_velx is applied if vel is None. (The initial value of _global_velx is 0.0 and can be set by set_velx.) ...
  • Page 88 # Relative Goal Poses dX1 = posx(0, 250, 0, 0, 0, 0) dX1a = posx(0, 0, -150, 0, 0, 0) dX1a2= posx(0, -125, 0, 0, 0, 0) dX1b = posx(0, 50, 0, 0, 0, 0) Doosan Robotics Programming Manual (ver.1.6)
  • Page 89 2Chapter Motion-related Commands dX1b2= posx(0, 75, 0, 0, 0, 0) dX1c = posx(0, -250, -250, 0, 0, 0) dX1c2= posx(0, 125, 0, 0, 0, 0) dX1d = posx(0, 125, 125, 0, 0, 0) dX1d2= posx(0, 125, -125, 0, 0, 0) dseg11 = posb(DR_LINE, dX1, radius=20) dseg12 = posb(DR_CIRCLE, dX1a, dX1a2, radius=20) dseg14 = posb(DR_LINE, dX1b2, radius=20)
  • Page 90: Move_Spiral

     DR_AXIS_X: x-axis axis DR_AXIS_Z  DR_AXIS_Y: y-axis  DR_AXIS_Z: z-axis reference coordinate DR_BASE : base coordinate  DR_WORLD : world coordinate  DR_TOOL  DR_TOOL : tool coordinate  user coordinate: user defined Doosan Robotics Programming Manual (ver.1.6)
  • Page 91 2Chapter Motion-related Commands Note  Abbreviated parameter names are supported. (v:vel, a:acc, t:time)  rev refers to the total number of revolutions of the spiral motion.  Rmax refers to the maximum radius of the spiral motion.  Lmax refers to the parallel distance in the axis direction during the motion. A negative value means the parallel distance in the –axis direction.
  • Page 92 50 mm (lmax) in the Tool-Z direction at the same time in 10 seconds from the initial position) J00 = posj(0,0,90,0,60,0) movej(J00,vel=30,acc=30) # Joint movement to the initial pose move_spiral(rev=9.5,rmax=20.0,lmax=50.0,time=20.0,axis=DR_AXIS_Z,ref=DR_TOOL) tool-X tool-Z tool-Z tool-X ▪ Related commands set_velx()/set_accx()/set_tcp()/set_ref_coord()/amove_spiral() Doosan Robotics Programming Manual (ver.1.6)
  • Page 93: Move_Periodic

    2Chapter Motion-related Commands move_periodic ▪ Features This function performs the cyclic motion based on the sine function of each axis (parallel and rotation) of the reference coordinate (ref) input as a relative motion that begins at the current position. The attributes of the motion on each axis are determined by the amplitude and period, and the acceleration/deceleration time and the total motion time are set by the interval and repetition count.
  • Page 94 The deceleration section will deviate from the previous path if the motions of all axes are not terminated at the same time. Refer to the following image for more information. Doosan Robotics Programming Manual (ver.1.6)
  • Page 95 2Chapter Motion-related Commands  Ref refers to the reference coordinate system of the repeated motion.  If a maximum velocity error is generated during a motion, adjust the amplification and period using the following formula. Max. velocity = Amplification(amp)*2*pi(3.14)/Period(period) (i.e., Max. velocity=62.83mm/sec if amp=10mm and period=1 sec) ...
  • Page 96: Move_Home

    Value Description Success Negative value Error ▪ Exception Exception Description DR_Error (DR_ERROR_TYPE) Parameter data type error occurred DR_Error (DR_ERROR_VALUE) Parameter value is invalid DR_Error (DR_ERROR_RUNTIME) C extension module error occurred DR_Error (DR_ERROR_STOP) Program terminated forcefully Doosan Robotics Programming Manual (ver.1.6)
  • Page 97 2Chapter Motion-related Commands ▪ Example move_home(DR_HOME_TARGET_USER) # Go to the user home P0 = posj(0,0,90,0,90,0) movej(P0)
  • Page 98: Amovej

    (a) None acceleration (acceleration to an axis) list (float[6]) time (t) float None Reach time [sec] Movement basis  DR_MV_MOD_ABS DR_MV_MOD_ABS: Absolute  DR_MV_MOD_REL: Relative Reactive motion mode  DR_MV_RA_DUPLICATE DR_MV_RA_DUPLICATE: duplicate  DR_MV_RA_OVERRIDE: override Doosan Robotics Programming Manual (ver.1.6)
  • Page 99 2Chapter Motion-related Commands Note  Abbreviated parameter names are supported. (v:vel, a:acc, t:time)  _global_velj is applied if vel is None. (The initial value of _global_velj is 0.0 and can be set by set_velj.)  _global_accj is applied if acc is None. (The initial value of _global_accj is 0.0 and can be set by set_accj.) ...
  • Page 100 # Performs the next command immediately after the blending motion. mwait(0) # Temporarily suspends the program execution until the motion is terminated. q99 = posj(0, 0, 0, 0, 0, 0) movej (q99, vel=10, acc=20) # Joint motion to q99 ▪ Related commands posj()/set_velj()/set_accj()/mwait()/movej() Doosan Robotics Programming Manual (ver.1.6)
  • Page 101: Amovel

    2Chapter Motion-related Commands amovel ▪ Features The asynchronous movel motion operates in the same way as movel except that it does not have the radius parameter for blending. The command is the asynchronous motion command, and the next command is executed without waiting for the motion to terminate. Note) •...
  • Page 102 Value Description Success Negative value Error ▪ Exception Exception Description DR_Error (DR_ERROR_TYPE) Parameter data type error occurred DR_Error (DR_ERROR_VALUE) Parameter value is invalid DR_Error (DR_ERROR_RUNTIME) C extension module error occurred DR_Error (DR_ERROR_STOP) Program terminated forcefully Doosan Robotics Programming Manual (ver.1.6)
  • Page 103 2Chapter Motion-related Commands ▪ Example #Example 1. D-Out 2 seconds after the motion starts with x1 j0 = posj(-148,-33,-54,180,92,32) movej(j0, v=30, a=30) x1 = posx(784, 543, 570, 0, 180, 0) amovel (x1, vel=100, acc=200) # Performs the next motion immediately after beginning a motion with x1.
  • Page 104: Amovejx

    DR_WORLD : world coordinate  None  DR_TOOL: tool coordinate  user coordinate: User defined Movement basis  DR_MV_MOD_ABS DR_MV_MOD_ABS: Absolute  DR_MV_MOD_REL: Relative Reactive motion mode  DR_MV_RA_DUPLICATE DR_MV_RA_DUPLICATE: duplicate  DR_MV_RA_OVERRIDE: override Solution space Doosan Robotics Programming Manual (ver.1.6)
  • Page 105 2Chapter Motion-related Commands Note  Abbreviated parameter names are supported. (v:vel, a:acc, t:time)  _global_velj is applied if vel is None. (The initial value of _global_velj is 0.0 and can be set by set_velj.)  _global_accj is applied if acc is None. (The initial value of _global_accj is 0.0 and can be set by set_accj.) ...
  • Page 106 # Temporarily suspends the program execution for 2 seconds (while the motion continues). set_digital_output(1, 1) # D-Out (no. 1 channel) ON mwait(0) # Temporarily suspends the program execution until the motion is terminated. ▪ Related commands posx()/set_velj()/set_accj()/get_current_posx()/mwait()/movejx() Doosan Robotics Programming Manual (ver.1.6)
  • Page 107: Amovec

    2Chapter Motion-related Commands amovec ▪ Features The asynchronous movec motion operates in the same way as movec except that it does not have the radius parameter for blending. The command is the asynchronous motion command, and the next command is executed without waiting for the motion to terminate. Note) •...
  • Page 108 Refer to the description of the movej() motion for the path of the blending according to option ra and vel/acc. ▪ Return Value Description Success Negative value Error ▪ Exception Exception Description DR_Error (DR_ERROR_TYPE) Parameter data type error occurred DR_Error (DR_ERROR_VALUE) Parameter value is invalid Doosan Robotics Programming Manual (ver.1.6)
  • Page 109 2Chapter Motion-related Commands Exception Description DR_Error (DR_ERROR_RUNTIME) C extension module error occurred DR_Error (DR_ERROR_STOP) Program terminated forcefully ▪ Example #Example 1. D-Out 3 seconds after the arc motion through x1 and x2 begins p0 = posj(-148,-33,-54,180,92,32) movej(p0, v=30, a=30) x1 = posx(784, 443, 770, 0, 180, 0) amovejx (x1, vel=100, acc=200, sol=2) # Performs the next motion immediately after beginning a joint motion with x1.
  • Page 110: Amovesj

    (If pos_list=[q1, q2, ...,q(n-1), q(n)], q1 is the relative angle of the starting point while q(n) is the relative coordinate of q(n-1).)  This function does not support online blending of previous and subsequent motions. Doosan Robotics Programming Manual (ver.1.6)
  • Page 111 2Chapter Motion-related Commands ▪ Return Value Description Success Negative value Error ▪ Exception Exception Description DR_Error (DR_ERROR_TYPE) Parameter data type error occurred DR_Error (DR_ERROR_VALUE) Parameter value is invalid DR_Error (DR_ERROR_RUNTIME) C extension module error occurred DR_Error (DR_ERROR_STOP) Program terminated forcefully...
  • Page 112 # Temporarily suspends the program execution for 3 seconds (while the motion continues). set_digital_output(1, 1) # D-Out (no. 1 channel) ON mwait(0) # Temporarily suspends the program execution until the motion is terminated. ▪ Related commands posj()/set_velj()/set_accj()/mwait()/amovesj() Doosan Robotics Programming Manual (ver.1.6)
  • Page 113: Amovesx

    2Chapter Motion-related Commands amovesx ▪ Features The asynchronous movesx motion operates in the same way as movesx() except for the asynchronous processing. Generating a new command for the motion before the amovesj() motion results in an error for safety reasons. Therefore, the termination of the amovesx() motion must be confirmed using mwait() or check_motion() between amovesx() and the following motion command.
  • Page 114 Value Description Success Negative value Error ▪ Exception Exception Description DR_Error (DR_ERROR_TYPE) Parameter data type error occurred DR_Error (DR_ERROR_VALUE) Parameter value is invalid DR_Error (DR_ERROR_RUNTIME) C extension module error occurred DR_Error (DR_ERROR_STOP) Program terminated forcefully Doosan Robotics Programming Manual (ver.1.6)
  • Page 115 2Chapter Motion-related Commands ▪ Example #Example 1. D-Out 3 seconds after the spline motion through x1 - x6 begins P0 = posj(0,0,90,0,90,0) movej(P0) x0 = posx(600, 43, 500, 0, 180, 0) # Defines the posx variable (space coordinate/pose) x0. movel(x0, vel=100, acc=200) # Linear movement to the initial position x0 x1 = posx(600, 600, 600, 0, 175, 0) # Defines the posx variable (space...
  • Page 116: Amoveb

    DR_BASE: base coordinate  DR_WORLD: world coordinate  None  DR_TOOL: tool coordinate  user coordinate: User defined Movement basis  DR_MV_MOD_ABS DR_MV_MOD_ABS: Absolute  DR_MV_MOD_REL: Relative Doosan Robotics Programming Manual (ver.1.6)
  • Page 117 2Chapter Motion-related Commands Note  Abbreviated parameter names are supported. (v:vel, a:acc, t:time)  Up to 50 arguments can be entered in posb_list.  _global_velx is applied if vel is None. (The initial value of _global_velx is 0.0 and can be set by set_velx.) ...
  • Page 118 # Temporarily suspends the program execution for 3 seconds (while the motion continues). set_digital_output(1, 1) # D-Out (no. 1 channel) ON mwait(0) # Temporarily suspends the program execution until the motion is terminated. ▪ Related commands posb()/set_velx()/set_accx()/set_tcp()/set_ref_coord()/mwait()/moveb() Doosan Robotics Programming Manual (ver.1.6)
  • Page 119: Amove_Spiral

    2Chapter Motion-related Commands amove_spiral ▪ Features The asynchronous move_spiral motion operates in the same way as move_spiral() except for the asynchronous processing and executes the next line after the command is executed. Generating a new command for the motion before the amove_spiral() motion results in an error for safety reasons.
  • Page 120 Value Description Success Negative value Error ▪ Exception Exception Description DR_Error (DR_ERROR_TYPE) Parameter data type error occurred DR_Error (DR_ERROR_VALUE) Parameter value is invalid DR_Error (DR_ERROR_RUNTIME) C extension module error occurred DR_Error (DR_ERROR_STOP) Program terminated forcefully Doosan Robotics Programming Manual (ver.1.6)
  • Page 121 2Chapter Motion-related Commands ▪ Example ## hole search # (A motion that completes 9.5 revolutions (rev) to the 30 mm radius (rmax) from 0 on the Tool-X/Y surface as the center of the rotation in the Tool-Z direction # and the spiral trajectory that moves 50 mm (lmax) in the Tool-Z direction at the same time in 20 seconds # from the initial position.
  • Page 122: Amove_Periodic

    0≤atime atime float Acc-, dec- time [sec] repeat > 0 Repetition count reference coordinate DR_BASE : base coordinate  DR_WORLD : world coordinate  DR_TOOL  DR_TOOL : tool coordinate  user coordinate: user defined Doosan Robotics Programming Manual (ver.1.6)
  • Page 123 2Chapter Motion-related Commands Note  Amp refers to the amplitude. The input is a list of 6 elements which are the amp values for the axes (x, y, z, rx, ry, and rz). The amp input on the axis that does not have a motion must be 0. ...
  • Page 124 # Repeats the x-axis (10mm amp and 1 sec. period) motion and y rotating axis (0.5deg amp and 1 sec. period) motion in the tool coordinate system # 5 times. # SET(1) the Digital_Output channel no. 1, 1 second after the periodic motion begins. Related commands ▪ set_ref_coord()/move_periodic() Doosan Robotics Programming Manual (ver.1.6)
  • Page 125: Mwait(Time=0)

    2Chapter Motion-related Commands mwait(time=0) ▪ Features This function sets the waiting time between the previous motion command and the motion command in the next line. The waiting time differs according to the time[sec] input. ▪ Parameters Parameter Data Type Default Value Description Name time...
  • Page 126 # Performs the next command immediately after the blending motion. mwait(0) # Temporarily suspends the program execution until the motion is terminated. q99 = posj(0, 0, 0, 0, 0, 0) movej (q99, vel=10, acc=20) # Joint motion to q99. ▪ Related commands wait()amovej()/amovel()/amovejx()/amovec()/amovesj()/amovesx()/amoveb()/ amove_spiral()/amove_periodic() Doosan Robotics Programming Manual (ver.1.6)
  • Page 127: Begin_Blend(Radius=0)

    2Chapter Motion-related Commands begin_blend(radius=0) ▪ Features This function begins the blending section. The following sync motion commands (movej, movel, movec, and movejx) with the blending section argument radius are blended using the radius set as the default argument. There is no actual blending effect if the radius is 0. Moreover, if a blending radius that is different from the set radius is needed, the blending radius can be changed as an exception by specifying the blending radius to the motion argument.
  • Page 128 DR_MV_RA_OVERRIDE) # Immediately terminates the last motion and blends it to move to the Q2 joint angle. end_blend() # Ends the batch setting of the blending sections. ▪ Related commands end_blend()/movej()/movel()/movejx()/movec() Doosan Robotics Programming Manual (ver.1.6)
  • Page 129: End_Blend()

    2Chapter Motion-related Commands end_blend() ▪ Features This function ends the blending section. It means that the validity of the blending section that began with begin_blend() ends. ▪ Parameters Not applicable ▪ Return Value Description Success ▪ Exception Not applicable Example ▪...
  • Page 130: Check_Motion()

    # A motion is completed. amovej (q99, vel=10, acc=20) # Joint motion to q99. break if check_motion()==2: # In motion pass mwait(0) # Temporarily suspends the program execution until the motion is terminated. ▪ Related commands movej()/movel()/movejx()/movec()/movesj()/movesx()/moveb()/move_spiral() /move_periodic()/amovej()/amovel()/amovejx()/amovec()/amovesj()/amovesx()/amoveb ()/amove_spiral()/amove_periodic() Doosan Robotics Programming Manual (ver.1.6)
  • Page 131: Stop(St_Mode)

    2Chapter Motion-related Commands stop(st_mode) ▪ Features This stops the current motion. The stop time is determined based on the st_mode, which is received as a factor, and it does not deviate from the current path. This command is used to stop the robot's motion, but it does not function to stop program execution.
  • Page 132 # Executes the next command immediately after the motion with x1. wait(2) # Temporarily suspends the program for 2 seconds. stop(DR_SSTOP) # Stops the motion with a soft stop. ▪ Related commands movej()/movel()/movejx()/movec()/movesj()/movesx()/moveb()/move_spiral() /move_periodic()/amovej()/amovel()/amovejx()/amovec()/amovesj()/amovesx()/amoveb ()/amove_spiral()/amove_periodic() Doosan Robotics Programming Manual (ver.1.6)
  • Page 133: Change_Operation_Speed(Speed)

    2Chapter Motion-related Commands change_operation_speed(speed) ▪ Features This function adjusts the operation velocity. The argument is the relative velocity in a percentage of the currently set velocity and has a value from 1 to 100. Therefore, a value of 50 means that the velocity is reduced to 50% of the currently set velocity. ▪...
  • Page 134 # The velocities of all following motions executed are 100% of the specified velocity. movej (q0, vel=10, acc=20) # Moves to q0 at a velocity 100% of 10mm/sec ▪ Related commands movej()/movel()/movejx()/movec()/movesj()/movesx()/moveb()/move_spiral()/move_pe riodic()/amovej()/amovel()/amovejx()/amovec()/amovesj()/amovesx()/amoveb()/amove_ spiral()/amove_periodic() Doosan Robotics Programming Manual (ver.1.6)
  • Page 135: Wait_Manual_Guide()

    2Chapter Motion-related Commands wait_manual_guide() ▪ Features This function enables the user to perform hand guiding (changing the position of the robot by pressing the Direct Teach button in the cockpit or the TP) during the execution of the program. The user executes the next command in one of the following two ways after hand guiding is completed (unless the program is terminated, it will wait at the command until one of the following is executed after the user performs hand guiding).
  • Page 136 = get_current_posx() # Stores the directly taught point in pos1. dposa = posx(0,0,-100,0,0,0) movel(dposa, vel=300, acc=600, ref=DR_TOOL) # Retract 100 mm in the tool-Z direction from the taught position. ▪ Related commands movej()/movel()/movejx()/movec()/movesj()/movesx()/moveb()/move_spiral()/move_pe riodic()/amovej()/amovel()/amovejx()/amovec()/amovesj()/amovesx()/amoveb()/amove_ spiral()/amove_periodic() Doosan Robotics Programming Manual (ver.1.6)
  • Page 137: Wait_Nudge()

    2Chapter Motion-related Commands wait_nudge() ▪ Features This function enables users to resume the execution of the program through the user’s nudge input (applying external force to the robot) when the execution of the program is paused. When the external force greater than the force threshold, it will proceed to the following command after the resume time, where the force threshold and the resume time are set at the collaborative workspace setting menu.
  • Page 138 ▪ Related commands movej()/movel()/movejx()/movec()/movesj()/movesx()/moveb()/move_spiral()/move_pe riodic()/amovej()/amovel()/amovejx()/amovec()/amovesj()/amovesx()/amoveb()/amove_ spiral()/amove_periodic() Doosan Robotics Programming Manual (ver.1.6)
  • Page 139: Enable_Alter_Motion(N,Mode,Ref,Limit_Dpos,Limit_Dpos_Per)

    2Chapter Motion-related Commands enable_alter_motion(n,mode,ref,limit_dPOS,limit_dPO S_per) ▪ Features enable_alter_motion() and alter_motion() functions enable to alter motion trajectory. This function sets the configurations for altering function and allows the input quantity of alter_motion() to be applied to motion trajectory. The unit cycle time of generating alter motion is 100msec.
  • Page 140 # cycle time:(5*100)msec, mode:accumulate, reference coordination:base coordination # Lmitation of accumulation amount :50mm,50deg # Limitation of increment amount :10mm, 10deg th_id = thread_run(alter_thread, loop=True) movel(X1,v=50,a=100,r=30) movel(X2,v=50,a=100) thread_stop(th_id) disable_alter_motion() # deactivates alter motion Doosan Robotics Programming Manual (ver.1.6)
  • Page 141 2Chapter Motion-related Commands ▪ Related commands alter_motion(pos), disable_alter_motion()
  • Page 142: Alter_Motion([X,Y,Z,Rx,Ry,Rz])

    DR_Error (DR_ERROR_VALUE) Parameter value is invalid DR_Error (DR_ERROR_RUNTIME) C extension module error occurred DR_Error (DR_ERROR_STOP) Program terminated forcefully ▪ Example def alter_thread(): alter_motion(dX) #dX : amount of alter motion dX = [10,0,0,10,0,0] J00 = posj(0,0,90,0,90) Doosan Robotics Programming Manual (ver.1.6)
  • Page 143 2Chapter Motion-related Commands X1 = posx(559.0, 200, 651.5, 180, -180.0, 180) X2 = posx(559.0, 200, 400, 180, -180.0, 180) movej(J00,vel=50,acc=100) enable_alter_motion(n=5,mode=DR_DPOS, ref=DR_BASE, limit_dPOS=[50,90], limit_dPOS_per=[10,10]) # cycle time:(5*100)msec, mode:accumulate, reference coordination:base coordination # Lmitation of accumulation amount :50mm,90deg # Limitation of increment amount :10mm, 10deg th_id = thread_run(alter_thread, loop=True) movel(X1,v=50,a=100,r=30) movel(X2,v=50,a=100)
  • Page 144: Disable_Alter_Motion()

    X2 = posx(559.0, 200, 400, 180, -180.0, 180) movej(J00,vel=50,acc=100) enable_alter_motion(n=10,mode=DR_DPOS, ref=DR_BASE, limit_dPOS=[50,90], limit_dPOS_per=[50,50]) # cycle time:(5*100)msec, mode:accumulate, reference coordination:base coordination # Lmitation of accumulation amount :50mm,50deg # Limitation of increment amount :10mm, 10deg th_id = thread_run(alter_thread, loop=True) Doosan Robotics Programming Manual (ver.1.6)
  • Page 145 2Chapter Motion-related Commands movel(X1,v=50,a=100,r=30) movel(X2,v=50,a=100) thread_stop(th_id) disable_alter_motion() # deactivates alter motion ▪ Related commands enable_alter_motion(n,mode,ref,limit_dPOS,limit_dPOS_per), alter_motion(pos)
  • Page 146: Auxiliary Control Commands

    Value Description Control mode 3 : Position control mode 4 : Torque control mode ▪ Exception Exception Description DR_Error (DR_ERROR_RUNTIME) C extension module error occurred ▪ Example mode = get_control_mode() Related commands ▪ Not applicable Doosan Robotics Programming Manual (ver.1.6)
  • Page 147: Get_Control_Space()

    3Chapter Auxiliary Control Commands get_control_space() ▪ Features This function returns the current control space. ▪ Parameters Not applicable ▪ Return Value Description Control mode 1 : Joint space control 2 : Task space control ▪ Exception Exception Description DR_Error (DR_ERROR_RUNTIME) C extension module error occurred ▪...
  • Page 148: Get_Current_Posj()

    This function returns the current joint angle. ▪ Parameters Not applicable ▪ Return Value Description posj Joint angle ▪ Exception Exception Description DR_Error (DR_ERROR_RUNTIME) C extension module error occurred ▪ Example q1 = get_current_posj() ▪ Related commands get_desired_posj() Doosan Robotics Programming Manual (ver.1.6)
  • Page 149: Get_Current_Velj()

    3Chapter Auxiliary Control Commands get_current_velj() ▪ Features This function returns the current joint velocity. ▪ Parameters Not applicable ▪ Return Value Description float[6] Joint speed ▪ Exception Exception Description DR_Error (DR_ERROR_RUNTIME) C extension module error occurred ▪ Example velj1 = get_current_velj() ▪...
  • Page 150: Get_Desired_Posj()

    ▪ Parameters Not applicable ▪ Return Value Description posj Joint angle ▪ Exception Exception Description DR_Error (DR_ERROR_RUNTIME) C extension module error occurred DR_Error (DR_ERROR_INVALID) Invalid command Example ▪ jp1 = get_desired_posj() ▪ Related commands get_current_posj() Doosan Robotics Programming Manual (ver.1.6)
  • Page 151: Get_Desired_Velj()

    3Chapter Auxiliary Control Commands get_desired_velj() ▪ Features This function returns the current target joint velocity. It cannot be used in the movel, movec, movesx, moveb, move_spiral, or move_periodic command. ▪ Parameters Not applicable ▪ Return Value Description float[6] Target joint velocity ▪...
  • Page 152: Get_Current_Posx(Ref)

    Lefty Below Flip Lefty Above No Flip Lefty Above Flip Righty Below No Flip Righty Below Flip Righty Above No Flip Righty Above Flip ▪ Exception Exception Description DR_Error (DR_ERROR_RUNTIME) C extension module error occurred Doosan Robotics Programming Manual (ver.1.6)
  • Page 153 3Chapter Auxiliary Control Commands ▪ Example x1, sol = get_current_posx() #x1 w.r.t. DR_BASE x1_wld, sol = get_current_posx(ref=DR_WORLD) #x1 w.r.t. DR_WORLD DR_USR1=set_user_cart_coord(x1, x2, x3, pos) set_ref_coord(DR_USR1) x1, sol = get_current_posx(DR_USR1) #x1 w.r.t. DR_USR1 ▪ Related commands get_desired_posx()
  • Page 154: Get_Current_Tool_Flange_Posx(Ref)

    #x1 : Flange pose base on the base coordinate(default value) x2 = get_current_tool_flange_posx(DR_BASE) #x2 : Flange pose based on the base coordinate x3 = get_current_tool_flange_posx(DR_WORLD) #x3 : Flange pose based on the world coordinate ▪ Related commands Not applicable Doosan Robotics Programming Manual (ver.1.6)
  • Page 155: Get_Current_Velx(Ref)

    3Chapter Auxiliary Control Commands get_current_velx(ref) ▪ Features This function returns the current tool velocity based on the ref coordinate. ▪ Parameters Parameter Data Type Default Value Description Name reference coordinate DR_BASE : base coordinate  DR_BASE DR_WORLD : world coordinate ...
  • Page 156: Get_Desired_Posx(Ref)

    = posx(100, 0, 0, 0, 0, 0) x3 = posx(0, 0, 20, 20, 20, 20) pos = x3 DR_USR1=set_user_cart_coord(x1, x2, x3, pos) set_ref_coord(DR_USR1) xa = get_desired_posx(DR_USR1) #xa w.r.t. DR_USR1 xb = get_desired_posx(DR_WORLD) #xb w.r.t. DR_WORLD ▪ Related commands get_desired_posx() Doosan Robotics Programming Manual (ver.1.6)
  • Page 157: Get_Desired_Velx(Ref)

    3Chapter Auxiliary Control Commands get_desired_velx(ref) ▪ Features This function returns the target velocity of the current tool based on the ref coordinate. It cannot be used in the movej, movejx, or movesj command. ▪ Parameters 인수명 자료형 기본값 설명 reference coordinate DR_BASE DR_BASE : base coordinate ...
  • Page 158: Get_Current_Solution_Space()

    This function returns the current solution space value. ▪ Parameters Not applicable ▪ Return Value Description Solution space (0 ~ 7) ▪ Exception Exception Description DR_Error (DR_ERROR_RUNTIME) C extension module error occurred Example ▪ sol = get_current_solution_space() ▪ Related commands get_solution_space() Doosan Robotics Programming Manual (ver.1.6)
  • Page 159: Related Commands

    3Chapter Auxiliary Control Commands get_current_rotm(ref) ▪ Features This function returns the direction and matrix of the current tool based on the ref coordinate. ▪ Parameters 인수명 자료형 기본값 설명 reference coordinate DR_BASE DR_BASE : base coordinate  DR_WORLD : world coordinate ...
  • Page 160: Get_Joint_Torque()

    This function returns the sensor torque value of the current joint. ▪ Parameters Not applicable Return ▪ Value Description float[6] JTS torque value ▪ Exception Exception Description DR_Error (DR_ERROR_RUNTIME) C extension module error occurred ▪ Example j_trq1 = get_joint_torque() ▪ Related commands get_external_torque()/get_tool_force() Doosan Robotics Programming Manual (ver.1.6)
  • Page 161: Get_External_Torque()

    3Chapter Auxiliary Control Commands get_external_torque() ▪ Features This function returns the torque value generated by the external force on each current joint. ▪ Parameters Not applicable ▪ Return Value Description float[6] Torque value generated by an external force ▪ Exception Exception Description DR_Error (DR_ERROR_RUNTIME)
  • Page 162: Get_Tool_Force(Ref)

    External force applied to the tool ▪ Exception Exception Description DR_Error (DR_ERROR_RUNTIME) C extension module error occurred ▪ Example force_ext = get_tool_force(DR_WORLD) # force_ext: external force of the tool based on the world coordinate ▪ Related commands get_joint_torque()/get_external_torque() Doosan Robotics Programming Manual (ver.1.6)
  • Page 163: Get_Solution_Space(Pos)

    3Chapter Auxiliary Control Commands get_solution_space(pos) ▪ Features Calculates the solution space of the entered pos (posj). ▪ Parameters Parameter Data Type Default Value Description Name posj posj or position list list (float[6]) Return ▪ Value Description 0 ~ 7 Solution space ▪...
  • Page 164: Get_Orientation_Error(Xd, Xc, Axis)

    C extension module error occurred DR_Error (DR_ERROR_STOP) Program terminated forcefully ▪ Example xd = posx(0, 0, 0, 0, 0, 0) xc = posx(10, 20, 30, 40, 50, 60) diff = get_orientation_error(xd, xc, DR_AXIS_X) ▪ Related commands get_current_rotm() Doosan Robotics Programming Manual (ver.1.6)
  • Page 165: Other Settings And Safety-Related Commands

    4Chapter Other Settings and Safety-related Commands Other Settings and Safety-related Commands get_workpiece_weight() ▪ Features This function measures and returns the weight of the workpiece. ▪ Parameters Not applicable ▪ Return Value Description Positive value Measured weight Negative value Error ▪ Exception Exception Description...
  • Page 166: Reset_Workpiece_Weight()

    ▪ Parameters Not applicable ▪ Return Value Description Success Negative value Error ▪ Exception Exception Description DR_Error (DR_ERROR_RUNTIME) C extension module error occurred DR_Error (DR_ERROR_STOP) Program terminated forcefully Example ▪ reset_workpiece_weight() ▪ Related commands set_workpiece_weight()/get_workpiece_weight() Doosan Robotics Programming Manual (ver.1.6)
  • Page 167: Set_Tool(Name)

    4Chapter Other Settings and Safety-related Commands set_tool(name) ▪ Features This function activates the tool of the entered name among the tool information registered in the Teach Pendant. ▪ Parameters Parameter Data Type Default Value Description Name Tool name registered in the Teach name string Pendant...
  • Page 168: Set_Tool_Shape(Name)

    Parameter data type error occurred DR_Error (DR_ERROR_VALUE) Parameter value is invalid DR_Error (DR_ERROR_RUNTIME) C extension module error occurred DR_Error (DR_ERROR_STOP) Program terminated forcefully Example ▪ set_tool_shape("tool_shape1") # Activate the geometry of "tool_shape1". ▪ Related commands set_tcp() Doosan Robotics Programming Manual (ver.1.6)
  • Page 169: Set_Singularity_Handling(Mode)

    4Chapter Other Settings and Safety-related Commands set_singularity_handling(mode) ▪ Features In case of path deviation due to the effect of singularity in task motion, user can select the response policy. The mode can be set as follows. ­ Automatic avoidance mode(Default) : DR_AVOID ­...
  • Page 170 P3 = posx(400,500,200,0,180,0) set_singularity_handling (DR_AVOID) # Automatic avoidance mode for singularity movel(P1, vel=10, acc=20) set_velx(30) set_accx(60) set_singularity_handling(DR_TASK_STOP) # Task motion path first movel(P2) set_singularity_handling(DR_VAR_VEL) # Variable velocity mode for singularity movel(P3) ▪ Related commands movel()/movec()/movesx()/moveb()/move_spiral()/amovel()/amovec()/ amovesx()/amoveb()/amove_spiral() Doosan Robotics Programming Manual (ver.1.6)
  • Page 171: Force/Stiffness Control And Other User-Friendly Features

    5Chapter Force/Stiffness Control and Other User-Friendly Force/Stiffness Control and Other User- Friendly Features parallel_axis(x1, x2, x3, axis, ref) ▪ Features This function matches the normal vector of the plane consists of points(x1, x2, x3) based on the ref coordinate(refer to get_normal(x1, x2, x3)) and the designated axis of the tool frame. The current position is maintained as the TCP position of the robot.
  • Page 172 = posx(300, 100, 500, 45, 0, 45) parallel_axis(x1, x2, x3, DR_AXIS_X, DR_WORLD) # match the tool x axis and the normal vector of the plane consists of points(x1,x2,x3) # based on the world coordinate ▪ Related commands get_normal()/parallel_axis()/align_axis()/align_axis() Doosan Robotics Programming Manual (ver.1.6)
  • Page 173: Parallel_Axis(Vect, Axis, Ref)

    5Chapter Force/Stiffness Control and Other User-Friendly parallel_axis(vect, axis, ref) Features ▪ This function matches the given vect direction based on the ref coordinate and the designated axis of the tool frame. The current position is maintained as the TCP position of the robot. ▪...
  • Page 174 ▪ Related commands parallel_axis()/align_axis()/align_axis() Doosan Robotics Programming Manual (ver.1.6)
  • Page 175: Align_Axis(X1, X2, X3, Pos, Axis, Ref)

    5Chapter Force/Stiffness Control and Other User-Friendly align_axis(x1, x2, x3, pos, axis, ref) Features ▪ This function matches the normal vector of the plane consists of points(x1, x2, x3) based on the ref coordinate(refer to get_normal(x1, x2, x3)) and the designated axis of the tool frame. The robot TCP moves to the pos position.
  • Page 176 = posx(400, 400, 500, 0, 0, 0) align_axis(x1, x2, x3, pos, DR_AXIS_X, DR_BASE) # match the tool x axis and the normal vector in the plane consists of points(x1, x2, # x3) based on the base coordinate ▪ Related commands get_normal()/align_axis()/parallel_axis()/parallel_axis() Doosan Robotics Programming Manual (ver.1.6)
  • Page 177: Align_Axis(Vect, Pos, Axis, Ref)

    5Chapter Force/Stiffness Control and Other User-Friendly align_axis(vect, pos, axis, ref) Features ▪ This function matches the given vect direction based on the ref coordinate and the designated axis of the tool frame. The robot TCP moves to the pos position. ▪...
  • Page 178: Is_Done_Bolt_Tightening(M=0, Timeout=0, Axis=None)

    DR_AXIS_Y: y-axis  DR_AXIS_Z: z-axis ▪ Return Value Description Success Negative value Error ▪ Exception Exception Description DR_Error (DR_ERROR_TYPE) Parameter data type error occurred DR_Error (DR_ERROR_RUNTIME) C extension module error occurred DR_Error (DR_ERROR_STOP) Program terminated forcefully Doosan Robotics Programming Manual (ver.1.6)
  • Page 179 5Chapter Force/Stiffness Control and Other User-Friendly ▪ Example p0 = posj(0,0,90,0,90,0) movej(p0, v=30, a=30) task_compliance_ctrl() xd = posx(559, 34.5, 651.5, 0, 180.0, 60) amovel(xd, vel=50, acc=50) # Bolt tightening motion res = is_done_bolt_tightening(10, 5, DR_AXIS_Z) # Returns True if the tightening torque of 10Nm is reached within 5 seconds. # Returns False otherwise.
  • Page 180: Release_Compliance_Ctrl()

    Error ▪ Exception Exception Description DR_Error (DR_ERROR_RUNTIME) C extension module error occurred DR_Error (DR_ERROR_STOP) Program terminated forcefully ▪ Example P0 = posj(0,0,90,0,90,0) movej(P0) task_compliance_ctrl() set_stiffnessx([100, 100, 300, 100, 100, 100]) release_compliance_ctrl() ▪ Related commands task_compliance_ctrl()/set_stiffnessx() Doosan Robotics Programming Manual (ver.1.6)
  • Page 181: Task_Compliance_Ctrl(Stx, Time)

    5Chapter Force/Stiffness Control and Other User-Friendly task_compliance_ctrl(stx, time) Features ▪ This function begins task compliance control based on the preset reference coordinate system. ▪ Parameters (Stiffness TBD) Parameter Data Type Default Value Description Name Three translational stiffnesses [3000, 3000, 3000, float[6] 200, 200, 200] Three rotational stiffnesses...
  • Page 182 ▪ Related commands set_stiffnessx()/elease_compliance_ctrl() Doosan Robotics Programming Manual (ver.1.6)
  • Page 183: Set_Stiffnessx(Stx, Time)

    5Chapter Force/Stiffness Control and Other User-Friendly set_stiffnessx(stx, time) Features ▪ This function sets the stiffness value based on the global coordinate(refer to set_ref_coord()). The linear transition from the current or default stiffness is performed during the time given as STX. The user-defined ranges of the translational stiffness and rotational stiffness are 0-20000N/m and 0- 400Nm/rad, respectively.
  • Page 184: Calc_Coord(X1, X2, X3, X4, Ref, Mod)

     0: defining z-axis based on the current Tool-z direction  1: defining z-axis based on the z direction of x1 ▪ Return Value Description Successful coordinate calculation posx Position information of the calculated coordinate Doosan Robotics Programming Manual (ver.1.6)
  • Page 185 5Chapter Force/Stiffness Control and Other User-Friendly ▪ Exception Exception Description DR_Error (DR_ERROR_TYPE) Parameter data type error occurred DR_Error (DR_ERROR_VALUE) Parameter value is invalid DR_Error (DR_ERROR_RUNTIME) C extension module error occurred DR_Error (DR_ERROR_STOP) Program terminated forcefully Example ▪ pos1 = posx(500, 30, 500, 0, 0, 0) pos2 = posx(400, 30, 500, 0, 0, 0) pos3 = posx(500, 30, 600, 45, 180, 45) pos4 = posx(500, -30, 600, 0, 180, 0)
  • Page 186: Set_User_Cart_Coord(Pos, Ref)

    C extension module error occurred DR_Error (DR_ERROR_STOP) Program terminated forcefully ▪ Example pos1 = posx(10, 20, 30, 0, 0, 0) pos2 = posx(30, 50, 70, 45, 180, 45) user_id1 = set_user_cart_coord(pos1, ref=DR_BASE) user_id2 = set_user_cart_coord(pos2, ref=DR_WORLD) Doosan Robotics Programming Manual (ver.1.6)
  • Page 187 5Chapter Force/Stiffness Control and Other User-Friendly ▪ Related commands set_ref_coord()
  • Page 188: Set_User_Cart_Coord(X1, X2, X3, Pos, Ref)

    (float[6]) reference coordinate DR_BASE: base coordinate  DR_BASE DR_WORLD: world coordinate  ▪ Return Value Description Successful coordinate setting Positive integer Set coordinate ID (101 - 200) Failed coordinate setting Doosan Robotics Programming Manual (ver.1.6)
  • Page 189 5Chapter Force/Stiffness Control and Other User-Friendly ▪ Exception Exception Description DR_Error (DR_ERROR_TYPE) Parameter data type error occurred DR_Error (DR_ERROR_VALUE) Parameter value is invalid DR_Error (DR_ERROR_RUNTIME) C extension module error occurred DR_Error (DR_ERROR_STOP) Program terminated forcefully ▪ Example x1 = posx(0, 500, 700, 0, 0, 0) # Ignores the Euler angle. x2 = posx(500, 0, 700, 0, 0, 0) x3 = posx(300, 100, 500, 0, 0) x4 = posx(300, 110, 510, 0, 0)
  • Page 190: Set_User_Cart_Coord(U1, V1, Pos, Ref)

    Set coordinate ID (101 - 200) Failed coordinate setting ▪ Exception Exception Description DR_Error (DR_ERROR_TYPE) Parameter data type error occurred DR_Error (DR_ERROR_VALUE) Parameter value is invalid DR_Error (DR_ERROR_RUNTIME) C extension module error occurred DR_Error (DR_ERROR_STOP) Program terminated forcefully Doosan Robotics Programming Manual (ver.1.6)
  • Page 191 5Chapter Force/Stiffness Control and Other User-Friendly ▪ Example u1 = [1, 1, 0] v1 = [-1, 1, 0] pos = posx(10, 20, 30, 0, 0, 0) user_tc1 = set_user_cart_coord(u1, v1, pos) user_tc2 = set_user_cart_coord(u1, v1, pos, ref=DR_WORLD) Related commands ▪ set_ref_coord()
  • Page 192: Overwrite_User_Cart_Coord(Id, Pos, Ref)

    C extension module error occurred DR_Error (DR_ERROR_STOP) Program terminated forcefully ▪ Example pose_user1 = posx(30, 40, 50, 0, 0, 0) id_user = set_user_cart_coord(pose_user1, ref=DR_BASE) pose_user2 = posx(100, 150, 200, 45, 180, 0) overwrite_user_cart_coord(id_user, pose_user2, ref=DR_BASE) ▪ Related commands set_user_cart_coord() Doosan Robotics Programming Manual (ver.1.6)
  • Page 193: Get_User_Cart_Coord(Id)

    5Chapter Force/Stiffness Control and Other User-Friendly get_user_cart_coord(id) ▪ Features This function returns the pose and reference coordinate system of the requested user coordinate system [id]. ▪ Parameters Parameter Data Type Default Value Description Name coordinate ID ▪ Return Value Description posx Position and orientation information of the coordinate to get Reference coordinate of the coordinate to get...
  • Page 194: Set_Desired_Force(Fd, Dir, Time, Mod)

    Value Description Success Negative value Error ▪ Exception Exception Description DR_Error (DR_ERROR_TYPE) Parameter data type error occurred DR_Error (DR_ERROR_VALUE) Parameter value is invalid DR_Error (DR_ERROR_RUNTIME) C extension module error occurred DR_Error (DR_ERROR_STOP) Program terminated forcefully Doosan Robotics Programming Manual (ver.1.6)
  • Page 195 5Chapter Force/Stiffness Control and Other User-Friendly Note  The value of external force refers to the sensor measurement at terminating the force control (control mode transition to compliance control) by the command release_force(). Therefore, the variation in external force can occur if the option mod=DR_FC_MOD_REL is applied.
  • Page 196: Release_Force(Time=0)

    = [500, 500, 500, 100, 100, 100]) fd = [0, 0, 0, 0, 0, 10] fctrl_dir= [0, 0, 1, 0, 0, 1] set_desired_force(fd, dir=fctrl_dir, time=1.0) movel(x3, v=10) release_force(0.5) release_compliance_ctrl() ▪ Related commands set_desired_force()/task_compliance_ctrl()/set_stiffnessx()/release_compliance_ctrl() Doosan Robotics Programming Manual (ver.1.6)
  • Page 197: Check_Position_Condition(Axis, Min, Max, Ref, Mod, Pos)

    5Chapter Force/Stiffness Control and Other User-Friendly check_position_condition(axis, min, max, ref, mod, pos) ▪ Features This function checks the status of the given position. This condition can be repeated with the while or if statement. Axis and pos of input paramets are based on the ref coordinate. In case of ref=DR_TOOL, pos should be defined in BASE coordinate.
  • Page 198 CON6= check_position_condition(DR_AXIS_Z,min=-10,max=-5, mod=DR_MV_MOD_ABS) # −10 ≤ z ≤ −5 posx1 = posx(400, 500, 800, 0, 180,0) CON7= check_position_condition(DR_AXIS_Z,min=-10,max=-5,mod = # posx1_(z) − DR_MV_MOD_REL, pos=posx1) 10 ≤ z ≤ posx1_(z) − 5 ▪ Related commands check_force_condition()/check_orientation_condition()/set_ref_coord() Doosan Robotics Programming Manual (ver.1.6)
  • Page 199 5Chapter Force/Stiffness Control and Other User-Friendly check_force_condition(axis, min, max, ref) Features ▪ This function checks the status of the given force. It disregards the force direction and only compares the sizes. This condition can be repeated with the while or if statement. Measuring the force, axis is based on the ref coordinate and measuring the moment, axis is based on the tool coordinate.
  • Page 200 # 5 ≤ f ≤ 10 while (fcon1): # 30 ≤ m fcon2 = check_force_condition(DR_AXIS_C, min=30) pcon1 = check_position_condition(DR_AXIS_X, min=0, max=0.1) # 0 ≤ x ≤ 0.1 if (fcon2 and pcon1): break ▪ Related commands check_position_condition()/check_orientation_condition()/set_ref_coord() Doosan Robotics Programming Manual (ver.1.6)
  • Page 201 5Chapter Force/Stiffness Control and Other User-Friendly check_orientation_condition(axis, min, max, ref, mod) Features ▪ This function checks the difference between the current pose and the specified pose of the robot end effector. It returns the difference between the current pose and the specified pose in rad with the algorithm that transforms it to a rotation matrix using the "AngleAxis"...
  • Page 202 # CON2=False since posx1 Rz=30 > posxc Rz=15 CON3= check_orientation_condition(DR_AXIS_C, max= posx2) # If the current task coordinate posxc = posx(400, 500, 500, 0, 180, 75) # CON2=False since posx1 Rz=75 > posxc Rz=60 ▪ Related commands check_position_condition()/check_force_condition()/check_orientation_condition() /set_ref_coord() Doosan Robotics Programming Manual (ver.1.6)
  • Page 203 5Chapter Force/Stiffness Control and Other User-Friendly check_orientation_condition(axis, min, max, ref, mod, pos) ▪ Features This function checks the difference between the current pose and the rotating angle range of the robot end effector. It returns the difference (in rad) between the current pose and the rotating angle range with the algorithm that transforms it to a rotation matrix using the "AngleAxis"...
  • Page 204 # CON1=True since posx1 Rz=15 – (min=5) < posxc Rz=40 CON1= check_orientation_condition(DR_AXIS_C, max=5, mod=DR_MV_MOD_REL, pos=posx1) # If the current task coordinate posxc = posx(400, 500, 500, 0, 180, 40) # CON1=False since posxc Rz=40 > posx1 Rz=15 + (max=5) ▪ Related commands check_position_condition()/check_force_condition()/check_orientation_condition() /set_ref_coord() Doosan Robotics Programming Manual (ver.1.6)
  • Page 205 5Chapter Force/Stiffness Control and Other User-Friendly 5.21 coord_transform(pose_in, ref_in, ref_out) ▪ Features This function transforms given task position expressed in reference coordinate, ‘ref_in’ to task position expressed in reference coordinate, ‘ref_out’. It returns transformed task position. It supports calculation of coordinate transformation for the following cases. •...
  • Page 206 # Transform task position(base_pos) expressed in base reference coordinate to task position expressed in tool reference coordinate # This command returns task position expressed in tool reference coordinate and the result value is stored in tool_pos ▪ Related commands set_user_cart_coord()/get_current_posx()/get_desired_posx()/set_ref_coord() Doosan Robotics Programming Manual (ver.1.6)
  • Page 207: System Commands

    6Chapter System Commands System Commands IO Related set_digital_output(index, val =None) ▪ Features This function sends a signal at the digital contact point of the controller. A value saved in the digital output register is output as a digital signal. ▪ Parameters Parameter Data Type...
  • Page 208 # No. 16 contact OFF set_digital_output(3) #No. 3 contact ON (A positive number means ON if the argument val is omitted.) set_digital_output(-3) #No. 3 contact OFF (A negative number means OFF if the argument val is omitted.) Doosan Robotics Programming Manual (ver.1.6)
  • Page 209 6Chapter System Commands set_digital_outputs(bit_list) ▪ Features This function sends a signal to multiple digital output contact points of the controller. The digital signals of the contact points defined in bit_list are output at one. ▪ Parameters Parameter Data Type Default Value Description Name List of multiple output contacts...
  • Page 210 Value Description Success Failed Negative value ▪ Exception Exception Description DR_Error (DR_ERROR_TYPE) Parameter data type error occurred DR_Error (DR_ERROR_VALUE) Parameter value is invalid DR_Error (DR_ERROR_RUNTIME) C extension module error occurred DR_Error (DR_ERROR_STOP) Program terminated forcefully Doosan Robotics Programming Manual (ver.1.6)
  • Page 211 6Chapter System Commands ▪ Example # Outputs contact 1=ON, contact 2=ON, contact 3=OFF, and contact 4=OFF. set_digital_outputs(bit_start=1, bit_end=4, val=0b0011) # 0b means a binary number. # Outputs contact 3=ON and contact 4=OFF. set_digital_outputs(bit_start=3, bit_end=4, val=0b01) # 0b means a binary number. # Outputs the ON signal from contacts 1 through 8.
  • Page 212 Parameter value is invalid DR_Error (DR_ERROR_RUNTIME) C extension module error occurred DR_Error (DR_ERROR_STOP) Program terminated forcefully ▪ Example in1 = get_digital_input(1) # Reads the no. 1 contact in8 = get_digital_input(8) # Reads the no. 8 contact Doosan Robotics Programming Manual (ver.1.6)
  • Page 213 6Chapter System Commands get_digital_inputs(bit_list) ▪ Features This function reads the signals from multiple digital contact points of the controller. The digital signals of the contact points defined in bit_list are input at one. ▪ Parameters Parameter Data Type Default Value Description Name List of contact points to read...
  • Page 214 Program terminated forcefully ▪ Example # input contacts: No. 1=OFF, No. 2=OFF, No. 3=ON, and No. 4=ON res = get_digital_inputs(bit_start=1, bit_end=4) #res expected value = 0b1100 (binary number), 12 (decimal number), or 0x0C (hexadecimal number) Doosan Robotics Programming Manual (ver.1.6)
  • Page 215 6Chapter System Commands wait_digital_input(index, val, timeout=None) ▪ Features This function waits until the signal value of the digital input register of the controller becomes val (ON or OFF). The waiting time can be changed with a timeout setting. The waiting time ends, and the result is returned if the waiting time has passed.
  • Page 216 # Sets the no. 6 contact of the robot arm OFF set_tool_digital_output(3 #No. 3 contact ON (A positive number means ON if the argument val is omitted.) set_tool_digital_output(-3) #No. 3 contact OFF (A negative number means OFF if the argument val is omitted.) Doosan Robotics Programming Manual (ver.1.6)
  • Page 217 6Chapter System Commands set_tool_digital_outputs(bit_list) ▪ Features This function sends the signal of the robot tool from the digital contact point. The digital signals of the contact points defined in bit_list are output at one. ▪ Parameters Parameter Data Type Default Value Description Name List of multiple output contacts...
  • Page 218 Value Description Success Error Negative value ▪ Exception Exception Description DR_Error (DR_ERROR_TYPE) Parameter data type error occurred DR_Error (DR_ERROR_VALUE) Parameter value is invalid DR_Error (DR_ERROR_RUNTIME) C extension module error occurred DR_Error (DR_ERROR_STOP) Program terminated forcefully Doosan Robotics Programming Manual (ver.1.6)
  • Page 219 6Chapter System Commands ▪ Example # Outputs contact 1=ON, contact 2=ON, contact 3=OFF, and contact 4=OFF. set_tool_digital_outputs(bit_start=1, bit_end=4, val=0b0011) # 0b means a binary number. # Outputs contact 3=ON and contact 4=OFF. set_tool_digital_outputs(bit_start=3, bit_end=4, val=0b01) # 0b means a binary number. # Outputs the ON signal from contacts 1 through 8.
  • Page 220 Parameter value is invalid DR_Error (DR_ERROR_RUNTIME) C extension module error occurred DR_Error (DR_ERROR_STOP) Program terminated forcefully ▪ Example get_tool_digital_input(1) # Reads the no. 1 contact of tool I/O get_tool_digital_input(6) # Reads the no. 6 contact of tool I/O Doosan Robotics Programming Manual (ver.1.6)
  • Page 221 6Chapter System Commands get_tool_digital_inputs(bit_list) ▪ Features This function reads the signal of the robot tool from the digital contact point. The digital signals of the contact points defined in bit_list are input at one. ▪ Parameters Parameter Default Data Type Description Name Value...
  • Page 222 #res expected value = 0b100 (binary number), 4 (decimal number), or 0x04 (hexadecimal number) # input contacts: No. 4=ON, No. 5=ON, and No. 6=OFF res = get_tool_digital_inputs(4, 6) #res expected value = 0b011 (binary number), 3 (decimal number), or 0x03 (hexadecimal number) Doosan Robotics Programming Manual (ver.1.6)
  • Page 223 6Chapter System Commands wait_tool_digital_input(index, val, timeout=None) ▪ Features This function waits until the digital input signal value of the robot tool becomes val (ON or OFF). The waiting time can be changed with a timeout setting. The waiting time ends, and the result is returned if the waiting time has passed.
  • Page 224 # Waiting is terminated and res = 0 if the no. 1 contact becomes ON within 3 seconds. # Waiting is terminated and res = -1 if the no. 1 contact does not become ON within 3 seconds. Doosan Robotics Programming Manual (ver.1.6)
  • Page 225 6Chapter System Commands set_mode_analog_output(ch, mod ) ▪ Features This function sets the channel mode of the controller analog output. ▪ Parameters Parameter Default Data Type Description Name Value  1 : channel 1  2 : channel 2 analog io mode ...
  • Page 226 DR_Error (DR_ERROR_RUNTIME) C extension module error occurred DR_Error (DR_ERROR_STOP) Program terminated forcefully Example ▪ # Sets analog_input channel 1 to the current mode. set_mode_analog_input(ch=1, mod=DR_ANALOG_CURRENT) # Sets analog_input channel 2 to the voltage mode. set_mode_analog_input(ch=2, mod=DR_ANALOG_VOLTAGE) Doosan Robotics Programming Manual (ver.1.6)
  • Page 227 6Chapter System Commands set_analog_output(ch, val) ▪ Features This function outputs the channel value corresponding to the controller analog output. ▪ Parameters Parameter Default Data Type Description Name Value  1 : channel 1  2 : channel 2 analog output value float ...
  • Page 228 #input ch1=current mode set_mode_analog_input(ch=2, mod=DR_ANALOG_VOLTAGE) #input ch2=voltage mode Cur = get_analog_input(1) # Reads the analog input current value of channel 1 Vol = get_analog_input(2) # Reads the analog input voltage value of channel 2. Doosan Robotics Programming Manual (ver.1.6)
  • Page 229 6Chapter System Commands TP Interface tp_popup(message, pm_type=DR_PM_MESSAGE, type=0) ▪ Features This function provides a message to users through the Teach Pendant. The higher level controller receives the string and displays it in the popup window, and the window must be closed by a user’s confirmation.
  • Page 230 TP Interface ▪ Example tp_popup("move done", DR_PM_MESSAGE) tp_popup("Error!! ", DR_PM_ALARM) tp_popup("a={0}, b={1}, c={2}".format(a,b,c) ,DR_PM_MESSAGE) tp_popup("critical error!! ", DR_PM_ALARM, 1) Doosan Robotics Programming Manual (ver.1.6)
  • Page 231 6Chapter System Commands tp_log(message) ▪ Features This function records the user-written log to the Teach Pendant. ▪ Parameters Parameter Data Type Default Value Description Name Log message message string (The message is limited to less than 256 bytes.) Return ▪ Value Description Success...
  • Page 232 ▪ Exception Exception Description DR_Error (DR_ERROR_TYPE) Parameter data type error occurred DR_Error (DR_ERROR_VALUE) Parameter value is invalid DR_Error (DR_ERROR_RUNTIME) C extension module error occurred DR_Error (DR_ERROR_STOP) Program terminated forcefully ▪ Example tp_progress(1, 100) tp_progress(99, 100) Doosan Robotics Programming Manual (ver.1.6)
  • Page 233 6Chapter System Commands tp_get_user_input(message, input_type) ▪ Features This function receives the user input data through the Teach Pendant. ▪ Parameters Parameter Data Default Value Description Name Type Character string message to be displayed on message string the TP user input window TP user input message type ...
  • Page 234 DR_VAR_STR) if str_y=="a": # Moves to q5 if the TP user input is "a". movej(q5, vel=30, acc=30) else: # Moves to q6 if the TP user input is not "a". movej(q6, vel=30, acc=30) Doosan Robotics Programming Manual (ver.1.6)
  • Page 235 6Chapter System Commands Thread thread_run(th_func_name, loop=False) ▪ Features This function creates and executes a thread. The features executed by the thread are determined by the functions specified in th_func_name. Note The following constraints are applied when using the thread command. ...
  • Page 236 Example #----- Thread -------------------------------------- def fn_th_func(): if check_motion()==0: # No motion in action set_digital_output(1, OFF) else: set_digital_output(1, ON) #----- Main routine ---------------------------------- th_id = thread_run(fn_th_func, loop=True) # Thread run while 1: # do something… wait(0.1) Doosan Robotics Programming Manual (ver.1.6)
  • Page 237 6Chapter System Commands thread_stop(th_id) ▪ Features This function terminates a thread. The program is automatically terminated when the DRL program is terminated even if the thread_stop() command is not used. Parameters ▪ Parameter Data Default Value Description Name Type th_id Thread ID to stop Return ▪...
  • Page 238 Program terminated forcefully ▪ Example def fn_th_func(): if check_motion()==0: # No motion in action set_digital_output(1, OFF) else: set_digital_output(1, ON) #----- Main routine -------------------------------------- th_id = thread_run(fn_th_func, loop=True) # do something… thread_pause(th_id) # Suspends the thread. Doosan Robotics Programming Manual (ver.1.6)
  • Page 239 6Chapter System Commands thread_resume(th_id) ▪ Features This function resumes a temporarily suspended thread. ▪ Parameters Parameter Data Default Value Description Name Type th_id Suspended thread ID to be resumed ▪ Return Value Description Success Negative value Failed ▪ Exception Exception Description DR_Error (DR_ERROR_TYPE) Parameter data type error occurred...
  • Page 240 Parameter data type error occurred DR_Error (DR_ERROR_VALUE) Parameter value is invalid ▪ Example def fn_th_func(): if check_motion()==0: # No motion in action set_digital_output(1, OFF) else: set_digital_output(1, ON) th_id = thread_run(fn_th_func, loop=True) state1 = thread_state(th_id) thread_pause(th_id) state2 = thread_state(th_id) Doosan Robotics Programming Manual (ver.1.6)
  • Page 241 6Chapter System Commands Integrated example This example explains how to use the thread. ▪ Example 1: Thread example #----- thread 1: client comm. --------------------- def fn_th_client(): global g_sock global g_cmd res, rx_data = client_socket_read(g_sock) if res > 0: g_cmd = rx_data.decode() #decode: Converts byte type into a string. else: # Communication error client_socket_close(g_sock) exit() # Terminates the program.
  • Page 242 If "a" is received from the server, it moves to p1 and sends "end" to the servers. If "b" is received from the server, it moves to p2 and sends "end" to the servers. If "c" is received from the server, it moves to p3 and sends "end" to the servers. Doosan Robotics Programming Manual (ver.1.6)
  • Page 243 6Chapter System Commands Others wait(time) ▪ Features This function waits for the specified time. ▪ Parameters Parameter Data Default Value Description Name Type Time Float Time [sec] ▪ Return Value Description Success Error Negative value Exception ▪ Exception Description DR_Error (DR_ERROR_TYPE) Parameter data type error occurred DR_Error (DR_ERROR_VALUE) Parameter value is invalid...
  • Page 244 Others exit() ▪ Features This function terminates the currently running program. Return ▪ Value Description Success ▪ Exception Exception Description DR_Error (DR_ERROR_RUNTIME) C extension module error occurred ▪ Example exit() Doosan Robotics Programming Manual (ver.1.6)
  • Page 245 6Chapter System Commands 6.4.3 sub_program_run(name) ▪ Features It executes a subprogram saved as a separate file. ▪ Parameter Parameter Data Default Value Description Name Type name string Name of subprogram ▪ Return Value Description module Module object of executed subprogram ▪...
  • Page 246 <subProgrmB.drl> from DRCF import * movej[(10,0,90,0,90,0), vel=30, acc=30) <main program> while True: var_select = tp_get_user_input("Select File", DR_VAR_INT) if var_select == 0: sub_program_run("subProgramA") # execute subProgramA elif var_select == 1: sub_program_run("subProgramB") # execute subProgramB Doosan Robotics Programming Manual (ver.1.6)
  • Page 247 6Chapter System Commands 6.4.4 drl_report_line(option) ▪ Features This command is used to turn ON / OFF the execution line display function when the DRL script is running. When the run line display function is turned OFF, the time required to execute the run line display function is reduced, which significantly speeds up the execution of the DRL.
  • Page 248 Description None None ▪ Example count = 0 movej(posj(0, 0, 90, 0,90,0), vel=30, acc=30) while True: movej(posj(0, 0, -90, 0,90,0), vel=30, acc=30) movej(posj(0, 0, 90, 0,90,0), vel=30, acc=30) count = count + 1 set_fm("TotalCount", count) Doosan Robotics Programming Manual (ver.1.6)
  • Page 249: Mathematical Function

    7Chapter Mathematical Function Mathematical Function sin(x) ▪ Features This function returns the sine value of x radians. Parameters ▪ Parameter Data Default Value Description Name Type float Return ▪ Value Description the sine of x ▪ Exception Exception Description DR_Error (DR_ERROR_TYPE) Parameter data type error occurred...
  • Page 250 This function returns the cosine value of x radians. ▪ Parameters Parameter Data Default Value Description Name Type float ▪ Return Value Description the cosine of x Exception ▪ Exception Description DR_Error (DR_ERROR_TYPE) Parameter data type error occurred Doosan Robotics Programming Manual (ver.1.6)
  • Page 251 7Chapter Mathematical Function tan(x) ▪ Features This function returns the tangent value of x radians. ▪ Parameters Parameter Data Default Value Description Name Type float ▪ Return Value Description the tangent of x ▪ Exception Exception Description DR_Error (DR_ERROR_TYPE) Parameter data type error occurred...
  • Page 252 This function returns the arc sine value of x radians. ▪ Parameters Parameter Default Data Type Description Name Value float ▪ Return Value Description the arc sine of x Exception ▪ Exception Description DR_Error (DR_ERROR_TYPE) Parameter data type error occurred Doosan Robotics Programming Manual (ver.1.6)
  • Page 253 7Chapter Mathematical Function acos(x) ▪ Features This function returns the arc cosine value of x radians. ▪ Parameters Parameter Default Data Type Description Name Value float ▪ Return Value Description the arc cosine of x ▪ Exception Exception Description DR_Error (DR_ERROR_TYPE) Parameter data type error occurred...
  • Page 254 This function returns the arc tangent value of x radians. ▪ Parameters Parameter Default Data Type Description Name Value float ▪ Return Value Description the arc tangent of x Exception ▪ Exception Description DR_Error (DR_ERROR_TYPE) Parameter data type error occurred Doosan Robotics Programming Manual (ver.1.6)
  • Page 255 7Chapter Mathematical Function atan2(y, x) ▪ Features This function returns the arc tangent value of y/x radians. ▪ Parameters Parameter Default Data Type Description Name Value float float ▪ Return Value Description the arc tangent of y/x The result is between -pi and pi ▪...
  • Page 256 This returns the smallest integer larger than or equal to x. It truncates up to the integer. ▪ Parameters Parameter Default Data Type Description Name Value float ▪ Return Value Description rounded integer Exception ▪ Exception Description DR_Error (DR_ERROR_TYPE) Parameter data type error occurred Doosan Robotics Programming Manual (ver.1.6)
  • Page 257 7Chapter Mathematical Function floor(x) ▪ Features This returns the largest integer smaller than or equal to x. It rounds down to the nearest one. ▪ Parameters Parameter Default Data Type Description Name Value float ▪ Return Value Description rounded integer ▪...
  • Page 258 Return x raised to the power of y. ▪ Parameters Parameter Default Data Type Description Name Value float float Return ▪ Value Description x raised to the power y ▪ Exception Exception Description DR_Error (DR_ERROR_TYPE) Parameter data type error occurred Doosan Robotics Programming Manual (ver.1.6)
  • Page 259 7Chapter Mathematical Function sqrt(x) ▪ Features This function returns the square root of x. ▪ Parameters Parameter Default Data Type Description Name Value float ▪ Return Value Description the square root of x Success ▪ Exception Exception Description DR_Error (DR_ERROR_TYPE) Parameter data type error occurred...
  • Page 260 Data Type Description Name Value float float base, e (natural logarithm) ▪ Return Value Description the logarithm of f to the base of b. ▪ Exception Exception Description DR_Error (DR_ERROR_TYPE) Parameter data type error occurred Doosan Robotics Programming Manual (ver.1.6)
  • Page 261 7Chapter Mathematical Function d2r(x) ▪ Features This returns x degrees as radians. ▪ Parameters Parameter Default Data Type Description Name Value float The angle in degrees ▪ Return Value Description The angle in radians Exception ▪ Exception Description DR_Error (DR_ERROR_TYPE) Parameter data type error occurred...
  • Page 262 This function returns the x radians value to degrees. ▪ Parameters Parameter Default Data Type Description Name Value float The angle in radians ▪ Return Value Description The angle in degrees Exception ▪ Exception Description DR_Error (DR_ERROR_TYPE) Parameter data type error occurred Doosan Robotics Programming Manual (ver.1.6)
  • Page 263 7Chapter Mathematical Function norm(x) ▪ Features This function returns the L2 norm of x. ▪ Parameters Parameter Default Data Type Description Name Value float[3] Point coordinate (x, y, z) ▪ Return Value Description float Size of the point coordinate vector Exception ▪...
  • Page 264 Features This function returns a random number between 0 and 1. ▪ Return Value Description random number Random number between 0 and 1 (float) Exception ▪ Exception Description DR_Error (DR_ERROR_TYPE) Parameter data type error occurred Doosan Robotics Programming Manual (ver.1.6)
  • Page 265 7Chapter Mathematical Function rotx(angle) ▪ Features This function returns a rotation matrix that rotates by the angle value along the x-axis. ▪ Parameters Parameter Default Data Type Description Name Value angle float Rotating angle [deg] ▪ Return Value Description float[3][3] Rotation matrix ▪...
  • Page 266 Parameter Default Data Type Description Name Value angle float Rotating angle [deg] ▪ Return Value Description float[3][3] Rotation matrix ▪ Exception Exception Description DR_Error (DR_ERROR_TYPE) Parameter data type error occurred ▪ Example rotm = roty(30) Doosan Robotics Programming Manual (ver.1.6)
  • Page 267 7Chapter Mathematical Function rotz(angle) ▪ Features This function returns a rotation matrix that rotates by the angle value along the z-axis. ▪ Parameters Parameter Default Data Type Description Name Value angle float Rotating angle [deg] ▪ Return Value Description float[3][3] Rotation matrix ▪...
  • Page 268 Description Name Value rotm Float[3][3] Rotation matrix ▪ Return Value Description float[3] ZYZ Euler angle [deg] ▪ Exception Exception Description DR_Error (DR_ERROR_TYPE) Parameter data type error occurred ▪ Example rotm = [[1,0,0],[0,0.87,-0.5],[0,0.5,0.87]] eul = rotm2eul(rotm) Doosan Robotics Programming Manual (ver.1.6)
  • Page 269 7Chapter Mathematical Function rotm2rotvec(rotm) ▪ Features This function receives a rotation matrix and returns the rotation vector (angle/axis representation). ▪ Parameters Parameter Default Data Type Description Name Value rotm float[3][3] Rotation matrix ▪ Return Value Description float[3] rotation vector ▪ Exception Exception Description...
  • Page 270 [0 0 0] Euler angle (zyz) [deg] ▪ Return Value Description float[3][3] Rotation matrix ▪ Exception Exception Description DR_Error (DR_ERROR_TYPE) Parameter data type error occurred ▪ Example eul = [90, 90, 0] rotm = eul2rotm (eul) Doosan Robotics Programming Manual (ver.1.6)
  • Page 271 7Chapter Mathematical Function eul2rotvec([alpha,beta,gamma]) ▪ Features This function transforms a Euler angle (zyz order) to a rotation vector. ▪ Parameters Parameter Default Data Type Description Name Value float[3] [0 0 0] Euler angle (zyz) [deg] ▪ Return Value Description float[3] rotation vector ▪...
  • Page 272 ▪ Return Value Description float[3] ZYZ Euler angle [deg] ▪ Exception Exception Description DR_Error (DR_ERROR_TYPE) Parameter data type error occurred ▪ Example rotvec = [0.7854, 0, 0] eul = rotvec2eul(rotvec) # eul=[45,0,0] Doosan Robotics Programming Manual (ver.1.6)
  • Page 273 7Chapter Mathematical Function rotvec2rotm([rx,ry,rz]) ▪ Features This function transforms a rotation vector to a rotation matrix. ▪ Parameters Parameter Default Data Type Description Name Value rotvec float[3] rotation vector Return ▪ Value Description float[3][3] Rotation matrix ▪ Exception Exception Description DR_Error (DR_ERROR_TYPE) Parameter data type error occurred ▪...
  • Page 274 [mm, deg] ▪ Exception Exception Description DR_Error (DR_ERROR_TYPE) Parameter data type error occurred ▪ Example posx1 = [100, 20, 300, 90, 0, 180] posx2 = [200, 50, 100, 90, 30, 150] posx = htrans(posx1,posx2) Doosan Robotics Programming Manual (ver.1.6)
  • Page 275 7Chapter Mathematical Function get_intermediate_pose(posx1,posx2,alpha) ▪ Features This function returns posx located at alpha of the linear transition from posx1 to posx2. It returns posx1 if alpha is 0, the median value of two poses if alpha is 0.5, and posx2 if alpha is 1.
  • Page 276 [mm] ▪ Exception Exception Description DR_Error (DR_ERROR_TYPE) Parameter data type error occurred ▪ Example posx1 = [100, 20, 300, 90, 0, 180] posx2 = [200, 50, 100, 90, 30, 150] dis_posx = get_distance(posx1, posx2) Doosan Robotics Programming Manual (ver.1.6)
  • Page 277 7Chapter Mathematical Function get_normal(x1, x2, x3) ▪ Features This function returns the normal vector of a surface consisting of three points (posx) in the task space. This direction is clockwise. ▪ Parameters Parameter Default Data Type Description Name Value posx or posx list (float[6]) position list...
  • Page 278 [mm, deg] ▪ Exception Exception Description DR_Error (DR_ERROR_TYPE) Parameter data type error occurred Example ▪ posx1 = [100, 20, 300, 90, 0, 180] posx2 = [200, 50, 100, 90, 30, 150] add_posx = add_pose(posx1, posx2) Doosan Robotics Programming Manual (ver.1.6)
  • Page 279 7Chapter Mathematical Function subtract_pose(posx1,posx2) ▪ Features This function obtains the difference between two poses. �� �� �� �� �� ]) ⇒ [ �� �� �� − �� subtract_pose([ ] ,[ Parameters ▪ Parameter Default Data Type Description Name Value posx or posx posx1 list (float[6])
  • Page 280 [mm, deg] ▪ Return Value Description posx [mm, deg] ▪ Exception Exception Description DR_Error (DR_ERROR_TYPE) Parameter data type error occurred ▪ Example posx1 = [100, 20, 300, 90, 0, 180] inv_posx = inverse_pose(posx1) Doosan Robotics Programming Manual (ver.1.6)
  • Page 281 7Chapter Mathematical Function dot_pose(posx1, posx2) ▪ Features This function obtains the inner product of the translation component when two poses are given. ▪ Parameters Parameter Default Data Type Description Name Value posx or posx posx1 list (float[6]) position list [mm, deg] posx or posx posx2...
  • Page 282 Outer product of two poses. ▪ Exception Exception Description DR_Error (DR_ERROR_TYPE) Parameter data type error occurred ▪ Example posx1 = [100, 20, 300, 90, 0, 180] posx2 = [200, 50, 100, 90, 30, 150] res= cross_pose(posx1, posx2) Doosan Robotics Programming Manual (ver.1.6)
  • Page 283 7Chapter Mathematical Function unit_pose(posx1) ▪ Features This function obtains the unit vector of the given posx translation component. ▪ Parameters Parameter Default Data Type Description Name Value posx or posx posx1 list (float[6]) position list [mm, deg] ▪ Return Value Description float[3] Unit vector of the given posx...
  • Page 284  DR_STOPBITS_ONE_POINT_FIVE = 1.5  DR_STOPBITS_TWO = 2 ▪ Return Value Description serial.Serial instance Successful connection ▪ Exception Exception Description DR_Error (DR_ERROR_TYPE) Parameter data type error occurred DR_Error (DR_ERROR_VALUE) Parameter value is invalid DR_Error (DR_ERROR_RUNTIME) Serial.SerialException error occurred Doosan Robotics Programming Manual (ver.1.6)
  • Page 285 8Chapter External Communication Commands ▪ Example ser = serial_open(port="COM2", baudrate=115200, bytesize=DR_EIGHTBITS, parity=DR_PARITY_NONE, stopbits=DR_STOPBITS_ONE) if type(ser) == serial.Serial: serial_write(ser, b"123456789") serial_close(ser)
  • Page 286 Value Description Successful closing of a serial port ▪ Exception Exception Description DR_Error (DR_ERROR_TYPE) Parameter data type error occurred ▪ Example ser = serial_open(port="COM2", baudrate=115200, bytesize=DR_EIGHTBITS, parity=DR_PARITY_NONE, stopbits=DR_STOPBITS_ONE) if type(ser) == serial.Serial: serial_write(ser, b"123456789") serial_close(ser) Doosan Robotics Programming Manual (ver.1.6)
  • Page 287 8Chapter External Communication Commands serial_state(ser) ▪ Features This function returns the status of a serial communication port. ▪ Parameters Parameter Default Data Type Description Name Value serial.Serial Serial instance ▪ Return Value Description Serial port opened Serial port closed ▪ Exception Exception Description...
  • Page 288  None: inter-byte timeout not specified ▪ Return Value Description Success ▪ Exception Exception Description DR_Error (DR_ERROR_TYPE) Parameter data type error occurred ▪ Example ser = serial_open(port="COM2", baudrate=115200, bytesize=DR_EIGHTBITS, parity=DR_PARITY_NONE, stopbits=DR_STOPBITS_ONE) state = serial_set_inter_byte_timeout(ser, 0.1) serial_close(ser)) Doosan Robotics Programming Manual (ver.1.6)
  • Page 289 8Chapter External Communication Commands serial_write(ser, tx_data) ▪ Features This function records the data (tx_data) to a serial port. ▪ Parameters Parameter Default Data Type Description Name Value serial.Serial Serial instance Data to be transmitted tx_data byte  The data type must be a byte. ...
  • Page 290 Number of bytes of the received data The port is not open. serial.SerialException error occurred rx_data Number of bytes read (byte type) ▪ Exception Exception Description DR_Error (DR_ERROR_TYPE) Parameter data type error occurred DR_Error (DR_ERROR_VALUE) Parameter value is invalid Doosan Robotics Programming Manual (ver.1.6)
  • Page 291 8Chapter External Communication Commands ▪ Example ser = serial_open(port="COM2", baudrate=115200, bytesize=DR_EIGHTBITS, parity=DR_PARITY_NONE, stopbits=DR_STOPBITS_ONE) serial_read(ser) serial_read(ser, 100) serial_read(ser, 100, 3) serial_read(ser, -1, 3) serial_close(ser)
  • Page 292 Parameter data error occurred DR_Error (DR_ERROR_VALUE) Invalid parameter value occurred ▪ Example count = serial_get_count() # read number of connected serial ports for i in range(count): port_info, device_name = serial_get_info(i+1) tp_popup("i={}, port ={}, dev ={}".format(i, port_info, device_name)) Doosan Robotics Programming Manual (ver.1.6)
  • Page 293 8Chapter External Communication Commands serial_get_info(id) ▪ Features This function reads the port information and device name of the connected USB to Serial. ▪ Parameter Parameter Default Data Type Description Name Value ID of "USB to Serial" to read (1-10) ▪ Return Value (port_info, Description device_name)
  • Page 294 ={0}, rx_data={1}".format(res, rx_data)) # close corresponding serial port serial_close(ser) Received data is collected as is and the result is outputted as a TP pop-up message. If executed properly, it outputs a result of res=6 rx_data = b’123ABC’. Doosan Robotics Programming Manual (ver.1.6)
  • Page 295 8Chapter External Communication Commands Tcp/Client client_socket_open(ip, port) ▪ Features This function creates a socket and attempts to connect it to a server (ip, port). It returns the connected socket when the client is connected. Parameters ▪ Parameter Default Data Type Description Name Value...
  • Page 296 Parameter data type error occurred DR_Error (DR_ERROR_RUNTIME) socket.error occurred during disconnection ▪ Example sock = client_socket_open("192.168.137.200", 20002) # An indefinite connection is attempted to the server (ip="192.168.137.200", port=20002). # do something… client_socket_close(sock) # Closes the connection to the server. Doosan Robotics Programming Manual (ver.1.6)
  • Page 297 8Chapter External Communication Commands client_socket_state(sock) ▪ Features This function returns the socket connection status. This checks the return value of client_socket_read or client_socket_write to identify the server connection status. (refer to Example 2) ▪ Parameters Parameter Default Data Type Description Name Value Socket instance returned...
  • Page 298 Example sock = client_socket_open("192.168.137.200", 20002) client_socket_write(sock, b"1234abcd") # b means the byte type. msg = "abcd" # msg is a string variable. client_socket_write(sock, msg.decode()) # decode() converts a string type to a byte type. client_socket_close(sock) Doosan Robotics Programming Manual (ver.1.6)
  • Page 299 8Chapter External Communication Commands client_socket_read(sock, length=-1, timeout=-1) ▪ Features This function receives data from the server. ▪ Parameters Parameter Default Data Type Description Name Value Socket instance returned sock socket.socket from client_socket_open() Number of bytes of the received data  -1: Not specified (The number of bytes to read is length not specified.) ...
  • Page 300 # Reads 64 bytes of the received data within the 3-second timeout. rx_msg = rx_data.decode() # rx_data is a byte type and can be converted to a string type # using decode(). # For example, if rx_data = b"abcd", # rx_msg= "abcd". client_socket_close(sock) Doosan Robotics Programming Manual (ver.1.6)
  • Page 301 8Chapter External Communication Commands Integrated example Assume that server IP = 192.168.137,200 and open port =20002 and that the received packets are sent to the client as they are (mirroring). ▪ Example 1: Example of a default TCP client # Assume server IP = 192.168.137,200 and open port =20002. g_sock = client_socket_open("192.168.137.200", 20002) tp_popup("connect O.K!",DR_PM_MESSAGE) while 1:...
  • Page 302 A negative value is returned if the connection to the server is terminated or there is a communication problem. The function reconnect() is called to attempt a reconnection if a negative value is returned. Note that the opened socket is closed when a reconnection is attempted. Doosan Robotics Programming Manual (ver.1.6)
  • Page 303 8Chapter External Communication Commands Tcp/Server server_socket_open(port) ▪ Features The robot controller creates a server socket and waits for the connection to the client. The connected socket is returned when the client is connected. Parameters ▪ Parameter Default Data Type Description Name Value Port number to open...
  • Page 304 Parameter data type error occurred DR_Error (DR_ERROR_RUNTIME) socket.error occurred during disconnection ▪ Example sock = server_socket_open(20002) # Opens the port 20002 and waits until the client connects. # do something… server_socket_close(sock) ) # Closes the connection to the client. Doosan Robotics Programming Manual (ver.1.6)
  • Page 305 8Chapter External Communication Commands server_socket_state(sock) ▪ Features This function returns the socket connection status. This checks the return value of server_socket_read or server_socket_write to identify the client connection status. (refer to Example 2) ▪ Parameters Parameter Default Data Type Description Name Value Socket instance returned from...
  • Page 306  The data type must be a byte.  Refer to the example below. ▪ Return Value Description Success The client is not connected. The client connection is lost or a socket.error exception occurred during transmission processing ▪ Exception Exception Description Doosan Robotics Programming Manual (ver.1.6)
  • Page 307 8Chapter External Communication Commands Exception Description DR_Error (DR_ERROR_TYPE) Parameter data type error occurred ▪ Example sock = server_socket_open(20002) server_socket_write(sock, b"1234abcd") # b means the byte type. msg = "abcd" # msg is a string variable. server_socket_write(sock, msg.decode()) # decode() converts a string type to a byte type.
  • Page 308 # (res = size of received data, rx_data=received data) is returned if the data is received within 3 seconds. # (res = -3, rx_data=None) is returned if the data is not received within 3 seconds. Doosan Robotics Programming Manual (ver.1.6)
  • Page 309 8Chapter External Communication Commands res, rx_data = server_socket_read(sock, length=64) # Reads 64 bytes of the received data. res, rx_data = server_socket_read(sock, length=64, timeout=3) # Reads 64 bytes of the received data within the 3-second timeout. rx_msg = rx_data.decode() # rx_data is a byte type and can be converted to a string type # using decode().
  • Page 310 = b"MEAS_START" data1 =1 data2 =2 send_data += (data1).to_bytes(4, byteorder='big') send_data += (data2).to_bytes(4, byteorder='big') server_socket_write(g_sock, send_data) wait(0.1) res, rx_data = server_socket_read(g_sock) tp_popup("res={0}, rx_data ={1}".format(res, rx_data), DR_PM_MESSAGE) rxd1 = int.from_bytes(rx_data[10:10+4], byteorder='big', signed=True) rxd2 = int.from_bytes(rx_data[14:14+4], byteorder='big', signed=True) Doosan Robotics Programming Manual (ver.1.6)
  • Page 311 8Chapter External Communication Commands tp_popup("res={0}, rxd1={1}, rxd2={2}".format(res, rxd1, rxd2), DR_PM_MESSAGE) server_socket_close(g_sock) The example sends the byte type send_data. res = 18 and rx_data=send_data since the client transmits the received data as is. rxd1 extraction: Conversion of 10th - 14th bytes to an integer rxd2 extraction: Conversion of 14th - 18th bytes to an integer The final result is res=18, rxd1=1, and rxd2=2.
  • Page 312 0 : Broadcase address slaveid 255 : Default value for ModbusTCP ▪ Return Value Description Success Failed Negative value ▪ Exception Exception Description DR_Error (DR_ERROR_TYPE) Parameter data type error occurred DR_Error (DR_ERROR_VALUE) Parameter value is invalid Doosan Robotics Programming Manual (ver.1.6)
  • Page 313 8Chapter External Communication Commands Exception Description DR_Error (DR_ERROR_RUNTIME) C extension module error occurred DR_Error (DR_ERROR_STOP) Program terminated forcefully ▪ Example # An example of connecting two Modbus IO and allocating the contacts #Modbus IO 1: IP 192.168.127.254, 8 input points: "di1" - "di8", 8 output points: "do1" - "do8"...
  • Page 314 Doosan Robotics Programming Manual (ver.1.6)
  • Page 315 8Chapter External Communication Commands add_modbus_rtu_signal (slaveid=1, port=None, baudrate=115200, bytesize=DR_EIGHTBITS, parity=DR_PARITY_NONE, stopbits=DR_STOPBITS_ONE, name, reg_type, index, value=0) ▪ Features This function registers the ModbusRTU signal. The Modbus I/O must be set in the Teach Pendant I/O set-up menu. Use this command only for testing if it is difficult to use the Teach Pendant. The Modbus menu is disabled in the Teach Pendant if it is set using this command.
  • Page 316 Parameter value is invalid DR_Error (DR_ERROR_RUNTIME) C extension module error occurred DR_Error (DR_ERROR_STOP) Program terminated forcefully ▪ Example add_modbus_rtu_signal(slaveid=1, port=port_info, baudrate=115200, bytesize=DR_EIGHTBITS, parity=DR_PARITY_NONE, stopbits=DR_STOPBITS_ONE, name=’di1’, reg_type=DR_MODBUS_REG_INPUT, index=0) add_modbus_rtu_signal(slaveid=1, port=port_info, baudrate=115200, bytesize=DR_EIGHTBITS, parity=DR_PARITY_NONE, stopbits=DR_STOPBITS_ONE, name=’do1’, reg_type=DR_MODBUS_REG_OUTPUT, index=0, value=12345) Doosan Robotics Programming Manual (ver.1.6)
  • Page 317 8Chapter External Communication Commands del_modbus_signal (name) ▪ Features This function deletes the registered Modbus signal. The Modbus I/O must be set in the Teach Pendant I/O set-up menu. Use this command only for testing if it is difficult to use the Teach Pendant. The Modbus menu is disabled in the Teach Pendant if it is set using this command.
  • Page 318 #Modbus digital I/O is connected, and the signals are registered as "do1" and "do2". set_modbus_output("do1", ON) set_modbus_output("do2", OFF) #Modbus analog I/O is connected, and the signals are registered as "reg1" and "reg2". set_modbus_output("reg1", 10) set_modbus_output("reg2", 24) Doosan Robotics Programming Manual (ver.1.6)
  • Page 319 8Chapter External Communication Commands set_modbus_outputs(iobus_list, val_list) ▪ Features This function sends multiple signals to the Modbus Slave unit. ▪ Parameters Parameter Default Data Type Description Name Value iobus string Modbus name (set in the TP) value I/O output value list Return ▪...
  • Page 320 Program terminated forcefully ▪ Example #Modbus digital I/O is connected, and the signals are registered as "di1" and "di2". get_modbus_input("di1") get_modbus_input("di2") #Modbus analog I/O is connected, and the signals are registered as "reg1" and "reg2". get_modbus_input("reg1") get_modbus_input("reg2") Doosan Robotics Programming Manual (ver.1.6)
  • Page 321 8Chapter External Communication Commands get_modbus_inputs(iobus_list) ▪ Features This function reads multiple signals from the Modbus Slave unit. ▪ Parameters Parameter Default Data Type Description Name Value Modbus input name list (set in the TP) signal type can be used only in the following iobus_list list(string) cases...
  • Page 322 ▪ Example # Modbus Register I/O "Holding1" is 1234, "Input1" is 567, # and "Holding2" is 9876 res, val_list = get_modbus_inputs_list(iobus_list=[ "Holding1", "Input1", "Holding2"]) #res expected value = 3 #val_list expected value = [1234, 567, 9876] Doosan Robotics Programming Manual (ver.1.6)
  • Page 323 8Chapter External Communication Commands wait_modbus_input(iobus, val, timeout=None) ▪ Features This function waits until the specified signal value of the Modbus digital I/O becomes val (ON or OFF). The waiting time can be changed with a timeout setting. The waiting time ends, and the result is returned if the waiting time has passed.
  • Page 324 ▪ Exception Exception Description DR_Error (DR_ERROR_TYPE) Parameter data error occurred occurred DR_Error (DR_ERROR_VALUE) Invalid parameter value occurred DR_Error (DR_ERROR_RUNTIME) C Extension module error occurred DR_Error (DR_ERROR_STOP) Program terminated forcefully ▪ Example set_modbus_slave(128, 0) set_modbus_slave(255, 65535) Doosan Robotics Programming Manual (ver.1.6)
  • Page 325 8Chapter External Communication Commands get_modbus_slave(address) ▪ Features It is used to import values by approaching the General Purpose Register area of the Modbus TCP Slave. ▪ Parameter Parameter Default Data Type Description Name Value Address value of the GPR area to read address (128~255) ▪...
  • Page 326 DR_Error (DR_ERROR_VALUE) Invalid parameter value occurred DR_Error (DR_ERROR_RUNTIME) C Extension module error occurred DR_Error (DR_ERROR_STOP) Program terminated forcefully ▪ Example data = b"\x01\x02\x03\x04\x05\x06" crchigh, crclow = modbus_crc16(data) #crchigh = 186(DEC), BA(HEX) #crclow = 221(DEC), DD(HEX) Doosan Robotics Programming Manual (ver.1.6)
  • Page 327 8Chapter External Communication Commands modbus_send_make(send_data) ▪ Features When using the Modbus protocol, this command provides the result data including the Modbus CRC16 result for the send data. ▪ Parameter Parameter Default Data Type Description Name Value send_data byte Transfer data requiring CRC calcuation ▪...
  • Page 328 DR_Error (DR_ERROR_TYPE) Parameter data error occurred occurred DR_Error (DR_ERROR_VALUE) Invalid parameter value occurred DR_Error (DR_ERROR_RUNTIME) C Extension module error occurred DR_Error (DR_ERROR_STOP) Program terminated forcefully ▪ Example #recvdata = b"\x01\x02\x03\x04\x05\x06\xba\xdd" res = modbus_recv_check(recvdata) #recv = True Doosan Robotics Programming Manual (ver.1.6)
  • Page 329 8Chapter External Communication Commands Industrial Ethernet (EtherNet/IP,PROFINET) set_output_register_bit(address, val) ▪ Features It is used to export values to the Output Bit General Purpose Register area of the Industrial Ethernet(EtherNet/IP, PROFINET) Slave. ▪ Parameter Parameter Data Type Default Value Description Name Address value of Output Bit GPR area address unsigned short...
  • Page 330 Exception Description DR_Error (DR_ERROR_TYPE) Parameter data error occurred occurred DR_Error (DR_ERROR_VALUE) Invalid parameter value occurred DR_Error (DR_ERROR_RUNTIME) C Extension module error occurred DR_Error (DR_ERROR_STOP) Program terminated forcefully ▪ Example set_output_register_int (0, 0x00FF00FF) set_output_register_int (23, 65535) Doosan Robotics Programming Manual (ver.1.6)
  • Page 331 8Chapter External Communication Commands set_output_register_float(address, val) ▪ Features It is used to export values to the Output Float General Purpose Register area of the Industrial Ethernet(EtherNet/IP, PROFINET) Slave. ▪ Parameter Parameter Data Type Default Value Description Name Address value of Output Float GPR address unsigned short area in Industrial Ethernet Slave(0-23)
  • Page 332 Exception Description DR_Error (DR_ERROR_TYPE) Parameter data error occurred occurred DR_Error (DR_ERROR_VALUE) Invalid parameter value occurred DR_Error (DR_ERROR_RUNTIME) C Extension module error occurred DR_Error (DR_ERROR_STOP) Program terminated forcefully ▪ Example a = get_output_register_bit(0) b = get_output_register_bit(63) Doosan Robotics Programming Manual (ver.1.6)
  • Page 333 8Chapter External Communication Commands get_output_register_int(address) ▪ Features It is used to import values to the Output Int General Purpose Register area of the Industrial Ethernet(EtherNet/IP, PROFINET) Slave. ▪ Parameter Parameter Data Type Default Value Description Name Address value of Output Int GPR area address unsigned short in Industrial Ethernet Slave(0-23)
  • Page 334 Exception Description DR_Error (DR_ERROR_TYPE) Parameter data error occurred occurred DR_Error (DR_ERROR_VALUE) Invalid parameter value occurred DR_Error (DR_ERROR_RUNTIME) C Extension module error occurred DR_Error (DR_ERROR_STOP) Program terminated forcefully ▪ Example a = get_output_register_float(0) b = get_output_register_float(63) Doosan Robotics Programming Manual (ver.1.6)
  • Page 335 8Chapter External Communication Commands get_input_register_bit(address) ▪ Features It is used to import values to the Input Bit General Purpose Register area of the Industrial Ethernet(EtherNet/IP, PROFINET) Slave. ▪ Parameter Parameter Data Type Default Value Description Name Address value of Input Bit GPR area in address unsigned short Industrial Ethernet Slave(0-63)
  • Page 336 Exception Description DR_Error (DR_ERROR_TYPE) Parameter data error occurred occurred DR_Error (DR_ERROR_VALUE) Invalid parameter value occurred DR_Error (DR_ERROR_RUNTIME) C Extension module error occurred DR_Error (DR_ERROR_STOP) Program terminated forcefully ▪ Example a = get_input_register_int(0) b = get_input_register_int(23) Doosan Robotics Programming Manual (ver.1.6)
  • Page 337 8Chapter External Communication Commands get_input_register_float(address) ▪ Features It is used to import values to the Input Float General Purpose Register area of the Industrial Ethernet(EtherNet/IP, PROFINET) Slave. ▪ Parameter Parameter Data Type Default Value Description Name Address value of Input Float GPR area address unsigned short in Industrial Ethernet Slave(0-23)
  • Page 338 External Vision Commands Overview Doosan Robotics provides the commands to guide robots with vision by connecting the robots to an external vision system. It enables connecting a robot to a 2D vision system which can measure the object position (Tx, Ty) data and the rotation (Rz) data (offset information) to guide the inputted robot task, and the commands can receive the measurement data inputs of multiple objects.
  • Page 339 9Chapter External Vision Commands vs_set_info(type) ▪ Features This function set the type of vision system to use. ▪ Parameters Parameter Default Data Type Description Name Value DR_VS_CUSTOM(0) DR_VS_C type DR_VS_COGNEX(1) USTOM DR_VS_SICK(2) ▪ Return Value Description ID of Type ID of type to set ▪...
  • Page 340 Port 번호 (예, 9999) port_num 9999 ▪ Return Value Description Connection success Connection failed ▪ Example vs_set_info(DR_VS_COGNEX) #Vision type information setting vs_connect("192.168.137.10") #Connect to vision - Vision IP, Default port # Enter your task vs_disconnect() #Disconnect to vision Doosan Robotics Programming Manual (ver.1.6)
  • Page 341 9Chapter External Vision Commands vs_disconnect() ▪ Features This function terminates the connection to the vision system. ▪ Return Value Description ▪ Example vs_set_info(DR_VS_COGNEX) #Vision type information setting vs_connect("192.168.137.10") #Connect to vision - Vision IP, Default port # Enter your task vs_disconnect() #Disconnect to vision...
  • Page 342 #Vision type information setting vs_connect("192.168.137.10") #Connect to vision - Vision IP, Default port vs_set_job("test.job") # Set (load) the current vision job job_name=vs_get_job() # Get the current setting vision job tp_popup("{0}".format(job_name)) vs_disconnect() # Disconnect to vision Doosan Robotics Programming Manual (ver.1.6)
  • Page 343 9Chapter External Vision Commands vs_set_job(job_name) ▪ Features This function loaded the entered task into the vision system. ▪ Parameters Parameter Default Data Type Description Name Value job_name string Task name to be loaded ▪ Return Value Data Type Description Success Failed ▪...
  • Page 344 = vs_trigger() # Execute the vision meausrement if var_list[0] == 1: # Check the inspection result robot_posx_meas = vs_get_offset_pos(pos, VS_POS1) # offset the robot pose movel(robot_posx_meas) # move the robot pose else: tp_popup("Inspection Fail") vs_disconnect() Doosan Robotics Programming Manual (ver.1.6)
  • Page 345 9Chapter External Vision Commands vs_set_init_pos(vision_posx_init, robot_posx_init, vs_pos=1) ▪ Features Enter the initial position information of the object to perform the vision guidance operation. (*VS_TYPE: DR_VS_COGNEX, DR_VS_SICK) ▪ Parameters Parameter Data Default Description Name Type Value vision_posx_init posx Vision measurement coordinate initial value robot_posx_init posx Coordinate initial value for robot work...
  • Page 346 = vs_trigger() # Execute the vision meausrement if var_list[0] == 1: # Check the inspection result robot_posx_meas = vs_get_offset_pos(pos, VS_POS1) # offset the robot pose movel(robot_posx_meas) # move the robot pose else: tp_popup("Inspection Fail") vs_disconnect() Doosan Robotics Programming Manual (ver.1.6)
  • Page 347 9Chapter External Vision Commands vs_request(cmd) Features This function sets the feature for the vision system to request (*VS_TYPE: DR_VS_CUSTOM) Parameters Parameter Default Data Type Description Name Value The number of objects to be detected by the vision system Return Value Description Success Failed...
  • Page 348 = vs_request(1) #Request vision measurement information of object 1 cnt, result = vs_result() #Load object measurement result information for i in range(cnt): x = result[i][0] y = result[i][1] t = result[i][2] tp_popup("x={0},y={1}, t={2}".format(result[i][0], result[i][1], result[i][2]),DR_PM_MESSAGE) Doosan Robotics Programming Manual (ver.1.6)
  • Page 349 9Chapter External Vision Commands Integrated example 1 (DR_VS_COGNEX, DR_VS_SICK) Example vs_set_info(DR_VS_COGNEX) # Select type of vision sensor if ( vs_connect("192.168.137.10") != 0 ): # Vision IP, Default port tp_popup("connection fail",DR_PM_MESSAGE) exit() vis_posx_init = posx (410,310,300,0,0,0) # Define the initial posx data - vision rob_posx_init1 = posx (400,300,300,0,180,0) # Define the initial posx data - robot rob_posx_init2 = posx (420,320,300,0,180,0)
  • Page 350 = 1 , (x=1.1 , y=2.2, t=3.3) “MEAS_INFO"+1[4byte] +110[4byte] +220[4byte] +330[4byte] Actual packet: 4D4541535F494E464F000000010000006E000000DC0000014A ex) cnt = 2 , (x=1.1 , y=2.2, t=3.3) (x=1.1 , y=-2.2, t=-3.3) “MEAS_ INFO"+2[4byte] +110[4byte] +220[4byte] +330[4byte] +110[4byte] -220[4byte] -330[4byte] Actual packet: 4D4541535F494E464F000000020000006E000000DC0000014A 0000006EFFFFFF24FFFFFEB6 Doosan Robotics Programming Manual (ver.1.6)
  • Page 351 9Chapter External Vision Commands Example vs_set_info(DR_VS_CUSTOM) res = vs_connect("192.168.137.200", 9999) #Vision and communication connection attempt if res !=0: #Check the result of communication connection tp_popup("connection fail",DR_PM_MESSAGE) #Upon connection failure, program termination exit() ret = vs_request(1) #Request of Vision Measurement Information for No. 1 Object cnt, result = vs_result() #Get object measurement result information for i in range(cnt):...
  • Page 352 Server IP address of vision module port Port number ▪ Return Value Description Connection success Connection failed ▪ Example svm_connect() #Connect to vision - Default IP address and port number # Enter the vision task svm_disconnect() #Disconnect to vision Doosan Robotics Programming Manual (ver.1.6)
  • Page 353 10Chapter Doosan Vision(SVM) Command svm_disconnect () ▪ Features This function terminates the connection to the SVM. ▪ Return Value Description ▪ Example #Connect to vision – Default IP address and port svm_connect() # Enter the vision task svm_disconnect() #Disconnect to vision...
  • Page 354 Value Description Job Loading success Job Loading fail ▪ Example svm_connect() #Connect to vision - Vision IP, Default port vision_test=1000 # Define vision job ID svm_set_job(vision_test) # Load the vision_test (1000) svm_disconnect() #Disconnect to vision Doosan Robotics Programming Manual (ver.1.6)
  • Page 355 10Chapter Doosan Vision(SVM) Command svm_get_robot_pose (job_id) ▪ Features The robot pose information(joint coordinate system) set in the vision task is loaded. Robot pose information is used as shoot_pose for vision task. Parameters ▪ Parameter Data Type Default Value Description Name Vision Task id (ex.
  • Page 356 # Define vision job ID svm_set_job(vision_test) # Load the vision_test (1000) shoot_pos=svm_get_robot_pose (vision_test) # Load the robot pose of vision_test count=svm_get_vision_info(vision_test) # Execute the vision measurement tp_popup("{0}".format(count)) # Check the result svm_disconnect() # Disconnect to vision Doosan Robotics Programming Manual (ver.1.6)
  • Page 357 10Chapter Doosan Vision(SVM) Command svm_get_variable (tool_id, var_type) ▪ Features If the object detection/measurement is successful(1) by executing svm_get_vision_info, the detection/measurement data is loaded. Enter the tool id and variable type for the data to be loaded. Position tool: POSX_TYPE (Object location), VALUE_TYPE (Detection similarity)
  • Page 358 POSX_TYPE) tp_popup("{0}".format(pos_result)) # Get the inspection information (PASS or Fail) of print_insp tool inspection_result=svm_get_variable(print_insp, INSP_TYPE) tp_popup("{0}".format(inspection_result)) # Get the distance information (distance) of box_size tool measurement_result= svm_get_variable(box_size, VALUE_TYPE) tp_popup("{0}".format(measurement_result)) svm_disconnect() # Disconnect to vision Doosan Robotics Programming Manual (ver.1.6)
  • Page 359 10Chapter Doosan Vision(SVM) Command svm_get_offset_pos (posx_robot_init, job_id, tool_id) ▪ Features The robot task coordinate information reflecting the vision measurement result is loaded into the robot work coordinate input by the user. *Procedure: Input posx_robot_init → Vision measurement→ Call svm_get_offset_pos → Changed robot work coordinates (posx_robot_offset) output ▪...
  • Page 360 # Get the position information (posx) of vision_test tool pos_result=svm_get_variable(vision_test, POSX_TYPE) tp_popup("{0}".format(pos_result)) # Get the vision guided robot pose ld_list =[vision_test] pos_list =[pos_result] svm_set_init_pos_data(Id_list,pos_list) rob_posx=svm_get_offset_pos(posx(200,200,100,0,180,0), vision_test) tp_popup("{0}".format(rob_posx)) # move to the rob_posx movel(rob_posx, vel=30, acc=100) svm_disconnect() # Disconnect to vision Doosan Robotics Programming Manual (ver.1.6)
  • Page 361 10Chapter Doosan Vision(SVM) Command svm_set_tp_popup (svm_flag) ▪ Features Set whether (tp_popup) should be displayed when SVM error occurs. ▪ Parameters Default Parameter Name Data Type Description Value svm_flag 1(Activation), 0(Deactivation) ▪ Return Default Parameter Name Data Type Description Value None ▪...
  • Page 362 Data Type Description Value value LED brightness value (0-1000). ▪ Return Value Data Type Description Fail - No measurement data or input variable error. Example svm_connect() # Connect to vision svm_set_led_brigtness(500) svm_disconnect() # Disconnect to vision Doosan Robotics Programming Manual (ver.1.6)
  • Page 363 10Chapter Doosan Vision(SVM) Command svm_get_led_brightness() ▪ Features Return the LED brightness value set in the SVM. ▪ Return Value Description SVM brightness value (0-1000) Fail - No measurement data or input variable error. Example svm_connect() # Connect to vision svm_get_led_brigtness()
  • Page 364 Data Type Description Value value SVM exposure value (2,660,000 – 29,260,000) ▪ Return Value Description Fail - No measurement data or input variable error. Example svm_connect() # Connect to vision svm_set_camera_exp_val(2,660,000) svm_disconnect() # Disconnect to vision Doosan Robotics Programming Manual (ver.1.6)
  • Page 365 10Chapter Doosan Vision(SVM) Command svm_set_camera_gain_val(value) ▪ Features Set SVM gain value.. ▪ Parameters Default Parameter Name Data Type Description Value value SVM gain value (0-1600). ▪ Return Value Description Fail - No measurement data or input variable error. Example svm_connect()
  • Page 366 Description Value job_id job id (ex - 1000, 2000, 3000) ▪ Return Value Description Fail - No measurement data or input variable error. Example svm_connect() # Connect to vision svm_set_camera_load(job_id) svm_disconnect() # Disconnect to vision Doosan Robotics Programming Manual (ver.1.6)
  • Page 367 10Chapter Doosan Vision(SVM) Command Intergrated example (SVM) ▪ Example Vision Job setting status - After deleting all the jobs saved in WCM, create vision task / tool as below. - Create vision task : vision_test (position tool, 1000) - Add vision tools: print_insp (presence tool, 1001) box_size (distance tool, 1002) - Select the "vision_test"...
  • Page 368 Value Description Not Used Exception Exception Description Not Used Example set_extenc_polarity(1, 0, 1, 0, 1) # External Encoder channel 1 is set to phase A, /phase B, phase Z (falling edge), phase S (rising edge) Doosan Robotics Programming Manual (ver.1.6)
  • Page 369 11Chapter Application Commands Related Commands set_extenc_mode set_extenc_mode(channel, mode_AB, pulse_AZ, mode_Z, mode_S, inverse_cnt) Features It configures the operation mode of phase A, B, Z and S of the corresponding encoder channel. Parameter Parameter Data Type Default Value Description Name Encoder channel (1, 2) channel 1: Channel 1 2: Channel 2...
  • Page 370 # Phase A Count, Phase B Direction Use # Pulse A Count per Z Pulse is 20000 # Phase Z error count accumulate compensation mode use, phase S use # Encoder Count direction is set to forward Related Commands set_extenc_polarity Doosan Robotics Programming Manual (ver.1.6)
  • Page 371 11Chapter Application Commands get_extenc_count(channel) Features Get the count value of the corresponding encoder channel. Parameter Parameter Data Type Default Value Description Name Encoder channel (1, 2) channel 1: Channel 1 2: Channel 2 Return Value Description count Current encoder count value of corresponding channel Exception Exception Description...
  • Page 372 Encoder channel (1, 2) channel 1: Channel 1 2: Channel 2 Return Value Description Not Used Exception Exception Description Not Used Example clear_extenc_count(1) # External Encoder channel 1 count value reset to 0 Related Commands get_extenc_count Doosan Robotics Programming Manual (ver.1.6)
  • Page 373: Conveyor Tracking

    11Chapter Application Commands Conveyor Tracking set_conveyor(name) ▪ Features If conveyor information is configured in the UI, obtain ID with the conveyor name to start the Conveyor Tracking Application from the program and execute the command for workpiece monitoring. Workpiece monitoring is performed on workpieces triggered in the conveyor, and monitoring continues until the program ends.
  • Page 374 DR_WORLD: World) Conveyor nominal velocity (Linear: conv_speed float 100.0 mm/s, Circular: ˚/s) Moving Average Filter Size during speed_filter_size conveyor velocity filtering Minimum conveyor work length min_dist float (based on Triggering Switch, Linear: mm, Circular: ˚) Doosan Robotics Programming Manual (ver.1.6)
  • Page 375 11Chapter Application Commands Parameter Name Data Type Default Value Description Maximum conveyor work length max_dist float 1000.0 (based on Triggering Switch, Linear: mm, Circular: ˚) Conveyor work standby monitoring watch_window float 100.0 length (based on minimum work length, Linear: mm, Circular: ˚) Conveyor tracking release buffer out_tracking_dist float...
  • Page 376 Returns Conveyor ID if conveyor setting is successful None Conveyor setting failure ▪ Exception Exception Description DR_Error (DR_ERROR_TYPE) Parameter data error occurred occurred DR_Error (DR_ERROR_VALUE) Invalid parameter value occurred DR_Error (DR_ERROR_RUNTIME) C Extension module error occurred DR_Error (DR_ERROR_STOP) Program terminated forcefully Doosan Robotics Programming Manual (ver.1.6)
  • Page 377: Related Commands

    11Chapter Application Commands ▪ Example CONV1 = set_conveyor_ex(name=‘conveyor_1’, conv_type=0, # linear encoder_channel=1, triggering_mute_time=0.0, count_per_dist=5000, # 5000 count/mm) conv_coord=posx(500, 100, 500, 0, -90, 0), ref=DR_BASE, conv_speed=100.0, # conveyor speed: 100 mm/s, speed_filter_size=500, # moving avg. filter size: 500 ms min_dist=100, max_dist=1000, watch_window=200, out_tracking_dist=10) ▪...
  • Page 378 It is usually used for easy input of a teaching point or when you want to dynamically change the position and orientation of the workpiece coordinates in conjunction with an external sensor (ex. Vision sensor). Doosan Robotics Programming Manual (ver.1.6)
  • Page 379 11Chapter Application Commands In the case shown below, the workpiece coordinates are created on the right side of the workpiece and the orientation is different from the base or world coord. At this time, if you want to position the workpiece coordinates at the center of workpiece and make the orientation to be same with the ones of base or world coordinates, you can apply it as obj_offset_coord = posx (-d, 0, 0, -90, 0, 0).
  • Page 380 0, 0, 0, 0), ref=CONV_COORD_1) set_digital_output(DO_GRIPPER, 1) movel(posx(0,0, 50, 0, 0, 0), ref=CONV_COORD_1) untracking_conveyor(CONV1) movel(posx(100, 100, 50, 0, 0, 0), ref=DR_BASE) # waiting position ## Multi objects in a cycle CONV1 = set_conveyor(‘conveyor1’) while True: CONV_COORD_1 = get_conveyor_obj(CONV1) Doosan Robotics Programming Manual (ver.1.6)
  • Page 381 11Chapter Application Commands tracking_conveyor(CONV1) # fist object movel(posx(0,0, 50, 0, 0, 0), ref=CONV_COORD_1) movel(posx(0,0, 0, 0, 0, 0), ref=CONV_COORD_1) set_digital_output(DO_GRIPPER, 1) movel(posx(0,0, 50, 0, 0, 0), ref=CONV_COORD_1) # second object CONV_COORD_2 = get_conveyor_obj(CONV1, time_out=10) if CONV_COORD_2 > 0: # -1 if no objects available during time_out movel(posx(0,0, 50, 0, 0, 0), ref=CONV_COORD_2) movel(posx(0,0, 0, 0, 0, 0), ref=CONV_COORD_2) set_digital_output(DO_GRIPPER, 1)
  • Page 382 If the robot is expected to exit the robot work space during Negative integer velocity synchronization ▪ Exception Exception Description DR_Error (DR_ERROR_TYPE) Parameter data error occurred occurred DR_Error (DR_ERROR_VALUE) Invalid parameter value occurred DR_Error (DR_ERROR_RUNTIME) C Extension module error occurred Doosan Robotics Programming Manual (ver.1.6)
  • Page 383 11Chapter Application Commands Exception Description DR_Error (DR_ERROR_STOP) Program terminated forcefully ▪ Example CONV1 = set_conveyor(‘conveyor1’) while True: CONV_COORD_1 = get_conveyor_obj(CONV1) tracking_conveyor(CONV1) # start moving to track conveyor # task on conveyor movel(posx(0,0, 50, 0, 0, 0), ref=CONV_COORD_1) movel(posx(0,0, 0, 0, 0, 0), ref=CONV_COORD_1) set_digital_output(DO_GRIPPER, 1) movel(posx(0,0, 50, 0, 0, 0), ref=CONV_COORD_1) untracking_conveyor(CONV1)
  • Page 384 Invalid parameter value occurred DR_Error (DR_ERROR_RUNTIME) C Extension module error occurred DR_Error (DR_ERROR_STOP) Program terminated forcefully ▪ Example CONV1 = set_conveyor(‘conveyor1’) while True: CONV_COORD_1 = get_conveyor_obj(CONV1) tracking_conveyor(CONV1) # task on conveyor movel(posx(0,0, 50, 0, 0, 0), ref=CONV_COORD_1) Doosan Robotics Programming Manual (ver.1.6)
  • Page 385 11Chapter Application Commands movel(posx(0,0, 0, 0, 0, 0), ref=CONV_COORD_1) set_digital_output(DO_GRIPPER, 1) movel(posx(0,0, 50, 0, 0, 0), ref=CONV_COORD_1) untracking_conveyor(CONV1, 0.1) Related Commands ▪ tracking_conveyor()
  • Page 386 C extension module error occurred DR_Error (DR_ERROR_STOP) Program terminated forcefully ▪ Example in1 = get_function_input(1) # Reads the no. 1 function button input in8 = get_function input(4) # Reads the no. 4 function button input Doosan Robotics Programming Manual (ver.1.6)
  • Page 387 12Chapter A-Series Command flange_serial_open(baudrate=115200, bytesize=DR_EIGHTBITS, parity=DR_PARITY_NONE, stopbits=DR_STOPBITS_ONE) ▪ Features This command is for opening the pseudo flange serial communication port. The characteristics of pseudo flange serial communication are different from normal serial communication. Therefore, handshaking communication is recommended. (e.g., modbus RTU) Due to the internal buffer size limit (255bytes) and internal delay, overflow may occur when used in sensors, etc.
  • Page 388 Exception Description DR_Error (DR_ERROR_VALUE) Parameter value is invalid DR_Error (DR_ERROR_RUNTIME) C extension module error occurred DR_Error (DR_ERROR_STOP) Program terminated forcefully Doosan Robotics Programming Manual (ver.1.6)
  • Page 389 12Chapter A-Series Command flange_serial_close() ▪ Features This function closes a flange serial communication port. ▪ Return Value Description Success ▪ Exception Exception Description DR_Error (DR_ERROR_TYPE) Parameter data type error occurred DR_Error (DR_ERROR_RUNTIME) C extension module error occurred DR_Error (DR_ERROR_STOP) Program terminated forcefully...
  • Page 390  Refer to the example below. ▪ Return Value Description Success ▪ Exception Exception Description DR_Error (DR_ERROR_TYPE) Parameter data type error occurred DR_Error (DR_ERROR_VALUE) Parameter value is invalid DR_Error (DR_ERROR_RUNTIME) C extension module error occurred DR_Error (DR_ERROR_STOP) Program terminated forcefully Doosan Robotics Programming Manual (ver.1.6)
  • Page 391 12Chapter A-Series Command flange_serial_read() ▪ Features This function reads the data from a flange serial port. ▪ Parameters Parameter Default Data Type Description Name Value ▪ Return Value (res, rx_data) Description Number of bytes of the received data Number of bytes read (byte type) rx_data ▪...

Table of Contents