NexMotion  1.4.0
Open Robots & Machines [WIP]
Axis_Motion_Change

Axis Motion Change Functions. More...

Collaboration diagram for Axis_Motion_Change:

Functions

RTN_ERR FNTYPE NMC_AxisVelOverride (I32_T DevID, I32_T AxisIndex, F64_T TargetVel)
 Override the velocity of a single axis. More...
 
RTN_ERR FNTYPE NMC_AxisAccOverride (I32_T DevID, I32_T AxisIndex, F64_T TargetAcc)
 Override the acceleration of a single axis. More...
 
RTN_ERR FNTYPE NMC_AxisDecOverride (I32_T DevID, I32_T AxisIndex, F64_T TargetDec)
 Override the deceleration of a single axis. More...
 

Detailed Description

Axis Motion Change Functions.

Change Axis profile on the fly.

Function Documentation

RTN_ERR FNTYPE NMC_AxisAccOverride ( I32_T  DevID,
I32_T  AxisIndex,
F64_T  TargetAcc 
)

Override the acceleration of a single axis.

Parameters
DevIDDevice ID (Dev ID)
AxisIndexAxis index
TargetAccTarget acceleration
Returns
Return an error code.
If the function is called successfully, the return value is ERR_NEXMOTION_SUCCESS (0). Otherwise, the return value is an error code. All error codes are defined in the header file, NexMotionError.h.

Usage:

  1. The function can only be called to change the target acceleration after the axis point-to-point motion (NMC_AxisPtp) or the axis JOG motion (NMC_AxisJog) is enabled.
  2. The input acceleration will be set to the axis parameter AXP_ACC.
  3. If the axis has reached the target velocity (bit 12 of axis status is 1), there is no any impact of the input acceleration on the current motion.

Examples:

RTN_ERR ret = 0;
I32_T status = 0;
F64_T maxVel = 50.0;
ret = NMC_AxisJog( 0, 0, 1, &maxVel ); // Enable the axis JOG motion at target velocity 50.
Sleep(100);
ret = NMC_AxisGetStatus( 0, 0, &status );
if( !( status & 0x1000 ) )
{
ret = NMC_AxisAccOverride ( 0, 0, 100.0 ); // // Change the acceleration to 100.
}

Reference:

RTN_ERR FNTYPE NMC_AxisDecOverride ( I32_T  DevID,
I32_T  AxisIndex,
F64_T  TargetDec 
)

Override the deceleration of a single axis.

Parameters
DevIDDevice ID (Dev ID)
AxisIndexAxis index
TargetDecTarget deceleration
Returns
Return an error code.
If the function is called successfully, the return value is ERR_NEXMOTION_SUCCESS (0). Otherwise, the return value is an error code. All error codes are defined in the header file, NexMotionError.h.

Usage:

  1. The function can only be called to change the target deceleration after the axis point-to-point motion (NMC_AxisPtp) or the normal stop (NMC_AxisHalt) is enabled.
  2. The input deceleration will be set to the axis parameter AXP_DEC.
  3. If the axis point-to-point is enabled and the axis velocity is changed from the target velocity to the configured end velocity gradually (bit 11 of axis status is 1), there is no any impact of the input deceleration on the current motion.
  4. If the normal stop of axis (NMC_AxisHalt) is enabled and the axis has not stopped, the input deceleration will impact on the current motion

Examples:

RTN_ERR ret = 0;
I32_T status = 0;
F64_T maxVel = 50.0;
ret = NMC_AxisPtp( 0, 0, 100, 0 ); // Enable the axis point-to-point motion at the target velocity based on the AXP_VM.
ret = NMC_AxisDecOverride ( 0, 0, 100.0 ); // Change the deceleration to 100.0

Reference:

RTN_ERR FNTYPE NMC_AxisVelOverride ( I32_T  DevID,
I32_T  AxisIndex,
F64_T  TargetVel 
)

Override the velocity of a single axis.

Parameters
DevIDDevice ID (Dev ID)
AxisIndexAxis index
TargetVelTarget velocity (Unit: user unit/sec)
Returns
Return an error code.
If the function is called successfully, the return value is ERR_NEXMOTION_SUCCESS (0). Otherwise, the return value is an error code. All error codes are defined in the header file, NexMotionError.h.

Usage:

  1. The function can only be called to change the target velocity after the axis point-to-point motion (NMC_AxisPtp) or the axis JOG motion (NMC_AxisJog) is enabled.
  2. The target velocity input through the function will be effective to the current motion only, not to modify the axis parameter AXP_VM.
  3. If the JOG motion is enabled, the input target velocity can be reached, and the bit 8 of axis status will become to 1.
  4. If the point-to-point motion is enabled, the input target velocity may not be reached. To meet the specified target position and acceleration/deceleration, the drive will plan the practical velocity curve based on the input target velocity.

Examples:

RTN_ERR ret = 0;
F64_T maxVel = 100.0;
ret = NMC_AxisJog( 0, 0, 1, &maxVel ); // Enable the axis JOG motion at target velocity 100.
Sleep(100);
ret = NMC_AxisVelOverride( 0, 0, 50.0 ); // Decrease the target velocity to 50.

Reference:
NMC_AxisPtp() NMC_AxisJog()