SMC_ETC_InterpolateAxisPosition (FUN)ΒΆ

FUNCTION SMC_ETC_InterpolateAxisPosition : SMC_Error

Determines the axis position at a given time. The time is given as a EtherCAT distributed clock (DC) system time.

Note

  • The actual position at Timestamp_ns, optionally adjusted by the Delay, has to be contained in the act value buffer of the Axis. The size of this buffer can be adjusted using the gc_SMC_ACT_VALUE_BUFFER_SIZE_BASE2_EXP library parameter of SM3_Basic. If the timestamp is too old (not found in the act value buffer) or too new (more than one task interval higher than the timestamp of the latest received actual position), the error SMC_INVALID_TIMESTAMP is returned.

  • The actual velocity is used if (and only if) it is transmitted by PDO. In this case, cubic interpolation is used, otherwise linear interpolation. For increased accuracy, transmitting the actual velocity is recommended.

  • If the underlying EtherCAT stack does not support querying the DC system time, the error SMC_NOT_IMPLEMENTED will be reported.

InOut:

Scope

Name

Type

Initial

Comment

Inout Const

Axis

AXIS_REF_SM3

Input

Timestamp_ns

ULINT

The timestamp at which the axis position is requested. This is the EtherCAT DC system time in nanoseconds. The timestamp must lie within the time span between the oldest available actual position (depending on the buffer size; see above) and the timestamp of the most recently received actual position plus one task cycle.

Delay

LREAL

0.0

Optional delay in seconds that is subtracted from the timestamp. Negative values are not supported.

Return

SMC_ETC_InterpolateAxisPosition

SMC_Error

Output

Position

LREAL

The position of the axis at the given timestamp.