打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
motion 2
MC_AbortTrigger
The MC_AbortTrigger function block interrupts a measuring probe cycle initiated by MC_TouchProbe. MC_TouchProbe initiates a measuring probe cycle by activating a position latch in external encoder or drive hardware. If the process is to be terminated before the trigger signal has activated the position latch, MC_AbortTrigger can be used for this purpose. If the measuring probe cycle has completed successfully, it is not necessary to call up this function block.
Inputs
VAR_INPUT
Execute  : BOOL;
END_VAR
Execute
The command is executed with the rising edge and the external position latch is deactivated.
Outputs
VAR_OUTPUT
Done    : BOOL;
Busy    : BOOL;
Error   : BOOL;
ErrorID : UDINT;
END_VAR
Done
Becomes TRUE, as soon as the measuring probe cycle has been interrupted successfully.
Busy
Becomes TRUE as soon as the function block is active, and becomes FALSE when it has returned to its initial state.
Error
Becomes TRUE, as soon as an error occurs.
ErrorID
If the error output is set, this parameter supplies the error number.
Inputs/outputs
VAR_IN_OUT
Axis         : AXIS_REF;
TriggerInput : TRIGGER_REF;
END_VAR
Axis
Axis data structure
TriggerInput
TRIGGER_REF data structure for describing the trigger source. This data structure must be parameterized before the function block is called for the first time.
MC_AbortTrigger_V2
The MC_AbortTrigger_V2 function block interrupts a measuring probe cycle initiated by MC_TouchProbe_V2. MC_TouchProbe_V2 initiates a measuring probe cycle by activating a position latch in external encoder or drive hardware. If the process is to be terminated before the trigger signal has activated the position latch, MC_AbortTrigger_V2 can be used for this purpose. If the measuring probe cycle has completed successfully, it is not necessary to call up this function block.
Inputs
VAR_INPUT
Execute  : BOOL;
END_VAR
Execute
The command is executed with the rising edge and the external position latch is deactivated.
Outputs
VAR_OUTPUT
Done     : BOOL;
Busy     : BOOL;
Error    : BOOL;
ErrorID  : UDINT;
END_VAR
Done
Becomes TRUE, as soon as the measuring probe cycle has been interrupted successfully.
Busy
Becomes TRUE as soon as the function block is active, and becomes FALSE when it has returned to its initial state.
Error
Becomes TRUE, as soon as an error occurs.
ErrorID
If the error output is set, this parameter supplies the error number.
Inputs/outputs
VAR_IN_OUT
Axis         : AXIS_REF;
TriggerInput : TRIGGER_REF;
END_VAR
Axis
Axis data structure
TriggerInput
TRIGGER_REF data structure for describing the trigger source. This data structure must be parameterized before the function block is called for the first time.
MC_ExtSetPointGenEnable
The external set value generator of an axis can be switched on with the function block MC_ExtSetPointGenEnable. The axis then adopts the set value specifications from its cyclic axis interface (Axis.PlcToNc.ExtSetPos, ExtSetVelo, ExtSetAcc and ExtSetDirection).
An external set value generator is usually a PLC block that calculates cyclic set values for an axis and can therefore substitute the internal set value generator in an NC axis.
See also: MC_ExtSetPointGenDisable and MC_ExtSetPointGenFeed
Inputs
VAR_INPUT
Execute      : BOOL;
Position     : LREAL;
PositionType : E_PositionType;
END_VAR
Execute
The command is executed with the rising edge.
Position
Position for target position monitoring. Setting of this position does not mean that the axis moves to this position, for which only the external set value generator is responsible. Setting of this position activates target position monitoring, and the flag Data type ST_AxisStatus becomes TRUE, as soon as this position is reached.
PositionType
Position type - POSITION TYPE_ABSOLUTE or POSITION TYPE_RELATIVE
Outputs
VAR_OUTPUT
Done    : BOOL;
Busy    : BOOL;
Error   : BOOL;
ErrorID : UDINT;
Enabled : BOOL;
END_VAR
Done
Becomes TRUE, if the command was issued successfully.
Busy
Becomes TRUE as soon as the function block is active, and becomes FALSE when it has returned to its initial state.
Error
Becomes TRUE, as soon as an error occurs.
ErrorID
If the error output is set, this parameter supplies the error number
Enabled
Enabled shows the current state of the external set value generator, independent of the function execution.
Inputs/outputs
VAR_IN_OUT
Axis    : AXIS_REF;
END_VAR
Axis
Axis data structure
The axis data structure of type AXIS_REF addresses an axis uniquely within the system. Among other parameters it contains the current axis status, including position, velocity or error status.
MC_ExtSetPointGenDisable
The external set value generator of an axis can be switched off with the function block MC_ExtSetPointGenDisable. The axis then no longer adopts the set value specifications from its cyclic axis interface (Axis.PlcToNc.ExtSetPos, ExtSetVelo, ExtSetAccand ExtSetDirection)
An external set value generator is usually a PLC block that calculates cyclic set values for an axis and can therefore substitute the internal set value generator in an NC axis.
See also: MC_ExtSetPointGenEnable and MC_ExtSetPointGenFeed
Inputs
VAR_INPUT
Execute : BOOL;
END_VAR
Execute
The command is executed with the rising edge.
Outputs
VAR_OUTPUT
Done    : BOOL;
Busy    : BOOL;
Error   : BOOL;
ErrorID : UDINT;
Enabled : BOOL;
END_VAR
Done
Becomes TRUE, if the command was executed successfully.
Busy
Becomes TRUE as soon as the function block is active, and becomes FALSE when it has returned to its initial state.
Error
Becomes TRUE, as soon as an error occurs.
ErrorID
If the error output is set, this parameter supplies the error number
Enabled
Enabled shows the current state of the external set value generator, independent of the function execution.
Inputs/outputs
VAR_IN_OUT
Axis    : AXIS_REF;
END_VAR
Axis
Axis data structure
The axis data structure of type AXIS_REF addresses an axis uniquely within the system. Among other parameters it contains the current axis status, including position, velocity or error status.
MC_ExtSetPointGenFeed
The MC_ExtSetPointGenFeed function is used to feed set values from an external set value generator into an axis. The function copies the data instantaneously into the cyclic axis interface (fExtSetPos, fExtSetVelo, fExtSetAcc and nExtSetDirection). The function result of MC_ExtSetPointGenFeed is not used and therefore always FALSE.
An external set value generator is usually a PLC block that calculates cyclic set values for an axis and can therefore substitute the internal set value generator in an NC axis.
See also: MC_ExtSetPointGenEnable and MC_ExtSetPointGenDisable
Inputs
VAR_INPUT
Position     : LREAL;
Velocity     : LREAL;
Acceleration : LREAL;
Direction    : DINT;
END_VAR
Position
Set position from an external set value generator
Velocity
Set velocity from an external set value generator
Acceleration
Set acceleration from an external set value generator
Direction
Set direction from an external set value generator. ( -1 = negative direction, 0 = standstill, 1 = positive direction)
Inputs/outputs
VAR_IN_OUT
Axis    : AXIS_REF;
END_VAR
Axis
Axis data structure
The axis data structure of type AXIS_REF addresses an axis uniquely within the system. Among other parameters it contains the current axis status, including position, velocity or error status.
Special extensions
Additional information
·
MC_PowerStepper
·
Notes on the MC_PowerStepper
·
MC_OverrideFilter
·
MC_SetOverride
·
MC_SetEncoderScalingFactor
·
MC_PositionCorrectionLimiter
·
MC_ReadDriveAddress
·
MC_SetAcceptBlockedDriveSignal
Point to point motion
Additional information
·
MC_MoveAbsolute
·
MC_MoveRelative
·
MC_MoveAdditive
·
MC_MoveModulo
·
Notes on modulo positioning
·
MC_MoveVelocity
·
MC_MoveContinuousAbsolute
·
MC_MoveContinuousRelative
·
MC_Halt
·
MC_Stop
《6666》
MC_MoveAbsolute
MC_MoveAbsolute starts positioning to an absolute target position and monitors the axis movement over the whole travel path. The Done output is set once the target position has been reached. Otherwise the CommandAborted or, on error, the Error output is set.
MC_MoveAbsolute is predominantly used for linear axis systems. For modulo axes the position is not interpreted as a modulo position, but as an absolute position in continuous absolute coordinate system. Alternatively, the MC_MoveModulo block can be used for modulo positioning.
Travel commands can be applied to coupled slave axes, if this option was explicitly activated in the axis parameters. Travel commands can be applied to coupled slave axes, if this option was explicitly activated in the axis parameters. In this case only Buffer-ModeAborting is possible.
Inputs
VAR_INPUT
Execute      : BOOL;
Position     : LREAL;
Velocity     : LREAL;
Acceleration : LREAL;
Deceleration : LREAL;
Jerk         : LREAL;
BufferMode   : MC_BufferMode;
Options      : ST_MoveOptions;
END_VAR
Execute
The command is executed with a rising edge at input Execute.
Position
Absolute target position to be used for positioning.
Velocity
Maximum travel velocity (>0).
Acceleration
Acceleration (≥0). If the value is 0, the standard acceleration from the axis configuration in the System Manager is used.
Deceleration
Deceleration (≥0). If the value is 0, the standard deceleration from the axis configuration in the System Manager is used.
Jerk
Jerk (≥0). If the value is 0, the standard jerk from the axis configuration in the System Manager is used.
BufferMode
The BufferMode is analyzed, if the axis is already executing another command. The running command can be aborted, or the new command becomes active after the running command. The BufferMode also determines the transition condition from the current to the next command.
If the command is applied to a coupled slave axis used, the only available buffer mode is Aborting.
A second function block is required to use the buffer mode. It is not possible to trigger a move block with new parameters while it is active.
Options
The data structure option includes additional, rarely required parameters. The input can normally remain open.
General rules for MC function blocks
Outputs
VAR_OUTPUT
Done           : BOOL;
Busy           : BOOL;
Active         : BOOL;
CommandAborted : BOOL;
Error          : BOOL;
ErrorID        : UDINT;
END_VAR
Done
The Done output becomes TRUE once the target position was reached.
Busy
The Busy output becomes TRUE when the command is started with Execute and remains TRUE as long as the movement command is processed. If Busy becomes FALSE again, the function block is ready for a new job. At the same time one of the outputs, Done, CommandAbortedor Error, is set.
Active
Active indicates that the command is executed If the command was queued, it becomes active once a running command is completed.
CommandAborted
Becomes TRUE, if the command could not be fully executed. The axis may have been stopped, or the running command may have been followed by a further Move command.
Error
Becomes TRUE if an error occurs.
ErrorID
If the error output is set, this parameter supplies the error number.
General rules for MC function blocks
Inputs/outputs
VAR_IN_OUT
Axis    : AXIS_REF;
END_VAR
Axis
Axis data structure
The axis data structure of type AXIS_REF addresses an axis uniquely within the system. Among other parameters it contains the current axis status, including position, velocity or error status.
MC_MoveRelative
MC_MoveRelative starts a relative positioning procedure based on the current set position and monitors the axis movement over the whole travel path. The Done output is set once the target position has been reached. Otherwise the CommandAborted or, on error, the Error output is set.
Notice: Travel commands can be applied to coupled slave axes, if this option was explicitly activated in the axis parameters. Travel commands can be applied to coupled slave axes, if this option was explicitly activated in the axis parameters. In this case only Buffer-ModeAborting is possible.
Inputs
VAR_INPUT
Execute      : BOOL;
Distance     : LREAL;
Velocity     : LREAL;
Acceleration : LREAL;
Deceleration : LREAL;
Jerk         : LREAL;
BufferMode   : MC_BufferMode;
Options      : ST_MoveOptions;
END_VAR
Execute
The command is executed with a rising edge at input Execute.
Distance
Relative distance to be used for positioning.
Velocity
Maximum travel velocity (>0).
Acceleration
Acceleration (≥0). If the value is 0, the standard acceleration from the axis configuration in the System Manager is used.
Deceleration
Deceleration (≥0). If the value is 0, the standard deceleration from the axis configuration in the System Manager is used.
Jerk
Jerk (≥0). If the value is 0, the standard jerk from the axis configuration in the System Manager is used.
BufferMode
The BufferMode is analyzed, if the axis is already executing another command. The running command can be aborted, or the new command becomes active after the running command. The BufferMode also determines the transition condition from the current to the next command.
If the command is applied to a coupled slave axis used, the only available buffer mode is Aborting.
A second function block is required to use the buffer mode. It is not possible to trigger a move block with new parameters while it is active.
Options
The data structure option includes additional, rarely required parameters. The input can normally remain open.
General rules for MC function blocks
Outputs
VAR_OUTPUT
Done           : BOOL;
Busy           : BOOL;
Active         : BOOL;
CommandAborted : BOOL;
Error          : BOOL;
ErrorID        : UDINT;
END_VAR
Done
The Done output becomes TRUE once the target position was reached.
Busy
The Busy output becomes TRUE when the command is started with Execute and remains TRUE as long as the movement command is processed. If Busy becomes FALSE again, the function block is ready for a new job. At the same time one of the outputs, Done, CommandAbortedor Error, is set.
Active
Active indicates that the command is executed If the command was queued, it becomes active once a running command is completed.
CommandAborted
Becomes TRUE, if the command could not be fully executed. The axis may have been stopped, or the running command may have been followed by a further Move command.
Error
Becomes TRUE if an error occurs.
ErrorID
If the error output is set, this parameter supplies the error number.
General rules for MC function blocks
Inputs/outputs
VAR_IN_OUT
Axis    : AXIS_REF;
END_VAR
Axis
Axis data structure
The axis data structure of type AXIS_REF addresses an axis uniquely within the system. Among other parameters it contains the current axis status, including position, velocity or error status.
MC_MoveAdditive
MC_MoveAdditive starts relative positioning procedure based on the last target position instruction, irrespective of whether this was reached. The Done output is set once the target position has been reached. Otherwise the CommandAborted or, on error, the Error output is set.
If no last target position is known or the axis is moving continuously, the movement is executed based on the current set position for the axis.
Inputs
VAR_INPUT
Execute      : BOOL;
Distance     : LREAL;
Velocity     : LREAL;
Acceleration : LREAL;
Deceleration : LREAL;
Jerk         : LREAL;
BufferMode   : MC_BufferMode;
Options      : ST_MoveOptions;
END_VAR
Execute
The command is executed with a rising edge at input Execute.
Distance
Relative distance to be used for positioning.
Velocity
Maximum travel velocity (>0).
Acceleration
Acceleration (≥0). If the value is 0, the standard acceleration from the axis configuration in the System Manager is used.
Deceleration
Deceleration (≥0). If the value is 0, the standard deceleration from the axis configuration in the System Manager is used.
Jerk
Jerk (≥0). If the value is 0, the standard jerk from the axis configuration in the System Manager is used.
BufferMode
The BufferMode is analyzed, if the axis is already executing another command. The running command can be aborted, or the new command becomes active after the running command. The BufferMode also determines the transition condition from the current to the next command.
A second function block is required to use the buffer mode. It is not possible to trigger a move block with new parameters while it is active.
Options
The data structure option includes additional, rarely required parameters. The input can normally remain open.
General rules for MC function blocks
Outputs
VAR_OUTPUT
Done           : BOOL;
Busy           : BOOL;
Active         : BOOL;
CommandAborted : BOOL;
Error          : BOOL;
ErrorID        : UDINT;
END_VAR
Done
The Done output becomes TRUE once the target position was reached.
Busy
The Busy output becomes TRUE when the command is started with Execute and remains TRUE as long as the movement command is processed. If Busy becomes FALSE again, the function block is ready for a new job. At the same time one of the outputs, Done, CommandAbortedor Error, is set.
Active
Active indicates that the command is executed If the command was queued, it becomes active once a running command is completed.
CommandAborted
Becomes TRUE, if the command could not be fully executed. The axis may have been stopped, or the running command may have been followed by a further Move command.
Error
Becomes TRUE if an error occurs.
ErrorID
If the error output is set, this parameter supplies the error number.
General rules for MC function blocks
Inputs/outputs
VAR_IN_OUT
Axis    : AXIS_REF;
END_VAR
Axis
Axis data structure
The axis data structure of type AXIS_REF addresses an axis uniquely within the system. Among other parameters it contains the current axis status, including position, velocity or error status.
Notes
MC_MoveAdditive is not implemented for fast/slow speed axes.
《7777》
MC_MoveModulo
The MC_MoveModulo function block carries out a positioning referenced to the modulo position of an axis. Modulo rotation is based on the adjustable axis parameter modulo factor (e.g.360°). A distinction is made between three possible start types, depending on the Direction input.
Positioning in positive direction
Positioning in negative direction
Positioning along shortest path
Travel commands can be applied to coupled slave axes, if this option was explicitly activated in the axis parameters. A motion command such as MC_MoveModulo then automatically leads to uncoupling of the axis, after which the command is executed. In this case only Buffer-ModeAborting is possible.
Starting an axis from standstill
If an axis is started from standstill with MC_MoveModulo , it is possible to specify positions greater than or equal to360°, in order to perform additional full turns. The same applies to a start with the BufferModeMC_Buffered.
Starting an axis during motion
If an axis is already in motion, certain special considerations apply. The direction of movement cannot be reversed by MC_MoveModulo, i.e. the target can only be reached in the current direction. The user is not able to specify the number of additional turns. The system automatically calculates how the axis can be moved to the target position on the shortest possible path.
The error output must be analyzed, because under certain conditions an oriented stop is not possible. For example, a standard stop may have been triggered just before, or an oriented stop would cause an active software limit switch to be exceeded. For all fault conditions, the axis is stopped safely, but it may subsequently not be at the required oriented position.
Special cases
Special attention must be paid to the behavior when one or more complete modulo rotations are requested. If the axis is located at an exact set position, such as 90 degrees, and if positioning to 90 degrees is required, no movement is carried out. If required to turn 450 degrees in a positive direction, it will perform just one rotation. The behavior can be different following an axis reset, because the reset will cause the current actual position to be adopted as the set position. The axis will then no longer be exactly at 90 degrees, but will be a little under or over. These cases will give rise either to a minimum positioning to 90 degrees, or on the other hand a complete rotation. For further details please refer to the Commentary section.
Depending on the particular case, it may be more effective for complete modulo rotations to calculate the desired target position on the basis of the current absolute position, and then to position using the MC_MoveAbsolute block.
Notice: Modulo positioning and absolute positioning are available for all axes, irrespective of the Modulo setting in the TwinCAT System Manager. For each axis, the current absolute position SetPos can be read from the cyclic axis interface data type NCTOPLC_AXIS_REF.
Important: Further information on modulo movements
Inputs
VAR_INPUT
Execute       : BOOL;
Position      : LREAL;
Velocity      : LREAL;
Acceleration : LREAL;
Deceleration : LREAL;
Jerk    : LREAL;
Direction : MC_Direction;
BufferMode : MC_BufferMode;
Options       : ST_MoveOptions;
END_VAR
MC_BufferMode MC_Direction
Execute
The command is executed with a rising edge at input Execute.
Position
Modulo target position to be used for positioning.
If the axis is started from standstill, positions greater than360° result in additional turns. Negative positions are not permitted.
Velocity
Maximum travel velocity (>0).
Acceleration
Acceleration (≥0). If the value is 0, the standard acceleration from the axis configuration in the System Manager is used.
Deceleration
Deceleration (≥0). If the value is 0, the standard deceleration from the axis configuration in the System Manager is used.
Jerk
Jerk (≥0). If the value is 0, the standard jerk from the axis configuration in the System Manager is used.
Direction
Positive or negative direction of travel of type MC_Direction.
If the axis is started during a motion, the direction may not be reversed.
BufferMode
The BufferMode is analyzed, if the axis is already executing another command. The running command can be aborted, or the new command becomes active after the running command. The BufferMode also determines the transition condition from the current to the next command.
A second function block is required to use the buffer mode. It is not possible to trigger a move block with new parameters while it is active.
Options
The data structure option includes additional, rarely required parameters. The input can normally remain open.
General rules for MC function blocks
Outputs
VAR_OUTPUT
Done    : BOOL;
Busy    : BOOL;
Active    : BOOL;
CommandAborted : BOOL;
Error    : BOOL;
ErrorID       : UDINT;
END_VAR
Done
The Done output becomes TRUE once the target position was reached.
Busy
The Busy output becomes TRUE when the command is started with Execute and remains TRUE as long as the movement command is processed. If Busy becomes FALSE again, the function block is ready for a new job. At the same time one of the outputs, Done, CommandAbortedor Error, is set.
Active
Active indicates that the command is executed If the command was queued, it becomes active once a running command is completed.
CommandAborted
Becomes TRUE, if the command could not be fully executed. The axis may have been stopped, or the running command may have been followed by a further Move command.
Error
Becomes TRUE if an error occurs.
ErrorID
If the error output is set, this parameter supplies the error number.
General rules for MC function blocks
Inputs/outputs
VAR_IN_OUT
Axis    : AXIS_REF;
END_VAR
AXIS_REF
Axis
Axis data structure
The axis data structure of type AXIS_REF addresses an axis uniquely within the system. Among other parameters it contains the current axis status, including position, velocity or error status.
Notes on modulo positioning
Modulo positioning (MC_MoveModulo) is possible irrespective of the axis type. If may be used both for linear or rotary axes, because TwinCAT makes no distinction between these types. A modulo axis has a consecutive absolute position in the range ±∞. The modulo position of the axis is simply a piece of additional information about the absolute axis position. Modulo positioning represents the required target position in a different way. Unlike absolute positioning, where the user specifies the target unambiguously, modulo positioning has potential pitfalls, because the required target position may be interpreted in different ways.
Settings in the TwinCAT System Manager
Modulo positioning refers to a modulo period that can be set in the TwinCAT System Manager. The examples on this page assume a rotary axis with a modulo period of360degrees.
The modulo tolerance window defines a position window around the current modulo set position of the axis. The window width is twice the specified value (set position ± tolerance value). A detailed description of the tolerance window is provided below.
Special features of axis resets
Axis positioning always refers to the set position. The set position of an axis is normally the target position of the last travel command. An axis reset (MC_Reset, controller activation with MC_Power) can lead to a set position that is different from that expected by the user, because in this case the current actual position is used as the set position. The axis reset will reset any following error that may have occurred. If this possibility is not considered, subsequent positioning may lead to unexpected behavior.
Example: An axis is positioned to 90°, with the result that subsequently the set position of the axis is exactly 90°. A further modulo travel command to 450° in positive direction results in a full turn, with the subsequent modulo position of the axis of once again being exactly 90°. If an axis reset is carried out at this stage, the set position may happen to be somewhat smaller or greater. The new value depends on the actual value of the axis at the time of the reset. However, the next travel command will lead to different results. If the set position is slightly less than 90°, a new travel command to 90° in positive direction only leads to minimum motion. The deviation created by the reset is compensated, and the subsequent set position is once again exactly 90°. However, if the set position after the axis reset is slightly more than 90°, the same travel command leads to a full turn to reach the exact set position of 90°. This problem occurs if complete turns by360° or multiples of360° were initiated. For positioning to an angle that is significantly different from the current modulo position, the travel command is unambiguous.
To solve the problem, a modulo tolerance window can be parameterized in the TwinCAT system manager. This ensures that small deviations from the position that are within the window do not lead to different axis behavior. If, for example, a window of 1° is parameterized, in the case described above the axis will behave identically, as long the set position is between 89° and 91°. If the set position exceeds 90° by less than 1°, the axis is re-positioned in positive direction at a modulo start. In both cases, a target position of 90° therefore leads to minimum movement to exactly 90°. A target position of 450° leads to a full turn in both cases.
Figure: Effect of the modulo tolerance window - modulo target position 90° in positive direction
For values that are within the window range, the modulo tolerance window can therefore lead to movements against the specified direction. For small windows this is usually not a problem, because system deviations between set and actual position are compensated in both directions. This means that the tolerance window may also be used for axes that may only be moved in one direction due to their construction.
Modulo positioning by less than one turn
Modulo positioning from a starting position to a non-identical target position is unambiguous and requires no special consideration. A modulo target position in the range [0 ≤; position <360] reaches the required target in less than one whole turn. No motion occurs if target position and starting position are identical. Target positions of more than360degrees lead to one or more full turns before the axis travels to the required target position.
For a movement from 270° to 0°, a modulo target position of 0° (not360°) should therefore be specified, because360is outside the basic range and would lead to an additional turn.
For modulo positioning, a distinction is made between three different directions, i.e. positive direction, negative direction and along shortest path (MC_Direction). For positioning along the shortest path, target positions of more than360° are not sensible, because the movement towards the target is always direct. In contrast to positive or negative direction, it is therefore not possible to carry out several turns before the axis moves to the target.
Important: For modulo positioning with start type along shortest path , only modulo target positions within the basic period (e.g. less than360°) are permitted, otherwise an error is returned.
The following table shows some positioning examples:
Direction
(modulo start type)
Absolute start position
Modulo target position
Relative travel path
Absolute end position
Modulo end position
positive direction
90.00
0.00
270.00
360.00
0.00
positive direction
90.00
360.00
630.00
720.00
0.00
positive direction
90.00
720.00
990.00
1080.00
0.00
negative direction
90.00
0.00
-90.00
0.00
0.00
negative direction
90.00
360.00
-450.00
-360.00
0.00
negative direction
90.00
720.00
-810.00
-720.00
0.00
along shortest path
90.00
0.00
-90.00
0.00
0.00
Modulo positioning with full turns
In principle, modulo positioning by one or full turns are no different than positioning to an angle that differs from the starting position. No motion occurs if target position and starting position are identical. For a full turn,360° has to be added to the starting position.
The reset behavior described above shows that positioning with full turns requires particular attention. The following table shows positioning examples for a starting position of approximately 90°. The modulo tolerance window (TW) is set to 1°. Special cases for which the starting position is outside this window are identified.
Direction
(modulo start type)
Absolute start position
Modulo target position
Relative travel path
Absolute end position
Modulo end position
Note
positive direction
90.00
90.00
0.00
90.00
90.00
positive direction
90.90
90.00
-0.90
90.00
90.00
positive direction
91.10
90.00
358.90
450.00
90.00
outside TF
positive direction
89.10
90.00
0.90
90.00
90.00
positive direction
88.90
90.00
1.10
90.00
90.00
outside TF
positive direction
90.00
450.00
360.00
450.00
90.00
positive direction
90.90
450.00
359.10
450.00
90.00
positive direction
91.10
450.00
718.90
810.00
90.00
outside TF
positive direction
89.10
450.00
360.90
450.00
90.00
positive direction
88.90
450.00
361.10
450.00
90.00
outside TF
positive direction
90.00
810.00
720.00
810.00
90.00
positive direction
90.90
810.00
719.10
810.00
90.00
positive direction
91.10
810.00
1078.90
1170.00
90.00
outside TF
positive direction
89.10
810.00
720.90
810.00
90.00
positive direction
88.90
810.00
721.10
810.00
90.00
outside TF
negative direction
90.00
90.00
0.00
90.00
90.00
negative direction
90.90
90.00
-0.90
90.00
90.00
negative direction
91.10
90.00
-1.10
90.00
90.00
outside TF
negative direction
89.10
90.00
0.90
90.00
90.00
negative direction
88.90
90.00
-358.90
-270.00
90.00
outside TF
negative direction
90.00
450.00
-360.00
-270.00
90.00
negative direction
90.90
450.00
-360.90
-270.00
90.00
negative direction
91.10
450.00
-361.10
-270.00
90.00
outside TF
negative direction
89.10
450.00
-359.10
-270.00
90.00
negative direction
88.90
450.00
-718.90
-630.00
90.00
outside TF
negative direction
90.00
810.00
-720.00
-630.00
90.00
negative direction
90.90
810.00
-720.90
-630.00
90.00
negative direction
91.10
810.00
-721.10
-630.00
90.00
outside TF
negative direction
89.10
810.00
-719.10
-630.00
90.00
negative direction
88.90
810.00
-1078.90
-990.00
90.00
outside TF
Modulo calculations within the PLC program
In TwinCAT NC, all axis positioning tasks are executed based on the set position. The current actual position is only used for control purposes. If a PLC program is to calculate a new target position based on the current position, the current set position of the axis has to be used in the calculation (Axis.NcToPlc.ModuloSetPos and Axis.NcToPlc.ModuloSetTurns).
It is not recommended to perform order calculations on basis of the modulo actual position available in the cyclic axis interface (ModuloActPos and ModuloActTurns). Due to the larger or smaller control deviation of the axis, errors can occur in the programmed sequence, such as unwanted rotations.
Application example
Within a system, a rotational axis carries out an operation. The starting position for each operation is 90°, and with each cycle the axis is to be positioned by360° in positive direction. Reverse positioning is not permitted for mechanical reasons. Small reverse positioning is acceptable as part of position control movements.
The modulo tolerance window is set to 1.5° in the System Manager. This ensures that undesirable axis turns after an axis reset are avoided. Since the axis may only be positioned in positive direction, the command MC_MoveModulo with modulo start type positive direction (MC_Positive_Direction) is used. The modulo target position is specified as 450°, since the original orientation is to be reached again after a full turn by360°. A modulo target position of 90° would not lead to any motion.
The process starts with a basic positioning movement (MC_MoveModulo) to ensure that the starting position is accurate. The step sequence then changes into an execution cycle. In the event of a fault, the axis is reset with MC_Reset and subsequently (at the start of the step sequence) moved to its valid starting position. In this case, 90° is specified as the target position to enable this position to be reached as quickly as possible. No motion occurs if the axis is already at the starting position.
Alternatively, the reset step may be carried out at the start of the step sequence, so that the axis is initialized at the start of the process.
《8888》
MC_MoveVelocity
MC_MoveVelocity starts a continuous movement with specified velocity and direction. The movement can be stopped through a Stop command.
The InVelocity output is set once the constant velocity is reached. Once constant velocity has been reached, the block function is complete, and no further monitoring of the movement takes place. If the command is aborted during the acceleration phase, the CommandAborted or, on error, the Error output is set.
Notice: Travel commands can be applied to coupled slave axes, if this option was explicitly activated in the axis parameters. Travel commands can be applied to coupled slave axes, if this option was explicitly activated in the axis parameters. In this case only Buffer-ModeAborting is possible.
Inputs
VAR_INPUT
Execute       : BOOL; (* B *)
Velocity      : LREAL; (* E *)
Acceleration : LREAL; (* E *)
Deceleration : LREAL; (* E *)
Jerk    : LREAL; (* E *)
Direction : MC_Direction := MC_Positive_Direction; (* E *)
BufferMode : MC_BufferMode; (* E *)
Options       : ST_MoveOptions; (* V *)
END_VAR
MC_BufferMode MC_Direction
Execute
The command is executed with a rising edge at input Execute.
Velocity
Maximum travel speed (>0).
Acceleration
Acceleration (≥0). If the value is 0, the standard acceleration from the axis configuration in the System Manager is used.
Deceleration
Deceleration (≥0). If the value is 0, the standard deceleration from the axis configuration in the System Manager is used.
Jerk
Jerk (≥0). If the value is 0, the standard jerk from the axis configuration in the System Manager is used.
Direction
positive or negative direction of travel of type MC_Direction.
BufferMode
The BufferMode is analyzed, if the axis is already executing another command. The running command can be aborted, or the new command becomes active after the running command. The BufferMode also determines the transition condition from the current to the next command.
If the command is applied to a coupled slave axis used, the only available buffer mode is Aborting.
A second function block is required to use the buffer mode. It is not possible to trigger a move block with new parameters while it is active.
Options
The data structure option includes additional, rarely required parameters. The input can normally remain open.
General rules for MC function blocks
Outputs
VAR_OUTPUT
InVelocity : BOOL; (* B *)
Busy    : BOOL; (* E *)
Active    : BOOL; (* E *)
CommandAborted : BOOL; (* E *)
Error    : BOOL; (* B *)
ErrorID       : UDINT; (* E *)
END_VAR
InVelocity
The output InVelocity becomes TRUE, as soon as the constant speed is reached. It may switch back to FALSE, if the speed differs.
The function block remains Busy and Active until a new command is issued.
Busy
The Busy output becomes TRUE when the command is started with Execute and remains TRUE as long as the block is active. If Busy becomes FALSE again, the function block is ready for a new job. At the same time one of the outputs CommandAborted or Error is set.
Active
Active indicates that the command is executed If the command was queued, it becomes active once a running command is completed.
CommandAborted
Becomes TRUE, if the command could not be fully executed. The axis may have been stopped, or the running command may have been followed by a further Move command.
Error
Becomes TRUE if an error occurs.
ErrorID
If the error output is set, this parameter supplies the error number.
General rules for MC function blocks
Inputs/outputs
VAR_IN_OUT
Axis    : AXIS_REF;
END_VAR
AXIS_REF
Axis
Axis data structure
The axis data structure of type AXIS_REF addresses an axis uniquely within the system. Among other parameters it contains the current axis status, including position, velocity or error status.
MC_MoveContinuousAbsolute
MC_MoveContinuousAbsolute starts positioning to an absolute target position and monitors the axis movement over the whole travel path. At the target position a constant end velocity is reached, which is maintained. The InEndVelocity output is set once the target position was reached. Otherwise the CommandAborted or, on error, the Error output is set.
Once the target position has been reached, the block function is complete and the axis is no longer monitored.
Inputs
VAR_INPUT
Execute       : BOOL;
Position      : LREAL;
Velocity      : LREAL;
EndVelocity : LREAL;
Acceleration : LREAL;
Deceleration : LREAL;
Jerk    : LREAL;
BufferMode : MC_BufferMode;
Options       : ST_MoveOptions;
END_VAR
MC_BufferMode
Execute
The command is executed with a rising edge at input Execute.
Position
Absolute target position
Velocity
Maximum velocity for the movement to the target position (>0).
EndVelocity
End velocity to be maintained once the target position has been reached.
Acceleration
Acceleration (≥0). If the value is 0, the standard acceleration from the axis configuration in the System Manager is used.
Deceleration
Deceleration (≥0). If the value is 0, the standard deceleration from the axis configuration in the System Manager is used.
Jerk
Jerk (≥0). If the value is 0, the standard jerk from the axis configuration in the System Manager is used.
BufferMode
The BufferMode is analyzed, if the axis is already executing another command. The running command can be aborted, or the new command becomes active after the running command. The BufferMode also determines the transition condition from the current to the next command.
A second function block is required to use the buffer mode. It is not possible to trigger a move block with new parameters while it is active.
Options
The data structure option includes additional, rarely required parameters. The input can normally remain open.
General rules for MC function blocks
Outputs
VAR_OUTPUT
InEndVelocity : BOOL;
Busy    : BOOL;
Active    : BOOL;
CommandAborted : BOOL;
Error    : BOOL;
ErrorID       : UDINT;
END_VAR
InEndVelocity
The InEndVelocity output becomes TRUE once the target position was reached.
Busy
The Busy output becomes TRUE when the command is started with Execute and remains TRUE as long as the movement command is processed. If Busy becomes FALSE again, the function block is ready for a new job. At the same time one of the outputs, Done, CommandAbortedor Error, is set.
Active
Active indicates that the command is executed If the command was queued, it becomes active once a running command is completed.
CommandAborted
Becomes TRUE, if the command could not be fully executed. The axis may have been stopped, or the running command may have been followed by a further Move command.
Error
Becomes TRUE if an error occurs.
ErrorID
If the error output is set, this parameter supplies the error number.
General rules for MC function blocks
Inputs/outputs
VAR_IN_OUT
Axis    : AXIS_REF;
END_VAR
AXIS_REF
Axis
Axis data structure
The axis data structure of type AXIS_REF addresses an axis uniquely within the system. Among other parameters it contains the current axis status, including position, velocity or error status.
Notes
MC_MoveContinuousAbsolute is not implemented for fast/slow axes.
MC_MoveContinuousRelative
MC_MoveContinuousRelative starts positioning by a relative distance and monitors the axis movement over the whole travel path. At the target position a constant end velocity is reached, which is maintained. The InEndVelocity output is set once the target position was reached. Otherwise the CommandAborted or, on error, the Error output is set.
Once the target position has been reached, the block function is complete and the axis is no longer monitored.
Inputs
VAR_INPUT
Execute       : BOOL;
Distance      : LREAL;
Velocity      : LREAL;
EndVelocity : LREAL;
Acceleration : LREAL;
Deceleration : LREAL;
Jerk    : LREAL;
BufferMode : MC_BufferMode;
Options       : ST_MoveOptions;
END_VAR
MC_BufferMode
Execute
The command is executed with a rising edge at input Execute.
Distance
Relative distance to be used for positioning.
Velocity
Maximum velocity for the movement over the distance (>0).
EndVelocity
End velocity to be maintained after the relative distance
Acceleration
Acceleration (≥0). If the value is 0, the standard acceleration from the axis configuration in the System Manager is used.
Deceleration
Deceleration (≥0). If the value is 0, the standard deceleration from the axis configuration in the System Manager is used.
Jerk
Jerk (≥0). If the value is 0, the standard jerk from the axis configuration in the System Manager is used.
BufferMode
The BufferMode is analyzed, if the axis is already executing another command. The running command can be aborted, or the new command becomes active after the running command. The BufferMode also determines the transition condition from the current to the next command.
A second function block is required to use the buffer mode. It is not possible to trigger a move block with new parameters while it is active.
Options
The data structure option includes additional, rarely required parameters. The input can normally remain open.
General rules for MC function blocks
Outputs
VAR_OUTPUT
InEndVelocity : BOOL;
Busy    : BOOL;
Active    : BOOL;
CommandAborted : BOOL;
Error    : BOOL;
ErrorID       : UDINT;
END_VAR
InEndVelocity
The InEndVelocity output becomes TRUE once the target position was reached.
Busy
The Busy output becomes TRUE when the command is started with Execute and remains TRUE as long as the movement command is processed. If Busy becomes FALSE again, the function block is ready for a new job. At the same time one of the outputs, Done, CommandAbortedor Error, is set.
Active
Active indicates that the command is executed If the command was queued, it becomes active once a running command is completed.
CommandAborted
Becomes TRUE, if the command could not be fully executed. The axis may have been stopped, or the running command may have been followed by a further Move command.
Error
Becomes TRUE if an error occurs.
ErrorID
If the error output is set, this parameter supplies the error number.
General rules for MC function blocks
Inputs/outputs
VAR_IN_OUT
Axis    : AXIS_REF;
END_VAR
AXIS_REF
Axis
Axis data structure
The axis data structure of type AXIS_REF addresses an axis uniquely within the system. Among other parameters it contains the current axis status, including position, velocity or error status.
Notes
MC_MoveContinuousRelative is not implemented for fast/slow axes.
MC_Halt
MC_Halt stops an axis with a defined braking ramp.
In contrast to MC_Stop, the axis is not locked against further movement commands. The axis can therefore be restarted through a further command during the braking ramp or after it has come to a halt.
Travel commands can be applied to coupled slave axes, if this option was explicitly activated in the axis parameters. A motion command such as MC_Halt then automatically leads to uncoupling of the axis, after which the command is executed. In this case only Buffer-ModeAborting is possible.
Inputs
VAR_INPUT
Execute       : BOOL;
Deceleration : LREAL;
Jerk    : LREAL;
BufferMode : MC_BufferMode;
Options       : ST_MoveOptions;
END_VAR
MC_BufferMode
Execute
The command is executed with a rising edge at input Execute.
Deceleration
Deceleration (≥0). If the value is 0, the deceleration parameterized with the last Move command is used.
For safety reasons MC_Halt and MC_Stop cannot be executed with weaker dynamics than the currently active travel command. The parameterization is adjusted automatically, if necessary.
Jerk
Jerk (≥0). If the value is 0, the jerk parameterized with the last Move command is used.
For safety reasons MC_Halt and MC_Stop cannot be executed with weaker dynamics than the currently active travel command. The parameterization is adjusted automatically, if necessary.
BufferMode
The BufferMode is analyzed, if the axis is already executing another command. The running command can be aborted, or the new command becomes active after the running command. The BufferMode also determines the transition condition from the current to the next command.
If the command is applied to a coupled slave axis used, the only available buffer mode is Aborting.
Special characteristics of MC_Halt: The MC_buffer mode has no effect, if the command is executed when the system is at a standstill. The blending modes MC_BlendingNextand MC_BlendingLow do not change the last target position, although they can result in a change in dynamics (deceleration) of the stop ramp. The modes MC_BlendingPrevious and MC_BlendingHigh extend the travel to the original target position. The stop ramp is only initiated when this position is reached (defined braking point).
Options
Currently not implemented - The data structure option includes additional, rarely required parameters. The input can normally remain open.
General rules for MC function blocks
Outputs
VAR_OUTPUT
Done    : BOOL;
Busy    : BOOL;
Active    : BOOL;
CommandAborted : BOOL;
Error    : BOOL;
ErrorID       : UDINT;
END_VAR
Done
The Done output becomes TRUE, if the axis was stopped and has come to a standstill.
Busy
The Busy output becomes TRUE when the command is started with Execute and remains TRUE as long as the command is processed. If Busy becomes FALSE again, the function block is ready for a new job. At the same time one of the outputs, Done, CommandAborted or Error, is set.
Active
Active indicates that the command is executed If the command was queued, it becomes active once a running command is completed.
CommandAborted
Becomes TRUE, if the command could not be fully executed. The running command may have been followed by a Move command.
Error
Becomes TRUE if an error occurs.
ErrorID
If the error output is set, this parameter supplies the error number.
General rules for MC function blocks
Inputs/outputs
VAR_IN_OUT
Axis    : AXIS_REF;
END_VAR
AXIS_REF
Axis
Axis data structure
The axis data structure of type AXIS_REF addresses an axis uniquely within the system. Among other parameters it contains the current axis status, including position, velocity or error status.
《9999》
MC_Stop
MC_Stop stops an axis with a defined braking ramp and locks it against other travel commands. The block is therefore suitable for stops in special situations, in which further axis movements are to be prevented.
NOTICE! At the same time the axis is blocked for other motion commands. The axis can only be restarted once the Execute signal has been set to FALSE after the axis has stopped. A few cycles are required to release the axis after a falling edge of Execute. During this phase the Busy output remains TRUE, and the function block has to be called until Busy becomes FALSE.
NOTICE! The locking of the axis is cancelled with an MC_Reset
Alternatively, the axis can be stopped with MC_Halt without locking. MC_Halt is preferable for normal movements.
Travel commands can be applied to coupled slave axes, if this option was explicitly activated in the axis parameters. A motion command such as MC_Stop then automatically leads to uncoupling of the axis, after which the command is executed.
Inputs
VAR_INPUT
Execute       : BOOL;
Deceleration : LREAL;
Jerk    : LREAL;
Options       : ST_MoveOptions;
END_VAR
Execute
The command is executed with a rising edge at input Execute.
The axis is locked during the stop. The axis can only be restarted once the Execute signal has been set to FALSE after the axis has stopped.
Deceleration
Deceleration (≥0). If the value is 0, the deceleration parameterized with the last Move command is used.
For safety reasons MC_Stop and MC_Halt cannot be executed with weaker dynamics than the currently active travel command. The parameterization is adjusted automatically, if necessary.
Jerk
Jerk (≥0). If the value is 0, the jerk parameterized with the last Move command is used.
For safety reasons MC_Stop and MC_Halt cannot be executed with weaker dynamics than the currently active travel command. The parameterization is adjusted automatically, if necessary.
Options
Currently not implemented - The data structure option includes additional, rarely required parameters. The input can normally remain open.
General rules for MC function blocks
Outputs
VAR_OUTPUT
Done    : BOOL;
Busy    : BOOL;
Active    : BOOL;
CommandAborted : BOOL;
Error    : BOOL;
ErrorID       : UDINT;
END_VAR
Done
The Done output becomes TRUE, if the axis was stopped and has come to a standstill.
Busy
The Busy output becomes TRUE when the command is started with Execute and remains TRUE as long as the command is processed. If Busy becomes FALSE again, the function block is ready for a new job.
Attention: Busy remains TRUE as long as the axis is locked. The axis is only unlocked and Busy becomes FALSE when Execute is set to FALSE.
Active
Active indicates that the function block controls the axis.
Attention: Active remains TRUE as long as the axis is locked. The axis is only unlocked and Busy becomes FALSE when Active is set to FALSE.
CommandAborted
Becomes TRUE, if the command could not be fully executed.
Error
Becomes TRUE if an error occurs.
ErrorID
If the error output is set, this parameter supplies the error number.
General rules for MC function blocks
Inputs/outputs
VAR_IN_OUT
Axis    : AXIS_REF;
END_VAR
AXIS_REF
Axis
Axis data structure
The axis data structure of type AXIS_REF addresses an axis uniquely within the system. Among other parameters it contains the current axis status, including position, velocity or error status.
MC_MoveSuperimposed
MC_MoveSuperimposed starts a relative superimposed movement while the axis is already moving. The current movement is not interrupted. The Done output is set once the superimposed movement is completed. The original subordinate movement may continue to be active and is monitored by the associated Move function block.
The superposition function becomes clear, if one considers two axes moving at the same speed. If one of the axes is superimposed by MC_MoveSuperimposed, it will precede or follow the other axis as determined by the Distance parameter. Once the superimposed movement is completed, the Distance between the two axes is maintained.
MC_MoveSuperimposed can be applied to single axes, master axes or slave axes. For a slave axis the superimposed movement only affects the slave axis. If the function is used for a master axis, the slave will follow the superimposed movement of the due master due to the axis coupling.
Since MC_MoveSuperimposed executes a relative superimposed movement, the target position for the subordinate travel command changes by Distance.
The superimposed movement depends on the position of the main movement. This means that a velocity change of the main movement also results in a velocity change in the superimposed movement, and that the superimposed movement is inactive if the main movement stops. The Options parameter can be used to specify whether the superimposed movement is to be aborted or continued if the main movement stops.
Application examples for MC_MoveSuperimposed
Inputs
VAR_INPUT
Execute       : BOOL; (* B *)
Mode    : E_SuperpositionMode;
Distance      : LREAL; (* B *)
VelocityDiff : LREAL; (* E *)
Acceleration : LREAL; (* E *)
Deceleration : LREAL; (* E *)
Jerk    : LREAL; (* E *)
VelocityProcess    : LREAL; (* V *)
Length    : LREAL; (* V *)
Options    : ST_SuperpositionOptions; (* V *)
END_VAR
ST_SuperpositionOptions E_SuperpositionMode
Execute
The command is executed with a rising edge at input Execute.
Mode
Mode determines the type of the superimposed motion.
Distance
Relative distance to catch up. A positive value means increase in velocity by an amount required to cover the additional distance, compared with the unaffected movement. A negative value results in braking and falling back by this distance.
VelocityDiff
Maximum velocity difference to the current velocity (basic velocity) of the axis (>0).
For this parameter a distinction may have to be made, depending on the superimposition direction (acceleration or deceleration). If, for example, a direction reversal is not permitted, the maximum available acceleration corresponds to the maximum velocity, and the maximum deceleration to stop. Therefore, there are two possible maximum values for VelocityDiff:
1. 1. Distance > 0 (axis accelerates)
VelocityDiff = maximum speed - basic speed
2. Distance > 0 (axis decelerates)
VelocityDiff = basic speed
Acceleration
Acceleration (≥0). If the value is 0, the standard acceleration from the axis configuration in the System Manager is used.
Deceleration
Deceleration (≥0). If the value is 0, the standard deceleration from the axis configuration in the System Manager is used.
Jerk
Jerk (≥0). If the value is 0, the standard jerk from the axis configuration in the System Manager is used.
VelocityProcess :
Mean process speed in the axis (>0).If the basic velocity during superposition is constant, the set axis velocity can be specified.
Length
Distance over which the superimposed movement is available. The Modeparameter defines how this distance is interpreted.
Options
The data structure option includes additional, rarely required parameters. The input can normally remain open.
Options.
AbortOption
AbortOption defines the behavior when the subordinate movement stops. The superimposed movement can be aborted or continued later.
General rules for MC function blocks
Outputs
VAR_OUTPUT
Done    : BOOL;
Busy    : BOOL;
Active    : BOOL;
CommandAborted : BOOL;
Error    : BOOL;
ErrorID       : UDINT;
Warning       : BOOL;
WarningID : UDINT;
ActualVelocityDiff : LREAL;
ActualDistance : LREAL;
ActualLength : LREAL;
ActualAcceleration : LREAL;
ActualDeceleration : LREAL;
END_VAR
Done
The Done output becomes TRUE, once the superimposed movement was completed successfully.
Busy
The Busy output becomes TRUE when the command is started with Execute and remains TRUE as long as the movement command is processed. If Busy becomes FALSE again, the function block is ready for a new job. At the same time one of the outputs, Done, CommandAbortedor Error, is set.
Active
Active indicates that the command is executed
CommandAborted
Becomes TRUE, if the command was aborted by another command and could therefore not be completed.
Error
Becomes TRUE if an error occurs.
ErrorID
If the error output is set, this parameter supplies the error number.
Warning
Warning becomes TRUE if the action cannot be executed completely.
WarningID
The block returns warning 4243hex (16963) if the compensation was incomplete due to the parameterization (distance, velocity, etc.). In this case compensation is implemented as far as possible. The user has to decide whether to interpret this warning message within his application as a proper error or merely as a warning.
ActualVelocityDiff:
Actual velocity difference during the superimposed motion (ActualVelocityDiff ≤ VelocityDiff).
ActualDistance:
Actual superimposed distance. The block tries to reach the full Distance as specified. This distance may not be reached fully, depending on the parameterization (VelocityDiff, Acceleration, Deceleration, Length, Mode). In this case the maximum possible distance is superimposed. (ActualDistance ≤ Distance).
ActualLength
Actual travel during superimposed motion (ActualLenght ≤ Length).
ActualAcceleration
Actual acceleration of the superimposed movement (ActualAcceleration≤Acceleration).
ActualDeceleration
Actual deceleration of the superimposed movement (ActualDeceleration≤Deceleration).
General rules for MC function blocks
Inputs/outputs
VAR_IN_OUT
Axis    : AXIS_REF;
END_VAR
AXIS_REF
Axis
Axis data structure
The axis data structure of type AXIS_REF addresses an axis uniquely within the system. Among other parameters it contains the current axis status, including position, velocity or error status.
Application examples for MC_MoveSuperimposed
The function block MC_MoveSuperimposed starts a superimposed movement on an axis that is already moving. For this superposition various applications are available that are described below.
Distance correction for products on a conveyor belt
A conveyor belt consists of individual segments, each driven by an axis. The conveyor belt is used for transporting packages, the spacing of which is to be corrected. To this end a conveying segment must briefly run faster or slower relative to a following segment.
The measured distance is 1800 mm and is to be reduced to 1500 mm. Conveyor belt 1 should be accelerated in order to reduce the distance. The correction must be completed by the time the end of belt 1 is reached in order to prevent the package being pushed onto the slower belt 2.
Since in this situation conveyer 1 has to be accelerated the drive system requires a velocity reserve, assumed to be 500 mm/s in this case. In practice this value can be determined from the difference between the maximum conveyor speed and the current set velocity.
For parameterization of function block MC_MoveSuperimposed this means:
Distance = 1800 mm - 1500 mm = 300 mm (distance correction)
Length = 1000 mm (available distance up to the end of belt 1)
Mode = SUPERPOSITIONMODE_VELOREDUCTION_LIMITEDMOTION
VelocityDiff = 500 mm/s
The mode defines that the distance Length up to the end of the conveyor belt is used for the correction and that the correction is completed at this point. The system uses the internally calculated velocity as degree of freedom. VelocityDiff therefore is the upper limit for the velocity change in this case.
Alternatively the correction could be achieved by decelerating belt 2. In this case Distance must be negative and the available correction distance Length is the distance between the right-hand package and the end of the belt. The maximum possible velocity change VelocityDiff corresponds to the current set velocity. Belt 2 could therefore be decelerated down to zero, if necessary.
Phase shift of a print roller
A print roller rotates with constant peripheral velocity at the same speed as conveyor belt on which a workpiece to be printed is transported. For synchronization with the workpiece the print roller is to be advanced by a certain angle (phase shift).
The phase shift can be implemented in two ways. The angle can be corrected as quickly as possible, resulting in a short-term strong increase in the velocity of the print roller. Alternatively a correction distance can be defined within which the correction can occur, e.g. a complete roller revolution. This leads to the following possible parameterizations for function block MC_MoveSuperimposed:
1. Fast correction:
Distance = 7.1°
Length =360° (maximum possible correction distance)
Mode = SUPERPOSITIONMODE_LENGTHREDUCTION_LIMITEDMOTION
VelocityDiff = 30°/s (velocity reserve)
The mode specifies that the correction distance should be as short as possible. The stated value for Length therefore is an upper limit that can be chosen freely (but not too small).
Alternatively SUPERPOSITIONMODE_VELOREDUCTION_ADDITIVEMOTION can be used as Mode. In this case the whole correction distance would be up to 367.1°. Since the distance should be as short as possible both modes are equivalent in this case.
2. Slow correction:
Distance = 7.1°
Length =360° (correction distance)
Mode = SUPERPOSITIONMODE_VELOREDUCTION_LIMITEDMOTION
VelocityDiff = 30°/s (velocity reserve)
The mode specifies that the correction distance should be utilized fully and the velocity change should be kept as small as possible. The stated value for VelocityDiff therefore is an upper limit that can be chosen freely (but not too small).
Drilling unit
A drilling unit should drill two holes in a moving workpiece. Synchronization for the first hole is assumed to be achieved via the flying saw (MC_GearInPos) and is not be considered here. After the first operation the device must be moved by certain distance relative to the moving workpiece.
The drilling unit is to be advanced by 250 mm relative to the workpiece after the first hole has been drilled. Meanwhile the workpiece covers a distance of 400 mm. From this position the drilling unit is once again synchronous with the workpiece and the second hole can be drilled.
Here too two options are available that differ in terms of the velocity change of the drilling device and therefore in the mechanical strain.
Parameterization of function block MC_MoveSuperimposed:
1. Fast correction:
Distance = 250 mm
Length = 400 mm
Mode = SUPERPOSITIONMODE_LENGTHREDUCTION_ADDITIVEMOTION
VelocityDiff = 500 mm/s (velocity reserve of the drilling device)
The mode specifies that the correction distance should be as short as possible. The stated value for Length therefore is an upper limit that can be chosen freely (but not too small). The drilling device can travel a larger distance since Length refers to the workpiece plus a relative change in position.
2. Slow correction:
Distance = 250 mm
Length = 400 mm
Mode = SUPERPOSITIONMODE_VELOREDUCTION_ADDITIVEMOTION
VelocityDiff = 500 mm/s (velocity reserve of the drilling device)
The mode specifies that the correction distance should be utilized fully and the velocity change should be kept as small as possible. The stated value for VelocityDiff therefore is an upper limit that can be chosen freely (but not too small). During the change in position the workpiece covers the distance Length, the drilling unit travels 650 mm due to the additional correction distance (Length + Distance).
《10101010》
本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
Design News
offboard模式的开发及应用
DDR内存参数
摄像机
Interface
教你设计并实现一个漂亮的结婚站
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服