1

Maxon EPOS 库定义了一些看似处理插值位置模式的功能块,但据我所知,没有示例指定如何使用它们。

这是我到目前为止所拥有的,但目前它只是在使用Executeset调用时跳过它TRUE

FUNCTION_BLOCK FB_MAIN_Routine1

TYPE
    POSITIONS: ARRAY[1..64] OF DINT;
    VELOCITIES: ARRAY[1..64] OF DINT;
    TIME_VALUES: ARRAY[1..64] OF USINT;
END_TYPE

VAR_EXTERNAL
    Axis1: AXIS_REF;
END_VAR

VAR_INPUT
    Execute: BOOL;
END_VAR

VAR_OUTPUT
    Done: BOOL;
END_VAR

VAR

    Start: BOOL := FALSE;    
    LoadPointsAx1: BOOL := FALSE;

    fbClearIpmBufferAx1: MU_ClearIpmBuffer;
    fbAddPvtValuesAx1: MU_AddPvtValues;
    fbStartIpmTrajectoryAx1: MU_StartIpmTrajectory;
    fbGetIpmStatusAx1: MU_GetIpmStatus;
    fbGetIpmTrajectoryStatusAx1: MU_GetIpmTrajectoryStatus;

    PositionsAx1:  POSITIONS  := [49500, 47703, 45906, 44109, 42312, 40516, 38719, 36922, 35125, 33329, 31532, 29735, 27938, 26142, 24345, 22548, 20751, 21834, 23037, 24240, 25443, 26646, 27848, 29051, 30254, 31457, 32660, 33863, 35065, 36268, 37471, 38674, 39877, 41080, 42282, 43485, 44688, 45891, 47094, 48297, 49500, 49500, 49500, 49500, 49500, 49500, 49500, 49500, 49500, 49500, 49500, 49500, 49500, 49500, 49500, 49500, 49500, 49500, 49500, 49500, 49500, 49500, 49500, 49500];    
    VelocitiesAx1: VELOCITIES  := [-216, -216, -216, -216, -216, -216, -216, -216, -216, -216, -216, -216, -216, -216, -216, -216, -216, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
    TimeValuesAx1: TIME_VALUES := [250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];

END_VAR

fbGetIpmStatusAx1(Axis := Axis1, Enable := Execute);

fbClearIpmBufferAx1(Axis := Axis1, Execute := Execute);

If fbClearIpmBufferAx1.Done Then    
    LoadPointsAx1 := TRUE;
END_IF;

fbAddPvtValuesAx1(Axis := Axis1, Execute := LoadPointsAx1, Position := PositionsAx1, Velocity := VelocitiesAx1, TimeValue := TimeValuesAx1);

If fbAddPvtValuesAx1.Done Then    
    Start := TRUE;
End_If; 

fbStartIpmTrajectoryAx1(Axis := Axis1, Execute := Start);

fbGetIpmTrajectoryStatusAx1(Axis := Axis1, Enable := fbStartIpmTrajectoryAx1.Done);

If (Execute = FALSE) Or fbGetIpmTrajectoryStatusAx1.TargetReached Then
    Done := Execute;
    Start := FALSE;
    LoadPointsAx1 := FALSE;
    fbAddPvtValuesAx1(Axis := Axis1, Execute := FALSE);
    fbStartIpmTrajectoryAx1(Axis := Axis1, Execute := FALSE);
    fbGetIpmTrajectoryStatusAx1(Axis := Axis1, Enable := FALSE);
End_If;

END_FUNCTION_BLOCK
4

1 回答 1

1

与其他操作移动(例如速度模式或位置模式)不同,插值位置模式需要初始化。

一个电话MU_ActivateInterpolatedPositionMode解决了这个问题。

于 2014-05-15T20:04:33.790 回答