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
- Use in Combination with MCA_SetDynamicFollower
- Use to Create a Simple, basic positioning Axis
- InOut:
Scope
Name
Type
Initial
Comment
Input
EnableBOOLLevel triggered, close = 1, open = 0, a rising edge required to clear any error condition
NewParaBOOLAt least one rising edge required to set parameter, TRUE: internal values calculated from input parameters, level triggered
PositionLREAL[u] Reference position
ActualPositionLREAL[u] Actual position
Pos_Lag_PercentageLREAL100
[%] 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_TimeTIMETIME#100ms
[ms] Tolerance time during which the velocity might deviate for 50%, zero will switch off the monitoring
Control_TimeLREAL100
[ms] Determines the gain for position control loop
FF_PercentageLREAL0
[%] Percentage for feed forward part of the control loop
CycleLREAL10
[ms] Cycle time of the PLC program
U_Per_Rev_NominatorDWORD1024
Units per motor revolution = U_Per_Rev_Nominator/U_Per_Rev_Denominator
U_Per_Rev_DenominatorDWORD1
Units per motor revolution = U_Per_Rev_Nominator/U_Per_Rev_Denominator
Ref_MaxLREAL32767
Maximum value for SpeedReference, has to be the value when Max_Rpm is reached
Max_RpmWORD1500
Maximum rotation per minute, has to be reached with SpeedReference = Ref_Max
Output
ClosedBOOLPosition control loop activated and closed
ParaErrorBOOLWrong parameter
PosFollowingErrorBOOLFollowing error detected
SpeedReferenceLREALSpeed reference. Range -Ref_Max <= SpeedReference <= Ref_Max
VelFollowingErrorBOOLVelocity error detected