top of page

4. Robot Motion

4. Robot Motion

4.1. JOG Motion

/**
* @brief JOG motion
* @param [in] ref 0-Joint JOG, 2-Base coordinate JOG, 4-Tool coordinate JOG, 8-Workpiece coordinate JOG
* @param [in] nb 1-Joint1 (or x-axis), 2-Joint2 (or y-axis), 3-Joint3 (or z-axis), 4-Joint4 (or rotation about x-axis), 5-Joint5 (or rotation about y-axis), 6-Joint6 (or rotation about z-axis)
* @param [in] dir 0-Negative direction, 1-Positive direction
* @param [in] vel Speed percentage [0~100]
* @param [in] acc Acceleration percentage [0~100]
* @param [in] max_dis Maximum single JOG angle in [°] or distance in [mm]
* @return Error code
*/
errno_t StartJOG(uint8_t ref, uint8_t nb, uint8_t dir, float vel, float acc, float max_dis);

4.2. JOG Deceleration Stop

/**
* @brief JOG deceleration stop
* @param [in] ref 1-Joint JOG stop, 3-Base coordinate JOG stop, 5-Tool coordinate JOG stop, 9-Workpiece coordinate JOG stop
* @return Error code
*/
errno_t StopJOG(uint8_t ref);

4.3. JOG Immediate Stop

/**
* @brief JOG immediate stop
* @return Error code
*/
errno_t ImmStopJOG();

4.4. Robot JOG Control Example

int TestJOG(void)
{
    ROBOT_STATE_PKG pkg = {};
    FRRobot robot;
    robot.LoggerInit();
    robot.SetLoggerLevel(1);
    int rtn = robot.RPC("192.168.58.2");
    if (rtn != 0)
    {
        return -1;
    }
    robot.SetReConnectParam(true, 30000, 500);
    for (int i = 0; i < 6; i++)
    {
        robot.StartJOG(0, i + 1, 0, 20.0, 20.0, 30.0);
        robot.Sleep(1000);
        robot.ImmStopJOG();
        robot.Sleep(1000);
    }
    for (int i = 0; i < 6; i++)
    {
        robot.StartJOG(2, i + 1, 0, 20.0, 20.0, 30.0);
        robot.Sleep(1000);
        robot.ImmStopJOG();
        robot.Sleep(1000);
    }
    for (int i = 0; i < 6; i++)
    {
        robot.StartJOG(4, i + 1, 0, 20.0, 20.0, 30.0);
        robot.Sleep(1000);
        robot.StopJOG(5);
        robot.Sleep(1000);
    }
    for (int i = 0; i < 6; i++)
    {
        robot.StartJOG(8, i + 1, 0, 20.0, 20.0, 30.0);
        robot.Sleep(1000);
        robot.StopJOG(9);
        robot.Sleep(1000);
    }
    robot.CloseRPC();
    return 0;
}

4.5. Joint Space Motion

/**
* @brief Joint space motion
* @param [in] joint_pos Target joint position in deg
* @param [in] desc_pos Target Cartesian pose
* @param [in] tool Tool coordinate number [0~14]
* @param [in] user Workpiece coordinate number [0~14]
* @param [in] vel Speed percentage [0~100]
* @param [in] acc Acceleration percentage [0~100] (not yet available)
* @param [in] ovl Speed scaling factor [0~100]
* @param [in] epos Extended axis position in mm
* @param [in] blendT [-1.0]-Move to position (blocking), [0~500.0]-Smoothing time (non-blocking) in ms
* @param [in] offset_flag 0-No offset, 1-Offset in base/workpiece coordinate, 2-Offset in tool coordinate
* @param [in] offset_pos Pose offset
* @return Error code
*/
errno_t  MoveJ(JointPos *joint_pos, DescPose *desc_pos, int tool, int user, float vel, float acc, float ovl, ExaxisPos *epos, float blendT, uint8_t offset_flag, DescPose *offset_pos);

4.6. Joint Space Motion (Automatic Forward Kinematics Calculation)

/**
* @brief Joint Space 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], temporarily not 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 (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] offset_pos Pose offset value
* @return Error code
*/
errno_t MoveJ(JointPos* joint_pos, int tool, int user, float vel, float acc, float ovl, ExaxisPos* epos, float blendT, uint8_t offset_flag, DescPose* offset_pos);

4.7. Cartesian Space Linear Motion

/**
* @brief Cartesian Space Linear Motion
* @param [in] joint_pos Target joint positions, unit: deg
* @param [in] desc_pos Target Cartesian pose
* @param [in] tool Tool coordinate system index, range [0~14]
* @param [in] user Workpiece/user coordinate system index, range [0~14]
* @param [in] vel Velocity percentage, range [0~100]
* @param [in] acc Acceleration percentage, range [0~100] (currently unavailable)
* @param [in] ovl Velocity scaling factor [0~100] / physical velocity (mm/s)
* @param [in] blendR [-1.0]-block until motion completes (blocking), [0~1000.0]-blend radius (non-blocking), unit: mm
* @param [in] blendMode Transition method; 0-tangent blend; 1-corner blend
* @param [in] epos Extended axis position, unit: mm
* @param [in] search 0-no wire search, 1-wire search
* @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 value
* @param [in] oacc Acceleration scaling factor [0-100] / physical acceleration (mm/s²)
* @param [in] velAccParamMode Velocity/acceleration parameter mode; 0-percentage; 1-physical velocity (mm/s) and acceleration (mm/s²)
* @param [in] overSpeedStrategy Overspeed handling strategy; 1-standard; 2-stop with error on overspeed; 3-adaptive speed reduction, default 0
* @param [in] speedPercent Allowable speed reduction threshold percentage [0-100], default 10%
* @return Error code
*/
errno_t MoveL(JointPos *joint_pos, DescPose *desc_pos, int tool, int user, float vel, float acc, float ovl, float blendR, int blendMode, ExaxisPos *epos, uint8_t search, uint8_t offset_flag, DescPose *offset_pos, float oacc = 100.0, int velAccParamMode = 0, int overSpeedStrategy = 0, int speedPercent = 10);

4.8. Cartesian Space Linear Motion (Automatic Inverse Kinematics Calculation)

/**
* @brief Cartesian Space Linear 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], temporarily not available
* @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] blendMode Transition method; 0-Tangent transition; 1-Corner transition
* @param [in] epos Extended axis position, unit: mm
* @param [in] search 0-No wire search, 1-Wire search
* @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 value
* @param [in] config Inverse kinematics joint space configuration, [-1]-Calculate based on current joint position, [0~7]-Solve based on specific joint space configuration
* @param [in] overSpeedStrategy Overspeed handling strategy, 1-Standard; 2-Error stop when overspeed; 3-Adaptive speed reduction, default is 0
* @param [in] speedPercent Allowable speed reduction threshold percentage [0-100], default 10%
* @return Error code
*/
errno_t MoveL(DescPose* desc_pos, int tool, int user, float vel, float acc, float ovl, float blendR, int blendMode, ExaxisPos* epos, uint8_t search, uint8_t offset_flag, DescPose* offset_pos, int config = -1, int overSpeedStrategy = 0, int speedPercent = 10);

4.9. Cartesian Space Circular Motion

/**
* @brief  Cartesian Space Circular Motion
* @param  [in] joint_pos_p  Path point joint position, unit: deg
* @param  [in] desc_pos_p   Path point Cartesian pose
* @param  [in] ptool  Tool coordinate number, range [0~14]
* @param  [in] puser  Workpiece coordinate number, range [0~14]
* @param  [in] pvel  Velocity percentage, range [0~100]
* @param  [in] pacc  Acceleration percentage, range [0~100], temporarily not available
* @param  [in] epos_p  Extended axis position, unit: mm
* @param  [in] poffset_flag  0-No offset, 1-Offset in base coordinate system/workpiece coordinate system, 2-Offset in tool coordinate system
* @param  [in] offset_pos_p  Pose offset value
* @param  [in] joint_pos_t  Target point joint position, unit: deg
* @param  [in] desc_pos_t   Target point Cartesian pose
* @param  [in] ttool  Tool coordinate number, range [0~14]
* @param  [in] tuser  Workpiece coordinate number, range [0~14]
* @param  [in] tvel  Velocity percentage, range [0~100]
* @param  [in] tacc  Acceleration percentage, range [0~100], temporarily not available
* @param  [in] epos_t  Extended axis position, unit: mm
* @param  [in] toffset_flag  0-No offset, 1-Offset in base coordinate system/workpiece coordinate system, 2-Offset in tool coordinate system
* @param  [in] offset_pos_t  Pose offset value
* @param [in] ovl Velocity scaling factor [0~100] / Physical velocity (mm/s)
* @param [in] blendR [-1.0]-Block until motion completes (blocking), [0~1000.0]-Blend radius (non-blocking), unit: mm
* @param [in] oacc Acceleration scaling factor [0-100] / Physical acceleration (mm/s²)
* @param [in] velAccParamMode Velocity/acceleration parameter mode; 0-Percentage; 1-Physical velocity (mm/s) acceleration (mm/s²)
* @return Error code
*/
errno_t MoveC(JointPos *joint_pos_p, DescPose *desc_pos_p, int ptool, int puser, float pvel, float pacc, ExaxisPos *epos_p, uint8_t poffset_flag, DescPose *offset_pos_p, JointPos *joint_pos_t, DescPose *desc_pos_t, int ttool, int tuser, float tvel, float tacc, ExaxisPos *epos_t, uint8_t toffset_flag, DescPose *offset_pos_t, float ovl, float blendR, float oacc = 100.0, int velAccParamMode = 0);

4.10. Cartesian Space Circular Motion (Automatic Inverse Kinematics Calculation)

/**
* @brief Cartesian Space Circular Motion (Automatic Inverse Kinematics Calculation)
* @param [in] desc_pos_p  Path point Cartesian pose
* @param [in] ptool Tool coordinate number, range [0~14]
* @param [in] puser Workpiece coordinate number, range [0~14]
* @param [in] pvel Velocity percentage, range [0~100]
* @param [in] pacc Acceleration percentage, range [0~100], temporarily not available
* @param [in] epos_p Extended axis position, unit: mm
* @param [in] poffset_flag 0-No offset, 1-Offset in base coordinate system/workpiece coordinate system, 2-Offset in tool coordinate system
* @param [in] offset_pos_p Pose offset value
* @param [in] desc_pos_t  Target point Cartesian pose
* @param [in] ttool Tool coordinate number, range [0~14]
* @param [in] tuser Workpiece coordinate number, range [0~14]
* @param [in] tvel Velocity percentage, range [0~100]
* @param [in] tacc Acceleration percentage, range [0~100], temporarily not available
* @param [in] epos_t Extended axis position, unit: mm
* @param [in] toffset_flag 0-No offset, 1-Offset in base coordinate system/workpiece coordinate system, 2-Offset in tool coordinate system
* @param [in] offset_pos_t Pose offset value
* @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] config Inverse kinematics joint space configuration, [-1]-Calculate based on current joint position, [0~7]-Solve based on specific joint space configuration
* @return Error code
*/
errno_t MoveC(DescPose* desc_pos_p, int ptool, int puser, float pvel, float pacc, ExaxisPos* epos_p, uint8_t poffset_flag, DescPose* offset_pos_p, DescPose* desc_pos_t, int ttool, int tuser, float tvel, float tacc, ExaxisPos* epos_t, uint8_t toffset_flag, DescPose* offset_pos_t, float ovl, float blendR, int config = -1);

4.11. Cartesian Space Full Circle Motion

/**
 *@brief  Cartesian Space Full Circle Motion
 *@param  [in] joint_pos_p  Path point 1 joint position, unit: deg
 *@param  [in] desc_pos_p   Path point 1 Cartesian pose
 *@param  [in] ptool  Tool coordinate number, range [1~15]
 *@param  [in] puser  Workpiece coordinate number, range [1~15]
 *@param  [in] pvel  Velocity percentage, range [0~100]
 *@param  [in] pacc  Acceleration percentage, range [0~100], temporarily not available
 *@param  [in] epos_p  Extended axis position, unit: mm
 *@param  [in] joint_pos_t  Path point 2 joint position, unit: deg
 *@param  [in] desc_pos_t   Path point 2 Cartesian pose
 *@param  [in] ttool  Tool coordinate number, range [1~15]
 *@param  [in] tuser  Workpiece coordinate number, range [1~15]
 *@param  [in] tvel  Velocity percentage, range [0~100]
 *@param  [in] tacc  Acceleration percentage, range [0~100], temporarily not available
 *@param  [in] epos_t  Extended axis position, unit: mm
 *@param  [in] ovl Velocity scaling factor [0~100] / Physical velocity (mm/s)
 *@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 value
 *@param  [in] oacc Acceleration scaling factor [0-100] / Physical acceleration (mm/s²)
 *@param  [in] blendR -1: Blocking; 0~1000: Smoothing radius
* @param  [in] velAccParamMode Velocity/acceleration parameter mode; 0-Percentage; 1-Physical velocity (mm/s) acceleration (mm/s²)
* @return Error code
*/
errno_t Circle(JointPos* joint_pos_p, DescPose* desc_pos_p, int ptool, int puser, float pvel, float pacc, Exax

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