top of page

Java 6.54. Joint Torque Sensor Sensitivity Calibration Function Enabled

/**
* @brief Joint torque sensor sensitivity calibration function enabled
* @param status 0-Disabled; 1-Enabled
* @return Error code
*/
public int JointSensitivityEnable(int status)

6.55. Joint Torque Sensor Sensitivity Data Acquisition

/**
* @brief Joint Torque Sensor Sensitivity Data Collection
* @return Error code
*/
public int JointSensitivityCollect()

6.56. Get Joint Torque Sensor Sensitivity Calibration Results

/**
* @brief Get joint torque sensor sensitivity calibration results
* @param calibResult j1~j6 joint sensitivity [0-1]
* @param linearity j1~j6 joint linearity [0-1]
* @return Error code
*/
public int JointSensitivityCalibration(double[] calibResult, double[] linearity)

6.57. Get Joint Torque Sensor Hysteresis Error

/**
* @brief Get joint torque sensor hysteresis error
* @param hysteresisError j1~j6 joint hysteresis error
* @return Error code
*/
public int JointHysteresisError(double[] hysteresisError);

6.58. Get Joint Torque Sensor Repeatability

/**
* @brief Get joint torque sensor repeatability
* @param repeatability j1~j6 joint torque sensor repeatability
* @return Error code
*/
public int JointRepeatability(double[] repeatability);

6.59. Set Joint Force Sensor Parameters

/**
* @brief Set joint force sensor parameters
* @param required M J1-J6 mass coefficient []
* @param required B J1-J6 damping coefficient []
* @param required K J1-J6 stiffness coefficient []
* @param default threshold Force control threshold, Nm
* @param default sensitivity Sensitivity, Nm/V, []
* @param default setZeroFlag Function enable flag; 0-Off; 1-On; 2-Record zero point at position 1; 3-Record zero point at position 2
* @return Error code
*/
public int SetAdmittanceParams(double[] M, double[] B, double[] K, double[] threshold, double[] sensitivity, int setZeroFlag);

6.60. Joint Torque Sensor Sensitivity Auto-Calibration Code Example

public static void TestSensitivityCalib(Robot robot)
{
    int rtn = robot.JointSensitivityEnable(0);
    rtn = robot.JointSensitivityEnable(1);
    System.out.printf("JointSensitivityEnable rtn is %d\n", rtn);
    JointPos curJPos = new JointPos();
    robot.GetActualJointPosDegree(curJPos);
    ExaxisPos epos = new ExaxisPos(0,0,0,0);
    DescPose offset_pos =new DescPose(0,0,0,0,0,0 );
    JointPos jointPos1 = new JointPos(curJPos.J1, 0, 0, -90, 0.02, curJPos.J6);
    DescPose descPos1 = new DescPose();
    robot.GetForwardKin(jointPos1, descPos1);
    robot.MoveJ(jointPos1, descPos1, 0, 0, 100, 100, 100, epos, -1, 0, offset_pos);
    robot.Sleep(200);
    rtn = robot.JointSensitivityCollect();
    System.out.printf("JointSensitivityCollect 1 rtn is %d\n", rtn);
    robot.Sleep(100);
    JointPos jointPos2 =new JointPos( curJPos.J1, -30, 0, -90, 0.02, curJPos.J6 );
    DescPose descPos2 =new DescPose();
    robot.GetForwardKin(jointPos2, descPos2);
    robot.MoveJ(jointPos2, descPos2, 0, 0, 100, 100, 100, epos, -1, 0, offset_pos);
    robot.Sleep(100);
    rtn = robot.JointSensitivityCollect();
    System.out.printf("JointSensitivityCollect 2 rtn is %d\n", rtn);
    robot.Sleep(100);
    JointPos jointPos3 = new JointPos( curJPos.J1, -60, 0, -90, 0.02, curJPos.J6 );
    DescPose descPos3 =new DescPose();
    robot.GetForwardKin(jointPos3, descPos3);
    robot.MoveJ(jointPos3, descPos3, 0, 0, 100, 100, 100, epos, -1, 0, offset_pos);
    robot.Sleep(100);
    rtn = robot.JointSensitivityCollect();
    System.out.printf("JointSensitivityCollect 3 rtn is %d\n", rtn);
    robot.Sleep(100);
    JointPos jointPos4 = new JointPos(curJPos.J1, -90, 0, -90, 0.02, curJPos.J6);
    DescPose descPos4 = new DescPose();
    robot.GetForwardKin(jointPos4, descPos4);
    robot.MoveJ(jointPos4, descPos4, 0, 0, 100, 100, 100, epos, -1, 0, offset_pos);
    robot.Sleep(100);
    rtn = robot.JointSensitivityCollect();
    System.out.printf("JointSensitivityCollect 4 rtn is %d\n", rtn);
    robot.Sleep(100);
    JointPos jointPos5 = new JointPos(curJPos.J1, -120, 0, -90, 0.02, curJPos.J6);
    DescPose descPos5 = new DescPose();
    robot.GetForwardKin(jointPos5, descPos5);
    robot.MoveJ(jointPos5, descPos5, 0, 0, 100, 100, 100, epos, -1, 0, offset_pos);
    robot.Sleep(100);
    rtn = robot.JointSensitivityCollect();
    System.out.printf("JointSensitivityCollect 5 rtn is %d\n", rtn);
    robot.Sleep(100);
    JointPos jointPos6 = new JointPos(curJPos.J1, -150, 0, -90, 0.02, curJPos.J6);
    DescPose descPos6 = new DescPose();
    robot.GetForwardKin(jointPos6, descPos6);
    robot.MoveJ(jointPos6, descPos6, 0, 0, 100, 100, 100, epos, -1, 0, offset_pos);
    robot.Sleep(100);
    rtn = robot.JointSensitivityCollect();
    System.out.printf("JointSensitivityCollect 6 rtn is %d\n", rtn);
    robot.Sleep(100);
    JointPos jointPos7 = new JointPos(curJPos.J1, -180, 0, -90, 0.02, curJPos.J6);
    DescPose descPos7 = new DescPose();
    robot.GetForwardKin(jointPos7, descPos7);
    robot.MoveJ(jointPos7, descPos7, 0, 0, 100, 100, 100, epos, -1, 0, offset_pos);
    robot.Sleep(100);
    rtn = robot.JointSensitivityCollect();
    System.out.printf("JointSensitivityCollect 7 rtn is %d\n", rtn);
    robot.Sleep(100);
    // Reverse stroke
    robot.MoveJ(jointPos6, descPos6, 0, 0, 100, 100, 100, epos, -1, 0, offset_pos);
    robot.Sleep(100);
    rtn = robot.JointSensitivityCollect();
    System.out.printf("JointSensitivityCollect 8 rtn is %d\n", rtn);
    robot.Sleep(100);
    robot.MoveJ(jointPos5, descPos5, 0, 0, 100, 100, 100, epos, -1, 0, offset_pos);
    robot.Sleep(100);
    rtn = robot.JointSensitivityCollect();
    System.out.printf("JointSensitivityCollect 9 rtn is %d\n", rtn);
    robot.Sleep(100);
    robot.MoveJ(jointPos4, descPos4, 0, 0, 100, 100, 100, epos, -1, 0, offset_pos);
    robot.Sleep(100);
    rtn = robot.JointSensitivityCollect();
    System.out.printf("JointSensitivityCollect 10 rtn is %d\n", rtn);
    robot.Sleep(100);
    robot.MoveJ(jointPos3, descPos3, 0, 0, 100, 100, 100, epos, -1, 0, offset_pos);
    robot.Sleep(100);
    rtn = robot.JointSensitivityCollect();
    System.out.printf("JointSensitivityCollect 11 rtn is %d\n", rtn);
    robot.Sleep(100);
    robot.MoveJ(jointPos2, descPos2, 0, 0, 100, 100, 100, epos, -1, 0, offset_pos);
    robot.Sleep(100);
    rtn = robot.JointSensitivityCollect();
    System.out.printf("JointSensitivityCollect 12 rtn is %d\n", rtn);
    robot.Sleep(100);
    robot.MoveJ(jointPos1, descPos1, 0, 0, 100, 100, 100, epos, -1, 0, offset_pos);
    robot.Sleep(200);
    rtn = robot.JointSensitivityCollect();
    System.out.printf("JointSensitivityCollect 13 rtn is %d\n", rtn);
    robot.Sleep(100);
    double[] calibResult =new double[6];
    double[] linearity = new double[6];
    rtn = robot.JointSensitivityCalibration(calibResult, linearity);
    System.out.printf("JointSensitivityCalibration rtn is %d\n", rtn);
    rtn = robot.JointSensitivityEnable(0);
    System.out.printf("JointSensitivityEnable rtn is %d\n", rtn);
    System.out.printf("jointSensor Calib result is %f %f %f %f %f %f\njointSensor linearity is %f %f %f %f %f %f\n",
            calibResult[0], calibResult[1], calibResult[2],
            calibResult[3], calibResult[4], calibResult[5],
            linearity[0], linearity[1], linearity[2],
            linearity[3], linearity[4], linearity[5]);
    double[] hysteresisError = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0};
    rtn = robot.JointHysteresisError(hysteresisError);
    System.out.printf("JointHysteresisError result is %f %f %f %f %f %f\n",
            hysteresisError[0], hysteresisError[1], hysteresisError[2],
            hysteresisError[3], hysteresisError[4], hysteresisError[5]);
    double[] repeatability = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0};
    rtn = robot.JointRepeatability(repeatability);
    System.out.printf("JointRepeatability result is %f %f %f %f %f %f\n",
            repeatability[0], repeatability[1], repeatability[2],
            repeatability[3], repeatability[4], repeatability[5]);
    double[] M = {1.0, 1.0, 1.0, 1.0, 1.0, 1.0};
    double[] B = {1.0, 1.0, 1.0, 1.0, 1.0, 1.0};
    double[] K = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0};
    double[] threshold = {1.0, 1.0, 1.0, 1.0, 1.0, 1.0};
    int setZeroFlag = 1;
    rtn = robot.SetAdmittanceParams(M, B, K, threshold, calibResult, setZeroFlag);
    System.out.printf("SetAdmittanceParams rtn is %d\n", rtn);
}

6.61. Retrieve the number of error frames for the robot’s 8 slave ports

/**
* @brief Retrieve error frame counts for the robot's 8 slave ports
* @param  inRecvErr Input received error frame count
* @param  inCRCErr Input CRC error frame count
* @param  inTransmitErr Input transmitted error frame count
* @param  inLinkErr Input link error frame count
* @param  outRecvErr Output received error frame count
* @param  outCRCErr Output CRC error frame count
* @param  outTransmitErr Output transmitted error frame count
* @param  outLinkErr Output link error frame count
* @return Error code
*/
public int GetSlavePortErrCounter(int[] inRecvErr, int[] inCRCErr, int[] inTransmitErr, int[] inLinkErr, int[] outRecvErr, int[] outCRCErr, int[] outTransmitErr, int[] outLinkErr)

6.62. Reset slave port error frames

/** @brief Clears error frames for slave port @param slaveID Slave ID (0~7) @return Error code / public int SlavePortErrCounterClear(int slaveID)

6.63. Example for retrieving slave port error frame codes

public static void TestSlavePortErr(Robot robot) {     ROBOT_STATE_PKG pkg =new ROBOT_STATE_PKG();     int[] inRecvErr =new int[8];     int[] inCRCErr =new int[8];     int[] inTransmitErr =new int[8];     int[] inLinkErr =new int[8];     int[] outRecvErr =new int[8];     int[] outCRCErr =new int[8];     int[] outTransmitErr =new int[8];     int[] outLinkErr =new int[8];     robot.GetSlavePortErrCounter(inRecvErr,  inCRCErr, inTransmitErr, inLinkErr,outRecvErr, outCRCErr, outTransmitErr, outLinkErr);     for (int i = 0; i < 8; i++)     {         if (inRecvErr[i] != 0)         {             System.out.printf("inRecvErr %d is %d\n", i, inRecvErr[i]);         }         if (inCRCErr[i] != 0)         {             System.out.printf("inRecvErr %d is %d\n", i, inCRCErr[i]);         }         if (inTransmitErr[i] != 0)         {             System.out.printf("inRecvErr %d is %d\n", i, inTransmitErr[i]);         }         if (inLinkErr[i] != 0)         {             System.out.printf("inRecvErr %d is %d\n", i, inLinkErr[i]);         }         if (outRecvErr[i] != 0)         {             System.out.printf("outRecvErr %d is %d\n", i, outRecvErr[i]);         }         if (outCRCErr[i] != 0)         {             System.out.printf("outCRCErr %d is %d\n", i, outCRCErr[i]);         }         if (outTransmitErr[i] != 0)         {             System.out.printf("outTransmitErr %d is %d\n", i, outTransmitErr[i]);         }         if (outLinkErr[i] != 0)         {             System.out.printf("outLinkErr %d is %d\n", i, outLinkErr[i]);         }     }     System.out.printf("others has no err!\n");     for (int i = 0; i < 8; i++)     {         robot.SlavePortErrCounterClear(i);     }     robot.CloseRPC(); }

6.64. Set speed feedforward coefficients for each axis

/**
* @brief Sets the feedforward ratio for each axis
* @param  radio The feedforward ratio for each axis
* @return Error code
*/
public int SetVelFeedForwardRatio(double[] radio)

6.65. Retrieve speed feedforward ratios for each axis

/** @brief Retrieve speed feedforward ratios for each axis @param radio Speed feedforward coefficients for each axis @return Error code / public int GetVelFeedForwardRatio(double[] radio)

6.66. Robot Speed Feedforward Coefficient Code Example

public static void TestVelFeedForwardRatio(Robot robot) {     double[] setRadio =new double[] { 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 };     robot.SetVelFeedForwardRatio(setRadio);     double[] getRadio = new double[]{ 0.0 };     robot.GetVelFeedForwardRatio(getRadio);     System.out.printf(" %f %f %f %f %f %f\n", getRadio[0], getRadio[1], getRadio[2], getRadio[3], getRadio[4], getRadio[5]);     robot.CloseRPC(); }

6.67. Photoelectric Sensor TCP Calibration - Compute Tool RPY

/**
* @brief Photoelectric sensor TCP calibration - compute tool RPY
* @param  Btool Robot Cartesian position
* @param  Etool Current tool coordinate coefficient value
* @param  sensor Current sensor coordinate coefficient value (not yet available)
* @param  radius Circular motion radius mm (not yet available)
* @param  dz Movement distance along the negative direction of the base coordinate system Z-axis; when dz = 10000, the function directly returns tool RPY
* @param  TCPRPY Tool RPY value
* @return Error code
*/
public int TCPComputeRPY(DescPose Btool, DescPose Etool, DescPose sensor, double radius, double dz, Rpy TCPRPY)

6.68. Photoelectric Sensor TCP Calibration - Compute Tool XYZ

/**
* @brief Photoelectric sensor TCP calibration - compute tool XYZ
* @param  select 0-Compute tool TCP; 1-Compute sensor origin; 2-Compute sensor orientation; 3-Directly return tool TCP; 4-Record current workpiece coordinate system and tool coordinate system
* @param  originDirection 0-X direction; 1-Y direction; 2-Z direction
* @param  pos1 Robot Cartesian position 1
* @param  pos2 Robot Cartesian position 2
* @param  pos3 Robot Cartesian position 3
* @param  pos4 Robot Cartesian position 4
* @param  TCP Tool XYZ value
* @return Error code
*/
public int TCPComputeXYZ(int select, double originDirection, DescTran pos1, DescTran pos2, DescTran pos3, DescTran pos4, DescTran TCP)

6.69. Photoelectric Sensor TCP Calibration - Start Recording Flange Center Position

/**
* @brief Photoelectric sensor TCP calibration - start recording flange center position
* @return Error code
*/
public int TCPRecordFlangePosStart()

6.70. Photoelectric Sensor TCP Calibration - Stop Recording Flange Center Position

/**
* @brief Photoelectric sensor TCP calibration - stop recording flange center position
* @return Error code
*/
public int TCPRecordFlangePosEnd()

6.71. Photoelectric Sensor TCP Calibration - Get Tool Center Point Position

/**
* @brief Photoelectric sensor TCP calibration - get tool center point position
* @param  TCP Tool center point position (x,y,z)
* @return Error code
*/
public int TCPGetRecordFlangePos(DescTran TCP)

6.72. Photoelectric Sensor TCP Calibration

/**
* @brief Photoelectric sensor TCP calibration
* @param luaPath Automatic calibration Lua program path: QX version robot - "/fruser/FR_CalibrateTheToolTcp.lua"; LA version robot - "/usr/local/etc/controller/lua/FR_CalibrateTheToolTcp.lua"
* @param offset Teach point offset (x,y,z) mm
* @param TCP Calibrated tool coordinate system (x,y,z,rx,ry,rz)
* @return Error code
*/
public int PhotoelectricSensorTCPCalibration(String luaPath, DescTran offset, DescPose TCP)

6.73. Photoelectric Sensor TCP Calibration Code Example

public static void TestPhotoelectricSensorTCPCalib(Robot robot)
{
    DescTran offset = new DescTran(10.0, 10.0, 3.0 );
    DescPose TCP = new DescPose();
    int rtn = robot.PhotoelectricSensorTCPCalibration("/fruser/FR_CalibrateTheToolTcp.lua", offset, TCP);
    System.out.printf("PhotoelectricSensorTCPCalibration rtn is %d %f %f %f %f %f %f \n", rtn, TCP.tran.x, TCP.tran.y, TCP.tran.z, TCP.rpy.rx, TCP.rpy.ry, TCP.rpy.rz);
    robot.CloseRPC();
    robot.Sleep(9999999);
}

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