top of page

Python 4.43. AO flyshot 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')
j1 = [-11.904-99.669117.473-108.616-91.72674.256]
j2 = [-45.615-106.172124.296-107.151-91.28274.255]
desc_pos1 = [-419.524-13.000351.569-178.1180.3143.833]
desc_pos2 = [-321.222185.189335.520-179.030-1.284-29.869]
offset_pos = [000000]
offset_pos1 = [0050000]
epos = [0000]
tool = 0
user = 0
vel = 20.0
acc = 20.0
ovl = 100.0
blendT = -1.0
flag = 0
robot.SetSpeed(20)
robot.MoveAOStart(010010020)
robot.MoveJ(joint_pos=j1,tool=tool, user=user, vel=vel)
robot.MoveJ(joint_pos=j2, tool=tool, user=user, vel=vel)
robot.MoveAOStop()
time.sleep(1)
robot.MoveToolAOStart(010010020)
robot.MoveJ(joint_pos=j1,tool=tool, user=user, vel=vel)
robot.MoveJ(joint_pos=j2, tool=tool, user=user, vel=vel)
robot.MoveToolAOStop()
robot.CloseRPC()

4.44. Start Ptp motion FIR filtering

New in version python: SDK-v2.1.2

Prototype

PtpFIRPlanningStart(maxAcc, maxJek)

Description

Start Ptp motion FIR filtering

Mandatory parameters

  • maxAcc:Maximum acceleration extremum(deg/s2)

  • maxJek:Unify the extreme values of joint urgency (deg/s3)

Default parameters

NULL

Return Value

Error Code Success-0 Failure- errcode

4.45. Disable Ptp motion FIR filtering

New in version python: SDK-v2.0.7

Prototype

PtpFIRPlanningEnd()

Description

Disable Ptp motion FIR filtering

Mandatory parameters

NULL

Default parameters

NULL

Return Value

Error Code Success-0 Failure- errcode

4.46. LIN, ARC motion FIR filtering is started

New in version python: SDK-v2.0.7

Prototype

LinArcFIRPlanningStart(maxAccLin,maxAccDeg,maxJerkLin,maxJerkDeg)

Description

LIN, ARC motion FIR filtering is started

Mandatory parameter

  • maxAccLin:Linear acceleration extremum(mm/s2)

  • maxAccDeg:Angular acceleration extremum(deg/s2)

  • maxJerkLin:Linear plus acceleration extremum(mm/s3)

  • maxJerkDeg:Angle plus acceleration extremum(deg/s3)

Default parameters

NULL

Return Value

Error Code Success-0 Failure- errcode

4.47. Turn off LIN and ARC motion FIR filtering

New in version python: SDK-v2.0.7

Prototype

LinArcFIRPlanningEnd()

Description

Turn off LIN and ARC motion FIR filtering

Mandatory parameter

NULL

Default parameters

NULL

Return Value

Error Code Success-0 Failure- errcode

4.48. FIR filtering 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')
startjointPos = [-11.904-99.669117.473-108.616-91.72674.256]
startjointPos = [-11.904-99.669117.473-108.616-91.72674.256]
midjointPos = [-45.615-106.172124.296-107.151-91.28274.255]
endjointPos = [-29.777-84.536109.275-114.075-86.65574.257]
startdescPose = [-419.524-13.000351.569-178.1180.3143.833]
middescPose = [-321.222185.189335.520-179.030-1.284-29.869]
enddescPose = [-487.434154.362308.576176.6000.268-14.061]
exaxisPos = [0.00.00.00.0]
offdese = [0.00.00.00.00.00.0]
rtn = robot.PtpFIRPlanningStart(1000.01000.0)
print(f"PtpFIRPlanningStart rtn is {rtn}")
error = robot.MoveJ(joint_pos=startjointPos,tool= 0,user= 0,desc_pos=startdescPose,vel= 100,acc=100,ovl=100, blendT=-1.0, offset_flag=0)
print(f"MoveJ rtn is {rtn}")
error = robot.MoveJ(joint_pos=endjointPos,tool= 0,user= 0,desc_pos=enddescPose,vel= 100,acc=100,ovl=100, blendT=-1.0, offset_flag=0)
print(f"MoveJ rtn is {rtn}")
robot.PtpFIRPlanningEnd()
print(f"PtpFIRPlanningEnd rtn is {rtn}")
rtn = robot.LinArcFIRPlanningStart(1000100010001000)
print(f"LinArcFIRPlanningStart rtn is {rtn}")
error = robot.MoveL(desc_pos=startdescPose,tool= 0,user= 0, joint_pos=startjointPos,vel= 100,overSpeedStrategy=1,speedPercent=1)
print(f"MoveL rtn is {rtn}")
error = robot.MoveC(desc_pos_p=middescPose,tool_p= 0,user_p= 0, joint_pos_p=midjointPos,vel_p= 100,desc_pos_t=enddescPose,tool_t= 0,user_t= 0,joint_pos_t=endjointPos,vel_t= 100)
print(f"MoveC rtn is {rtn}")
robot.LinArcFIRPlanningEnd()
print(f"LinArcFIRPlanningEnd rtn is {rtn}")
robot.CloseRPC()

4.49. Acceleration smooth on

New in version python: SDK-v2.1.1

Prototype

AccSmoothStart(saveFlag_flag)

Description

Acceleration smooth on

Mandatory parameters

  • saveFlag_flag: Power off and save

Default parameters

NULL

Return Value

Error Code Success-0 Failure- errcode

4.50. Acceleration smooth closing

New in version python: SDK-v2.1.1

Prototype

AccSmoothEnd(saveFlag_flag)

Description

Acceleration smooth closing

Mandatory parameters

  • saveFlag_flag: Power off and save

Default parameters

NULL

Return Value

Error Code Success-0 Failure- errcode

4.51. Acceleration smoothing 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')
startjointPos = [-11.904-99.669117.473-108.616-91.72674.256]
endjointPos = [-45.615-106.172124.296-107.151-91.28274.255]
startdescPose = [-419.524-13.000351.569-178.1180.3143.833]
enddescPose = [-321.222185.189335.520-179.030-1.284-29.869]
exaxisPos = [0.00.00.00.0]
offdese = [0.00.00.00.00.00.0]
rtn = robot.AccSmoothStart(0)
print(f"AccSmoothStart rtn is {rtn}")
robot.MoveJ(joint_pos=startjointPos,tool= 0,user= 0,vel= 100)
robot.MoveJ(joint_pos=endjointPos,tool= 0,user= 0,vel= 100)
rtn = robot.AccSmoothEnd(0)
print(f"AccSmoothEnd rtn is {rtn}")

4.52. Setting the machine’s specified attitude speed on

New in version python: SDK-v2.0.5

Prototype

AngularSpeedStart(ratio)

Description

Specifies that attitude speed is on.

Mandatory parameters

  • ratio: percentage of attitude velocity [0-300]

Default parameters

NULL

Return Value

Error Code Success-0 Failure- errcode

4.53. Specify Attitude Velocity Off

New in version python: SDK-v2.0.5

Prototype

AngularSpeedEnd()

Description

Specify Attitude Velocity Off

Mandatory parameters

NULL

Default parameters

NULL

Return Value

Error Code Success-0 Failure- errcode

4.54. Robot specified pose velocity 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')
startjointPos = [-11.904-99.669117.473-108.616-91.72674.256]
endjointPos = [-45.615-106.172124.296-107.151-91.28274.255]
startdescPose = [-419.524-13.000351.569-178.1180.3143.833]
enddescPose = [-321.222185.189335.520-179.030-1.284-29.869]
exaxisPos = [0.00.00.00.0]
offdese = [0.00.00.00.00.00.0]
rtn = robot.AngularSpeedStart(50)
print(f"AngularSpeedStart rtn is {rtn}")
robot.MoveJ(joint_pos=startjointPos, tool=0,user= 0,vel= 100)
robot.MoveJ(joint_pos=endjointPos, tool=0,user= 0,vel= 100)
rtn = robot.AngularSpeedEnd()
print(f"AngularSpeedEnd rtn is {rtn}")
robot.CloseRPC()

4.55. Odd-position protection on.

New in version python: SDK-v2.0.5

Prototype

SingularAvoidStart(protectMode, minShoulderPos=100, minElbowPos=50, minWristPos=10)

Description

Turn on odd-bit posture protection.

Mandatory parameters

  • protectMode: singular position protection protection mode: 0 - articulated mode; 1 - Cartesian mode

Default Parameters

  • minShoulderPos: Shoulder singularity adjustment range (mm), default 100.0

  • minElbowPos: elbow singularity adjustment range (mm), default 50.0

  • minWristPos: range of wrist singularity adjustment (°), default 10.0

Return Value

  • errcode Success-0 Failure- errcode

4.56. Odd position protection off

New in version python: SDK-v2.0.5

Prototype

SingularAvoidEnd()

Description

Turn off odd-position protection

Mandatory parameters

NULL

Default parameters

NULL

Return Value

  • errcode Success-0 Failure- errcode

4.57. Example of robot singular pose protection code

from fairino import Robot
import time
# Establish a connection with the robot controller and return a robot object if the connection is successful
robot = Robot.RPC('192.168.58.2')
startjointPos = [-11.904-99.669117.473-108.616-91.72674.256]
endjointPos = [-45.615-106.172124.296-107.151-91.28274.255]
startdescPose = [-419.524-13.000351.569-178.1180.3143.833]
enddescPose = [-321.222185.189335.520-179.030-1.284-29.869]
exaxisPos = [0.00.00.00.0]
offdese = [0.00.00.00.00.00.0]
rtn = robot.SingularAvoidStart(21055)
print(f"SingularAvoidStart rtn is {rtn}")
robot.MoveJ(joint_pos=startjointPos, tool=0,user= 0,vel= 100)
robot.MoveJ(joint_pos=endjointPos, tool=0,user= 0,vel= 100)
rtn = robot.SingularAvoidEnd()
print(f"SingularAvoidEnd rtn is {rtn}")
robot.CloseRPC()

4.58. Clear the motor command queue

New in version python: SDK-v2.1.7

Prototype

MotionQueueClear()

Description

Clear the motor command queue

Mandatory parameters

NULL

Default parameters

NULL

Return Value

  • errcode Success-0 Failure- errcode

4.59. Clear Motion Command Queue

Prototype

MoveToIntersectLineStart(mainPoint, piecePoint, tool, wobj, vel, acc, ovl, oacc, moveType,mainExaxisPos=[[0.0,0.0,0.0,0.0],[0.0,0.0,0.0,0.0],[0.0,0.0,0.0,0.0],[0.0,0.0,0.0,0.0],[0.0,0.0,0.0,0.0],[0.0,0.0,0.0,0.0]],pieceExaxisPos=[[0.0,0.0,0.0,0.0],[0.0,0.0,0.0,0.0],[0.0,0.0,0.0,0.0],[0.0,0.0,0.0,0.0],[0.0,0.0,0.0,0.0],[0.0,0.0,0.0,0.0]],extAxisFlag=0,exaxisPos=[0.0,0.0,0.0,0.0],moveDirection=0,offset=[0.0,0.0,0.0,0.0,0.0,0.0])

Description

Clear motion command queue

Required Parameters

  • mainPoint:Cartesian poses of 6 taught points on the main pipe

  • piecePoint:Cartesian poses of 6 taught points on the branch pipe

  • tool:Tool coordinate system number

  • wobj:Workpiece coordinate system number

  • vel:Velocity percentage

  • acc:Acceleration percentage

  • ovl:Velocity scaling factor

  • oacc:Acceleration scaling factor

  • moveType:Motion type; 0-PTP; 1-LIN

  • mainExaxisPos:Extended axis positions for 6 taught points on the main pipe, default [[0.0,0.0,0.0,0.0],[0.0,0.0,0.0,0.0],[0.0,0.0,0.0,0.0],[0.0,0.0,0.0,0.0],[0.0,0.0,0.0,0.0],[0.0,0.0,0.0,0.0]]

  • pieceExaxisPos:Extended axis positions for 6 taught points on the branch pipe, default [[0.0,0.0,0.0,0.0],[0.0,0.0,0.0,0.0],[0.0,0.0,0.0,0.0],[0.0,0.0,0.0,0.0],[0.0,0.0,0.0,0.0],[0.0,0.0,0.0,0.0]]

  • extAxisFlag:Whether to enable extended axis; 0-Disable; 1-Enable

  • exaxisPos:Start point extended axis position [0.0,0.0,0.0,0.0]

  • moveDirection:Motion direction; 0-Clockwise; 1-Counterclockwise

  • offset:Offset value

Default Parameters

None

Return Value

  • Error code Success-0 Failure- errcode

4.60. Intersecting Line Motion

Prototype

MoveIntersectLine(mainPoint, piecePoint, tool, wobj, vel, acc, ovl, oacc, moveDirection,mainExaxisPos=[[0.0,0.0,0.0,0.0],[0.0,0.0,0.0,0.0],[0.0,0.0,0.0,0.0],[0.0,0.0,0.0,0.0],[0.0,0.0,0.0,0.0],[0.0,0.0,0.0,0.0]],pieceExaxisPos=[[0.0,0.0,0.0,0.0],[0.0,0.0,0.0,0.0],[0.0,0.0,0.0,0.0],[0.0,0.0,0.0,0.0],[0.0,0.0,0.0,0.0],[0.0,0.0,0.0,0.0]],extAxisFlag=0,exaxisPos=[[0.0,0.0,0.0,0.0],[0.0,0.0,0.0,0.0],[0.0,0.0,0.0,0.0],[0.0,0.0,0.0,0.0]],offset=[0.0,0.0,0.0,0.0,0.0,0.0])

Description

Intersecting line motion

Required Parameters

  • mainPoint:Cartesian poses of 6 taught points on the main pipe

  • piecePoint:Cartesian poses of 6 taught points on the branch pipe

  • tool:Tool coordinate system number

  • wobj:Workpiece coordinate system number

  • vel:Velocity percentage

  • acc:Acceleration percentage

  • ovl:Velocity scaling factor

  • oacc:Acceleration scaling factor

  • moveDirection:Motion direction; 0-Clockwise; 1-Counterclockwise

  • mainExaxisPos:Extended axis positions for 6 taught points on the main pipe, default [[0.0,0.0,0.0,0.0],[0.0,0.0,0.0,0.0],[0.0,0.0,0.0,0.0],[0.0,0.0,0.0,0.0],[0.0,0.0,0.0,0.0],[0.0,0.0,0.0,0.0]]

  • pieceExaxisPos:Extended axis positions for 6 taught points on the branch pipe, default [[0.0,0.0,0.0,0.0],[0.0,0.0,0.0,0.0],[0.0,0.0,0.0,0.0],[0.0,0.0,0.0,0.0],[0.0,0.0,0.0,0.0],[0.0,0.0,0.0,0.0]]

  • extAxisFlag:Whether to enable extended axis; 0-Disable; 1-Enable

  • exaxisPos:Start point extended axis position [0.0,0.0,0.0,0.0]

  • offset:Offset value

Default Parameters

None

Return Value

  • Error code Success-0 Failure- errcode

4.61. Robot Intersecting Line Motion Code Example

from fairino import Robot
import time
robot = Robot.RPC('192.168.58.2')
mainPoint = [[0.0* 6 for _ in range(6)]
piecePoint = [[0.0* 6 for _ in range(6)]
mainExaxisPos = [[0.0* 4 for _ in range(6)]
pieceExaxisPos = [[0.0* 4 for _ in range(6)]
extAxisFlag = 1
exaxisPos = [[0.0* 4 for _ in range(4)]
offset = [0.02.030.0-2.00.00.0]
mainPoint[0= [490.004-383.194402.735-9.332-1.52869.594]
mainPoint[1= [444.950-407.117389.011-5.546-2.19665.279]
mainPoint[2= [445.168-463.605355.759-1.544-10.88657.104]
mainPoint[3= [507.529-485.385343.013-0.786-4.83461.799]
mainPoint[4= [554.390-442.647367.701-4.761-10.18164.925]
mainPoint[5= [532.552-394.003396.467-13.732-13.59267.411]
mainExaxisPos[0= [-29.9960.0000.0000.000]
mainExaxisPos[1= [-29.9960.0000.0000.000]
mainExaxisPos[2= [-29.9960.0000.0000.000]
mainExaxisPos[3= [-29.9960.0000.0000.000]
mainExaxisPos[4= [-29.9960.0000.0000.000]
mainExaxisPos[5= [-29.9960.0000.0000.000]
piecePoint[0= [505.571-192.408316.75938.09837.051139.447]
piecePoint[1= [533.837-201.558332.34034.64442.339137.748]
piecePoint[2= [530.386-225.085373.80835.43145.111137.560]
piecePoint[3= [485.646-229.195383.77833.87045.173137.064]
piecePoint[4= [460.551-212.161354.25628.85645.602135.930]
piecePoint[5= [474.217-197.124324.61142.46941.133148.167]
pieceExaxisPos[0= [-29.996-0.0000.0000.000]
pieceExaxisPos[1= [-29.996-0.0000.0000.000]
pieceExaxisPos[2= [-29.996-0.0000.0000.000]
pieceExaxisPos[3= [-29.996-0.0000.0000.000]
pieceExaxisPos[4= [-29.996-0.0000.0000.000]
pieceExaxisPos[5= [-29.996-0.0000.0000.000]
exaxisPos[0= [-29.996-0.0000.0000.000]
exaxisPos[1= [-44.99490.0000.0000.000]
exaxisPos[2= [-59.9920.0020.0000.000]
exaxisPos[3= [-44.994-89.9970.0000.000]
tool = 2
wobj = 0
vel = 100.0
acc = 100.0
ovl = 12.0
oacc = 12.0
moveType = 1
moveDirection = 1
rtn = robot.MoveToIntersectLineStart(mainPoint=mainPoint, mainExaxisPos=mainExaxisPos, piecePoint=piecePoint, pieceExaxisPos=pieceExaxisPos, extAxisFlag=extAxisFlag,exaxisPos=exaxisPos[0], tool=tool, wobj=wobj, vel=vel, acc=acc, ovl=ovl, oacc=oacc, moveType=moveType, moveDirection=moveDirection, offset=offset)
print(f"MoveToIntersectLineStart rtn is {rtn}")
rtn = robot.MoveIntersectLine(mainPoint=mainPoint, mainExaxisPos=mainExaxisPos, piecePoint=piecePoint, pieceExaxisPos=pieceExaxisPos, extAxisFlag=extAxisFlag, exaxisPos=exaxisPos, tool=tool,wobj=wobj, vel=vel, acc=acc, ovl=5.0, oacc=5.0, moveDirection=moveDirection, offset=offset)
print(f"MoveIntersectLine rtn is {rtn}")
robot.CloseRPC()

4.62. Stationary Air Motion

Prototype

MoveStationary()

Description

Stationary Air Motion

Required Parameters

None

Default Parameters

None

Return Value

  • Error code. Success - 0, Failure - errcode

4.63. Stationary Air Motion Code Example

from fairino import Robot
import time
robot = Robot.RPC('192.168.58.2')
rtn = robot.LaserSensorRecordandReplay(010100.11010100)
print(f"LaserSensorRecordandReplay rtn is {rtn}")
rtn = robot.MoveStationary()
print(f"MoveStationary rtn is {rtn}")
rtn = robot.LaserSensorRecord1(010)
print(f"LaserSensorRecordandReplay rtn is {rtn}")
robot.CloseRPC()
return 0

robotic arm
FAIRINO ROBOTIC ARMS

Contact

Location: 10637 Scripps Summit Court,

San Diego, CA. 92131
Phone: (619) 333-FAIR
Email: hello@fairino.us

© 2023 Fairino US official site Proudly created By G2T

bottom of page