13. Extended Axis
13.1. Setting the 485 Extended Axis Parameters
New in version python: SDK-v2.0.3
Prototype |
|
|---|---|
Description |
Setting the 485 extended axis parameters |
Mandatory parameters |
|
Default parameters |
NULL |
Return Value |
Error Code Success-0 Failure- errcode |
13.2. Getting 485 Expansion Axis Configuration Parameters
New in version python: SDK-v2.0.3
Prototype |
|
|---|---|
Description |
Get 485 extended axis configuration parameters |
Mandatory parameters |
|
Default parameters |
NULL |
Return Value |
|
13.3. Setting the 485 expansion axis enable/disable
New in version python: SDK-v2.0.3
Prototype |
|
|---|---|
Description |
Setting the 485 extension axis to enable/de-enable |
Mandatory parameters |
|
Default parameters |
NULL |
Return Value |
Error Code Success-0 Failure- errcode |
13.4. Setting the 485 Extended Axis Control Mode
New in version python: SDK-v2.0.3
Prototype |
|
|---|---|
Description |
Setting the 485 Extended Axis Control Mode |
Mandatory parameters |
|
Default parameters |
NULL |
Return Value |
Error Code Success-0 Failure- errcode |
13.5. Setting the 485 extended axis target position (position mode)
New in version python: SDK-v2.0.3
Prototype |
|
|---|---|
Description |
Setting the 485 extended axis target position (position mode) |
Mandatory parameters |
|
Default parameters |
NULL |
Return Value |
Error Code Success-0 Failure- errcode |
13.6. Setting the 485 extended axis target torque (torque mode)-not yet available
New in version python: SDK-v2.0.3
prototype |
|
|---|---|
Description |
Setting the 485 extended axis target torque (torque mode) |
Mandatory parameters |
|
Default parameters |
NULL |
Return Value |
Error Code Success-0 Failure- errcode |
13.7. Setting the 485 extended axis back to zero
New in version python: SDK-v2.0.3
Prototype |
|
|---|---|
Description |
Setting the 485 extension axis back to zero |
Mandatory parameters |
|
Default parameters |
NULL |
Return Value |
Error Code Success-0 Failure- errcode |
13.8. Clearing 485 Expansion Axis Error Messages
New in version python: SDK-v2.0.3
Prototype |
|
|---|---|
Description |
Clearing 485 Extended Axis Error Message |
Mandatory parameters |
|
Default parameters |
NULL |
Return Value |
Error Code Success-0 Failure- errcode |
13.9. Get 485 extended axis servo status
New in version python: SDK-v2.0.3
prototype |
|
|---|---|
Description |
Get 485 extended axis servo status |
Mandatory parameters |
|
Default parameters |
NULL |
Return Value |
|
13.10. Setting the 485 extended axis target speed (velocity mode)
New in version python: SDK-v2.0.3
Prototype |
|
|---|---|
Description |
Setting the 485 extended axis target speed (velocity mode) |
Mandatory parameters |
|
Default parameters |
NULL |
Return Value |
Error Code Success-0 Failure- errcode |
13.11. Setting the 485 extended axis data axis number in the status feedback
New in version python: SDK-v2.0.3
Prototype |
|
|---|---|
Description |
Sets the 485 extended axis data axis number in status feedback |
Mandatory parameters |
|
Default parameters |
NULL |
Return Value |
Error Code Success-0 Failure- errcode |
13.12. Setting the 485 Extended Axis Motion Acceleration and Deceleration Speed
New in version python: SDK-v2.0.5
Prototype |
|
|---|---|
Description |
Sets the 485 extended axis motion acceleration and deceleration speeds. |
Mandatory parameters |
|
Default parameters |
NULL |
Return Value |
Error Code Success-0 Failure- errcode |
13.13. Setting the 485 extended axis emergency stop acceleration and deceleration speeds
New in version python: SDK-v2.0.5
Prototype |
|
|---|---|
Description |
Setting the 485 extended axis emergency stop acceleration and deceleration speed |
Mandatory parameters |
|
Default parameters |
NULL |
Return Value |
Error Code Success-0 Failure- errcode |
13.14. Get 485 Extended Axis Motion Acceleration and Deceleration
New in version python: SDK-v2.0.5
Prototype |
|
|---|---|
Description |
Get 485 extended axis motion plus or minus velocity |
Mandatory parameters |
NULL |
Default parameters |
NULL |
Return Value |
|
13.15. Get 485 extended axis emergency stop acceleration and deceleration speeds
New in version python: SDK-v2.0.5
Prototype |
|
|---|---|
Description |
Get 485 extended axis emergency stop acceleration and deceleration speed |
Mandatory parameters |
NULL |
Default parameters |
NULL |
Return Value |
|
13.16. Extended axis control code example
1from fairino import Robot
2import time
3# Establish a connection with the robot controller and return a robot object if the connection is successful
4robot = Robot.RPC('192.168.58.2')
5retval = robot.AuxServoSetParam(1, 1, 1, 1, 131072, 15.45)
6print(f"AuxServoSetParam is: {retval}")
7servoCompany = 0
8servoModel = 0
9servoSoftVersion = 0
10servoResolution = 0
11axisMechTransRatio = 0.0
12retval, servoCompany, servoModel, servoSoftVersion, servoResolution, axisMechTransRatio = robot.AuxServoGetParam(1)
13print(f"servoCompany {servoCompany}\n"
14 f"servoModel {servoModel}\n"
15 f"servoSoftVersion {servoSoftVersion}\n"
16 f"servoResolution {servoResolution}\n"
17 f"axisMechTransRatio {axisMechTransRatio}\n")
18retval = robot.AuxServoSetParam(1, 10, 11, 12, 13, 14)
19print(f"AuxServoSetParam is: {retval}")
20retval, servoCompany, servoModel, servoSoftVersion, servoResolution, axisMechTransRatio = robot.AuxServoGetParam(1)
21print(f"servoCompany {servoCompany}\n"
22 f"servoModel {servoModel}\n"
23 f"servoSoftVersion {servoSoftVersion}\n"
24 f"servoResolution {servoResolution}\n"
25 f"axisMechTransRatio {axisMechTransRatio}\n")
26retval = robot.AuxServoSetParam(1, 1, 1, 1, 131072, 36)
27print(f"AuxServoSetParam is: {retval}")
28time.sleep(3)
29robot.AuxServoSetAcc(3000, 3000)
30robot.AuxServoSetEmergencyStopAcc(5000, 5000)
31time.sleep(1)
32emagacc = 0.0
33emagdec = 0.0
34acc = 0.0
35dec = 0.0
36error,emagacc, emagdec = robot.AuxServoGetEmergencyStopAcc()
37print(f"emergency acc is {emagacc} dec is {emagdec}")
38error,acc, dec = robot.AuxServoGetAcc()
39print(f"acc is {acc} dec is {dec}")
40robot.AuxServoSetControlMode(1, 0)
41time.sleep(2)
42retval = robot.AuxServoEnable(1, 0)
43print(f"AuxServoEnable disenable {retval}")
44time.sleep(1)
45servoErrCode = 0
46servoState = 0
47servoPos = 0.0
48servoSpeed = 0.0
49servoTorque = 0.0
50retval, servoErrCode, servoState, servoPos, servoSpeed, servoTorque = robot.AuxServoGetStatus(1)
51print(f"AuxServoGetStatus servoState {servoState}")
52time.sleep(1)
53retval = robot.AuxServoEnable(1, 1)
54print(f"AuxServoEnable enable {retval}")
55time.sleep(1)
56retval, servoErrCode, servoState, servoPos, servoSpeed, servoTorque = robot.AuxServoGetStatus(1)
57print(f"AuxServoGetStatus servoState {servoState}")
58time.sleep(1)
59retval = robot.AuxServoHoming(1, 1, 5, 1,100)
60print(f"AuxServoHoming {retval}")
61time.sleep(3)
62retval = robot.AuxServoSetTargetPos(1, 200, 30,100)
63print(f"AuxServoSetTargetPos {retval}")
64time.sleep(1)
65retval, servoErrCode, servoState, servoPos, servoSpeed, servoTorque = robot.AuxServoGetStatus(1)
66print(f"AuxServoGetStatus servoSpeed {servoSpeed}")
67time.sleep(8)
68robot.AuxServoSetControlMode(1, 1)
69time.sleep(2)
70robot.AuxServoEnable(1, 0)
71time.sleep(1)
72robot.AuxServoEnable(1, 1)
73time.sleep(1)
74robot.AuxServoSetTargetSpeed(1, 100, 80)
75time.sleep(5)
76robot.AuxServoSetTargetSpeed(1, 0, 80)
77robot.CloseRPC()
13.17. Parameter configuration for UDP extended axis communication
New in version python: SDK-v2.1.2
prototype |
|
|---|---|
Description |
UDP Extended Axis Communication Parameter Configuration |
Mandatory parameters |
|
Default parameters |
NULL |
Return Value |
Error Code Success-0 Failure- errcode |
13.18. Get UDP extended axis communication parameters
New in version python: SDK-v2.0.4
Prototype |
|
|---|---|
Description |
Get UDP extended axis communication parameters |
Mandatory parameters |
NULL |
Default parameters |
NULL |
Return Value |
|
13.19. Load UDP communication
New in version python: SDK-v2.0.4
Prototype |
|
|---|---|
Description |
Load UDP communication |
Mandatory parameters |
NULL |
Default parameters |
NULL |
Return Value |
Error Code Success-0 Failure- errcode |
13.20. Offloading UDP communication
New in version python: SDK-v2.0.4
Prototype |
|
|---|---|
Description |
Offloading UDP communication |
Mandatory parameters |
NULL |
Default parameters |
NULL |
Return Value |
Error Code Success-0 Failure- errcode |
13.21. UDP Extended Axis Communication Recovery after Abnormal Disconnection
New in version python: SDK-v2.0.4
prototype |
|
|---|---|
Description |
UDP Extended Axis Communication Abnormally Disconnected After Restoring Connection |
Mandatory parameters |
NULL |
Default parameters |
NULL |
Return Value |
Error Code Success-0 Failure- errcode |
13.22. UDP extension axis communication is closed after abnormal disconnection.
New in version python: SDK-v2.0.4
Prototype |
|
|---|---|
Description |
UDP Extended Axis Communication Abnormal Disconnect Closes Communication |
Mandatory parameters |
NULL |
Default parameters |
NULL |
Return Value |
Error Code Success-0 Failure- errcode |
13.23. UDP Extended Axis Parameter Configuration
New in version python: SDK-v2.0.4
Prototype |
|
|---|---|
Description |
UDP Extended Axis Parameter Configuration |
Mandatory parameters |
|
Default parameters |
NULL |
Return Value |
Error Code Success-0 Failure- errcode |
13.24. Setting the extended robot position relative to the extended axis
New in version python: SDK-v2.0.4
Prototype |
|
|---|---|
Description |
Set the position of the extended robot relative to the extended axis |
Mandatory parameters |
|
Default parameters |
NULL |
Return Value |
Error Code Success-0 Failure- errcode |
13.25. Setting the extended axis system DH parameter configuration
New in version python: SDK-v2.0.4
Prototype |
|
|---|---|
Description |
Sets the extended axis system DH parameter configuration |
Mandatory parameters |
|
Default parameters |
NULL |
Return Value |
Error Code Success-0 Failure- errcode |
13.26. UDP Extended Axis Enable
New in version python: SDK-v2.0.4
Prototype |
|
|---|---|
description |
UDP Extended Axis Enable |
Mandatory parameters |
|
Default parameters |
NULL |
Return Value |
Error Code Success-0 Failure- errcode |
13.27. UDP Extended Axis Zero Return
New in version python: SDK-v2.0.4
Prototype |
|
|---|---|
Description |
UDP extended axis back to zero |
Mandatory parameters |
|
Default parameters |
NULL |
Return Value |
Error Code Success-0 Failure- errcode |
13.28. UDP Extended Axis Tap Start
New in version python: SDK-v2.0.4
Prototype |
|
|---|---|
Description |
UDP Extended Axis Tap Start |
Mandatory parameters |
|
Default parameters |
NULL |
Return Value |
Error Code Success-0 Failure- errcode |
13.29. UDP Extended Axis Tap Stop
New in version python: SDK-v2.0.4
Prototype |
|
|---|---|
Description |
UDP Extended Axis Tap Stop |
Mandatory parameters |
|
Default parameters |
NULL |
Return Value |
Error Code Success-0 Failure- errcode |
13.30. Example of UDP extension axis configuration and tapping code
1from fairino import Robot
2import time
3# Establish a connection with the robot controller and return a robot object if the connection is successful
4robot = Robot.RPC('192.168.58.2')
5rtn = robot.ExtDevSetUDPComParam("192.168.58.88", 2021, 2, 100, 3, 200, 1, 100, 5, 1)
6print(f"ExtDevSetUDPComParam rtn is {rtn}")
7ip = ""
8port = 0
9period = 0
10lossPkgTime = 0
11lossPkgNum = 0
12disconnectTime = 0
13reconnectEnable = 0
14reconnectPeriod = 0
15reconnectNum = 0
16rtn,[ip, port, period, lossPkgTime, lossPkgNum,disconnectTime, reconnectEnable, reconnectPeriod, reconnectNum] = robot.ExtDevGetUDPComParam()
17param_str = (f"\nip {ip}\nport {port}\nperiod {period}\nlossPkgTime {lossPkgTime}"
18 f"\nlossPkgNum {lossPkgNum}\ndisConntime {disconnectTime}"
19 f"\nreconnecable {reconnectEnable}\nreconnperiod {reconnectPeriod}"
20 f"\nreconnnun {reconnectNum}")
21print(f"ExtDevGetUDPComParam rtn is {rtn}{param_str}")
22robot.ExtDevLoadUDPDriver()
23rtn = robot.ExtAxisServoOn(1, 1)
24print(f"ExtAxisServoOn axis id 1 rtn is {rtn}")
25rtn = robot.ExtAxisServoOn(2, 1)
26print(f"ExtAxisServoOn axis id 2 rtn is {rtn}")
27time.sleep(2)
28robot.ExtAxisSetHoming(1, 0, 10, 2)
29time.sleep(2)
30rtn = robot.ExtAxisSetHoming(2, 0, 10, 2)
31print(f"ExtAxisSetHoming rtn is {rtn}")
32time.sleep(4)
33rtn = robot.SetRobotPosToAxis(1)
34print(f"SetRobotPosToAxis rtn is {rtn}")
35rtn = robot.SetAxisDHParaConfig(10, 20, 0, 0, 0, 0, 0, 0, 0)
36print(f"SetAxisDHParaConfig rtn is {rtn}")
37rtn = robot.ExtAxisParamConfig(1, 1, 1, 1000, -1000, 1000, 1000, 1.905, 262144, 200, 1, 0, 0)
38print(f"ExtAxisParamConfig axis 1 rtn is {rtn}")
39rtn = robot.ExtAxisParamConfig(2, 1, 1, 1000, -1000, 1000, 1000, 4.444, 262144, 200, 1, 0, 0)
40print(f"ExtAxisParamConfig axis 2 rtn is {rtn}")
41time.sleep(3)
42robot.ExtAxisStartJog(1, 0, 10, 10, 30)
43time.sleep(1)
44robot.ExtAxisStopJog(1)
45time.sleep(3)
46robot.ExtAxisServoOn(1, 0)
47time.sleep(3)
48robot.ExtAxisStartJog(2, 0, 10, 10, 30)
49time.sleep(1)
50robot.ExtAxisStopJog(2)
51time.sleep(3)
52robot.ExtAxisServoOn(2, 0)
53robot.ExtDevUnloadUDPDriver()
54robot.CloseRPC()
13.31. Setting the reference point of the extended axis coordinate system - four-point method
New in version python: SDK-v2.0.4
Prototype |
|
|---|---|
Description |
Setting the reference point of the extended axis coordinate system - four-point method |
Mandatory parameters |
|
Default parameters |
NULL |
Return Value |
Error Code Success-0 Failure- errcode |
13.32. Calculating the Extended Axis Coordinate System - Four Point Method
New in version python: SDK-v2.0.4
Prototype |
|
|---|---|
Description |
Calculating Extended Axis Coordinate Systems - Four Point Method |
Mandatory parameters |
NULL |
Default parameters |
NULL |
Return Value |
|
13.33. Reference Point Setting for the Shifter Coordinate System - Four-Point Method
New in version python: SDK-v2.0.4
Prototype |
|
|---|---|
Description |
Reference Point Setting for the Variable Position Machine Coordinate System - Four Point Method |
Mandatory parameters |
|
Default parameters |
NULL |
Return Value |
Error Code Success-0 Failure- errcode |
13.34. Shifter Coordinate System Calculation - Four Point Method
New in version python: SDK-v2.0.4
Prototype |
|
|---|---|
Description |
Translator Coordinate System Calculation - Four Point Method |
Mandatory parameters |
NULL |
Default parameters |
NULL |
Return Value |
|
13.35. Setting of the calibration reference point in the position in the coordinate system of the end of the translator
New in version python: SDK-v2.0.4
prototype |
|
|---|---|
Description |
Set the calibration reference point to be positioned in the coordinate system of the end of the variator |
Mandatory parameters |
|
Default parameters |
NULL |
Return Value |
Error Code Success-0 Failure- errcode |
13.36. Applying the Extended Axis Coordinate System
New in version python: SDK-v2.0.4
Prototype |
|
|---|---|
Description |
Apply extended axis coordinate system |
Mandatory parameters |
|
Default parameters |
NULL |
Return Value |
Error Code Success-0 Failure- errcode |
13.37. Obtain the extended axis coordinate system
New in version python: SDK-v2.1.2
Prototype |
|
|---|---|
Description |
Obtain the extended axis coordinate system |
Mandatory parameters |
NULL |
Default parameters |
NULL |
Return Value |
|
13.38. Extended axis coordinate system calibration code example
1from fairino import Robot
2import time
3# Establish a connection with the robot controller and return a robot object if the connection is successful
4robot = Robot.RPC('192.168.58.2')
5rtn = robot.ExtDevSetUDPComParam("192.168.58.88", 2021, 2, 100, 3, 200, 1, 100, 5, 1)
6print(f"ExtDevSetUDPComParam rtn is {rtn}")
7rtn,udp_params = robot.ExtDevGetUDPComParam()
8ip, port, period, lossPkgTime, lossPkgNum, disconnectTime, reconnectEnable, reconnectPeriod, reconnectNum = udp_params
9patam = (
10 f"\nip {ip}\nport {port}\nperiod {period}\nlossPkgTime {lossPkgTime}\n"
11 f"lossPkgNum {lossPkgNum}\ndisConntime {disconnectTime}\nreconnecable {reconnectEnable}\n"
12 f"reconnperiod {reconnectPeriod}\nreconnnun {reconnectNum}"
13)
14print(f"ExtDevGetUDPComParam rtn is {rtn}{patam}")
15robot.ExtDevLoadUDPDriver()
16rtn = robot.ExtAxisServoOn(1, 1)
17print(f"ExtAxisServoOn axis id 1 rtn is {rtn}")
18rtn = robot.ExtAxisServoOn(2, 1)
19print(f"ExtAxisServoOn axis id 2 rtn is {rtn}")
20time.sleep(2)
21robot.ExtAxisSetHoming(1, 0, 10, 2)
22time.sleep(2)
23rtn = robot.ExtAxisSetHoming(2, 0, 10, 2)
24print(f"ExtAxisSetHoming rtn is {rtn}")
25time.sleep(4)
26rtn = robot.SetRobotPosToAxis(1)
27print(f"SetRobotPosToAxis rtn is {rtn}")
28rtn = robot.SetAxisDHParaConfig(1, 128.5, 206.4, 0, 0, 0, 0, 0, 0)
29print(f"SetAxisDHParaConfig rtn is {rtn}")
30rtn = robot.ExtAxisParamConfig(1, 1, 1, 1000, -1000, 1000, 1000, 1.905, 262144, 200, 1, 0, 0)
31print(f"ExtAxisParamConfig axis 1 rtn is {rtn}")
32rtn = robot.ExtAxisParamConfig(2, 1, 1, 1000, -1000, 1000, 1000, 4.444, 262144, 200, 1, 0, 0)
33print(f"ExtAxisParamConfig axis 2 rtn is {rtn}")
34toolCoord = [0, 0, 210, 0, 0, 0]
35robot.SetToolCoord(1, toolCoord, 0, 0, 1, 0)
36jSafe = [115.193, -96.149, 92.489, -87.068, -89.15, -83.488]
37j1 = [117.559, -92.624, 100.329, -96.909, -94.057, -83.488]
38j2 = [112.239, -90.096, 99.282, -95.909, -89.824, -83.488]
39j3 = [110.839, -83.473, 93.166, -89.22, -90.499, -83.487]
40j4 = [107.935, -83.572, 95.424, -92.873, -87.933, -83.488]
41descSafe = [0.0,0.0,0.0,0.0,0.0,0.0]
42desc1 = [0.0,0.0,0.0,0.0,0.0,0.0]
43desc2 = [0.0,0.0,0.0,0.0,0.0,0.0]
44desc3 = [0.0,0.0,0.0,0.0,0.0,0.0]
45desc4 = [0.0,0.0,0.0,0.0,0.0,0.0]
46exaxisPos = [0.0,0.0,0.0,0.0]
47offdese = [0.0,0.0,0.0,0.0,0.0,0.0]
48error, descSafe = robot.GetForwardKin(jSafe)
49robot.MoveJ(joint_pos=jSafe,tool= 1,user= 0,vel= 100)
50time.sleep(2)
51error, desc1 = robot.GetForwardKin(j1)
52robot.MoveJ(joint_pos=j1,tool= 1,user= 0,vel= 100)
53time.sleep(2)
54actualTCPPos = [0.0,0.0,0.0,0.0,0.0,0.0]
55error, actualTCPPos = robot.GetActualTCPPose(0)
56robot.SetRefPointInExAxisEnd(actualTCPPos)
57rtn = robot.PositionorSetRefPoint(1)
58print(f"PositionorSetRefPoint 1 rtn is {rtn}")
59time.sleep(2)
60robot.MoveJ(joint_pos=jSafe,tool= 1,user= 0,vel= 100)
61robot.ExtAxisStartJog(1, 0, 50, 50, 10)
62time.sleep(1)
63robot.ExtAxisStartJog(2, 0, 50, 50, 10)
64time.sleep(1)
65error, desc2 = robot.GetForwardKin(j2)
66rtn = robot.MoveJ(joint_pos=j2,tool= 1,user= 0,vel= 100)
67rtn = robot.PositionorSetRefPoint(2)
68print(f"PositionorSetRefPoint 2 rtn is {rtn}")
69time.sleep(2)
70robot.MoveJ(joint_pos=jSafe,tool= 1,user= 0,vel= 100)
71robot.ExtAxisStartJog(1, 0, 50, 50, 10)
72time.sleep(1)
73robot.ExtAxisStartJog(2, 0, 50, 50, 10)
74time.sleep(1)
75error, desc3 = robot.GetForwardKin(j3)
76robot.MoveJ(joint_pos=j3,tool= 1,user= 0,vel= 100)
77rtn = robot.PositionorSetRefPoint(3)
78print(f"PositionorSetRefPoint 3 rtn is {rtn}")
79time.sleep(2)
80robot.MoveJ(joint_pos=jSafe,tool= 1,user= 0,vel= 100)
81robot.ExtAxisStartJog(1, 0, 50, 50, 10)
82time.sleep(1)
83robot.ExtAxisStartJog(2, 0, 50, 50, 10)
84time.sleep(1)
85error, desc4 = robot.GetForwardKin(j4)
86robot.MoveJ(joint_pos=j4,tool= 1,user= 0,vel= 100)
87rtn = robot.PositionorSetRefPoint(4)
88print(f"PositionorSetRefPoint 4 rtn is {rtn}")
89time.sleep(2)
90axisCoord = [0.0,0.0,0.0,0.0,0.0,0.0]
91error,axisCoord = robot.PositionorComputeECoordSys()
92robot.MoveJ(joint_pos=jSafe,tool= 1,user= 0,vel= 100)
93print(f"PositionorComputeECoordSys rtn is {axisCoord[0]} {axisCoord[1]} {axisCoord[2]} {axisCoord[3]} {axisCoord[4]} {axisCoord[5]}")
94rtn = robot.ExtAxisActiveECoordSys(3, 1, axisCoord, 1)
95print(f"ExtAxisActiveECoordSys rtn is {rtn}")
96robot.CloseRPC()
13.39. UDP Extended Axis Motion
New in version python: SDK-v2.1.4
Prototype |
|
|---|---|
Description |
UDP Extended Axis Motion |
Mandatory parameters |
|
Default parameters |
|
Return Value |
Error Code Success-0 Failure- errcode |
13.40. UDP Extended axis motion code example
1from fairino import Robot
2import time
3# Establish a connection with the robot controller and return a robot object if the connection is successful
4robot = Robot.RPC('192.168.58.2')
5axisPos = [20,0,0,0]
6robot.ExtAxisMove(axisPos, 50, -1)
7robot.CloseRPC()
8return 0
13.41. UDP extension axes synchronized with robot joint motion
New in version python: SDK-v2.0.4
Prototype |
|
|---|---|
Description |
UDP extension axis synchronized motion with robot joint motion |
Mandatory parameters |
|
Default Parameters |
|
Return Value |
Error Code Success-0 Failure- errcode; |
13.42. UDP extension axes synchronized with robot joint motion code example
1from fairino import Robot
2# Establish a connection with the robot controller and return a robot object if the connection is successful
3robot = Robot.RPC('192.168.58.2')
4# Set the UDP communication parameters and load
5robot.ExtDevSetUDPComParam("192.168.58.88", 2021, 2, 100, 3, 100, 1, 100, 10)
6robot.ExtDevLoadUDPDriver()
7# Set the parameters of the extended axis
8robot.SetAxisDHParaConfig(4, 200, 200, 0, 0, 0, 0, 0, 0)
9robot.SetRobotPosToAxis(1)
10robot.ExtAxisParamConfig(1, 0, 1, 100, -100, 10, 10, 12, 131072, 0, 1, 0, 0)
11# Expand the axis to enable and return to zero
12robot.ExtAxisServoOn(1, 0)
13robot.ExtAxisSetHoming(1, 0, 20, 3)
14# Extended axis coordinate system calibration
15pos = [] # Please fill in the specific coordinates
16robot.SetRefPointInExAxisEnd(pos)
17robot.PositionorSetRefPoint(1) # This operation should be repeated 4 times (using 4 dots)
18error,coord = robot.PositionorComputeECoordSys()
19robot.ExtAxisActiveECoordSys(1, 1, coord, 1)
20# Synchronize the starting and ending points of the movement
21startdescPose = [] # Please fill in the specific coordinates
22startjointPos = [] # Please fill in the specific coordinates
23startexaxisPos = [] # Please fill in the specific coordinates
24enddescPose = [] # Please fill in the specific coordinates
25endjointPos = [] # Please fill in the specific coordinates
26endexaxisPos = [] # Please fill in the specific coordinates
27# Move to the starting point
28robot.ExtAxisMove(startexaxisPos, 20, -1)
29offdese = [0, 0, 0, 0, 0, 0]
30robot.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)
31robot.ExtAxisSyncMoveJ(endjointPos, enddescPose, 1, 1, endexaxisPos, 100, 100, 100, -1, 0, offdese)
32robot.CloseRPC()
13.43. UDP extension axes synchronized with robot linear motion
New in version python: SDK-v2.1.5
Prototype |
|
|---|---|
Description |
UDP extension axis synchronized motion with robot linear motion |
Mandatory parameters |
|
Default Parameters |
|
Return Value |
Error Code Success-0 Failure- errcode; |
13.44. UDP extension axes synchronized with robot linear motion code example
1from fairino import Robot
2# Establish a connection with the robot controller and return a robot object if the connection is successful
3robot = Robot.RPC('192.168.58.2')
4# Set the UDP communication parameters and load
5robot.ExtDevSetUDPComParam("192.168.58.88", 2021, 2, 100, 3, 100, 1, 100, 10)
6robot.ExtDevLoadUDPDriver()
7# Set the parameters of the extended axis
8robot.SetAxisDHParaConfig(4, 200, 200, 0, 0, 0, 0, 0, 0)
9robot.SetRobotPosToAxis(1)
10robot.ExtAxisParamConfig(1, 0, 1, 100, -100, 10, 10, 12, 131072, 0, 1, 0, 0)
11# Expand the axis to enable and return to zero
12robot.ExtAxisServoOn(1, 0)
13robot.ExtAxisSetHoming(1, 0, 20, 3)
14# Extended axis coordinate system calibration
15pos = [] # Please fill in the coordinates of the marking points
16robot.SetRefPointInExAxisEnd(pos)
17robot.PositionorSetRefPoint(1) # It needs to be called four times for calibration
18error,coord = robot.PositionorComputeECoordSys()
19robot.ExtAxisActiveECoordSys(1, 1, coord, 1)
20# Synchronize the starting and ending points of the movement
21startdescPose = [] # Please fill in the coordinates of the marking points
22startjointPos = [] # Please fill in the coordinates of the marking points
23startexaxisPos = [] # Please fill in the coordinates of the marking points
24enddescPose = [] # Please fill in the coordinates of the marking points
25endjointPos = [] # Please fill in the coordinates of the marking points
26endexaxisPos = [] # Please fill in the coordinates of the marking points
27# Move to the starting point
28robot.ExtAxisMove(startexaxisPos, 20, -1)
29offdese = [0, 0, 0, 0, 0, 0]
30robot.MoveJ(joint_pos=startjointPos, tool= 1,user= 1,vel= 100,acc= 100,ovl= 100,exaxis_pos= startexaxisPos,blendT= 0)
31# Perform synchronous linear motion
32robot.ExtAxisSyncMoveL(endjointPos, enddescPose, 1, 1, endexaxisPos, 100, 100, 100, 0, 0, offdese)
33robot.CloseRPC()
13.45. UDP extension axes synchronized with robot circular motion
New in version python: SDK-v2.1.5
Prototype |
|
|---|---|
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
1from fairino import Robot
2# Establish a connection with the robot controller and return a robot object if the connection is successful
3robot = Robot.RPC('192.168.58.2')
4# Set the UDP communication parameters and load
5robot.ExtDevSetUDPComParam("192.168.58.88", 2021, 2, 100, 3, 100, 1, 100, 10)
6robot.ExtDevLoadUDPDriver()
7# Set the parameters of the extended axis
8robot.SetAxisDHParaConfig(4, 200, 200, 0, 0, 0, 0, 0, 0)
9robot.SetRobotPosToAxis(1)
10robot.ExtAxisParamConfig(1, 0, 1, 100, -100, 10, 10, 12, 131072, 0, 1, 0, 0)
11# Expand the axis to enable and return to zero
12robot.ExtAxisServoOn(1, 0)
13robot.ExtAxisSetHoming(1, 0, 20, 3)
14# Extended axis coordinate system calibration
15pos = [] # Enter the coordinates of the reference point
16robot.SetRefPointInExAxisEnd(pos)
17robot.PositionorSetRefPoint(1) # Call four times to complete the calibration
18coord = []
19error,coord = robot.PositionorComputeECoordSys()
20robot.ExtAxisActiveECoordSys(1, 1, coord, 1)
21# Synchronous arc starting point, middle point and end point
22startdescPose = []# Input coordinates
23startjointPos = []# Input coordinates
24startexaxisPos =[] # Enter the coordinates of the extended axis
25middescPose = []# Input the midpoint
26midjointPos = []
27midexaxisPos =[]
28enddescPose = []
29endjointPos = []
30endexaxisPos =[]
31# Move to the starting point
32robot.ExtAxisMove(startexaxisPos, 20, -1)
33offdese = [0, 0, 0, 0, 0, 0]
34robot.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)
35# Start synchronous circular arc movement
36robot.ExtAxisSyncMoveC(midjointPos,middescPose,1,1,midexaxisPos,
37 endjointPos,enddescPose,1,1,endexaxisPos,
38 100,100,0,offdese,
39 100,100,0,offdese,
40 100,0)
41robot.CloseRPC()
13.47. Setting the Extended DO
New in version python: SDK-v2.0.4
Prototype |
|
|---|---|
Description |
Setting the Extended DO |
Mandatory parameters |
|
Default parameters |
NULL |
Return Value |
Error Code Success-0 Failure- errcode |
13.48. Setting up Extended AO
New in version python: SDK-v2.0.4
Prototype |
|
|---|---|
Description |
Setting the Extended AO |
Mandatory parameters |
|
Default parameters |
NULL |
Return Value |
Error Code Success-0 Failure- errcode |
13.49. Setting the Extended DI Input Filter Time
New in version python: SDK-v2.0.4
Prototype |
|
|---|---|
Description |
Setting the Extended DI Input Filter Time |
Mandatory parameters |
|
Default parameters |
NULL |
Return Value |
Error Code Success-0 Failure- errcode |
13.50. Setting the Extended AI Input Filter Time
New in version python: SDK-v2.0.4
Prototype |
|
|---|---|
Description |
Set the extended AI input filter time |
Mandatory parameters |
|
Default parameters |
NULL |
Return Value |
Error Code Success-0 Failure- errcode |
13.51. Waiting for extended DI input
New in version python: SDK-v2.0.4
Prototype |
|
|---|---|
Description |
Waiting for extended DI input |
Mandatory parameters |
|
Default parameters |
NULL |
Return Value |
Error Code Success-0 Failure- errcode |
13.52. Waiting for extended AI input
New in version python: SDK-v2.0.4
Prototype |
|
|---|---|
Description |
Waiting for extended AI input |
Mandatory parameters |
|
Default parameters |
NULL |
Return Value |
Error Code Success-0 Failure- errcode |
13.53. Get Extended DI Value
New in version python: SDK-v2.0.4
Prototype |
|
|---|---|
Description |
Get Extended DI Value |
Mandatory parameters |
|
Default parameters |
NULL |
Return Value |
|
13.54. Get Extended AI Value
New in version python: SDK-v2.0.4
Prototype |
|
|---|---|
Description |
Get Extended AI Value |
Mandatory parameters |
|
Default parameters |
NULL |
Return Value |
|
13.55. Extended IO code examples
1from fairino import Robot
2import time
3# Establish a connection with the robot controller and return a robot object if the connection is successful
4robot = Robot.RPC('192.168.58.2')
5for i in range(128):
6 robot.SetAuxDO(i, True, False, True)
7 time.sleep(0.1)
8for i in range(128):
9 robot.SetAuxDO(i, False, False, True)
10 time.sleep(0.1)
11for i in range(409):
12 value1 = i * 10
13 value2 = 4095 - i * 10
14 robot.SetAuxAO(0, value1, True)
15 robot.SetAuxAO(1, value2, True)
16 robot.SetAuxAO(2, value1, True)
17 robot.SetAuxAO(3, value2, True)
18 time.sleep(0.01)
19robot.SetAuxDIFilterTime(10)
20robot.SetAuxAIFilterTime(0, 10)
21for i in range(20):
22 curValue = False
23 error, curValue = robot.GetAuxDI(i, False) # 注意:如库内部需引用方式,这里需修改
24 print(f"DI{i} {curValue}")
25curValue = -1
26for i in range(4):
27 error, curValue = robot.GetAuxAI(i, True) # 同样注意引用传参问题
28 print(f"AI{i} {curValue}")
29robot.WaitAuxDI(1, False, 1000, False)
30robot.WaitAuxAI(1, 1, 132, 1000, False)
31robot.CloseRPC()
13.56. Removable Device Enable
New in version python: SDK-v2.0.5
Prototype |
|
|---|---|
description |
removable device enable |
Mandatory parameters |
|
Default parameters |
NULL |
Return Value |
Error Code Success-0 Failure- errcode |
13.57. Zeroing of removable units
New in version python: SDK-v2.0.5
Prototype |
|
|---|---|
Description |
Removable unit back to zero |
Mandatory parameters |
NULL |
Default parameters |
NULL |
Return Value |
Error Code Success-0 Failure- errcode |
13.58. Movable unit linear motion
New in version python: SDK-v2.0.5
Prototype |
|
|---|---|
Description |
Movable device linear motion |
Mandatory parameters |
|
Default parameters |
NULL |
Return Value |
Error Code Success-0 Failure- errcode |
13.59. Movable unit circular motion
New in version python: SDK-v2.0.5
prototype |
|
|---|---|
Description |
Movable device circular motion |
Mandatory parameters |
|
Default parameters |
NULL |
Return Value |
Error Code Success-0 Failure- errcode |
13.60. Stopping motion of movable devices
New in version python: SDK-v2.0.5
Prototype |
|
|---|---|
Description |
Movable unit stops moving |
Mandatory parameters |
NULL |
Default parameters |
NULL |
Return Value |
Error Code Success-0 Failure- errcode |
13.61. Portable device code example
1from fairino import Robot
2# Establish a connection with the robot controller and return a robot object if the connection is successful
3robot = Robot.RPC('192.168.58.2')
4robot.ExtDevSetUDPComParam("192.168.58.2", 2021, 2, 50, 5, 50, 1, 50, 10, 1)
5robot.ExtDevLoadUDPDriver()
6rtn = robot.ExtAxisServoOn(1, 1)
7rtn = robot.ExtAxisServoOn(2, 1)
8time.sleep(2)
9robot.ExtAxisSetHoming(1, 0, 10, 2)
10time.sleep(2)
11rtn = robot.ExtAxisSetHoming(2, 0, 10, 2)
12time.sleep(4)
13robot.ExtAxisParamConfig(1, 0, 0, 50000, -50000, 1000, 1000, 6.280, 16384, 200, 0, 0, 0)
14robot.ExtAxisParamConfig(2, 0, 0, 50000, -50000, 1000, 1000, 6.280, 16384, 200, 0, 0, 0)
15robot.SetAxisDHParaConfig(5, 0, 0, 0, 0, 0, 0, 0, 0)
16robot.TractorEnable(False)
17time.sleep(2)
18robot.TractorEnable(True)
19time.sleep(2)
20robot.TractorHoming()
21time.sleep(2)
22robot.TractorMoveL(100, 2)
23time.sleep(5)
24robot.TractorStop()
25robot.TractorMoveL(-100, 20)
26time.sleep(5)
27robot.TractorMoveC(300, 90, 20)
28time.sleep(10)
29robot.TractorMoveC(300, -90, 20)
30time.sleep(1)
31robot.CloseRPC()
13.62. Laser sensor recording points
New in version python: SDK-v2.1.4
Prototype |
|
|---|---|
Description |
Laser sensor recording points |
Mandatory par |
|
Default param |
NULL |
Return Value |
|
13.63. Sample code for laser sensor recording points
New in version python: SDK-v2.1.4
1from fairino import Robot
2# Establish a connection with the robot controller and return a robot object if the connection is successful
3robot = Robot.RPC('192.168.58.2')
4direction_point = [0, 0, 0]
5rtn = robot.LaserTrackingSearchStart(2, direction_point, 10, 100, 10000, 2)
6print(f"LaserTrackingSearchStart rtn is {rtn}")
7robot.LaserTrackingSearchStop()
8coord_id = 2
9rtn, joint, desc, exaxis = robot.LaserRecordPoint(coord_id)
10print(f"rtn is {rtn}")
11print(f"desc_pos:{desc[0]},{desc[1]},{desc[2]},"
12 f"{desc[3]},{desc[4]},{desc[5]}")
13print(f"joint_pos:{joint[0]},{joint[1]},{joint[2]},{joint[3]},{joint[4]},{joint[5]}")
14print(f"exaxis pos is {exaxis[0]} {exaxis[1]} {exaxis[2]} {exaxis[3]}")
15off = [0] * 6
16robot.MoveJ(joint,tool=1,user=0,vel=100,acc=100,ovl=50,exaxis_pos=exaxis,blendT=-1,offset_flag=0,offset_pos=off)
17robot.CloseRPC()
13.64. Set the synchronous movement strategy of the extended axis and the robot
New in version python: SDK-v2.1.5
Prototype |
|
|---|---|
Description |
Set the synchronous movement strategy of the extended axis and the robot |
Mandatory par |
|
Default param |
NULL |
Return Value |
Error Code Success-0 Failure- errcode |
13.65. Code example for setting the synchronous motion strategy of the extended axis and the robot
New in version python: SDK-v2.1.5
1from fairino import Robot
2# Establish a connection with the robot controller and return a robot object if the connection is successful
3robot = Robot.RPC('192.168.58.2')
4joint_pos1 = [-22.016, -49.217, 124.714, -161.100, -85.108, -0.333]
5joint_pos2 = [-21.083, -46.613, 110.079, -147.796, -80.757, -0.330]
6joint_pos3 = [-25.572, -60.090, 135.397, -163.889, -82.489, -0.345]
7desc_pos1 = [2.637, -0.001, 30.673, 178.786, -4.134, 68.326]
8desc_pos2 = [213.812, -1.440, 47.311, 177.410, 0.166, 68.946]
9desc_pos3 = [444.342, -12.723, 82.470, -177.701, -1.325, 65.151]
10epos1 = [0.001, 0.000, 0.000, 0.000]
11epos2 = [299.977, 0.000, 0.000, 0.000]
12epos3 = [399.969, 0.000, 0.000, 0.000]
13offset_pos = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
14rtn = robot.SetExAxisRobotPlan(0)
15print(f"SetExAxisRobotPlan rtn is {rtn}")
16time.sleep(1)
17rtn = robot.ExtAxisSyncMoveL(desc_pos=desc_pos1,tool=1,user=0,vel=100,acc=100,ovl=100,blendR=-1,exaxis_pos=epos1,offset_flag=0,offset_pos=offset_pos)
18print(f"ExtAxisSyncMoveL 1 rtn is {rtn}")
19rtn = robot.ExtAxisSyncMoveL(desc_pos=desc_pos2,tool=1,user=0,vel=100,acc=100,ovl=100,blendR=-1,exaxis_pos=epos2,offset_flag=0,offset_pos=offset_pos)
20print(f"ExtAxisSyncMoveL 2 rtn is {rtn}")
21rtn = robot.ExtAxisSyncMoveL(desc_pos=desc_pos3,tool=1,user=0,vel=100,acc=100,ovl=100,blendR=-1,exaxis_pos=epos3,offset_flag=0,offset_pos=offset_pos)
22print(f"ExtAxisSyncMoveL 3 rtn is {rtn}")
23time.sleep(8)
24robot.CloseRPC()