from fairino import Robot
# Establish a connection with the robot controller and return a robot object if the connection is successful
robot = Robot.RPC('192.168.58.2')
# Set the UDP communication parameters and load
robot.ExtDevSetUDPComParam("192.168.58.88", 2021, 2, 100, 3, 100, 1, 100, 10)
robot.ExtDevLoadUDPDriver()
# Set the parameters of the extended axis
robot.SetAxisDHParaConfig(4, 200, 200, 0, 0, 0, 0, 0, 0)
robot.SetRobotPosToAxis(1)
robot.ExtAxisParamConfig(1, 0, 1, 100, -100, 10, 10, 12, 131072, 0, 1, 0, 0)
# Expand the axis to enable and return to zero
robot.ExtAxisServoOn(1, 0)
robot.ExtAxisSetHoming(1, 0, 20, 3)
# Extended axis coordinate system calibration
pos = [] # Please fill in the coordinates of the marking points
robot.SetRefPointInExAxisEnd(pos)
robot.PositionorSetRefPoint(1) # It needs to be called four times for calibration
error,coord = robot.PositionorComputeECoordSys()
robot.ExtAxisActiveECoordSys(1, 1, coord, 1)
# Synchronize the starting and ending points of the movement
startdescPose = [] # Please fill in the coordinates of the marking points
startjointPos = [] # Please fill in the coordinates of the marking points
startexaxisPos = [] # Please fill in the coordinates of the marking points
enddescPose = [] # Please fill in the coordinates of the marking points
endjointPos = [] # Please fill in the coordinates of the marking points
endexaxisPos = [] # Please fill in the coordinates of the marking points
# Move to the starting point
robot.ExtAxisMove(startexaxisPos, 20, -1)
offdese = [0, 0, 0, 0, 0, 0]
robot.MoveJ(joint_pos=startjointPos, tool= 1,user= 1,vel= 100,acc= 100,ovl= 100,exaxis_pos= startexaxisPos,blendT= 0)
# Perform synchronous linear motion
robot.ExtAxisSyncMoveL(endjointPos, enddescPose, 1, 1, endexaxisPos, 100, 100, 100, 0, 0, offdese)
robot.CloseRPC()
13.45. UDP extension axes synchronized with robot circular motion
New in version python: SDK-v2.1.5
Prototype | ExtAxisSyncMoveC(desc_pos_p, tool_p, user_p,exaxis_pos_p, desc_pos_t, tool_t, user_t,exaxis_pos_t,joint_pos_p=[0.0, 0.0, 0.0, 0.0, 0.0, 0.0], joint_pos_t=[0.0, 0.0, 0.0, 0.0, 0.0, 0.0],vel_p =20.0, acc_p=100.0, offset_flag_p=0, offset_pos_p =[0.0, 0.0, 0.0, 0.0, 0.0, 0.0], vel_t=20.0, acc_t=100.0, offset_flag_t=0, offset_pos_t=[0.0, 0.0, 0.0, 0.0, 0.0, 0.0], ovl=100.0, blendR=-1.0, config=-1) |
Description |
|
Mandatory parameters |
|
Default Parameters |
|
Return Value | Error Code Success-0 Failure- errcode; |
13.46. UDP extension axes synchronized with robot circular motion code example
from fairino import Robot
# Establish a connection with the robot controller and return a robot object if the connection is successful
robot = Robot.RPC('192.168.58.2')
# Set the UDP communication parameters and load
robot.ExtDevSetUDPComParam("192.168.58.88", 2021, 2, 100, 3, 100, 1, 100, 10)
robot.ExtDevLoadUDPDriver()
# Set the parameters of the extended axis
robot.SetAxisDHParaConfig(4, 200, 200, 0, 0, 0, 0, 0, 0)
robot.SetRobotPosToAxis(1)
robot.ExtAxisParamConfig(1, 0, 1, 100, -100, 10, 10, 12, 131072, 0, 1, 0, 0)
# Expand the axis to enable and return to zero
robot.ExtAxisServoOn(1, 0)
robot.ExtAxisSetHoming(1, 0, 20, 3)
# Extended axis coordinate system calibration
pos = [] # Enter the coordinates of the reference point
robot.SetRefPointInExAxisEnd(pos)
robot.PositionorSetRefPoint(1) # Call four times to complete the calibration
coord = []
error,coord = robot.PositionorComputeECoordSys()
robot.ExtAxisActiveECoordSys(1, 1, coord, 1)
# Synchronous arc starting point, middle point and end point
startdescPose = []# Input coordinates
startjointPos = []# Input coordinates
startexaxisPos =[] # Enter the coordinates of the extended axis
middescPose = []# Input the midpoint
midjointPos = []
midexaxisPos =[]
enddescPose = []
endjointPos = []
endexaxisPos =[]
# Move to the starting point
robot.ExtAxisMove(startexaxisPos, 20, -1)
offdese = [0, 0, 0, 0, 0, 0]
robot.MoveJ(joint_pos=startjointPos,tool= 1,user= 1,vel= 100,acc= 100,ovl= 100,exaxis_pos= startexaxisPos,blendT= 0,offset_flag= 0,offset_pos= offdese)
# Start synchronous circular arc movement
robot.ExtAxisSyncMoveC(midjointPos,middescPose,1,1,midexaxisPos,
endjointPos,enddescPose,1,1,endexaxisPos,
100,100,0,offdese,
100,100,0,offdese,
100,0)
robot.CloseRPC()