top of page

13.41. UDP extended axis and robot joint motion synchronization

New in version C#SDK-v1.0.7.

/**
* @brief UDP extension axis and robot joint motion synchronization
* @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 currently available
* @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 (blocked), [0~500.0]-Smooth time (non-blocked), unit ms
* @param [in] offset_flag 0-no offset, 1-offset relative to base coordinate system/workpiece coordinate system, 2-offset relative to tool coordinate system
* @param [in] offset_pos Pose offset
* @return Error code
*/
int ExtAxisSyncMoveJ(JointPos joint_pos, DescPose desc_pos, int tool, int user, float vel, float acc, float ovl, ExaxisPos epos, float blendT, byte offset_flag, DescPose offset_pos);

13.42. Code example

private void btnSyncMoveJ_Click(object sender, EventArgs e)
{
    Robot robot = new Robot();
    robot.RPC("192.168.58.2");
    //1. Calibrate and apply the robot tool coordinate system. You can use the four-point method or six-point method to calibrate and apply the tool coordinate system. The interfaces involved in calibrating the tool coordinate system 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 application tool coordinate system
    //    int SetToolList(int id, DescPose coord, int type, int install);   // Set application tool coordinate system list

    //2. Set UDP communication parameters and load UDP communication
    robot.ExtDevSetUDPComParam("192.168.58.88", 2021, 2, 100, 3, 100, 1, 100, 10);
    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 drive parameters. In this example, a single-axis positioner is used, so only one drive parameter needs to be set. If you select an extended axis type with multiple axes, each axis must have its drive parameters set.
    //4. Enable the selected axis and return to zero
    robot.ExtAxisServoOn(1, 0);

    robot.ExtAxisSetHoming(1, 0, 20, 3);
    //5. Perform extended axis coordinate system calibration and application (Note: The calibration interfaces for positioners and linear rails are different. The following is the calibration interface for positioners)
    DescPose pos = new DescPose(/* Enter your calibration point coordinates */);

    robot.SetRefPointInExAxisEnd(pos);
    robot.PositionorSetRefPoint(1); /* You need to calibrate the extended axis using four points at different positions, so this interface must be called four times to complete the calibration */
    DescPose coord = new DescPose( );
    robot.PositionorComputeECoordSys(ref coord); // Calculate the extended axis calibration results

    robot.ExtAxisActiveECoordSys(1, 1, coord, 1);  //Apply the calibration results to the extended axis coordinate system
    //6. Calibrate the workpiece coordinate system on the extended axis. You need to use 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 the starting point of your synchronized joint motion

    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 the endpoint coordinates of your synchronized joint motion

    DescPose enddescPose = new DescPose(/*enter your coordinates*/);
    JointPos endjointPos = new JointPos(/*enter your coordinates*/);
    ExaxisPos endexaxisPos = new ExaxisPos(/* Enter your extended axis endpoint coordinates */);
    //9. Write the synchronized motion program
    //Move to the starting point, assuming the 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 synchronized movement
    robot.ExtAxisSyncMoveJ(endjointPos, enddescPose, 1, 1, 100, 100, 100, endexaxisPos, -1, 0, offdese);
}

13.43. UDP extended axis and robot linear motion synchronization

New in version C#SDK-v1.0.7.

/**
* @brief UDP extended axis and robot linear motion synchronization
* @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 index, range [0~14]
* @param [in] vel  Velocity percentage, range [0~100]
* @param [in] acc  Acceleration percentage, range [0~100], not currently available
* @param [in] ovl  Velocity scaling factor, range [0~100]
* @param [in] blendR [-1.0]-Move to position (blocked), [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 relative to base coordinate system/workpiece coordinate system, 2-offset relative to tool coordinate system
* @param [in] offset_pos  Position offset
*/
int ExtAxisSyncMoveL(JointPos joint_pos, DescPose desc_pos, int tool, int user, float vel, float acc, float ovl, float blendR, ExaxisPos epos, 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