top of page

Python 4.22. Cartesian Space Servo Mode Motion

Prototype

ServoCart(mode, desc_pos, exaxis, pos_gain=[1.0, 1.0, 1.0, 1.0, 1.0, 1.0], acc=0.0, vel=0.0, cmdT=0.008,filterT=0.0, gain=0.0)

Description

Cartesian space servo mode motion

Required Parameters

  • mode:[0]-Absolute motion (base coordinate system), [1]-Incremental motion (base coordinate system), [2]-Incremental motion (tool coordinate system);

  • exaxis:Extended axis position;

  • desc_pos:Target Cartesian position/Target Cartesian position increment;

Default Parameters

  • pos_gain:Pose increment proportionality coefficient, only effective in incremental motion, range [0~1], default [1.0, 1.0, 1.0, 1.0, 1.0, 1.0];

  • acc:Acceleration, range [0~100], temporarily not available, default 0.0;

  • vel:Velocity, range [0~100], temporarily not available, default 0.0;

  • cmdT:Command transmission period, unit s, recommended range [0.001~0.0016], default 0.008;

  • filterT:Filter time, unit [s], temporarily not available, default 0.0;

  • gain:Proportional amplifier for target position, temporarily not available, default 0.0;

Return Value

Error code Success-0 Failure- errcode

4.23. Cartesian Space Servo Mode Motion Code Example

from fairino import Robot
import time
robot = Robot.RPC('192.168.58.2')
desc_pos_dt = [83.0080050.52500029.246179.629-7.138-166.975]
exaxis = [100.00.00.00.0]
pos_gain = [0.0* 6
mode = 0
vel = 0.0
acc = 0.0
cmdT = 0.001
filterT = 0.0
gain = 0.0
flag = 0
count = 5000
robot.SetSpeed(20)
while count:
    rtn = robot.ServoCart(mode, desc_pos_dt, exaxis, pos_gain, acc, vel, cmdT, filterT, gain)
    print(f"ServoCart rtn is {rtn}")
    count -= 1
    desc_pos_dt[0+= 0.01
    exaxis[0+= 0.01
robot.CloseRPC()
return 0

4.24. Start of spline motion

Prototype

SplineStart()

Description

Sample movement begins

Mandatory parameters

NULL

Default parameters

NULL

Return Value

Error Code Success-0 Failure- errcode

4.25. Sample motion PTP

Prototype

SplinePTP(joint_pos, tool, user, desc_pos = [0.0,0.0,0.0,0.0,0.0,0.0,0.0], vel = 20.0, acc = 100.0, ovl = 100.0)

Description

Sample Motion PTP

Mandatory parameters

  • joint_pos: target joint position in [°];

  • tool: tool number, [0 to 14];

  • user: artifact number, [0 to 14];

Default parameters

  • desc_pos: target Cartesian position in [mm][°] Default initial value [0.0,0.0,0.0,0.0,0.0,0.0,0.0], default value calls positive kinematics to solve for the return value.

  • vel: velocity, range [0-100], default 20.0.

  • acc: acceleration, range [0 to 100], default 100.0.

  • ovl: velocity scaling factor, [0 to 100], default 100.0

Return Value

Error Code Success-0 Failure- errcode

4.26. End of spline motion

Prototype

SplineEnd()

Description

End of spline motion

Mandatory parameters

NULL

Default parameters

NULL

Return Value

Error Code Success-0 Failure- errcode

4.27. Spline 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')
joint_points = [
    [-11.904-99.669117.473-108.616-91.72674.256],  # j1
    [-45.615-106.172124.296-107.151-91.28274.255],  # j2
    [-61.954-84.409108.153-116.316-91.28374.260],  # j3
    [-89.575-80.276102.713-116.302-91.28474.267]  # j4
]
cart_points = [
    [-419.524-13.000351.569-178.1180.3143.833],  # desc_pos1
    [-321.222185.189335.520-179.030-1.284-29.869],  # desc_pos2
    [-327.622402.230320.402-178.0672.127-46.207],  # desc_pos3
    [-104.066544.321327.023-177.7153.371-73.818]  # desc_pos4
]
offset_pos = [0* 6
epos = [0* 4
tool = user = 0
vel = acc = ovl = 100.0
blendT = -1.0
flag = 0
robot.SetSpeed(20)
err1 = robot.MoveJ(joint_pos=joint_points[0],tool=tool, user=user,vel=vel)
print(f"MoveJ 错误码: {err1}")
robot.SplineStart()
robot.SplinePTP(joint_pos=joint_points[0],tool=tool, user=user)
robot.SplinePTP(joint_pos=joint_points[1],tool=tool, user=user)
robot.SplinePTP(joint_pos=joint_points[2],tool=tool, user=user)
robot.SplinePTP(joint_pos=joint_points[3],tool=tool, user=user)
robot.SplineEnd()
robot.CloseRPC()

4.28. New spline movement begins

Changed in version python: SDK-v2.0.3

prototype

NewSplineStart(type,averageTime=2000)

Description

New Sample Movement Begins

Mandatory parameters

  • type: 0 - arc transition, 1 - given point path point

Default Parameters

  • averageTime: global average articulation time (ms) defaults to 2000

Return Value

Error Code Success-0 Failure- errcode

4.29. New spline command point

Prototype

NewSplinePoint(desc_pos,tool,user,lastFlag,joint_pos=[0.0,0.0,0.0,0.0,0.0,0.0], vel = 0.0, acc = 0.0, ovl = 100.0 ,blendR = 0.0 )

description

new spline command point

Mandatory parameters

  • desc_pos: target Cartesian position in [mm][°].

  • tool: tool number, [0 to 14];

  • user: artifact number, [0 to 14];

  • lastFlag: whether it is the last point, 0 - no, 1 - yes;

Default parameters

  • joint_pos: target joint position in [°] Default initial value is [0.0,0.0,0.0,0.0,0.0,0.0,0.0], default value calls inverse kinematics to solve for the return value.

  • vel: velocity, range [0~100], not open yet, default is 0.0;;

  • acc: acceleration, range [0 to 100], not open, default 0.0.

  • ovl: velocity scaling factor, [0~100] default 100.0.

  • blendR: [0~1000]-smoothing radius in [mm] default 0.0;

Return Value

Error Code Success-0 Failure- errcode

4.30. End of new spline movement

Prototype

NewSplineEnd()

Description

End of New Sample Campaign

Mandatory parameters

NULL

Default parameters

NULL

Return Value

Error Code Success-0 Failure- errcode

4.31. Example of new spline motion code

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]
j3 = [-61.954-84.409108.153-116.316-91.28374.260]
j4 = [-89.575-80.276102.713-116.302-91.28474.267]
j5 = [-95.228-54.62173.691-112.245-91.28074.268]
desc_pos1 = [-419.524-13.000351.569-178.1180.3143.833]
desc_pos2 = [-321.222185.189335.520-179.030-1.284-29.869]
desc_pos3 = [-327.622402.230320.402-178.0672.127-46.207]
desc_pos4 = [-104.066544.321327.023-177.7153.371-73.818]
desc_pos5 = [-33.421732.572275.103-177.9072.709-79.482]
offset_pos = [000000]
epos = [0000]
tool = 0
user = 0
vel = 100.0
acc = 100.0
ovl = 100.0
blendT = -1.0
flag = 0
robot.SetSpeed(20)
err1 = robot.MoveJ(joint_pos=j1, tool=tool, user=user, vel=vel)
print(f"movej errcode:{err1}")
robot.NewSplineStart(12000)
robot.NewSplinePoint(desc_pos=desc_pos1, tool=tool, user=user, vel=vel, lastFlag=-1, blendR=0)
robot.NewSplinePoint(desc_pos=desc_pos2, tool=tool, user=user, vel=vel, lastFlag=-1, blendR=0)
robot.NewSplinePoint(desc_pos=desc_pos3, tool=tool, user=user, vel=vel, lastFlag=-1, blendR=0)
robot.NewSplinePoint(desc_pos=desc_pos4, tool=tool, user=user, vel=vel, lastFlag=-1, blendR=0)
robot.NewSplinePoint(desc_pos=desc_pos5, tool=tool, user=user, vel=vel, lastFlag=-1, blendR=0)
robot.NewSplineEnd()
robot.CloseRPC()

4.32. Robot termination motion

Prototype

StopMotion()

Description

Terminate motion, use of terminate motion requires motion instruction to be non-blocking

Mandatory parameters

NULL

Default parameters

NULL

Return Value

Error Code Success-0 Failure- errcode

4.33. Robot pause

Prototype

PauseMotion()

Description

Pause motion. Using pause motion requires the motion instruction to be in a non-blocking state

Mandatory parameters

NULL

Default parameters

NULL

Return Value

Error Code Success-0 Failure- errcode

4.34. Robot resume motion

Prototype

ResumeMotion()

Description

Resume motion, using resume motion requires the motion instruction to be in a non-blocking state

Mandatory parameters

NULL

Default parameters

NULL

Return Value

Error Code Success-0 Failure- errcode

4.35. Motion pause, resume, and stop code examples

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]
j5 =[-95.228-54.62173.691-112.245-91.28074.268]
desc_pos1 = [-419.524-13.000351.569-178.1180.3143.833]
desc_pos5 = [-33.421732.572275.103-177.9072.709-79.482]
offset_pos = [000000]
epos = [0000]
tool = 0
user = 0
vel = 100.0
acc = 100.0
ovl = 100.0
blendT = -1.0
flag = 0
robot.SetSpeed(20)
rtn = robot.MoveJ(joint_pos=j1, tool=tool, user=user, vel=vel)
rtn = robot.MoveJ(joint_pos=j5, tool=tool, user=user, vel=vel, blendT=1)
time.sleep(1)
robot.PauseMotion()
time.sleep(1)
robot.ResumeMotion()
time.sleep(1)
robot.StopMotion()
time.sleep(1)
robot.CloseRPC()

4.36. Overall shift in points begins

Prototype

PointsOffsetEnable(flag,offset_pos)

Description

Point Overall Offset Begins

Mandatory parameters

  • flag: 0 - offset in base or work coordinate system, 2 - offset in tool coordinate system;

  • offset_pos: offset in [mm][°].

Default parameters

NULL

Return Value

Error Code Success-0 Failure- errcode

4.37. Overall offset of points ends

Prototype

PointsOffsetDisable()

Description

End of overall point offset

Mandatory parameters

NULL

Default parameters

NULL

Return Value

Error Code Success-0 Failure- errcode

4.38. Point offset 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 = 100.0
acc = 100.0
ovl = 100.0
blendT = -1.0
flag = 0
robot.SetSpeed(20)
robot.MoveJ(joint_pos=j1,tool=tool, user=user, vel=vel)
robot.MoveJ(joint_pos=j2, tool=tool, user=user, vel=vel)
time.sleep(1)
robot.PointsOffsetEnable(flag=0, offset_pos=offset_pos1)
robot.MoveJ(joint_pos=j1,tool=tool, user=user, vel=vel)
robot.MoveJ(joint_pos=j2, tool=tool, user=user, vel=vel)
robot.PointsOffsetDisable()
robot.CloseRPC()

4.39. Control box motion AO start

New in version python: SDK-v2.0.4

Prototype

MoveAOStart(AONum,maxTCPSpeed=1000,maxAOPercent=100,zeroZoneCmp=20)

Description

Control Box Motion AO Start

Mandatory parameters

  • AONum: control box AO number

Default Parameters

  • maxTCPSpeed: Maximum TCP speed value [1-5000mm/s], default 1000;

  • maxAOPercent: percentage of AO corresponding to the maximum TCP speed value, default 100%;

  • zeroZoneCmp: deadzone compensation value AO percentage, shaped, default 20%, range [0-100].

Return Value

Error Code Success-0 Failure- errcode

4.40. End of control box movement AO

New in version python: SDK-v2.0.4

Prototype

MoveAOStop()

Description

End of control box motion AO

Mandatory parameters

NULL

Default parameters

NULL

Return Value

Error Code Success-0 Failure- errcode

4.41. End Motion AO Start

New in version python: SDK-v2.0.4

Prototype

MoveToolAOStart(AONum,maxTCPSpeed=1000,maxAOPercent=100,zeroZoneCmp =20)

Description

End Motion AO Start

Mandatory parameters

  • AONum: end AO number

Default Parameters

  • maxTCPSpeed: Maximum TCP speed value [1-5000mm/s], default 1000;

  • maxAOPercent: percentage of AO corresponding to the maximum TCP speed value, default 100%;

  • zeroZoneCmp: deadzone compensation value AO percentage, shaped, default 20%, range [0-100].

Return Value

Error Code Success-0 Failure- errcode

4.42. End movement AO end

New in version python: SDK-v2.0.4

Prototype

MoveToolAOStop()

Description

end movement AO end

Mandatory parameters

NULL

Default parameters

NULL

Return Value

Error Code Success-0 Failure- errcode


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