Skip to main content

Axis teach motion

Use NRC_JogMove(1,1) to jog the robot. The first parameter indicates the axis, which determines whether it is a joint motion or composite motion based on the coordinate system. For example, in the joint coordinate system, 1 represents joint axis 1, while in the Cartesian coordinate system, 1 represents the X axis. The second parameter indicates the forward or reverse direction, where 1 represents forward motion and -1 represents reverse motion.

To prevent the robot from crashing due to communication interruption after issuing this instruction, it is required to send the instruction every 200ms to achieve continuous motion.

For example, if we want axis 1 to move continuously in the positive direction for 2 seconds, we need to add the following code:

for(int i = 0 ; i < 10 ; i++)
{
NRC_JogMove(1,1);
NRC_Delayms(200); //Delay 200ms
}
NRC_JogMoveStop(1);//Stop jogging

NRC_JogMove() is defined as follows

/**
* @brief Start jogging an axis
* @note The robot will move along the "dir" direction of the "axis" axis in the NRC_GetCurrentCoord() coordinate system.
* @pre Before calling this function, please power on the servo, you can call the NRC_ServoEnable() function to power on the servo.
* @warning
* - During jog operation, for safety reasons, this function needs to be called every 200ms. If it is not called within the timeout, the robot will automatically stop jogging.
* - When performing inching operation, even if this function is called continuously, it will only be executed once. You need to stop jogging first and then call the function again in order to start the next execution.
* - After successfully calling this function, the robot will start to move. Please pay attention to safety.
* @param axis The axis to jog, the value range is 1-6
* @param dir Axis movement direction
* - 1 Forward
* - -1 Reverse
*/
int NRC_JogMove(int axis, int dir);