top of page

Java 13.38. Extended Axis Coordinate System Calibration Code Example

public static int TestUDPAxisCalib(Robot robot)
{
    UDPComParam para1=new UDPComParam("192.168.58.88", 2021, 2, 100, 3, 200, 1, 100, 5, 1);

    int rtn = robot.ExtDevSetUDPComParam(para1);
    String ip = ""; int port = 0; int period = 0; int lossPkgTime = 0; int lossPkgNum = 0; int disconnectTime = 0; int reconnectEnable = 0; int reconnectPeriod = 0; int reconnectNum = 0;
    UDPComParam para2=new UDPComParam(ip, port, period, lossPkgTime, lossPkgNum, disconnectTime, reconnectEnable, reconnectPeriod, reconnectNum,0);

    rtn = robot.ExtDevGetUDPComParam(para2);

    robot.ExtDevLoadUDPDriver();

    rtn = robot.ExtAxisServoOn(1, 1);
    rtn = robot.ExtAxisServoOn(2, 1);

    robot.Sleep(4000);

    rtn = robot.SetRobotPosToAxis(1);
    rtn = robot.SetAxisDHParaConfig(1, 128.5, 206.4,  0, 0, 0, 0, 0, 0);
    rtn = robot.ExtAxisParamConfig(1, 1, 1, 1000, -1000, 1000, 1000, 1.905, 262144, 200, 1, 0, 0);
    rtn = robot.ExtAxisParamConfig(2, 1, 1, 1000, -1000, 1000, 1000, 4.444, 262144, 200, 1, 0, 0);

    DescPose toolCoord=new DescPose(0, 0, 210, 0, 0, 0);
    robot.SetToolCoord(1, toolCoord, 0, 0, 1, 0);

    JointPos jSafe=new JointPos(115.193, -96.149, 92.489, -87.068, -89.15, -83.488);
    JointPos j1=new JointPos(117.559, -92.624, 100.329, -96.909, -94.057, -83.488);
    JointPos j2=new JointPos(112.239, -90.096, 99.282, -95.909, -89.824, -83.488);
    JointPos j3=new JointPos(110.839, -83.473, 93.166, -89.22, -90.499, -83.487);
    JointPos j4=new JointPos(107.935, -83.572, 95.424, -92.873, -87.933, -83.488);

    DescPose descSafe =new DescPose(0,0,0,0,0,0);
    DescPose desc1 = new DescPose(0,0,0,0,0,0);
    DescPose desc2 = new DescPose(0,0,0,0,0,0);
    DescPose desc3 = new DescPose(0,0,0,0,0,0);
    DescPose desc4 = new DescPose(0,0,0,0,0,0);
    ExaxisPos exaxisPos =new ExaxisPos(0,0,0,0);
    DescPose offdese =new DescPose(0, 0, 0, 0, 0, 0);

    robot.GetForwardKin(jSafe, descSafe);
    robot.MoveJ(jSafe, descSafe, 1, 0, 100, 100, 100, exaxisPos, -1, 0, offdese);
    robot.Sleep(2000);

    robot.GetForwardKin(j1, desc1);
    robot.MoveJ(j1, desc1, 1, 0, 100, 100, 100, exaxisPos, -1, 0, offdese);
    robot.Sleep(2000);

    DescPose actualTCPPos =new DescPose(0,0,0,0,0,0);

    robot.GetActualTCPPose(actualTCPPos);
    robot.SetRefPointInExAxisEnd(actualTCPPos);
    rtn = robot.PositionorSetRefPoint(1);
    robot.Sleep(2000);

    robot.MoveJ(jSafe, descSafe, 1, 0, 100, 100, 100, exaxisPos, -1, 0, offdese);
    robot.ExtAxisStartJog(1, 0, 50, 50, 10);
    robot.Sleep(1000);
    robot.ExtAxisStartJog(2, 0, 50, 50, 10);
    robot.Sleep(1000);
    robot.GetForwardKin(j2, desc2);
    rtn = robot.MoveJ(j2, desc2, 1, 0, 100, 100, 100, exaxisPos, -1, 0, offdese);
    rtn = robot.PositionorSetRefPoint(2);
    robot.Sleep(2000);

    robot.MoveJ(jSafe, descSafe, 1, 0, 100, 100, 100, exaxisPos, -1, 0, offdese);
    robot.ExtAxisStartJog(1, 0, 50, 50, 10);
    robot.Sleep(1000);
    robot.ExtAxisStartJog(2, 0, 50, 50, 10);
    robot.Sleep(1000);
    robot.GetForwardKin(j3, desc3);
    robot.MoveJ(j3, desc3, 1, 0, 100, 100, 100, exaxisPos, -1, 0, offdese);
    rtn = robot.PositionorSetRefPoint(3);
    robot.Sleep(2000);

    robot.MoveJ(jSafe, descSafe, 1, 0, 100, 100, 100, exaxisPos, -1, 0, offdese);
    robot.ExtAxisStartJog(1, 0, 50, 50, 10);
    robot.Sleep(1000);
    robot.ExtAxisStartJog(2, 0, 50, 50, 10);
    robot.Sleep(1000);
    robot.GetForwardKin(j4, desc4);
    robot.MoveJ(j4, desc4, 1, 0, 100, 100, 100, exaxisPos, -1, 0, offdese);
    rtn = robot.PositionorSetRefPoint(4);
    robot.Sleep(2000);

    DescPose axisCoord = new DescPose();
    robot.PositionorComputeECoordSys(axisCoord);
    robot.MoveJ(jSafe, descSafe, 1, 0, 100, 100, 100, exaxisPos, -1, 0, offdese);
    rtn = robot.ExtAxisActiveECoordSys(3, 1, axisCoord, 1);

    robot.CloseRPC();
    return 0;
}

13.39. UDP Extended Axis Motion

Changed in version Java: SDK-v1.0.7-3.8.4

/**
*@ brief UDP Extended Axis Motion
*@ param [in] pos target location
*@ param [in] ovl speed percentage
*@ param [in] blend smoothing parameter (mm or ms)
*@ return error code
*/
int ExtAxisMove(ExaxisPos pos, double ovl, double blend);

13.40. UDP Extended Axis Motion Code Example

public static int TestUDPAxisCalib(Robot robot)
{
    ExaxisPos exaxisPos = new ExaxisPos( 20, 0, 0, 0 );
    robot.ExtAxisMove(exaxisPos,40);
    robot.CloseRPC();
    return 0;
}

13.41. UDP Extended Axis and Robot Joint Motion Synchronous Motion

/**
* @brief UDP extended axis and robot joint motion synchronous motion
* @param [in] joint_pos  Target joint position, unit deg
* @param [in] desc_pos   Target Cartesian pose
* @param [in] tool  Tool coordinate number, range [0~14]
* @param [in] user  Workpiece coordinate number, range [0~14]
* @param [in] vel  Speed percentage, range [0~100]
* @param [in] acc  Acceleration percentage, range [0~100], not yet available
* @param [in] ovl  Speed scaling factor, range [0~100]
* @param [in] epos  Extended axis position, unit mm
* @param [in] blendT [-1.0]-motion到位(blocking), [0~500.0]-smoothing time (non-blocking), unit ms
* @param [in] offset_flag  0-no offset, 1-offset in base coordinate system/workpiece coordinate system, 2-offset in tool coordinate system
* @param [in] ffset_pos  Pose offset
* @return Error code
*/
int ExtAxisSyncMoveJ(JointPos joint_pos, DescPose desc_pos, int tool, int user, double vel, double acc, double ovl, ExaxisPos epos, double blendT, int offset_flag, DescPose offset_pos);

13.42. UDP extended axis and robot joint motion synchronous motion (automatic forward kinematics calculation)

New in version Java: SDK-v1.0.8-3.8.5

/**
* @brief UDP extended axis and robot joint motion synchronous motion (automatic forward kinematics calculation)
* @param [in] joint_pos  Target joint position, unit deg
* @param [in] tool  Tool coordinate number, range [0~14]
* @param [in] user  Workpiece coordinate number, range [0~14]
* @param [in] vel  Velocity percentage, range [0~100]
* @param [in] acc  Acceleration percentage, range [0~100], not open yet
* @param [in] ovl  Velocity scaling factor, range [0~100]
* @param [in] epos  Extended axis position, unit mm
* @param [in] blendT [-1.0]-move to position (blocking), [0~500.0]-smoothing time (non-blocking), unit ms
* @param [in] offset_flag  0-no offset, 1-offset in base/workpiece coordinate system, 2-offset in tool coordinate system
* @param [in] offset_pos  Pose offset
* @return Error code
*/
int ExtAxisSyncMoveJ(JointPos joint_pos, int tool, int user, double vel, double acc, double ovl, ExaxisPos epos, double blendT, int offset_flag, DescPose offset_pos)

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