CMC_SInterPolation (FB)

FUNCTION_BLOCK CMC_SInterPolation

The function block can be used for a simple point-to-point interpolation.

It can be combined with the function block CMC_SIPosiLoop as position control loop.
The function block allows to create a very simple, basic axis for linear movement. The function block can be either used independent to create a basic axis with/without position control loop or it can be used in combination with PLCopen function blocks.
The function block creates a positioning interpolation towards TargetPosition and uses the given velocity and acceleration values. The function block has to be used within the real-time cycle. The result is given to output Position. The TargetPosition and also Velocity and Acceleration can be changed anytime and will be used at once. With Enable = FALSE, the function block sets the output Position to ActualPosition, this is similar to an open loop.
Behavior of inputs

Enable

Stop

Behavior

FALSE

x

Output Position = ActualPosition

TRUE

FALSE

Interpolates output Position to reach TargetPosition with the given velocity and acceleration.

TRUE

TRUE

Ramps down to velocity = 0.


Behavior of outputs

InSync

Active

Behavior

FALSE

TRUE

Function block is activated, position and velocity is not yet reached.

TRUE

FALSE

Function block is activated, position is reached, output Position = TargetPosition.

FALSE

TRUE

Function block is either disabled or stopped, velocity


Different use cases for this block

Use in Combination with MC_MoveByExternalReference

A positioning axis can be created with modifying the parameters for positioning “on the fly”, without the need of a certain statemachine to follow.
Use to Create a Simple, basic positioning Axis

A very basic, simple positioning axis can be created by using this blokc without the PLCopen blocks.
Be aware that there is not additional check if the axis really follows, also no scaling for the position is included.
If function block CMC_SIPosiLoop is used, it will check for position or velocity following error.

Note

This block has to be called within the REAL-TIME task

InOut:

Scope

Name

Type

Initial

Comment

Input

Enable

BOOL

Level triggered, Enables the interpolation

Stop

BOOL

Stop, level triggered, interpolate down to velocity = 0

TargetPosition

LREAL

[u] Target position

ActualPosition

LREAL

[u] Actual position

Velocity

LREAL

1

[u/s] Value of the maximum velocity (not necessarily reached). Range: >0

Acceleration

LREAL

1

[u/s^2]Value of the acceleration and deceleration. Range: >0

Cycle

LREAL

10

[ms] Cycle time of the PLC program.

Output

Position

LREAL

[u] New absolute position

InSync

BOOL

Position reached TargetPosition

Active

BOOL

Interpolation active