02-16-2022, 08:19 PM
(This post was last modified: 02-16-2022, 08:22 PM bybalazs.szabo58.)
A weird problem occured in my program when using *transl() command.
(My station contains a Hanwha HCR-5)
Running the code below the TCP should move to an approach position then down along Z axis and lastly back to the approach position again.
Whiletarget_dipappis created in RoboDK and is imported in the beginning of the script using
target_dipapp = RDK.Item('Targetname', ITEM_TYPE_TARGET),dip_poseis calculated with respect totarget_dipappin the first line of the code above.
This way the program works perfectly in RDK simulation but generating the G-Code gives a wrong result.
In the G-Code it moves to the approach position(target_dipapp) then to thedip_posethat has been calculated but the last move, which is moving back to the approach position is either completely missing or just results in random joint values.
尝试使用Fanuc等其他帖子or ABB but it did not help.
Tried using Joint movements instead of LIN but the result was the same.
Finally I tried creating thedip_posetarget in RDK as well and importing it just like the other one and it worked well.
This is how the G-Code looksWITH*transl(), usingJOINTmove on the last one:
#APPROACH
moveLinear('tcp', {"x": 395.683, "y": 582.618, "z": 93.757, "rx": -180.000, "ry": -0.000, "rz": 90.000}, 30, 1000, {"precisely":false,"radius":2}, function() {});
#CALCULATED DIP_POSE
moveLinear('tcp', {"x": 395.683, "y": 582.618, "z": 13.757, "rx": -180.000, "ry": -0.000, "rz": 90.000}, 30, 1000, {"precisely":false,"radius":2}, function() {});
#RANDOM JOINT VALUES
moveJoint([-32.901000, -133.135000, -98.837800, -38.027300, 90.000000, 147.099000], 20, 20, {"precisely":false,"radius":2}, function() {});
This is how the G-Code looksWITH*transl(), usingLINmove on the last one:
#APPROACH
moveLinear('tcp', {"x": 395.683, "y": 582.618, "z": 93.757, "rx": -180.000, "ry": -0.000, "rz": 90.000}, 30, 1000, {"precisely":false,"radius":2}, function() {});
#CALCULATED DIP_POSE
moveLinear('tcp', {"x": 395.683, "y": 582.618, "z": 13.757, "rx": -180.000, "ry": -0.000, "rz": 90.000}, 30, 1000, {"precisely":false,"radius":2}, function() {});
#MISSING THE LAST MOVE COMPLETELY
This is how the G-Code looksWITHOUT*transl(), importing the target from RoboDK (this is how it should look like in the other cases):
#APPROACH
moveLinear('tcp', {"x": 336.574, "y": 729.887, "z": 70.000, "rx": -180.000, "ry": -0.000, "rz": 90.000}, 500.0, 1000, {"precisely":false,"radius":2}, function() {});
#IMPORTED DIP_POSE
moveLinear('tcp', {"x": 336.574, "y": 729.887, "z": -70.000, "rx": -180.000, "ry": -0.000, "rz": 90.000}, 500.0, 1000, {"precisely":false,"radius":2}, function() {});
#APPROACH
moveLinear('tcp', {"x": 336.574, "y": 729.887, "z": 70.000, "rx": -180.000, "ry": -0.000, "rz": 90.000}, 500.0, 1000, {"precisely":false,"radius":2}, function() {});
(My station contains a Hanwha HCR-5)
Running the code below the TCP should move to an approach position then down along Z axis and lastly back to the approach position again.
Code:
dip_pose=target_dipapp.Pose()*transl(0,0,80)
robot.MoveL(target_dipapp)
robot.MoveL(dip_pose)
robot.MoveL(target_dipapp)
target_dipapp = RDK.Item('Targetname', ITEM_TYPE_TARGET),dip_poseis calculated with respect totarget_dipappin the first line of the code above.
This way the program works perfectly in RDK simulation but generating the G-Code gives a wrong result.
In the G-Code it moves to the approach position(target_dipapp) then to thedip_posethat has been calculated but the last move, which is moving back to the approach position is either completely missing or just results in random joint values.
尝试使用Fanuc等其他帖子or ABB but it did not help.
Tried using Joint movements instead of LIN but the result was the same.
Finally I tried creating thedip_posetarget in RDK as well and importing it just like the other one and it worked well.
This is how the G-Code looksWITH*transl(), usingJOINTmove on the last one:
#APPROACH
moveLinear('tcp', {"x": 395.683, "y": 582.618, "z": 93.757, "rx": -180.000, "ry": -0.000, "rz": 90.000}, 30, 1000, {"precisely":false,"radius":2}, function() {});
#CALCULATED DIP_POSE
moveLinear('tcp', {"x": 395.683, "y": 582.618, "z": 13.757, "rx": -180.000, "ry": -0.000, "rz": 90.000}, 30, 1000, {"precisely":false,"radius":2}, function() {});
#RANDOM JOINT VALUES
moveJoint([-32.901000, -133.135000, -98.837800, -38.027300, 90.000000, 147.099000], 20, 20, {"precisely":false,"radius":2}, function() {});
This is how the G-Code looksWITH*transl(), usingLINmove on the last one:
#APPROACH
moveLinear('tcp', {"x": 395.683, "y": 582.618, "z": 93.757, "rx": -180.000, "ry": -0.000, "rz": 90.000}, 30, 1000, {"precisely":false,"radius":2}, function() {});
#CALCULATED DIP_POSE
moveLinear('tcp', {"x": 395.683, "y": 582.618, "z": 13.757, "rx": -180.000, "ry": -0.000, "rz": 90.000}, 30, 1000, {"precisely":false,"radius":2}, function() {});
#MISSING THE LAST MOVE COMPLETELY
This is how the G-Code looksWITHOUT*transl(), importing the target from RoboDK (this is how it should look like in the other cases):
#APPROACH
moveLinear('tcp', {"x": 336.574, "y": 729.887, "z": 70.000, "rx": -180.000, "ry": -0.000, "rz": 90.000}, 500.0, 1000, {"precisely":false,"radius":2}, function() {});
#IMPORTED DIP_POSE
moveLinear('tcp', {"x": 336.574, "y": 729.887, "z": -70.000, "rx": -180.000, "ry": -0.000, "rz": 90.000}, 500.0, 1000, {"precisely":false,"radius":2}, function() {});
#APPROACH
moveLinear('tcp', {"x": 336.574, "y": 729.887, "z": 70.000, "rx": -180.000, "ry": -0.000, "rz": 90.000}, 500.0, 1000, {"precisely":false,"radius":2}, function() {});