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')
startdescPose = [-484.707, 276.996, -14.013, -37.657, -40.508, -1.548]
startjointPos = [-45.421, -75.673, 93.627, -104.302, -87.938, 6.005]
enddescPose = [-508.767, 137.109, -13.966, -37.639, -40.508, -1.559]
endjointPos = [-32.768, -80.947, 100.254, -106.201, -87.201, 18.648]
safedescPose = [-484.709, 294.436, 13.621, -37.660, -40.508, -1.545]
safejointPos = [-46.604, -75.410, 89.109, -100.003, -88.012, 4.823]
exaxisPos = [0, 0, 0, 0]
offdese = [0, 0, 0, 0, 0, 0]
robot.WeldingSetCurrentRelation(0, 495, 1, 10, 0)
robot.WeldingSetVoltageRelation(10, 45, 1, 10, 1)
robot.WeldingSetVoltage(0, 25, 1, 0)
robot.WeldingSetCurrent(0, 260, 0, 0)
robot.MoveJ(joint_pos=safejointPos, tool=1, user=0, vel=5, acc=100)
rtn = robot.WeldingSetCurrentGradualChangeStart(0, 260, 220, 0, 0)
print("WeldingSetCurrentGradualChangeStart rtn is", rtn)
rtn = robot.WeldingSetVoltageGradualChangeStart(0, 25, 22, 1, 0)
print("WeldingSetVoltageGradualChangeStart rtn is", rtn)
rtn = robot.ArcWeldTraceControl(1, 0, 1, 0.08, 5, 5, 300, 1, 0.06, 4, 4, 300, 1, 0, 4, 1, 10, 0, 0)
print("ArcWeldTraceControl rtn is", rtn)
robot.MoveJ(joint_pos=startjointPos, tool=1, user=0, vel=5, acc=100)
robot.ARCStart(0, 0, 10000)
robot.WeaveStart(0)
robot.WeaveChangeStart(2, 1, 24, 36)
robot.MoveL(desc_pos=enddescPose, tool=1, user=0, vel=100, ovl=2, acc=100)
robot.ARCEnd(0, 0, 10000)
robot.WeaveChangeEnd()
robot.WeaveEnd(0)
robot.ArcWeldTraceControl(0, 0, 1, 0.08, 5, 5, 300, 1, 0.06, 4, 4, 300, 1, 0, 4, 1, 10, 0, 0)
robot.WeldingSetCurrentGradualChangeEnd()
robot.WeldingSetVoltageGradualChangeEnd()
14.69. Set custom swing parameters
New in version python: SDK-v2.1.6
Prototype | CustomWeaveSetPara(id, pointNum, point, stayTime, frequency, incStayType, stationary) |
Description | Set custom swing parameters |
Mandatory parameters |
|
Default parameters | NULL |
Return Value | Error Code Success-0 Failure- errcode |
14.70. Gets custom swing parameters
New in version python: SDK-v2.1.6
Prototype | CustomWeaveGetPara(id) |
Description | Gets custom swing parameters |
Mandatory parameters |
|
Default parameters | NULL |
Return Value |
|
14.71. Custom swing parameter 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')
point = [0.0] * 30
point[0] = -3.0
point[1] = -3.0
point[2] = 0.0
point[3] = -6.0
point[4] = 0.0
point[5] = 0.0
point[6] = -3.0
point[7] = 3.0
point[8] = 0.0
point[9] = 0.0
point[10] = 0.0
point[11] = 0.0
stayTime = [0.0] * 10
rtn = robot.CustomWeaveSetPara(2, 4, point, stayTime, 1.000, 0, 0)
print(f"CustomWeaveSetPara rtn is {rtn}")
time.sleep(1)
pointNum = 0
frequency = 0.0
incStayType = 0
stationary = 0
rtn, pointNum, point, stayTime, frequency, incStayType, stationary = robot.CustomWeaveGetPara(2)
print(f"pointNum is {pointNum}")
for i in range(pointNum):
print(f"point {i}, point x y z {point[i * 3 + 0]},{point[i * 3 + 1]},{point[i * 3 + 2]}")
print(f"fre is {frequency}, stay is {incStayType},{stationary}")
robot.WeaveSetPara(0, 9, 1.000000, 1, 5.000000, 6.000000, 5.000000, 50, 100, 100, 0, 1, 0.000000, 0.000000)
desc_p1 = [-288.650, 367.807, 288.404, 0.000, -0.001, 0.001]
desc_p2 = [-431.714, 367.815, 288.415, 0.001, 0.001, 0.000]
desc_p3 = [-348.666, 427.798, 288.404, -0.000, -0.000, 0.001]
j1 = [140.656, -84.560, -91.707, -93.734, 90.000, 50.655]
j2 = [149.873, -98.298, -77.599, -94.103, 90.000, 59.873]
j3 = [139.773, -96.173, -80.014, -93.814, 90.000, 49.772]
epos = [0.0] * 4
offset_pos = [0.0] * 6
robot.MoveJ(joint_pos=j1, tool=3, user=0, vel=100)
robot.WeaveStart(0)
robot.Circle(desc_pos_p=desc_p3, tool_p=3, user_p=0, vel_p=50, desc_pos_t=desc_p2, tool_t=3, user_t=0, vel_t=50, oacc=10)
robot.WeaveEnd(0)
robot.MoveJ(joint_pos=j1, tool=3, user=0, vel=100)
robot.WeaveStart(0)
robot.MoveC(desc_pos_p=desc_p3, tool_p=3, user_p=0, vel_p=50, desc_pos_t=desc_p2, tool_t=3, user_t=0, vel_t=50)
robot.WeaveEnd(0)
robot.MoveJ(joint_pos=j1, tool=3, user=0, vel=100)
robot.WeaveStart(0)
robot.MoveL(desc_pos=desc_p2, tool=3, user=0, vel=100, ovl=10, speedPercent=100)
robot.WeaveEnd(0)
robot.CloseRPC()