NexMotion  1.4.0
Open Robots & Machines [WIP]
Group_3D_Motion

Group 3D Line or Arc Interpolation Motion Functions. More...

Collaboration diagram for Group_3D_Motion:

Functions

RTN_ERR FNTYPE NMC_GroupLine (I32_T DevID, I32_T GroupIndex, I32_T CartAxisMask, const Pos_T *PCartPos, _opt_null_ const F64_T *PMaxVel)
 Enable the group line interpolation motion from the current position to the target position in the Cartesian space. More...
 
RTN_ERR FNTYPE NMC_GroupCircR (I32_T DevID, I32_T GroupIndex, I32_T CartAxisMask, const Pos_T *PCartPos, const Xyz_T *PNormalVector, F64_T Radius, I32_T CW_CCW, _opt_null_ const F64_T *PMaxVel)
 Enable the group arc interpolation motion from the current position to the target position in the Cartesian space (radius method). More...
 
RTN_ERR FNTYPE NMC_GroupCircC (I32_T DevID, I32_T GroupIndex, I32_T CartAxisMask, const Pos_T *PCartPos, I32_T CenOfsMask, const Xyz_T *PCenOfs, I32_T CW_CCW, _opt_null_ const F64_T *PMaxVel)
 Enable the group arc interpolation motion from the current position to the target position in the Cartesian space (circle center method). More...
 
RTN_ERR FNTYPE NMC_GroupCircB (I32_T DevID, I32_T GroupIndex, I32_T CartAxisMask, const Pos_T *PCartPos, I32_T BorPosMask, const Xyz_T *PBorPoint, _opt_null_ const F64_T *PMaxVel)
 Enable the group arc interpolation motion from the current position to the target position in the Cartesian space (pass-through method). More...
 
RTN_ERR FNTYPE NMC_GroupCircBEx (I32_T DevID, I32_T GroupIndex, I32_T CartAxisMask, const Pos_T *PCartPos, I32_T BorPosMask, const Xyz_T *PBorPoint, _opt_null_ const F64_T *PAngleDeg, _opt_null_ const F64_T *PMaxVel)
 

Detailed Description

Group 3D Line or Arc Interpolation Motion Functions.

Todo:
Add description to NMC_GroupCircBEx function

Function Documentation

RTN_ERR FNTYPE NMC_GroupCircB ( I32_T  DevID,
I32_T  GroupIndex,
I32_T  CartAxisMask,
const Pos_T PCartPos,
I32_T  BorPosMask,
const Xyz_T PBorPoint,
_opt_null_ const F64_T PMaxVel 
)

Enable the group arc interpolation motion from the current position to the target position in the Cartesian space (pass-through method).

The group state will transfer from GROUP_STAND_STILL to GROUP_MOVING. If the group reaches the target position (i.e. the velocity is decreased to 0), the group state will transfer to GROUP_STAND_STILL. The path algorithm of the arc motion (pass-through method) is developed based on the PLCopen specification. Please refer to the below figure for the coordination.

GroupCircB.png
Parameters
DevIDDevice ID (DevID)
GroupIndexGroup index
CartAxisMaskThe mask is specified to execute the motion in the Cartesian space. Please refer to the below table.
[in]PCartPosA pointer variable to set the target position
BorPosMaskThe mask of the pass-through point in the Cartesian space. Please refer to the below table.
[in]PBorPointA pointer variable to set the pass-through point
[in]PMaxVelA pointer variable to set the maximum. Input NULL (0) to ignore the parameter.
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:

Cartesian Coordinate Axis V U C B A Z Y X
Bit index 7 6 5 4 3 2 1 0
The power is the index of bit $2^7$ $2^6$ $2^5$ $2^4$ $2^3$ $2^2$ $2^1$ $2^0$

The usage of the mask in the Cartesian space coordinate system (CartAxesMask) is described as follows:
If the group axes to be moved are the X-, Z- and A-axis, the GroupAxesIdxMask is $2^0$ + $2^2$ + $2^3$ = 13.

Examples:

I32_T devID = 0;
I32_T groupIndex = 0;
I32_T cartAxesMask = 7; // Move the X-, Y- and Z-axis
Pos_T targetPos = { 50, 50, 0, 0, 0, 0, 0 };
I32_T borPosMask = 7; // Move the X-, Y- and Z-axis
Xyz_T borPoint = { 50, 0, 50 };
RTN_ERR ret = 0;
ret = NMC_GroupCircB( devID, groupIndex, cartAxesMask, targetPos, borPosMask, borPoint, NULL );
if( ret != 0 ) return ret;

Reference:
None.

RTN_ERR FNTYPE NMC_GroupCircC ( I32_T  DevID,
I32_T  GroupIndex,
I32_T  CartAxisMask,
const Pos_T PCartPos,
I32_T  CenOfsMask,
const Xyz_T PCenOfs,
I32_T  CW_CCW,
_opt_null_ const F64_T PMaxVel 
)

Enable the group arc interpolation motion from the current position to the target position in the Cartesian space (circle center method).

The group state will transfer from GROUP_STAND_STILL to GROUP_MOVING. If the group reaches the target position (i.e. the velocity is decreased to 0), the group state will transfer to GROUP_STAND_STILL. The path algorithm of the arc motion (circle center method) is developed based on the PLCopen specification. Please pay attention to the following items:

  • The path developed based on the circle center method can be divided to the larger radian path and the small radian path, and one of the paths shall be selected. They shall be determined by the rotation direction (CW_CCW). That is, the CW indicates the small radian path, and the CCW indicates the larger radian path.
  • If the arc is a 2D path, the path can be determined based on the rotation direction (CW_CCW) because the right-hand rule will be used in the XY-, YZ- or ZX-plane.
GroupCircC.png
Parameters
DevIDDevice ID (DevID)
GroupIndexGroup index
CartAxisMaskThe mask is specified to execute the motion in the Cartesian space. Please refer to the below table.
[in]PCartPosA pointer variable to set the target position
CenOfsMaskThe mask of the circle center in the Cartesian space. Please refer to the below table.
[in]PCenOfsA pointer variable to set the position of the circle center
CW_CCWRotation direction of arc (0=CW; 1=CCW)
[in]PMaxVelA pointer variable to set the maximum. Input NULL (0) to ignore the parameter.
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:

Cartesian Coordinate Axis V U C B A Z Y X
Bit index 7 6 5 4 3 2 1 0
The power is the index of bit $2^7$ $2^6$ $2^5$ $2^4$ $2^3$ $2^2$ $2^1$ $2^0$

The usage of the mask in the Cartesian space coordinate system (CartAxesMask) is described as follows:
If the group axes to be moved are the X-, Z- and A-axis, the GroupAxesIdxMask is $2^0$ + $2^2$ + $2^3$ = 13.

Examples:

I32_T devID = 0;
I32_T groupIndex = 0;
I32_T cartAxesMask = 7; // Move the X-, Y- and Z-axis
Pos_T targetPos = { 50, 50, 0, 0, 0, 0, 0 };
I32_T cenOfsMask = 7; // Move the X-, Y- and Z-axis
Xyz_T cenOfs = { 50, 0, 50 };
I32_T cwCcw = 1;
RTN_ERR ret = 0;
ret = NMC_GroupCircC( devID, groupIndex, cartAxesMask, &targetPos, cenOfsMask, &cenOfs, cwCcw, NULL );
if( ret != 0 ) return ret;

Reference:
None.

RTN_ERR FNTYPE NMC_GroupCircR ( I32_T  DevID,
I32_T  GroupIndex,
I32_T  CartAxisMask,
const Pos_T PCartPos,
const Xyz_T PNormalVector,
F64_T  Radius,
I32_T  CW_CCW,
_opt_null_ const F64_T PMaxVel 
)

Enable the group arc interpolation motion from the current position to the target position in the Cartesian space (radius method).

The group state will transfer from GROUP_STAND_STILL to GROUP_MOVING. If the group reaches the target position (i.e. the velocity is decreased to 0), the group state will transfer to GROUP_STAND_STILL. The path algorithm of the arc motion (radius method) is developed based on the PLCopen specification. Please pay attention to the following items:

  • The starting point of normal vector of the circle plane is the origin in the Cartesian space coordinate system. The unit vector cannot be input.
  • The vector formed by the starting point and the end point must be perpendicular to the normal vector of the circle plane. Otherwise, an error code will be returned.
  • The path developed based on the radius method can be divided to the larger radian path and the small radian path, and one of the paths shall be selected. They shall be determined by the sign of the radius. That is, the positive sign indicates the small radian path, and the negative sign indicates the larger radian path.
  • If the arc is a 2D path, the normal vector of the circle plane is dispensable to set, but the rotation direction (CW_CCW) shall be set because the right-hand rule will be used in the XY-, YZ- or ZX-plane.
  • If the arc is a 3D path, the rotation direction (CW_CCW) shall not be referred because the 3D path cannot be determined based on the right-hand rule.
GroupCircR.png
Parameters
DevIDDevice ID (DevID)
GroupIndexGroup index
CartAxisMaskThe mask is specified to execute the motion in the Cartesian space. Please refer to the below table.
[in]PCartPosA pointer variable to set the target position
[in]PNormalVectorA pointer variable to set the normal vector of the circle plane
RadiusRadius of arc (negative value indicates the larger radian path).
CW_CCWRotation direction of arc (0=CW; 1=CCW)
[in]PMaxVelA pointer variable to set the maximum velocity. Input NULL (0) to ignore the parameter.
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:

Cartesian Coordinate Axis V U C B A Z Y X
Bit index 7 6 5 4 3 2 1 0
The power is the index of bit $2^7$ $2^6$ $2^5$ $2^4$ $2^3$ $2^2$ $2^1$ $2^0$

The usage of the mask in the Cartesian space coordinate system (CartAxesMask) is described as follows:
If the group axes to be moved are the X-, Z- and A-axis, the GroupAxesIdxMask is $2^0$ + $2^2$ + $2^3$ = 13.

Examples:

I32_T devID = 0;
I32_T groupIndex = 0;
I32_T cartAxesMask = 3; // Move the X- and Y-axis
Pos_T targetPos = { 50, 50, 0, 0, 0, 0, 0 };
Xyz_T normalVec = { 0, 0, 50 };
F64_T radius = 50.0;
I32_T cwCcw = 1;
RTN_ERR ret = 0;
ret = NMC_GroupCircR( devID, groupIndex, cartAxesMask, &targetPos, &normalVec, radius, cwCcw, NULL );
if( ret != 0 ) return ret;

Reference:
None.

RTN_ERR FNTYPE NMC_GroupLine ( I32_T  DevID,
I32_T  GroupIndex,
I32_T  CartAxisMask,
const Pos_T PCartPos,
_opt_null_ const F64_T PMaxVel 
)

Enable the group line interpolation motion from the current position to the target position in the Cartesian space.

The group state will transfer from GROUP_STAND_STILL to GROUP_MOVING. If the group reaches the target position (i.e. the velocity is decreased to 0), the group state will transfer to GROUP_STAND_STILL.

Parameters
DevIDDevice ID (DevID)
GroupIndexGroup index
CartAxisMaskThe mask is specified to execute the motion in the Cartesian space. Please refer to the below table.
[in]PCartPosA pointer variable to set the target position
[in]PMaxVelA pointer variable to set the maximum velocity. Input NULL (0) to ignore the parameter.
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:

Cartesian Coordinate Axis V U C B A Z Y X
Bit index 7 6 5 4 3 2 1 0
The power is the index of bit $2^7$ $2^6$ $2^5$ $2^4$ $2^3$ $2^2$ $2^1$ $2^0$

Examples:

I32_T devID = 0;
I32_T groupIndex = 0;
I32_T cartAxesMask = 13; // Move the X-, Z- and A-axis
Pos_T targetPos = { 10, 20, 30, 40, 50, 60, 70 };
RTN_ERR ret = 0;
ret = NMC_GroupLine( devID, groupIndex, cartAxesMask, &targetPos, NULL );
if( ret != 0 ) return ret;

Reference:
None.