CMC_SIPosiLoop (FB)

FUNCTION_BLOCK CMC_SIPosiLoop

The function block can be used for a simple interpolation. Alternatively, the function block CMC_SInterpolation can be used. A “stand alone” position control loop

This function block has to be used along with function block CMC_SInterPolation

Note

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

Behavior of inputs

InSync

Active

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 in Combination with MCA_SetDynamicFollower

The function block will smooth the movement when a group has to follow a conveyor.
It will create defined ramps to accelerate to the conveyors position and also can be used to prevent a position jump when switching between 2 conveyors or before switching of the follower.
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.
InOut:

Scope

Name

Type

Initial

Comment

Input

Enable

BOOL

Level triggered, close = 1, open = 0, a rising edge required to clear any error condition

NewPara

BOOL

At least one rising edge required to set parameter, TRUE: internal values calculated from input parameters, level triggered

Position

LREAL

[u] Reference position

ActualPosition

LREAL

[u] Actual position

Pos_Lag_Percentage

LREAL

100

[%] Allowed percentage for following error, 100% will be reached with constant velocity at Max_Rpm with FF_Percentage = 0. Zero will switch off the monitoring

V_Check_Time

TIME

TIME#100ms

[ms] Tolerance time during which the velocity might deviate for 50%, zero will switch off the monitoring

Control_Time

LREAL

100

[ms] Determines the gain for position control loop

FF_Percentage

LREAL

0

[%] Percentage for feed forward part of the control loop

Cycle

LREAL

10

[ms] Cycle time of the PLC program

U_Per_Rev_Nominator

DWORD

1024

Units per motor revolution = U_Per_Rev_Nominator/U_Per_Rev_Denominator

U_Per_Rev_Denominator

DWORD

1

Units per motor revolution = U_Per_Rev_Nominator/U_Per_Rev_Denominator

Ref_Max

LREAL

32767

Maximum value for SpeedReference, has to be the value when Max_Rpm is reached

Max_Rpm

WORD

1500

Maximum rotation per minute, has to be reached with SpeedReference = Ref_Max

Output

Closed

BOOL

Position control loop activated and closed

ParaError

BOOL

Wrong parameter

PosFollowingError

BOOL

Following error detected

SpeedReference

LREAL

Speed reference. Range -Ref_Max <= SpeedReference <= Ref_Max

VelFollowingError

BOOL

Velocity error detected