top of page

Java 13.43. UDP Extended Axis and Robot Joint Motion Synchronous Motion Code Example

public int testSyncMoveJ(Robot robot)
{
    //1. Calibrate and apply robot tool coordinate system. You can use the four-point or six-point method for tool coordinate system calibration and application. The interfaces involved are as follows:
    //  int SetToolPoint(int point_num); //Set tool reference point - six-point method
    //  int ComputeTool(ref DescPose tcp_pose); //Calculate tool coordinate system
    //  int SetTcp4RefPoint(int point_num);  //Set tool reference point - four-point method
    //  int ComputeTcp4(ref DescPose tcp_pose);  //Calculate tool coordinate system - four-point method
    //  int SetToolCoord(int id, DescPose coord, int type, int install); //Set and apply tool coordinate system
    //  int SetToolList(int id, DescPose coord, int type, int install);  //Set and apply tool coordinate system list
    //2. Set UDP communication parameters and load UDP communication
    UDPComParam param=new UDPComParam("192.168.58.88", 2021, 2, 100, 3, 100, 1, 100, 10,0);
    robot.ExtDevSetUDPComParam(param);
    robot.ExtDevLoadUDPDriver();
    //3. Set extended axis parameters, including extended axis type, extended axis driver parameters, and extended axis DH parameters
    robot.SetAxisDHParaConfig(4, 200, 200, 0, 0, 0, 0, 0, 0); //Single-axis positioner and DH parameters
    robot.SetRobotPosToAxis(1); //Extended axis installation position
    robot.ExtAxisParamConfig(1, 0, 1, 100, -100, 10, 10, 12, 131072, 0, 1, 0, 0); //Servo driver parameters. This example is for a single-axis positioner, so only one driver parameter needs to be set. If you choose an extended axis type with multiple axes, each axis needs to be configured.
    //4. Enable the selected axis and perform homing
    robot.ExtAxisServoOn(1, 0);
    robot.ExtAxisSetHoming(1, 0, 20, 3);
    //5. Perform extended axis coordinate system calibration and application
    DescPose pos = new DescPose(/* Enter your calibration point coordinates */ );
    robot.SetRefPointInExAxisEnd(pos);
    robot.PositionorSetRefPoint(1); /*You need to call this interface 4 times with different points to complete the calibration */
    DescPose coord = new DescPose();
    robot.PositionorComputeECoordSys(coord); //Calculate extended axis calibration result
    robot.ExtAxisActiveECoordSys(1, 1, coord, 1); //Apply the calibration result to the extended axis coordinate system
    //6. Calibrate the workpiece coordinate system on the extended axis. You will need the following interfaces:
    //int SetWObjCoordPoint(int point_num);
    //int ComputeWObjCoord(int method, ref DescPose wobj_pose);
    //int SetWObjCoord(int id, DescPose coord);
    //int SetWObjList(int id, DescPose coord);
    //7. Record your synchronous joint motion starting point
    DescPose startdescPose = new DescPose(/*Enter your coordinates*/ );
    JointPos startjointPos = new JointPos(/*Enter your coordinates*/ );
    ExaxisPos startexaxisPos = new ExaxisPos(/* Enter your extended axis starting point coordinates */ );
    //8. Record your synchronous joint motion end point coordinates
    DescPose enddescPose = new DescPose(/*Enter your coordinates*/ );
    JointPos endjointPos = new JointPos(/*Enter your coordinates*/ );
    ExaxisPos endexaxisPos =new ExaxisPos(/* Enter your extended axis end point coordinates */);
    //9. Write the synchronous motion program
    //Move to the starting point, assuming the applied tool coordinate system and workpiece coordinate system are both 1
    robot.ExtAxisMove(startexaxisPos, 20);
    DescPose offdese = new DescPose( 0, 0, 0, 0, 0, 0 );
    robot.MoveJ(startjointPos, startdescPose, 1, 1, 100, 100, 100, startexaxisPos, 0, 0, offdese);
    //Start synchronous motion
    robot.ExtAxisSyncMoveJ(endjointPos, enddescPose, 1, 1, 100, 100, 100, endexaxisPos, -1, 0, offdese);
    robot.MoveJ(startjointPos, 1, 1, 100, 100, 100, startexaxisPos, 0, 0, offdese);
    //Start synchronous motion
    robot.ExtAxisSyncMoveJ(endjointPos, 1, 1, 100, 100, 100, endexaxisPos, -1, 0, offdese);

    robot.CloseRPC();
    return 0;
}

13.44. UDP Extended Axis and Robot Linear Motion Synchronous Motion

/**
* @brief UDP extended axis and robot linear 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] blendR [-1.0]-motion到位(blocking), [0~1000.0]-smoothing radius (non-blocking), unit mm
* @param [in] epos  Extended axis position, unit mm
* @param [in] offset_flag  0-no offset, 1-offset in base coordinate system/workpiece coordinate system, 2-offset in tool coordinate system
* @param [in] offset_pos  Pose offset
* @return Error code
*/
int ExtAxisSyncMoveL(JointPos joint_pos, DescPose desc_pos, int tool, int user, double vel, double acc, double ovl, double blendR, ExaxisPos epos, int offset_flag, DescPose offset_pos);

13.45. UDP extended axis and robot linear motion synchronous motion (automatic inverse kinematics calculation)

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

/**
* @brief UDP extended axis and robot linear motion synchronous motion (automatic inverse kinematics calculation)
* @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  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] blendR [-1.0]-move to position (blocking), [0~1000.0]-smoothing radius (non-blocking), unit mm
* @param [in] epos  Extended axis position, unit mm
* @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
* @param [in] config Inverse kinematics joint space configuration, [-1]-calculate based on current joint position, [0~7]-solve according to specific joint space configuration
* @return Error code
*/
int ExtAxisSyncMoveL(DescPose desc_pos, int tool, int user, double vel, double acc, double ovl, double blendR, ExaxisPos epos, int offset_flag, DescPose offset_pos,int config)

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