跳转至

GTN_SetGroupVelProfileMode

指令原型:

GT_API GTN_SetGroupVelProfileMode(short core,short group,TVelProfileMode *pSmooth,TListInfo *pListInfo)
指令类型:

group指令。

指令说明:

设置group的速度规划模式。

指令参数说明:

core 核号,正整数,取值范围请参照核号参数范围一栏。
group group号,正整数,取值范围请参照group号参数范围一栏。
pSmooth 速度规划模式及参数结构体指针。详情说明请参照TVelProfileMode
TVelProfileMode
typedef struct VelProfileMode
{
    short mode;
    short reserve[3];
    TVelProfileModeParameter parameter;
} TVelProfileMode;
mode:速度规划模式。根据不同的速度规划模式,设置不同的速度规划参数。
VEL_PROFILE_MODE_SMOOTH(40):平滑模式。
VEL_PROFILE_MODE_JERK(46):Jerk模式,此模式为保留值,暂不支持。
reserve:保留参数,必须为0。
parameter:速度规划参数,详情说明请参照TVelProfileModeParameter
TVelProfileModeParameter
typedef union VelProfileModeParameter
{
    TVelProfileModeSmooth smooth;
    TVelProfileModeJerk jerk;
    double data[20];
} TVelProfileModeParameter;
smooth:平滑模式速度规划参数,详情说明请参照TVelProfileModeSmooth
TVelProfileModeSmooth
typedef struct VelProfileModeSmooth
{
    double accTime;
    double k;
    double reserve[2];
} TVelProfileModeSmooth;
accTime:加速度变化时间,取值范围:[0,60],单位:ms。当accTime为0时,速度规划曲线为T型曲线。
k:形态系数,取值范围:[0,1000]。
reserve:保留参数,必须为0。
jerk:Jerk模式速度规划参数,详情说明请参照TVelProfileModeJerk
TVelProfileModeJerk
typedef struct VelProfileModeJerk
{
    double value;
    short beginPercent;
    short endPercent;
    short reserve[2];
} TVelProfileModeJerk;
value:加加速度,取值范围:(0,...),单位:mm/s3
beginPercent:起始加速度百分比,取值范围:[0,100]。
endPercent:终止加速度百分比,取值范围:[0,100]。
reserve:保留参数,必须为0。
data:保留参数,必须为0。
pListInfo 指令流信息结构体指针。详情说明请参照TListInfo
TListInfo
typedef struct  
{
    short list; 
    short reserve1[2];
    short modal;
    long segNum;
    long reserve2[3];
    double reserve3[4];
} TListInfo;
list:指令压入的指令流号,取值范围:[0, 4]。
当pListInfo为空或者list=0时,指令为立即指令,调用后立即生效。
当list>0时,指令为list指令,调用后被发送到指令流中,在启动指令流后顺序执行到该指令才生效。
modal:为1时表示阻塞指令流,等待当前指令完成。本指令不需要设置此参数。
segNum:指令段号,取值范围:[-2147483648, 2147483647]。
reserve1:保留参数,必须为0。
reserve2:保留参数,必须为0。
reserve3:保留参数,必须为0。

指令返回值:

请参照通用返回值说明

相关指令:

GTN_SetMotionSmoothFpgaResCount

注意事项: