Plcopen Motion Control Part 1 Version 2.0
Plcopen Motion Control Part 1 Version 2.0
Technical Specification
PLCopen - Technical Committee 2 – Task Force
DISCLAIMER OF WARANTIES
THIS DOCUMENT IS PROVIDED ON AN “AS IS” BASIS AND MAY BE SUBJECT TO FUTURE ADDITIONS,
MODIFICATIONS, OR CORRECTIONS. PLCOPEN HEREBY DISCLAIMS ALL WARRANTIES OR
CONDITIONS OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION, ANY
WARRANTIES, OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR
A PARTICULAR PURPOSE, FOR THIS DOCUMENT. IN NO EVENT WILL PLCOPEN BE RESPONSIBLE FOR
ANY LOSS OR DAMAGE ARISING OUT OR RESULTING FROM ANY DEFECT, ERROR OR OMISSION IN
THIS DOCUMENT OR FROM ANYONE’S USE OF OR RELIANCE ON THIS DOCUMENT.
TC2 Task Force Motion Control March 17, 2011 © 1999 - 2011 copyright by PLCopen
Function Blocks for Motion Control Version 2.0, Published page 1/ 141
PLCopen
for efficiency in automation
The following specification has been developed within the PLCopen Motion Control Task Force.
This specification was written by the following members of the Motion Control Task Force:
TC2 Task Force Motion Control March 17, 2011 © 1999 - 2011 copyright by PLCopen
Function Blocks for Motion Control Version 2.0, Published page 2/ 141
PLCopen
for efficiency in automation
Table of Contents
1. GENERAL.................................................................................................................................................................8
1.1. OBJECTIVES .............................................................................................................................................................9
1.1.1. Language context goals ..................................................................................................................................9
1.1.2. Definition of a set of Function Blocks.............................................................................................................9
1.1.3. Overview of the defined Function Blocks .....................................................................................................10
1.1.4. Compliance and Portability..........................................................................................................................10
1.1.5. Length of names and ways to shorten them ..................................................................................................11
1.1.6. History ..........................................................................................................................................................11
2. MODEL ...................................................................................................................................................................13
2.1. THE STATE DIAGRAM ............................................................................................................................................13
2.2. ERROR HANDLING ..................................................................................................................................................16
2.2.1. Centralized versus Decentralized .................................................................................................................16
2.2.2. Buffered Commands......................................................................................................................................17
2.2.3. Timing example for the ‘Enable’ input .........................................................................................................17
2.3. DEFINITIONS ..........................................................................................................................................................19
2.4. FB INTERFACE .......................................................................................................................................................19
2.4.1. General rules ................................................................................................................................................19
2.4.2. Aborting versus Buffered modes ...................................................................................................................22
2.4.3. AXIS_REF Data type ....................................................................................................................................24
2.4.4. Technical Units.............................................................................................................................................24
2.4.5. Why the command input is edge sensitive.....................................................................................................25
2.4.6. The input ‘ContinuousUpdate’ .....................................................................................................................25
2.5. EXAMPLE 1: THE SAME FUNCTION BLOCK INSTANCE CONTROLS DIFFERENT MOTIONS OF AN AXIS ........................26
2.6. EXAMPLE 2: DIFFERENT FUNCTION BLOCK INSTANCES CONTROL THE MOTIONS OF AN AXIS ..................................27
3. SINGLE-AXIS FUNCTION BLOCKS.................................................................................................................29
3.1. MC_POWER .....................................................................................................................................................29
3.2. MC_HOME .......................................................................................................................................................30
3.3. MC_STOP .........................................................................................................................................................31
3.4. MC_HALT ........................................................................................................................................................33
3.5. MC_MOVEABSOLUTE ......................................................................................................................................35
3.6. MC_MOVERELATIVE .......................................................................................................................................37
3.7. MC_MOVEADDITIVE .......................................................................................................................................39
3.8. MC_MOVESUPERIMPOSED ...............................................................................................................................41
3.9. MC_HALTSUPERIMPOSED ................................................................................................................................44
3.10. MC_MOVEVELOCITY .......................................................................................................................................45
3.11. MC_MOVECONTINUOUSABSOLUTE .................................................................................................................47
3.12. MC_MOVECONTINUOUSRELATIVE ..................................................................................................................50
3.13. MC_TORQUECONTROL ....................................................................................................................................53
3.14. MC_POSITIONPROFILE .....................................................................................................................................56
3.15. MC_VELOCITYPROFILE....................................................................................................................................58
3.16. MC_ACCELERATIONPROFILE ...........................................................................................................................60
3.17. MC_SETPOSITION ............................................................................................................................................63
3.18. MC_SETOVERRIDE ..........................................................................................................................................64
3.19. MC_READPARAMETER & MC_READBOOLPARAMETER..................................................................................66
3.20. MC_WRITEPARAMETER & MC_WRITEBOOLPARAMETER ..............................................................................68
3.21. MC_READDIGITALINPUT .................................................................................................................................70
3.22. MC_READDIGITALOUTPUT ..............................................................................................................................71
3.23. MC_WRITEDIGITALOUTPUT ............................................................................................................................72
3.24. MC_READACTUALPOSITION ............................................................................................................................73
3.25. MC_READACTUALVELOCITY ..........................................................................................................................74
3.26. MC_READACTUALTORQUE .............................................................................................................................75
3.27. MC_READSTATUS............................................................................................................................................76
3.28. MC_READMOTIONSTATE ................................................................................................................................77
TC2 Task Force Motion Control March 17, 2011 © 1999 - 2011 copyright by PLCopen
Function Blocks for Motion Control Version 2.0, Published page 3/ 141
PLCopen
for efficiency in automation
TC2 Task Force Motion Control March 17, 2011 © 1999 - 2011 copyright by PLCopen
Function Blocks for Motion Control Version 2.0, Published page 4/ 141
PLCopen
for efficiency in automation
Table of Figures
TC2 Task Force Motion Control March 17, 2011 © 1999 - 2011 copyright by PLCopen
Function Blocks for Motion Control Version 2.0, Published page 5/ 141
PLCopen
for efficiency in automation
FIGURE 41: EXAMPLES OF WINDOWS, WHERE TRIGGER EVENTS ARE ACCEPTED (FOR MODULO
AXES) ......................................................................................................................................................................86
FIGURE 45: EXAMPLE OF THE DIFFERENCE BETWEEN ‘SYNCMODES’ ‘SLOWDOWN’ (GREEN) AND
‘CATCHUP’ (RED) WITH DIFFERENT INITIAL VELOCITIES OF THE SLAVE....................................99
FIGURE 46: EXAMPLE OF MC_GEARINPOS WHERE THE INITIAL VELOCITY OF THE SLAVE IS IN
THE SAME DIRECTION OF THE MASTER..................................................................................................100
FIGURE 47: EXAMPLE OF MC_GEARINPOS WHERE THE INITIAL VELOCITY OF THE SLAVE IS IN
THE INVERSE DIRECTION OF THE MASTER............................................................................................100
FIGURE 48: TIMING EXAMPLE OF MC_PHASING – BOTH FOR ABSOLUTE AND RELATIVE ............102
FIGURE 53: TIMING DIAGRAMS FOR DRILLING. LEFT SIDE NO BLENDING, RIGHT SIDE WITH
BLENDING ...........................................................................................................................................................109
FIGURE 55: STRAIGHT FORWARD STEP-TRANSITION CHAIN FOR DRILLING EXAMPLE IN SFC ..110
FIGURE 56: BASIC EXAMPLE WITH TWO MC_MOVEABSOLUTE ON SAME AXIS ................................111
FIGURE 57: TIMING DIAGRAM FOR EXAMPLE ABOVE WITHOUT INTERFERENCE BETWEEN FB1
AND FB2 (‘ABORTING’ MODE) ......................................................................................................................111
FIGURE 58: TIMING DIAGRAM FOR EXAMPLE ABOVE WITH FB2 INTERRUPTING FB1 (‘ABORTING’
MODE) ..................................................................................................................................................................112
FIGURE 59: TIMING DIAGRAM FOR EXAMPLE ABOVE IN ‘BUFFERED’ MODE ....................................113
FIGURE 60: TIMING DIAGRAM FOR EXAMPLE ABOVE WITH MODE ‘BLENDINGLOW’ ....................114
FIGURE 61: TIMING DIAGRAM FOR EXAMPLE ABOVE WITH MODE ‘MERGING1’.............................115
FIGURE 62: TIMING DIAGRAM FOR EXAMPLE ABOVE WITH MODE ‘BLENDINGNEXT’ MOTION.116
FIGURE 63: TIMING DIAGRAM FOR EXAMPLE ABOVE WITH MODE ‘BLENDINGHIGH’ MOTION.117
Table of Tables
TABLE 1: OVERVIEW OF THE DEFINED FUNCTION BLOCKS.......................................................................10
TC2 Task Force Motion Control March 17, 2011 © 1999 - 2011 copyright by PLCopen
Function Blocks for Motion Control Version 2.0, Published page 7/ 141
PLCopen
for efficiency in automation
1. General
The motion control market displays a wide variety of incompatible systems and solutions. In businesses where different
systems are used, this incompatibility induces considerable costs for the end-users, learning is confusing, engineering
becomes difficult, and the process of market growth slows down.
Standardization would certainly reduce these negative factors. Standardization means not only the programming lan-
guages themselves, (as standardization is achieved using the worldwide IEC 61131-3 standard) but also standardizing
the interface towards different motion control solutions. In this way the programming of these motion control solutions
is less hardware dependent. The reusability of the application software is increased, and the costs involved in training
and support are reduced.
Users have requested that PLCopen helps to solve this problem, which initiated the Motion Control Task Force. This
Task Force has defined the programmer’s interface by standardizing the Function Blocks for Motion Control.
For the positioning of this activity, please check figure 1. This triangle has the following user options at its corners:
Performance
Functionality
Standardization.
In practice, users write their programs very closely coupled to the hardware with dedicated functions, in order to get the
highest performance possible as dictated by their environment. This limits the user in his options with respect to the
target hardware and the reusability of the control software and raises the training investment.
The second user option enables a very broad range of software functionality to be offered. This can be very helpful to
the user, but will seldom lead to high performance. Also the training costs are increased.
The third corner, standardization, is primarily focused on reusability across different systems from different suppliers,
including integrated, distributed and networked systems, as well as reduction in training investments. Due to the general
character of this definition, the performance on different architectures can be less optimal than hard coding. Due to this,
standardization should not be expected to offer maximum performance but can closely approach maximum functional-
ity, meaning that the bottom of the triangle is very short.
The first specification was released as an independent library of function blocks for motion control. It included motion
functionality for single axes and multiple axes, several administrative tasks, as well as a state diagram. This specifica-
tion provides the user with a standard command set and structure independent of the underlying architecture.
This structure can be used on many platforms and architectures. In this way one can decide which architecture will be
used at a later stage of the development cycle. Advantages for the machine builder are, amongst others, lower costs for
supporting the different platforms and the freedom to develop application software in a more independent way, without
limiting the productivity of the machine. In addition to those benefits, system maintenance is easier and the education
period is shorter. This is a major step forward, and is more and more accepted by users as well as suppliers.
With the release of part 1, it was understood that additional functionality was needed. Part 1 provides the basis for a set
TC2 Task Force Motion Control March 17, 2011 © 1999 - 2011 copyright by PLCopen
Function Blocks for Motion Control Version 2.0, Published page 8/ 141
PLCopen
for efficiency in automation
of inter-related specifications:
With the release of the underlying document, Part 1 – PLCopen Function Blocks for Motion Control version 2.0, Part 2
– PLCopen Motion Control Extensions has been integrated into the Basic document
The PLCopen Motion Control User Guidelines, Part 3, is an addition to the PLCopen Function Blocks for Motion Con-
trol, and should not be seen as stand alone document.
1.1. Objectives
The Motion Control Function Blocks are applicable in the IEC 61131-3 languages with following factors in considera-
tion:
1 Simplicity - ease of use, towards the application program builder and installation & maintenance
2 Efficiency - in the number of Function Blocks, directed to efficiency in design (and understanding)
3 Consistency - conforming to IEC 61131-3 standard
4 Universality - hardware independent
5 Flexibility - future extensions / range of application
6 Completeness - not mandatory but sufficiently
TC2 Task Force Motion Control March 17, 2011 © 1999 - 2011 copyright by PLCopen
Function Blocks for Motion Control Version 2.0, Published page 9/ 141
PLCopen
for efficiency in automation
Administrative Motion
Single Axis Multiple Axis Single Axis Multiple Axis
MC_Power MC_CamTableSelect MC_Home MC_CamIn
MC_ReadStatus MC_Stop MC_CamOut
MC_ReadAxisError MC_Halt MC_GearIn
MC_ReadParameter MC_MoveAbsolute MC_GearOut
MC_ReadBoolParameter MC_MoveRelative MC_GearInPos
MC_WriteParameter MC_MoveAdditive MC_PhasingAbsolute
MC_WriteBoolParameter MC_MoveSuperimposed MC_PhasingRelative
MC_ReadDigitalInput MC_MoveVelocity MC_CombineAxis
MC_ReadDigitalOutput MC_MoveContinuousAbsolute
MC_WriteDigitalOutput MC_MoveContinuousRelative
MC_ReadActualPosition MC_TorqueControl
MC_ReadActualVelocity MC_PositionProfile
MC_ReadActualTorque MC_VelocityProfile
MC_ReadAxisInfo MC_AccelerationProfile
MC_ReadMotionState
MC_SetPosition
MC_SetOverride
MC_TouchProbe
MC_DigitalCamSwitch
MC_Reset
MC_AbortTrigger
MC_HaltSuperimposed
Table 1: Overview of the defined Function Blocks
- Basic input/output variables are mandatory Marked in the tables with the letter “B”
- Extended input /output variables are optional Marked in the tables with the letter “E”
- Vendor Specific additions Marked in the vendor’s compliance documentation with “V”
Any vendor is allowed to add Vendor Specific parameters to any of the Function Blocks specified within this document.
Note:
According to the IEC 61131-3 specification, the input variables may be unconnected or not parameterized by the user. In this case the Function
Block will use the value from the previous invocation of the Function Block instance or in case of the first invocation the initial value will be used.
Each Function Block input has a defined initial value, which is typically 0.
The data type REAL listed in the Function Blocks and parameters (e.g. for velocity, acceleration, distance, etc.) may be
TC2 Task Force Motion Control March 17, 2011 © 1999 - 2011 copyright by PLCopen
Function Blocks for Motion Control Version 2.0, Published page 10/ 141
PLCopen
for efficiency in automation
exchanged to SINT, INT, DINT or LREAL without being seen as incompliant to this standard, as long as it is consistent
for the whole set of Function Blocks and parameters.
Implementation allows the extension of data types as long as the basic data type is kept. For example: WORD may be
changed to DWORD, but not to REAL.
Any FBs and inputs that are no longer specified in this new version of the specification can be kept in the vendors’ sys-
tems to keep compatibility, avoiding incompatible changes in existing FBs.
1.1.6. History
The first official release of Part 1 was made in November 2001. Since that time feedback has been received from both
users and implementers. In 2004 it was decided to release a new version, Version 1.1, of Part 1, which includes the
changes resulting from inclusion of the feedback into the specification. This update was published in April 2005.
In September 2005 the first official release of Part 2 – Extensions was published.
After that date, a corrigendum and addendum was maintained for both parts. During 2008 the proposal was accepted to
merge both part 1 and 2 in one new part 1, to be released as version 2.0, the document you are looking at now.
Basically the two sets of function blocks have been merged. In addition, several overall changes were done. These
changes include (however are not limited to):
The simplification of the representation of the State Diagram, with a.o. the removal of the transition commands
The new input ‘ContinuousUpdate’ extending the behaviour of the relevant motion related function blocks
Adopted description resulting in a changed behaviour of the output ‘Active’
Aborting mode deleted in some FBs
Changes in the mcAborting enum
The split of MC_Phasing and MC_MoveContinuous FBs in to relative and absolute versions for both
New FBs MC_ReadMotionState, MC_ReadAxisInfo, MC_CombineAxes and MC_HaltSuperimposed
The description at Camming
The functionality of MC_CamTableSelect is extended with input ‘ExecutionMode’. Description of ‘Peri-
odic’defined more precise.
The functionality of MC_CamIn is extended with inputs ‘MasterStartDistance’and ‘MasterSyncPosition’.
New input ‘MasterValueSource’ and corresponding datatype in MC_CamIn, MC_GearIn, MC_GearInPos,
MC_ReadMotionState, and MC_CombineAxes
TC2 Task Force Motion Control March 17, 2011 © 1999 - 2011 copyright by PLCopen
Function Blocks for Motion Control Version 2.0, Published page 11/ 141
PLCopen
for efficiency in automation
Input ‘Mode’ of MC_SetPosition now called ‘Relative’ (in line with Part 4)
Unified naming conventions for Function Blocks, Enum elements, Data types, Structures, Inputs and Outputs for all
PLCopen Motion Control specifications.
The behaviour of the ‘InVelocity’, ‘InGear’, ‘InTorque’, and ‘InSync’outputs changed after the corresponding SET
value is reached
FBs MC_ReadAxisInfo, MC_PhasingRelative and MC_PhasingAbsolute added to Function Blocks which are not
listed in the State Diagram
Description of inputs ‘Axis’, ‘Master’ and ‘Slave’ changed
Description of outputs ‘Busy’, ‘Error’ and ‘ErrorID’ changed
TC2 Task Force Motion Control March 17, 2011 © 1999 - 2011 copyright by PLCopen
Function Blocks for Motion Control Version 2.0, Published page 12/ 141
PLCopen
for efficiency in automation
2. Model
The following Function Block (FB) library is designed for the purpose of controlling axes via the language elements
consistent with those defined in the IEC 61131-3 standard. It was decided by the task force that it would not be practical
to encapsulate all the aspects of one axis into only one function block. The retained solution is to provide a set of com-
mand oriented function blocks that have a reference to the axis, e.g. the abstract data type ‘Axis’, which offers flexibil-
ity, ease of use and reusability.
Implementations based on IEC 61131-3 (for instance via Function Blocks and SFC) will be focused towards the inter-
face (look-and-feel / ‘proxy’) of the Function Blocks. This specification does not define the internal operation of the
Function Blocks.
This leads to some consequences that are described in this chapter.
The basic rule is that motion commands are always taken sequentially, even if the PLC had the capability of real parallel
processing. These commands act on the axis’ state diagram.
The axis is always in one of the defined states (see diagram below). Any motion command that causes a transition
changes the state of the axis and, as a consequence, modifies the way the current motion is computed.
The state diagram is an abstraction layer of what the real state of the axis is, comparable to the image of the I/O points
within a cyclic (PLC) program.
A change of state is reflected immediately when issuing the corresponding motion command. (Note: the response time
of ‘immediately’ is system dependent, coupled to the state of the axis, or an abstraction layer in the software)
The diagram is focused on a single axis. The multiple axis Function Blocks, MC_CamIn, MC_GearIn and MC_Phasing,
can be looked at, from a state diagram point of view, as multiple single-axes all in specific states. For instance, the
CAM-master can be in the state ‘ContinuousMotion’. The corresponding slave is in the state ‘SynchronizedMotion’.
Connecting a slave axis to a master axis has no influence on the master axis.
Arrows within the state diagram show the possible state transitions between the states. State transitions due to an issued
command are shown by full arrows. Dashed arrows are used for state transitions that occur when a command of an axis
has terminated or a system related transition (like error related). The motion commands which transit the axis to the
corresponding motion state are listed above the states. These motion commands may also be issued when the axis is
already in the according motion state.
Remarks on states:
Disabled The state ‘Disabled’ describes the initial state of the axis.
In this state the movement of the axis is not influenced by the FBs. Power is off and there is no error
in the axis.
If the MC_Power FB is called with ‘Enable’=TRUE while being in ‘Disabled’, the state changes to
‘Standstill’. The axis feedback is operational before entering the state ‘Standstill’.
Calling MC_Power with ‘Enable’=FALSE in any state except ‘ErrorStop’ transfers the axis to the
state ‘Disabled’, either directly or via any other state. Any on-going motion commands on the axis are
aborted (‘CommandAborted’).
ErrorStop ‘ErrorStop’ is valid as highest priority and applicable in case of an error. The axis can have either
power enabled or disabled and can be changed via MC_Power. However, as long as the error is pend-
ing the state remains ‘ErrorStop’.
The intention of the ‘ErrorStop’ state is that the axis goes to a stop, if possible. There is no further
motion command accepted until a reset has been done from the ‘ErrorStop’ state.
The transition to ‘ErrorStop’ refers to errors from the axis and axis control, and not from the Function
Block instances. These axis errors may also be reflected in the output of the Function Blocks ‘FB
instances errors’.
TC2 Task Force Motion Control March 17, 2011 © 1999 - 2011 copyright by PLCopen
Function Blocks for Motion Control Version 2.0, Published page 13/ 141
PLCopen
for efficiency in automation
Standstill Power is on, there is no error in the axis, and there are no motion commands active on the axis.
Remarks on commands:
MC_Stop Calling the FB MC_Stop in state ‘Standstill’ changes the state to ‘Stopping’ and back
to ‘Standstill’ when ‘Execute’ = FALSE. The state ‘Stopping’ is kept as long as the
input ‘Execute’ is true. The ‘Done’ output is set when the stop ramp is finished.
MC_MoveSuperimposed MC_MoveSuperimposed issued in state ‘Standstill’ brings the axis to state ‘Discrete-
Motion’. Issued in any other state the state of the axis is not influenced.
MC_GearOut, Change the state of the slave axis from ‘SynchronizedMotion’ to ‘ContinuousMotion’.
MC_CamOut Issuing one of these FBs in any other state generates an error.
Function Blocks which are not listed in the State Diagram do not affect the state of the State Diagram, meaning that
whenever they are called the state does not change. They are:
MC_ReadStatus
MC_ReadAxisError
MC_ReadParameter
MC_ReadBoolParameter
MC_WriteParameter
MC_WriteBoolParameter
MC_ReadDigitalInput
MC_ReadDigitalOutput
MC_WriteDigitalOutput
MC_ReadActualPosition
MC_ReadActualVelocity
MC_ReadActualTorque
MC_ReadMotionState
MC_SetPosition
MC_SetOverride
MC_AbortTrigger
MC_TouchProbe
MC_DigitalCamSwitch
MC_CamTableSelect
MC_ReadAxisInfo
MC_PhasingRelative
MC_PhasingAbsolute
MC_HaltSuperimposed
TC2 Task Force Motion Control March 17, 2011 © 1999 - 2011 copyright by PLCopen
Function Blocks for Motion Control Version 2.0, Published page 14/ 141
PLCopen
for efficiency in automation
TC2 Task Force Motion Control March 17, 2011 © 1999 - 2011 copyright by PLCopen
Function Blocks for Motion Control Version 2.0, Published page 15/ 141
PLCopen
for efficiency in automation
& &
Recovery ErrorHandling
FB100 FB200
Axis Axis
Execute Done Execute Done
ErrorID Error ErrorID Error
ErrorID ErrorID
TC2 Task Force Motion Control March 17, 2011 © 1999 - 2011 copyright by PLCopen
Function Blocks for Motion Control Version 2.0, Published page 16/ 141
PLCopen
for efficiency in automation
1. The axis goes to state ‘ErrorStop’ (e.g. due to a following error or over-temperature). FB1 sets the output ‘Error’.
FB2 (as well as any other FB instance that is waiting to execute a buffered command on this axis) sets its ‘Error’
output and shows with the output ‘ErrorID’, that it cannot execute its job, because the axis is in a state that doesn't
allow it. All buffered commands are cleared. After the axis error is reset by MC_Reset, it can be commanded again.
2. The FB1 sets its ‘Error’ output (e.g. due to an invalid parameterization). FB2 becomes active and executes the
given command immediately afterwards, and the application should handle the error situation.
TC2 Task Force Motion Control March 17, 2011 © 1999 - 2011 copyright by PLCopen
Function Blocks for Motion Control Version 2.0, Published page 17/ 141
PLCopen
for efficiency in automation
TC2 Task Force Motion Control March 17, 2011 © 1999 - 2011 copyright by PLCopen
Function Blocks for Motion Control Version 2.0, Published page 18/ 141
PLCopen
for efficiency in automation
2.3. Definitions
Within this document the following levels of values are used: Commanded/ Set/ Actual:
Commanded value – is the value that is based on the inputs of the function blocks and can be used as (one of the)
input to the profile generator.
Set value – is at a ‘lower’ level, closer to the actuator. It is the latest value (generated by the profile generator) that is
about to be send to the servo loop (e.g. actuator), e.g. the next value the actuator will use.
Actual value – the latest value that is available in the system from the feedback system
2.4. FB interface
2.4.1. General rules
Input parameters With ‘Execute’ without ‘ContinuousUpdate’: The parameters are used with the rising edge of
the ‘Execute’ input. To modify any parameter it is necessary to change the input parameter(s)
and to trigger the ‘Execute’ input again.
With ‘Execute’ combined with ‘ContinuousUpdate’: The parameters are used with the rising
edge of the ‘Execute’ input. The parameters can be modified continuously as long as the ‘Con-
tinuousUpdate’ is SET.
With ‘Enable’: The parameters are used with the rising edge of the enable input and can be
modified continuously.
Inputs exceeding If a FB is commanded with parameters which result in a violation of application limits, the in-
application limits puts are limited by the system or the instance of the FB generates an error. The consequences of
this error for the axis are application specific and thus should be handled by the application
program.
Missing input pa- According to IEC 61131-3, if any parameter of a function block input is missing (“open”) then
rameters the value from the previous invocation of this instance will be used. In the first invocation the
initial value is applied.
Acceleration, Decel- If the input ‘Deceleration’, ‘Acceleration’ or ‘Jerk’ is set to 0, the result is implementation de-
eration and Jerk in- pendent. There are several implementations possible, like one goes to the error state, one signals
puts a warning (via a supplier specific output), one inhibits this in the editor, one takes the value as
either specified in AxisRef or in the drive itself, or one takes a maximum value. Even if the 0
value input is accepted by the system, please use with caution especially if compatibility is tar-
geted.
Output exclusivity With ‘Execute’: The outputs ‘Busy’, ‘Done’, ‘Error’, and ‘CommandAborted’ are mutually
exclusive: only one of them can be TRUE on one FB. If ‘Execute’ is TRUE, one of these out-
puts has to be TRUE.
Only one of the outputs ‘Active’, ‘Error’, ‘Done’ and ‘CommandAborted’ is set at the same
time, except in MC_Stop where ‘Active’ and ‘Done’ can be set both at the same time
With ‘Enable’: The outputs ‘Valid’ and ‘Error’ are mutually exclusive: only one of them can be
TRUE on one FB.
Output status With ‘Execute’: The ‘Done’, ‘Error’, ‘ErrorID’ and ‘CommandAborted’ outputs are reset with
the falling edge of ‘Execute’ . However the falling edge of ‘Execute’ does not stop or even in-
fluence the execution of the actual FB. It must be guaranteed that the corresponding outputs are
set for at least one cycle if the situation occurs, even if execute was reset before the FB com-
pleted.
If an instance of a FB receives a new execute before it finished (as a series of commands on the
same instance), the FB won’t return any feedback, like ‘Done’ or ‘CommandAborted’, for the
previous action.
With ‘Enable’: The ‘Valid’, ‘Enabled’, ‘Busy’, ‘Error’,and ‘ErrorID’ outputs are reset with the
falling edge of ‘Enable’ as soon as possible.
TC2 Task Force Motion Control March 17, 2011 © 1999 - 2011 copyright by PLCopen
Function Blocks for Motion Control Version 2.0, Published page 19/ 141
PLCopen
for efficiency in automation
Behavior of Done The ‘Done’ output is set when the commanded action has been completed successfully.
output With multiple Function Blocks working on the same axis in a sequence, the following applies:
when one movement on an axis is interrupted with another movement on the same axis without
having reached the final goal, ‘Done’ of the first FB will not be set.
Behavior of Busy With ‘Execute’: Every FB can have an output ‘Busy’, reflecting that the FB is not finished and
output new output values can be expected. ‘Busy’ is SET at the rising edge of ‘Execute’ and RESET
when one of the outputs ‘Done’, ‘Aborted’, or ‘Error’ is set.
With ‘Enable’: Every FB can have an output ‘Busy’, reflecting that the FB is working and new
output values can be expected. ‘Busy’ is SET at the rising edge of ‘Enable’ and stays SET as
long as the FB is performing any action.
It is recommended that the FB should be kept in the active loop of the application program for
at least as long as ‘Busy’ is true, because the outputs may still change.
Behavior of InVeloc- The outputs ‘InVelocity’, ‘InGear’, ‘InTorque’, and ‘InSync’ (from now on referred to as
ity, InGear, InTorque ‘Inxxx’) have a different behavior than the ‘Done’ output.
and InSync As long as the FB is Active, ‘Inxxx’ is SET when the set value equals the commanded value,
and will be RESET when at a later time they are unequal. For example, the InVelocity output is
SET when the set velocity is equal to the commanded velocity. This is similar for ‘InGear’,
‘InTorque’, and ‘InSync’ outputs in the applicable FBs.
‘Inxxx’ is updated even if ‘Execute’ is low as long as the FB has control of the axis (‘Active’
and ‘Busy’ are SET).
The behavior of ‘Inxxx’ directly after ‘Execute’ is SET again while the condition of ‘Inxxx’ is
already met, is implementation specific.
‘Inxxx’ definition does not refer to the actual axis value, but must refer to the internal instanta-
neous setpoint.
Output ‘Active’ The ‘Active’ output is required on buffered Function Blocks. This output is set at the moment
the function block takes control of the motion of the according axis. For un-buffered mode the
outputs ‘Active’ and ‘Busy’ can have the same value.
For one axis, several Function Blocks might be busy, but only one can be active at a time. Ex-
ceptions are FBs that are intended to work in parallel, like MC_MoveSuperimposed and
MC_Phasing’s, where more than one FB related to one axis can be active.
Behavior of ‘CommandAborted’ is set, when a commanded motion is interrupted by another motion com-
CommandAborted mand.
output The reset-behavior of ‘CommandAborted’ is like that of ‘Done’. When ‘CommandAborted’
occurs, the other output-signals such as ‘InVelocity’ are reset.
Enable and Valid The ‘Enable’ input is coupled to a ‘Valid’ output. ‘Enable’ is level sensitive, and ‘Valid’ shows
that a valid set of outputs is available at the FB.
The ‘Valid’ output is TRUE as long as a valid output value is available and the ‘Enable’ input is
TRUE. The relevant output value can be refreshed as long as the input ‘Enable’ is TRUE.
If there is a FB error, the output is not valid (‘Valid’ set to FALSE). When the error condition
disappears, the values will reappear and ‘Valid’ output will be set again.
Position versus dis- ‘Position’ is a value defined within a coordinate system. ‘Distance’ is a relative measure related
tance to technical units. ‘Distance’ is the difference between two positions.
Sign rules The ‘Acceleration’, ‘Deceleration’ and ‘Jerk’ are always positive values. ‘Velocity’, ‘Position’
and ‘Distance’ can be both positive and negative.
TC2 Task Force Motion Control March 17, 2011 © 1999 - 2011 copyright by PLCopen
Function Blocks for Motion Control Version 2.0, Published page 20/ 141
PLCopen
for efficiency in automation
Error Handling All blocks can have two outputs, which deal with errors that can occur while executing that
Behavior Function Block. These outputs are defined as follow:
Error Rising edge of ‘Error’ informs that an error occurred during the execution of
the Function Block.
ErrorID Error identification (Extended parameter)
‘Done’, ‘InVelocity’, ‘InGear’, ‘InTorque’, and ‘InSync’ mean successful completion so these
signals are logically exclusive to ‘Error’.
Types of errors:
Function Blocks (e.g. parameters out of range, state machine violation attempted)
Communication
Drive
Instance errors do not always result in an axis error (bringing the axis to ‘ErrorStop’)
The error outputs of the relevant FB are reset with falling edge of ‘Execute’ and ‘Enable’. The
error outputs at FBs with ‘Enable’ can be reset during operation (without a reset of ‘Enable’).
FB Naming In case of multiple libraries within one system (to support multiple drive / motion control sys-
tems), the FB naming may be changed to “MC_FBname_SupplierID”.
Naming conventions Due to the naming constraints in the IEC standard on the uniqueness of variable names, the ‘mc’
ENUM types reference to the PLCopen Motion Control namespace is used for the ENUMs.
In this way we avoid the conflict that using the ENUM types ‘positive’ and ‘negative’ for in-
stance with variables with these names throughout the rest of the project since they are called
mcPositive and mcNegative resp.
Table 2: General Rules
The behavior of the ‘Execute’ / ‘Done’ style FBs is as follows:
TC2 Task Force Motion Control March 17, 2011 © 1999 - 2011 copyright by PLCopen
Function Blocks for Motion Control Version 2.0, Published page 21/ 141
PLCopen
for efficiency in automation
Execute
Busy
Active
InXxx
Error
CommandAborted
There are several options for the buffered mode. For this reason, this input is an ENUM of type MC_BUFFER_MODE.
The following modes have been identified:
Aborting Default mode without buffering. The next FB aborts an ongoing motion and the command
affects the axis immediately. The buffer is cleared.
Buffered The next FB affects the axis as soon as the previous movement is ‘Done’. There is no
blending.
BlendingLow The next FB controls the axis after the previous FB has finished (equivalent to ‘Buffered’),
but the axis will not stop between the movements. The velocity is blended with the lowest
velocity of both commands (1 and 2) at the first end-position (1).
BlendingPrevious blending with the velocity of FB 1 at end-position of FB 1
BlendingNext blending with velocity of FB 2 at end-position of FB 1
BlendingHigh blending with highest velocity of FB 1 and FB 2 at end-position of FB1
TC2 Task Force Motion Control March 17, 2011 © 1999 - 2011 copyright by PLCopen
Function Blocks for Motion Control Version 2.0, Published page 22/ 141
PLCopen
for efficiency in automation
The examples as listed in Appendix A describe the different behavior of these modes.
The following table gives an overview of the effects on the defined function blocks:
TC2 Task Force Motion Control March 17, 2011 © 1999 - 2011 copyright by PLCopen
Function Blocks for Motion Control Version 2.0, Published page 23/ 141
PLCopen
for efficiency in automation
Example:
TYPE
AXIS_REF : STRUCT
AxisNo: UINT;
AxisName: STRING (255);
…
END_STRUCT
END_TYPE
TC2 Task Force Motion Control March 17, 2011 © 1999 - 2011 copyright by PLCopen
Function Blocks for Motion Control Version 2.0, Published page 24/ 141
PLCopen
for efficiency in automation
FB 1 FB 2 FB 3
Par
Par Error Error Par Error
First.Execute
First.Active
First.Done
Second.Execute
Second.Active
Second.Done
In13
Third.Execute
Third.Active
Third.Done
Third.Error
Therefore, the input ‘ContinuousUpdate’ has been introduced. It is an extended input to all applicable function blocks.
If it is TRUE, when the function block is triggered (rising ‘Execute’), it will - as long as it stays TRUE – make the func-
tion block use the current values of the input variables and apply it to the ongoing movement. This does not influence
the general behavior of the function block nor does it impact the state diagram. In other words it only influences the
ongoing movement and its impact ends as soon as the function block is no longer ‘Busy’ or the input ‘ContinuousUp-
TC2 Task Force Motion Control March 17, 2011 © 1999 - 2011 copyright by PLCopen
Function Blocks for Motion Control Version 2.0, Published page 25/ 141
PLCopen
for efficiency in automation
date’ is set to FALSE. (Remark: it can be that certain inputs like ‘BufferMode’ are not really intended to change every
cycle. However, this has to be dealt with in the application, and is not forbidden in the specification.)
If ‘ContinuousUpdate’ is FALSE with the rising edge of the ‘Execute’ input, a change in the input parameters is ignored
during the whole movement and the original behavior of previous versions is applicable.
The ‘ContinuousUpdate’ is not a retriggering of the ‘Execute’ input of the function block. A retriggering of a function
block which was previously aborted, stopped, or completed, would regain control on the axis and also modify its state
diagram. Opposite to this, the ‘ContinuousUpdate’ only effects an ongoing movement.
Also, a ‘ContinuousUpdate’ of relative inputs (e.g. ‘Distance’ in MC_MoveRelative) always refers to the initial condi-
tion (at rising edge of ‘Execute’).
Example:
MC_MoveRelative is started at ‘Position’ 0 with ‘Distance’ 100, ‘Velocity’ 10 and ‘ContinuousUpdate’ set TRUE.
‘Execute’ is Set and so the movement is started to position 100
While the movement is executed (let the drive be at position 50), the input ‘Distance’ is changed to 130, ‘Velocity’
20.
The axis will accelerate (to the new ‘Velocity’ 20) and stop at ‘Position’ 130 and set the output ‘Done’ and does not
accept any new values.
2.5. Example 1: the same Function Block instance controls different motions of an axis
Figure 10: Single FB usage with a SFC shows an example where the Function Block FB1 is used to control “AxisX”
with three different values of ‘Velocity’. In a Sequential Function Chart (SFC) the ‘Velocity’ 10, 20, and 0 is assigned
to V. To trigger the ‘Execute’ input with a rising edge the variable E is stepwise set and reset.
K = true
InVelocity = TRUE
E := FALSE;
M = TRUE
K, L, M are Boolean Variables
V:= 0; E := TRUE;
InVelocity =TRUE
E := FALSE;
TC2 Task Force Motion Control March 17, 2011 © 1999 - 2011 copyright by PLCopen
Function Blocks for Motion Control Version 2.0, Published page 26/ 141
PLCopen
for efficiency in automation
20
Commanded 10
Velocity V 0
1
Execute E
0
20
Set Velocity 10
1
InVelocity
0
2.6. Example 2: different Function Block instances control the motions of an axis
Different instances related to the same axis can control the motions on an axis. Each instance will then be «responsible»
for one part of the global profile.
M
L
TC2 Task Force Motion Control March 17, 2011 © 1999 - 2011 copyright by PLCopen
Function Blocks for Motion Control Version 2.0, Published page 27/ 141
PLCopen
for efficiency in automation
TC2 Task Force Motion Control March 17, 2011 © 1999 - 2011 copyright by PLCopen
Function Blocks for Motion Control Version 2.0, Published page 28/ 141
PLCopen
for efficiency in automation
3.1. MC_Power
FB-Name MC_Power
This Function Block controls the power stage (On or Off).
VAR_IN_OUT
B Axis AXIS_REF Reference to the axis
VAR_INPUT
B Enable BOOL As long as ‘Enable’ is true, power is being enabled.
E EnablePositive BOOL As long as ‘Enable’ is true, this permits motion in positive direction
E EnableNegative BOOL As long as ‘Enable’ is true, this permits motion in negative direction
VAR_OUTPUT
B Status BOOL Effective state of the power stage
E Valid BOOL If true, a valid set of outputs is available at the FB
B Error BOOL Signals that an error has occurred within the Function Block
E ErrorID WORD Error identification
Notes:
The ‘Enable’ input enables the power stage in the drive and not the FB itself
If the MC_Power FB is called with the ‘Enable’ = TRUE while being in ‘Disabled’, the axis state changes to
‘Standstill’.
It is possible to set an error variable when the Command is TRUE for a while and the Status remains false with a
Timer FB and an AND Function (with inverted Status input). It indicates that there is a hardware problem with the
power stage.
If power fails (also during operation) it will generate a transition to the ‘ErrorStop’ state.
‘EnablePositive’ and ‘EnableNegative’ are both level sensitive.
‘EnablePositive’ & ‘EnableNegative’ can both be true.
Only 1 FB MC_Power should be issued per axis.
MC_Power
AXIS_REF Axis Axis AXIS_REF
BOOL Enable Status BOOL
BOOL EnablePositive Valid BOOL
BOOL EnableNegative Error BOOL
ErrorID WORD
TC2 Task Force Motion Control March 17, 2011 © 1999 - 2011 copyright by PLCopen
Function Blocks for Motion Control Version 2.0, Published page 29/ 141
PLCopen
for efficiency in automation
3.2. MC_Home
FB-Name MC_Home
This Function Block commands the axis to perform the «search home» sequence. The details of this sequence are
manufacturer dependent and can be set by the axis’ parameters. The ‘Position’ input is used to set the absolute posi-
tion when reference signal is detected. This Function Block completes at ‘Standstill’ if it was started in ‘Standstill’.
VAR_IN_OUT
B Axis AXIS_REF Reference to the axis
VAR_INPUT
B Execute BOOL Start the motion at rising edge
B Position REAL Absolute position when the reference signal is detected [u]
E BufferMode MC_BufferMode Defines the chronological sequence of the FB. See 2.4.2
Aborting versus Buffered modes
VAR_OUTPUT
B Done BOOL Reference known and set sucessfully
E Busy BOOL The FB is not finished and new output values are to be expected
E Active BOOL Indicates that the FB has control on the axis
E CommandAborted BOOL ‘Command’ is aborted by another command
B Error BOOL Signals that an error has occurred within the Function Block
E ErrorID WORD Error identification
Notes: MC_Home is a generic FB which does a system specified homing procedure which can be constructed by the
StepHoming FBs as specified in Part 5 – Homing Procedures.
MC_Home
AXIS_REF Axis Axis AXIS_REF
BOOL Execute Done BOOL
REAL Position Busy BOOL
MC_BUFFER_MODE BufferMode Active BOOL
CommandAborted BOOL
Error BOOL
ErrorID WORD
TC2 Task Force Motion Control March 17, 2011 © 1999 - 2011 copyright by PLCopen
Function Blocks for Motion Control Version 2.0, Published page 30/ 141
PLCopen
for efficiency in automation
3.3. MC_Stop
FB-Name MC_Stop
This Function Block commands a controlled motion stop and transfers the axis to the state ‘Stopping’. It aborts any
ongoing Function Block execution. While the axis is in state ‘Stopping’, no other FB can perform any motion on the
same axis. After the axis has reached ‘Velocity’ zero, the ‘Done’ output is set to TRUE immediately. The axis re-
mains in the state ‘Stopping’ as long as ‘Execute’ is still TRUE or ‘Velocity’ zero is not yet reached. As soon as
‘Done’ is SET and ‘Execute’ is FALSE the axis goes to state ‘Standstill’.
VAR_IN_OUT
B Axis AXIS_REF Reference to the axis
VAR_INPUT
B Execute BOOL Start the action at rising edge
E Deceleration REAL Value of the ‘Deceleration’ [u/s2]
E Jerk REAL Value of the ‘Jerk’ [u/s3]
VAR_OUTPUT
B Done BOOL Zero velocity reached
E Busy BOOL The FB is not finished and new output values are to be expected
E CommandAborted BOOL ‘Command’ is aborted by switching off power (only possibility to
abort)
B Error BOOL Signals that an error has occurred within the Function Block
E ErrorID WORD Error identification
Note:
1. This FB is primarily intended for emergency stop functionality or exception situations
2. As long as ‘Execute’ is high, the axis remains in the state ‘Stopping’ and may not be executing any other motion
command.
3. If ‘Deceleration’ = 0, the behavior of the function block is implementation specific
MC_Stop
AXIS_REF Axis Axis AXIS_REF
BOOL Execute Done BOOL
REAL Deceleration Busy BOOL
REAL Jerk CommandAborted BOOL
Error BOOL
ErrorID WORD
Execute
Done
Velocity
Stopping
StandStill
FB1 FB2
MC_MoveVelocity MC_Stop
Axis_1 Axis Axis Axis_1 Axis_1 Axis Axis Axis_1
Exe_1 Execute InVelocity InVel_1 Exe_2 Execute Done Done_2
ContinuousUpdate Busy 20 Deceleration Busy
50 Velocity Active 0 Jerk CommandAborted Abort_2
10 Acceleration CommandAborted Abort_1 Error
10 Deceleration Error Error_1 ErrorID
0 Jerk ErrorID
1 Direction
BufferMode
FB1 a b
1
Exe_1
0 t
1
InVel_1
0 t
Abort_1 1
0 t
1
Error_1
0 t
FB2
1
Exe_2
0 t
1
Done_2
0 t
50
Velocity
Axis_1
t
TC2 Task Force Motion Control March 17, 2011 © 1999 - 2011 copyright by PLCopen
Function Blocks for Motion Control Version 2.0, Published page 32/ 141
PLCopen
for efficiency in automation
3.4. MC_Halt
FB-Name MC_Halt
This Function Block commands a controlled motion stop. The axis is moved to the state ‘DiscreteMotion’, until the
velocity is zero. With the ‘Done’ output set, the state is transferred to ‘Standstill’.
VAR_IN_OUT
B Axis AXIS_REF Reference to the axis
VAR_INPUT
B Execute BOOL Start the action at rising edge
E Deceleration REAL Value of the ‘Deceleration’ [u/s2]
E Jerk REAL Value of the ‘Jerk’ [u/s3]
E BufferMode MC_BUFFER_MODE Defines the chronological sequence of the FB. See 2.4.2
Aborting versus Buffered modes
VAR_OUTPUT
B Done BOOL Zero velocity reached
E Busy BOOL The FB is not finished and new output values are to be ex-
pected
E Active BOOL Indicates that the FB has control on the axis
E CommandAborted BOOL ‘Command’ is aborted by another command
B Error BOOL Signals that an error has occurred within the Function Block
E ErrorID WORD Error identification
Notes:
MC_Halt is used to stop the axis under normal operation conditions. In non-buffered mode it is possible to set
another motion command during deceleration of the axis, which will abort the MC_Halt and will be executed
immediately.
If this command is active the next command can be issued. E.g. a driverless vehicle detects an obstacle and
needs to stop. MC_Halt is issued. Before the ‘Standstill’ is reached the obstacle is removed and the motion can
be continued by setting another motion command, so the vehicle does not stop.
MC_Halt
AXIS_REF Axis Axis AXIS_REF
BOOL Execute Done BOOL
REAL Deceleration Busy BOOL
REAL Jerk Active BOOL
MC_BUFFER_MODE BufferMode CommandAborted BOOL
Error BOOL
ErrorID WORD
TC2 Task Force Motion Control March 17, 2011 © 1999 - 2011 copyright by PLCopen
Function Blocks for Motion Control Version 2.0, Published page 33/ 141
PLCopen
for efficiency in automation
FB1 FB2
MC_MoveVelocity MC_Halt
Axis_1 Axis Axis Axis_1 Axis_1 Axis Axis Axis_1
Exe_1 Execute InVelocity InVel_1 Exe_2 Execute Done Done_2
ContinuousUpdate Busy 5 Deceleration Busy
50 Velocity Active 0 Jerk Active
10 Acceleration CommandAborted Abort_1 BufferMode CommandAborted Abort_2
10 Deceleration Error Error
0 Jerk ErrorID ErrorID
1 Direction
BufferMode
FB1
1
Exe_1
0 t
1
InVel_1
0 t
Abort_1 1
0 t
FB2
1
Exe_2
0 t
1
Done_2
0 t
1
Abort_2
0 t
50
Velocity
Axis_1
t
a b
TC2 Task Force Motion Control March 17, 2011 © 1999 - 2011 copyright by PLCopen
Function Blocks for Motion Control Version 2.0, Published page 34/ 141
PLCopen
for efficiency in automation
3.5. MC_MoveAbsolute
FB-Name MC_MoveAbsolute
This Function Block commands a controlled motion to a specified absolute position.
VAR_IN_OUT
B Axis AXIS_REF Reference to the axis
VAR_INPUT
B Execute BOOL Start the motion at rising edge
E ContinuousUpdate BOOL See 2.4.6 The input ‘ContinuousUpdate’
B Position REAL Commanded ‘Position’ for the motion (in technical unit
[u]) (negative or positive)
B Velocity REAL Value of the maximum ‘Velocity’ (not necessarily
reached) [u/s].
E Acceleration REAL Value of the ‘Acceleration’ (always positive) (increasing
energy of the motor) [u/s2]
E Deceleration REAL Value of the ‘Deceleration’ (always positive) (decreasing
energy of the motor) [u/s2]
E Jerk REAL Value of the ‘Jerk’ [u/s3]. (always positive)
B Direction MC_DIRECTION Enum type (1-of-4 values: mcPositiveDirection, mcShort-
estWay, mcNegativeDirection, mcCurrentDirection)
E BufferMode MC_BUFFER_MODE Defines the chronological sequence of the FB. See 2.4.2
‘Aborting versus Buffered modes’
VAR_OUTPUT
B Done BOOL Commanded position finally reached
E Busy BOOL The FB is not finished and new output values are to be
expected
E Active BOOL Indicates that the FB has control on the axis
E CommandAborted BOOL ‘Command’ is aborted by another command
B Error BOOL Signals that an error has occurred within the Function
Block
E ErrorID WORD Error identification
Notes:
This action completes with velocity zero if no further actions are pending
If there is only one mathematical solution to reach the ‘CommandedPosition’ (like in linear systems), the value of
the input ‘Direction’ is ignored
For modulo axis - valid absolute position values are in the range of [0, 360[, (360 is excluded), or corresponding
range. The application however may shift the ‘CommandedPosition’ of MC_MoveAbsolute into the correspond-
ing modulo range.
The Enum type ‘mcShortestWay’ is focused to a trajectory which will go through the shortest route. The decision
which direction to go is based on the current position where the command is issued.
MC_MoveAbsolute
AXIS_REF Axis Axis AXIS_REF
BOOL Execute Done BOOL
BOOL ContinuousUpdate Busy BOOL
REAL Position Active BOOL
REAL Velocity CommandAborted BOOL
REAL Acceleration Error BOOL
REAL Deceleration ErrorID WORD
REAL Jerk
MC_DIRECTION Direction
MC_BUFFER_MODE BufferMode
TC2 Task Force Motion Control March 17, 2011 © 1999 - 2011 copyright by PLCopen
Function Blocks for Motion Control Version 2.0, Published page 35/ 141
PLCopen
for efficiency in automation
The following figure shows two examples of the combination of two absolute move Function Blocks:
1. The left part of the timing diagram illustrates the case if the Second Function Block is called after the First one.
If First reaches the commanded position of 6000 (and the velocity is 0) then the output ‘Done’ causes the Second FB
to move to the ‘Position’ 10000.
2. The right part of the timing diagram illustrates the case if the Second move Function Block starts the execution while
the First FB is still executing. In this case the First motion is interrupted and aborted by the Test signal during the
constant velocity of the First FB. The Second FB moves directly to the position 10000 although the position of 6000
is not yet reached.
TC2 Task Force Motion Control March 17, 2011 © 1999 - 2011 copyright by PLCopen
Function Blocks for Motion Control Version 2.0, Published page 36/ 141
PLCopen
for efficiency in automation
3.6. MC_MoveRelative
FB-Name MC_MoveRelative
This Function Block commands a controlled motion of a specified distance relative to the set position at the time of the
execution.
VAR_IN_OUT
B Axis AXIS_REF Reference to the axis
VAR_INPUT
B Execute BOOL Start the motion at rising edge
E ContinuousUpdate BOOL See 2.4.6 The input ‘ContinuousUpdate’
B Distance REAL Relative distance for the motion (in technical unit [u])
E Velocity REAL Value of the maximum velocity (not necessarily reached)
[u/s]
E Acceleration REAL Value of the acceleration (increasing energy of the motor)
[u/s2]
E Deceleration REAL Value of the deceleration (decreasing energy of the motor)
[u/s2]
E Jerk REAL Value of the Jerk [u/s3]
E BufferMode MC_BUFFER_MODE Defines the chronological sequence of the FB. See 2.4.2
Aborting versus Buffered modes
VAR_OUTPUT
B Done BOOL Commanded distance reached
E Busy BOOL The FB is not finished and new output values are to be ex-
pected
E Active BOOL Indicates that the FB has control on the axis
E CommandAborted BOOL ‘Command’ is aborted by another command
B Error BOOL Signals that an error has occurred within the Function Block
E ErrorID WORD Error identification
Notes: This action completes with velocity zero if no further actions are pending.
MC_MoveRelative
AXIS_REF Axis Axis AXIS_REF
BOOL Execute Done BOOL
BOOL ContinuousUpdate Busy BOOL
REAL Distance Active BOOL
REAL Velocity CommandAborted BOOL
REAL Acceleration Error BOOL
REAL Deceleration ErrorID WORD
REAL Jerk
MC_BUFFER_MODE BufferMode
The following figure shows the example of the combination of two relative move Function Blocks
1. The left part of the timing diagram illustrates the case if the Second Function Block is called after the First
one.
If First reaches the commanded distance 6000 (and the velocity is 0) then the output ‘Done’ causes the Second
FB to move the commanded distance 4000 and moves the axis to the resulting position of 10000.
2. The right part of the timing diagram illustrates the case if the Second move Function Blocks starts the execu-
tion while the First FB is still executing. In this case the First motion is interrupted and aborted by the Test sig-
nal during the constant velocity of the First FB. The Second FB adds on the actual position of 3250 the dis-
tance 4000 and moves the axis to the resulting position of 7250.
TC2 Task Force Motion Control March 17, 2011 © 1999 - 2011 copyright by PLCopen
Function Blocks for Motion Control Version 2.0, Published page 37/ 141
PLCopen
for efficiency in automation
MoveRelative - Example
First Second
MC_MoveRelative MC_MoveRelative
MyAX Axis Axis Axis Axis
GO Execute Done Execute Done Finish
ContinuousUpdate Busy OR ContinuousUpdate Busy
6000 Distance Active 4000 Distance Active
3000 Velocity CommandAborted 2000 Velocity CommandAborted
10 Acceleration Error 10 Acceleration Error
10 Deceleration ErrorID 10 Deceleration ErrorID
0 Jerk 0 Jerk
BufferMode BufferMode
Test
First Sequence of two complete motions Second motion interrupts first motion
Go
0
t
1
Done
0
t
1
Command
Aborted 0 t
1
0
Accelerating
1 t
Constant 0
Decelerating
t
Second 1
Test
0
t
1
Finish
0
t
1
Accelerating
0
t
1
Constant
0
t
1
Decelerating
0
Motion
3000
Velocity 2000
0
10000
7250
relative 6000
Position 3250
TC2 Task Force Motion Control March 17, 2011 © 1999 - 2011 copyright by PLCopen
Function Blocks for Motion Control Version 2.0, Published page 38/ 141
PLCopen
for efficiency in automation
3.7. MC_MoveAdditive
FB-Name MC_MoveAdditive
This Function Block commands a controlled motion of a specified relative distance additional to the most recent com-
manded position in the axis state ‘DiscreteMotion’. The most recent commanded position may be the result of a previ-
ous MC_MoveAdditive motion which was aborted. If the FB is activated in the axis state ‘ContinuousMotion’, the
specified relative distance is added to the set position at the time of the execution.
VAR_IN_OUT
B Axis AXIS_REF Reference to the axis
VAR_INPUT
B Execute BOOL Start the motion at rising edge
E ContinuousUpdate BOOL See 2.4.6 The input ‘ContinuousUpdate’
B Distance REAL Relative distance for the motion (in technical unit [u])
E Velocity REAL Value of the maximum velocity (not necessarily reached)
[u/s]
E Acceleration REAL Value of the acceleration (increasing energy of the motor)
[u/s2]
E Deceleration REAL Value of the deceleration (decreasing energy of the motor)
[u/s2]
E Jerk REAL Value of the Jerk [u/s3]
E BufferMode MC_BUFFER_MODE Defines the chronological sequence of the FB. See 2.4.2
Aborting versus Buffered modes
VAR_OUTPUT
B Done BOOL Commanded distance reached
E Busy BOOL The FB is not finished and new output values are to be ex-
pected
E Active BOOL Indicates that the FB has control on the axis
E CommandAborted BOOL ‘Command’ is aborted by another command
B Error BOOL Signals that an error has occurred within the Function Block
E ErrorID WORD Error identification
Notes: -
MC_MoveAdditive
AXIS_REF Axis Axis AXIS_REF
BOOL Execute Done BOOL
BOOL ContinuousUpdate Busy BOOL
REAL Distance Active BOOL
REAL Velocity CommandAborted BOOL
REAL Acceleration Error BOOL
REAL Deceleration ErrorID WORD
REAL Jerk
MC_BUFFER_MODE BufferMode
The following figure shows two examples of the combination of two Function Blocks while the axis is in ‘DiscreteMo-
tion’ state:
1. The left part of the timing diagram illustrates the case if the Second Function Block is called after the First
one.
If First reaches the commanded distance 6000 (and the velocity is 0) then the output ‘Done’ causes the Second
FB to move the commanded distance 4000 and moves the axis to the resulting position of 10000.
TC2 Task Force Motion Control March 17, 2011 © 1999 - 2011 copyright by PLCopen
Function Blocks for Motion Control Version 2.0, Published page 39/ 141
PLCopen
for efficiency in automation
2. The right part of the timing diagram illustrates the case if the Second move Function Blocks starts the execu-
tion while the First FB is still executing. In this case the First motion is interrupted and aborted by the Test sig-
nal during the constant velocity of the First FB. The Second FB adds on the previous commanded position
of 6000 the distance 4000 and moves the axis to the resulting position of 10000.
TC2 Task Force Motion Control March 17, 2011 © 1999 - 2011 copyright by PLCopen
Function Blocks for Motion Control Version 2.0, Published page 40/ 141
PLCopen
for efficiency in automation
3.8. MC_MoveSuperimposed
FB-Name MC_MoveSuperimposed
This Function Block commands a controlled motion of a specified relative distance additional to an existing motion.
The existing Motion is not interrupted, but is superimposed by the additional motion.
VAR_IN_OUT
B Axis AXIS_REF Reference to the axis
VAR_INPUT
B Execute BOOL Start the motion at rising edge
E ContinuousUpdate BOOL See 2.4.6 The input ‘ContinuousUpdate’
B Distance REAL Additional distance that is to be superimposed (in technical unit [u])
E VelocityDiff REAL Value of the velocity difference of the additional motion (not necessar-
ily reached) [u/s]
E Acceleration REAL Value of the acceleration (increasing energy of the motor) [u/s2]
E Deceleration REAL Value of the deceleration (decreasing energy of the motor) [u/s2]
E Jerk REAL Value of the Jerk [u/s3]
VAR_OUTPUT
B Done BOOL Additional distance superimposed to the ongoing motion
E Busy BOOL The FB is not finished and new output values are to be expected
E CommandAborted BOOL ‘Command’ is aborted by another command
B Error BOOL Signals that an error has occurred within the Function Block
E ErrorID WORD Error identification
E CoveredDistance REAL Displays continuously the covered distance contributed by this FB
since it was started
Note:
If MC_MoveSuperimposed is active, then any other command in aborting mode except MC_MoveSuperimposed
will abort both motion commands: both the MC_MoveSuperimposed and the underlying motion command. In
any other mode, the underlying motion command is not aborted
If MC_MoveSuperimposed is active and another MC_MoveSuperimposed is commanded, only the on-going
MC_MoveSuperimposed command is aborted, and replaced by the new MC_MoveSuperimposed, but not the
underlying motion command
The FB MC_MoveSuperimposed causes a change of the velocity and, if applicable, the commanded position of
an ongoing motion in all relevant states
In the state ‘Standstill’ the FB MC_MoveSuperimposed acts like MC_MoveRelative
The values of ‘Acceleration’, ‘Deceleration’, and ‘Jerk’ are additional values to the on-going motion, and not
absolute ones. With this, the underlying FB always finishes its job in the same period of time regardless of
whether a MC_MoveSuperimposed FB takes place concurrently.
The output ‘Active’ has a different behavior as in buffered FBs.
MC_MoveSuperimposed
AXIS_REF Axis Axis AXIS_REF
BOOL Execute Done BOOL
BOOL ContinuousUpdate Busy BOOL
REAL Distance Active BOOL
REAL VelocityDiff CommandAborted BOOL
REAL Acceleration Error BOOL
REAL Deceleration ErrorID WORD
REAL Jerk CoveredDistance REAL
TC2 Task Force Motion Control March 17, 2011 © 1999 - 2011 copyright by PLCopen
Function Blocks for Motion Control Version 2.0, Published page 41/ 141
PLCopen
for efficiency in automation
MC_MoveRelative MC_MoveSuperimposed
Axis Axis Axis Axis
Execute Done Execute Done
ContinuousUpdate Busy ContinuousUpdate Busy
Distance Active Distance Active
Velocity CommandAborted VelocityDiff CommandAborted
Acceleration Error Acceleration Error
Deceleration ErrorID Deceleration ErrorID
Jerk Jerk CoveredDistance
Direction
BufferMode
TC2 Task Force Motion Control March 17, 2011 © 1999 - 2011 copyright by PLCopen
Function Blocks for Motion Control Version 2.0, Published page 42/ 141
PLCopen
for efficiency in automation
Example of MC_MoveSuperimposed during Camming with modulo axes. In green color the slave position is shown
both with and without MC_MoveSuperimposed:
1 2 3 4 5
2
Takte x 10
Master position
3.9. MC_HaltSuperimposed
FB-Name MC_HaltSuperimposed
This Function Block commands a halt to all superimposed motions of the axis. The underlying motion is not inter-
rupted.
VAR_IN_OUT
B Axis AXIS_REF Reference to the axis
VAR_INPUT
B Execute BOOL Start the action at rising edge
E Deceleration REAL Value of the deceleration [u/s2]
E Jerk REAL Value of the Jerk [u/s3]
VAR_OUTPUT
B Done BOOL Superimposed motion halted
E Busy BOOL The FB is not finished and new output values are to be expected
E CommandAborted BOOL ‘Command’ is aborted by another command
B Error BOOL Signals that an error has occurred within the Function Block
E ErrorID WORD Error identification
-
MC_HaltSuperimposed
AXIS_REF Axis Axis AXIS_REF
BOOL Execute Done BOOL
REAL Deceleration Busy BOOL
REAL Jerk Active BOOL
CommandAborted BOOL
Error BOOL
ErrorID WORD
TC2 Task Force Motion Control March 17, 2011 © 1999 - 2011 copyright by PLCopen
Function Blocks for Motion Control Version 2.0, Published page 44/ 141
PLCopen
for efficiency in automation
3.10. MC_MoveVelocity
FB-Name MC_MoveVelocity
This Function Block commands a never ending controlled motion at a specified velocity.
VAR_IN_OUT
B Axis AXIS_REF Reference to the axis
VAR_INPUT
B Execute BOOL Start the motion at rising edge
E ContinuousUpdate BOOL See 2.4.6 The input ‘ContinuousUpdate’
B Velocity REAL Value of the maximum velocity [u/s]. Can be a signed value.
E Acceleration REAL Value of the acceleration (increasing energy of the motor)
[u/s2]
E Deceleration REAL Value of the deceleration (decreasing energy of the motor)
[u/s2]
E Jerk REAL Value of the Jerk [u/s3]
E Direction MC_DIRECTION Enum type (1-of-3 values: mcPositiveDirection, mcNega-
tiveDirection, and mcCurrentDirection. Note: shortest way
not applicable)
E BufferMode MC_BUFFER_MODE Defines the chronological sequence of the FB. See 2.4.2
Aborting versus Buffered modes
VAR_OUTPUT
B InVelocity BOOL Commanded velocity reached
E Busy BOOL The FB is not finished and new output values are to be ex-
pected
E Active BOOL Indicates that the FB has control on the axis
E CommandAborted BOOL ‘Command’ is aborted by another command
B Error BOOL Signals that an error has occurred within the Function Block
E ErrorID WORD Error identification
Notes:
To stop the motion, the FB has to be interrupted by another FB issuing a new command
The signal ‘InVelocity’ has to be reset when the block is aborted by another block.
Negative velocity * negative direction = positive velocity
In combination with MC_MoveSuperimposed, the output ‘InVelocity’ is SET as long as the contribution of this FB
(MC_MoveVelocity) to the set velocity is equal to the commanded velocity of this FB.
MC_MoveVelocity
AXIS_REF Axis Axis AXIS_REF
BOOL Execute InVelocity BOOL
BOOL ContinuousUpdate Busy BOOL
REAL Velocity Active BOOL
REAL Acceleration CommandAborted BOOL
REAL Deceleration Error BOOL
REAL Jerk ErrorID WORD
MC_DIRECTION Direction
MC_BUFFER_MODE BufferMode
The following figure shows two examples of the combination of two MC_MoveVelocity Function Blocks:
1. The left part of the timing diagram illustrates the case if the Second Function Block is called after the First one
is completed. If First reaches the commanded velocity 3000 then the output ‘First.InVelocity’ AND the signal
Next causes the Second FB to move to the velocity 2000. In the next cycle ‘First.InVelocity’ is Reset and
TC2 Task Force Motion Control March 17, 2011 © 1999 - 2011 copyright by PLCopen
Function Blocks for Motion Control Version 2.0, Published page 45/ 141
PLCopen
for efficiency in automation
‘First.CommandAborted’ is Set. Therefore the ‘Execute’ of the 2nd FB is Reset. And as soon as the axis
reaches ‘Velocity’ 2000 the ‘Second.InVelocity’ is set.
2. The right part of the timing diagram illustrates the case if the Second move Function Block starts the execution
while the First FB is not yet ‘InVelocity’.
The following sequence is shown: The First motion is started again by GO at the input ‘First.Execute’. While
the First FB is still accelerating to reach the velocity 3000 the First FB will be interrupted and aborted because
the Test signal starts the Run of the Second FB. Now the Second FB runs and decelerates the velocity to 2000.
TC2 Task Force Motion Control March 17, 2011 © 1999 - 2011 copyright by PLCopen
Function Blocks for Motion Control Version 2.0, Published page 46/ 141
PLCopen
for efficiency in automation
3.11. MC_MoveContinuousAbsolute
FB-Name MC_MoveContinuousAbsolute
This Function Block commands a controlled motion to a specified absolute position ending with the specified velocity.
VAR_IN_OUT
B Axis AXIS_REF Reference to the axis
VAR_INPUT
B Execute BOOL Start the motion at rising edge
E ContinuousUpdate BOOL See 2.4.6 The input ‘ContinuousUpdate’
B Position REAL Commanded position for the motion (in technical unit
[u]) (negative or positive)
B EndVelocity REAL Value of the end velocity [u/s]. Signed value
B Velocity REAL Value of the maximum velocity [u/s]
E Acceleration REAL Value of the acceleration [u/s2]
E Deceleration REAL Value of the deceleration [u/s2]
E Jerk REAL Value of the Jerk [u/s3]
E Direction MC_DIRECTION Enum type (1-of-4 values: mcPositiveDirection,
mcNegativeDirection, mcCurrentDirection and mcShort-
estWay
E BufferMode MC_BUFFER_MODE Defines the chronological sequence of the FB. See 2.4.2
Aborting versus Buffered modes
VAR_OUTPUT
B InEndVelocity BOOL Commanded distance reached and running at requested
end velocity
E Busy BOOL The FB is not finished and new output values are to be
expected
E Active BOOL Indicates that the FB has control on the axis
E CommandAborted BOOL ‘Command’ is aborted by another command
B Error BOOL Signals that an error has occurred within the Function
Block
B ErrorID WORD Error identification
Notes:
If the commanded position is reached and no new motion command is put into the buffer, the axis continues to run
with the specified ‘EndVelocity’.
State ‘ContinuousMotion’ (meaning: it will not stop by itself).
This FB can be replaced by the combination of MC_MoveAbsolute and MC_MoveVelocity if BufferMode is im-
plemented on those FBs
MC_MoveContinuousAbsolute
AXIS_REF Axis Axis AXIS_REF
BOOL Execute InEndVelocity BOOL
BOOL ContinuousUpdate Busy BOOL
REAL Position Active BOOL
REAL EndVelocity CommandAborted BOOL
REAL Velocity Error BOOL
REAL Acceleration ErrorID WORD
REAL Deceleration
REAL Jerk
MC_BUFFER_MODE BufferMode
TC2 Task Force Motion Control March 17, 2011 © 1999 - 2011 copyright by PLCopen
Function Blocks for Motion Control Version 2.0, Published page 47/ 141
PLCopen
for efficiency in automation
One linear axis that is carrying a laser device that is used to cut a workpiece.
1. Move the laser with fast velocity over the position lrStartCutPos. The laser is off during this movement:
2. Turn back and make sure to have the speed lrCutVelocity when at lrStartCutPos. At this position, switch the la-
ser on:
3. Travel over the work piece with this constant speed while the laser is on:
4. When reaching lrEndCutPos switch off the laser and move back to idle position with fast velocity:
During the cutting process the laser must be moved with a fix velocity, no acceleration or deceleration phase can be
tolerated. The laser must be moved to its waiting position after the cutting was done.
This can be achieved with the FB MC_MoveContinuousAbsolute in the following way:
TC2 Task Force Motion Control March 17, 2011 © 1999 - 2011 copyright by PLCopen
Function Blocks for Motion Control Version 2.0, Published page 48/ 141
PLCopen
for efficiency in automation
Started with a rising edge of xStartCuttingCycle, the instance ‘mca’ of MC_MoveContinuousAbsolute will move the
axis with lrFastVelocity over lrStartCutPos, turn back and have the speed lrCutVelocity when reaching lrStartCutPos
again in negative direction. In this point in time, ‘InEndVelocity’ is set, and the laser is switched on. As no other motion
FB interrupts this movement, MC_MoveContinuousAbsolute will keep travelling in negative direction with the current
speed. After the axis has overstepped the position lrEndPos, where the laser is switched off, the MC_MoveAbsolute
instance ‘ma’ moves the axis with high speed to its idle position:
TC2 Task Force Motion Control March 17, 2011 © 1999 - 2011 copyright by PLCopen
Function Blocks for Motion Control Version 2.0, Published page 49/ 141
PLCopen
for efficiency in automation
3.12. MC_MoveContinuousRelative
FB-Name MC_MoveContinuousRelative
This Function Block commands a controlled motion of a specified relative distance ending with the specified velocity.
VAR_IN_OUT
B Axis AXIS_REF Reference to the axis
VAR_INPUT
B Execute BOOL Start the motion at rising edge
E ContinuousUpdate BOOL See 2.4.6 The input ‘ContinuousUpdate’
B Distance REAL Relative distance for the motion [u]
B EndVelocity REAL Value of the end velocity [u/s]. Signed value
B Velocity REAL Value of the maximum velocity [u/s]
E Acceleration REAL Value of the acceleration [u/s2]
E Deceleration REAL Value of the deceleration [u/s2]
E Jerk REAL Value of the Jerk [u/s3]
E BufferMode MC_BUFFER_MODE Defines the chronological sequence of the FB. See 2.4.2
Aborting versus Buffered modes
VAR_OUTPUT
B InEndVelocity BOOL Commanded distance reached and running at requested
end velocity
E Busy BOOL The FB is not finished and new output values are to be
expected
E Active BOOL Indicates that the FB has control on the axis
E CommandAborted BOOL ‘Command’ is aborted by another command
B Error BOOL Signals that an error has occurred within the Function
Block
B ErrorID WORD Error identification
Notes:
If the commanded position is reached and no new motion command is put into the buffer, the axis continues to run
with the specified ‘EndVelocity’.
State ‘ContinuousMotion’ (meaning: it will not stop by itself).
This FB is specified here for systems without the support for the ‘BufferMode’.
This FB can be replaced by the combination of MC_MoveAbsolute and MC_MoveVelocity if BufferMode is im-
plemented on those FBs
MC_MoveContinuousRelative
AXIS_REF Axis Axis AXIS_REF
BOOL Execute InEndVelocity BOOL
BOOL ContinuousUpdate Busy BOOL
REAL Distance Active BOOL
REAL EndVelocity CommandAborted BOOL
REAL Velocity Error BOOL
REAL Acceleration ErrorID WORD
REAL Deceleration
REAL Jerk
MC_BUFFER_MODE BufferMode
These two sampling traces show the effect of the sign of the value of the input ‘EndVelocity’:
1. ‘EndVelocity’ with positive direction:
TC2 Task Force Motion Control March 17, 2011 © 1999 - 2011 copyright by PLCopen
Function Blocks for Motion Control Version 2.0, Published page 50/ 141
PLCopen
for efficiency in automation
TC2 Task Force Motion Control March 17, 2011 © 1999 - 2011 copyright by PLCopen
Function Blocks for Motion Control Version 2.0, Published page 51/ 141
PLCopen
for efficiency in automation
Example of MC_MoveContinuousRelative:
Velocity
50
20 20
FB1.Start
FB1.Aborted
FB2.InEndVelocity = FB3.Execute
TC2 Task Force Motion Control March 17, 2011 © 1999 - 2011 copyright by PLCopen
Function Blocks for Motion Control Version 2.0, Published page 52/ 141
PLCopen
for efficiency in automation
3.13. MC_TorqueControl
FB-Name MC_TorqueControl
This Function Block continuously exerts a torque or force of the specified magnitude. This magnitude is ap-
proached using a defined ramp (‘TorqueRamp’), and the Function Block sets the ‘InTorque’ output if the com-
manded torque level is reached. This function block is applicable for force and torque. When there is no external
load, force is applicable. Positive torque is in the positive direction of velocity.
VAR_IN_OUT
B Axis AXIS_REF Reference to the axis
VAR_INPUT
B Execute BOOL Starts the motion on a rising edge
E ContinuousUpdate BOOL See 2.4.6 The input ‘ContinuousUpdate’
B Torque REAL Value of the torque (Torque or force in technical unit [u])
E TorqueRamp REAL The maximum time derivative of the set value of the
torque or force (in technical unit per sec. [u/s])
E Velocity REAL Absolute value of the maximum velocity.
E Acceleration REAL Value of the maximum acceleration (acceleration is appli-
cable with same sign of torque and velocity)
E Deceleration REAL Value of the maximum deceleration (deceleration is appli-
cable with opposite signs of torque and velocity)
E Jerk REAL Value of the maximum jerk
E Direction MC_DIRECTION Enum type (1 of 2 values: mcPositiveDirection, mcNega-
tiveDirection or mcCurrentDirection). Specifies the direc-
tion of the torque. (Note: Torque input can be signed
value).
E BufferMode MC_BUFFER_MODE Defines the chronological sequence of the FB. See 2.4.2
Aborting versus Buffered modes
VAR_OUTPUT
B InTorque BOOL Setpoint value of torque or force equals the commanded
value
E Busy BOOL The FB is not finished and new output values are to be
expected
E Active BOOL Indicates that the FB has control on the axis
E CommandAborted BOOL ‘Command’ is aborted by another command
B Error BOOL Signals that an error has occurred within the Function
Block
E ErrorID WORD Error identification
Notes:
1. The movement is limited by velocity, acceleration / deceleration, and jerk, or by the value of the torque, de-
pending on the mechanical circumstances.
2. Specific additional tests are outside this FB. For instance, checking on the traveled distance could be done via
tracing the actual positions during the action.
3. ‘Velocity’ is a limit input and is always a positive value. The direction is dependent on the torque and load.
4. The axis ceases to be in ‘Torque’ control mode when any motion control (not administrative) Function Block
is accepted on the same axis.
TC2 Task Force Motion Control March 17, 2011 © 1999 - 2011 copyright by PLCopen
Function Blocks for Motion Control Version 2.0, Published page 53/ 141
PLCopen
for efficiency in automation
MC_TorqueControl
AXIS_REF Axis Axis AXIS_REF
BOOL Execute InTorque BOOL
BOOL ContinuousUpdate Busy BOOL
REAL Torque Active BOOL
REAL TorqueRamp CommandAborted BOOL
REAL Velocity Error BOOL
REAL Acceleration ErrorID WORD
REAL Deceleration
REAL Jerk
MC_DIRECTION Direction
MC_BUFFER_MODE BufferMode
The example below shows the typical behavior of an intermediate “resistive” load (see ‘Deceleration’ limit) with some
“inertia” (see ‘TorqueRamp’ limit).
TC2 Task Force Motion Control March 17, 2011 © 1999 - 2011 copyright by PLCopen
Function Blocks for Motion Control Version 2.0, Published page 54/ 141
PLCopen
for efficiency in automation
The second example (below) opposite signs for ‘Direction’ & ‘Torque’ are used (e.g. Retention or brake control). (In
the FB: +Direction –Torque). It is like an unwinding application with torque on the material, and a break in the material.
When the material breaks, as shown in the middle of the picture, this causes a drop in the real Torque value (in absolute
terms): the velocity will decrease, limited by the fastest “deceleration” limit specified by the ‘Deceleration’
VAR_INPUT down to zero velocity (with no tension there is a risk of having shock breakings, so we have to limit to the
fastest). In this case the torque setpoint might not be achieved.
Direction
Material
Loose material force
Initial Torque from (no tension) Tension Recovered
previous state Time
Commanded Torque
- “TorqueRamp”
limiter Actual Torque -
Initial velocity from
max
previous state “Deceleration”
limit
max
“Deceleration”
Actual Velocity limit
Execute
Time
NOTE: In an unwinding application (derived from this brake control) material tension is the target, not motor torque.
The instantaneous diameter of the roll should be taken into account to transform the “User tension setpoint”. Also addi-
tional inertia compensation by modification of the torque setpoint for acceleration / deceleration is common from instan-
taneous weight data (weight is commonly estimated from diameter). Additionally in unwinding applications, in the case
of loose material (same condition as material break), a negative slow velocity reference is usually applied in order to
“rewind” the loose material. In this case, this has to be provided by external programming.
TC2 Task Force Motion Control March 17, 2011 © 1999 - 2011 copyright by PLCopen
Function Blocks for Motion Control Version 2.0, Published page 55/ 141
PLCopen
for efficiency in automation
3.14. MC_PositionProfile
FB-Name MC_PositionProfile
This Function Block commands a time-position locked motion profile
VAR_IN_OUT
B Axis AXIS_REF Reference to the axis
B TimePosition MC_TP_REF Reference to Time / Position. Description - see note below
VAR_INPUT
B Execute BOOL Start the motion at rising edge
E ContinuousUpdate BOOL See 2.4.6 The input ‘ContinuousUpdate’
E TimeScale REAL Overall time scaling factor of the profile
E PositionScale REAL Overall Position scaling factor
E Offset REAL Overall offset for profile [u]
E BufferMode MC_BUFFER_MODE Defines the chronological sequence of the FB. See 2.4.2
Aborting versus Buffered modes
VAR_OUTPUT
B Done BOOL Profile completed
E Busy BOOL The FB is not finished and new output values are to be
expected
E Active BOOL Indicates that the FB has control on the axis
E CommandAborted BOOL ‘Command’ is aborted by another command
B Error BOOL Signals that an error has occurred within the Function
block
E ErrorID WORD Error identification
Notes:
MC_TP_REF is a supplier specific data type. An example for this datatype is given below:
The content of a Time/Position pair may be expressed in DeltaTime/Pos, where Delta could be the differ-
ence in time between two successive points.
TYPE
MC_TP : STRUCT
DeltaTime : TIME;
Position : REAL;
END_STRUCT;
END_TYPE
TYPE
MC_TP_REF : STRUCT
NumberOfPairs : WORD;
IsAbsolute : BOOL;
MC_TP_Array : ARRAY [1..N] OF MC_TP;
END_STRUCT;
END_TYPE
This functionality does not mean it runs one profile over and over again: it can switch between different pro-
files
Alternatively to this FB, the FB MC_CamIn coupled to a virtual master can be used
TC2 Task Force Motion Control March 17, 2011 © 1999 - 2011 copyright by PLCopen
Function Blocks for Motion Control Version 2.0, Published page 56/ 141
PLCopen
for efficiency in automation
MC_PositionProfile
AXIS_REF Axis Axis AXIS_REF
MC_TP_REF TimePosition TimePosition MC_TP_REF
BOOL Execute Done BOOL
BOOL ContinuousUpdate Busy BOOL
REAL TimeScale Active BOOL
REAL PositionScale CommandAborted BOOL
REAL Offset Error BOOL
MC_BUFFER_MODE BufferMode ErrorID WORD
s, v, a
Position
Pos2
Pos3
Pos4
Pos1
Acceleration
Time
0
Velocity
deltaTime absPos
dT1 Pos1
dT2 Pos2
dT3 Pos3
dT4 Pos4
TC2 Task Force Motion Control March 17, 2011 © 1999 - 2011 copyright by PLCopen
Function Blocks for Motion Control Version 2.0, Published page 57/ 141
PLCopen
for efficiency in automation
3.15. MC_VelocityProfile
FB-Name MC_VelocityProfile
This Function Block commands a time-velocity locked motion profile. The velocity in the final element in the profile
should be maintained. The state remains ‘ContinuousMotion’.
VAR_IN_OUT
B Axis AXIS_REF Reference to the axis
B TimeVelocity MC_TV_REF Reference to Time / Velocity. Description - see note below
VAR_INPUT
B Execute BOOL Start the motion at rising edge
E ContinuousUpdate BOOL See 2.4.6 The input ‘ContinuousUpdate’
E TimeScale REAL Overall time scaling factor of the profile
E VelocityScale REAL Overall velocity scaling factor of the profile
E Offset REAL Overall offset for profile [u/s]
E BufferMode MC_BUFFER_MODE Defines the chronological sequence of the FB. See 2.4.2
Aborting versus Buffered modes
VAR_OUTPUT
B ProfileCompleted BOOL End of profile reached
E Busy BOOL The FB is not finished and new output values are to be ex-
pected
E Active BOOL Indicates that the FB has control on the axis
E CommandAborted BOOL ‘Command’ is aborted by another command
B Error BOOL Signals that an error has occurred within the Function Block
E ErrorID WORD Error identification
Notes:
MC_TV_REF is a supplier specific datatype. An example for this datatype is given here below:
The content of Time/Velocity pair may be expressed in DeltaTime/Velocity, where Delta could be the dif-
ference in time between two successive points. Velocity can be a signed value.
TYPE
MC_TV : STRUCT
DeltaTime : TIME;
Velocity : REAL;
END_STRUCT;
END_TYPE
TYPE
MC_TV_REF : STRUCT
NumberOfPairs : WORD;
MC_TV_Array : ARRAY [1..N] of MC_TV;
END_STRUCT;
END_TYPE
This functionality does not mean it runs one profile over and over again: it can switch between different profiles
Alternatively to this FB, the CAM FB coupled to a virtual master can be used
TC2 Task Force Motion Control March 17, 2011 © 1999 - 2011 copyright by PLCopen
Function Blocks for Motion Control Version 2.0, Published page 58/ 141
PLCopen
for efficiency in automation
MC_VelocityProfile
AXIS_REF Axis Axis AXIS_REF
MC_TV_REF TimeVelocity TimeVelocity MC_TV_REF
BOOL Execute ProfileCompleted BOOL
BOOL ContinuousUpdate Busy BOOL
REAL TimeScale Active BOOL
REAL VelocityScale CommandAborted BOOL
REAL Offset Error BOOL
MC_BUFFER_MODE BufferMode ErrorID WORD
TC2 Task Force Motion Control March 17, 2011 © 1999 - 2011 copyright by PLCopen
Function Blocks for Motion Control Version 2.0, Published page 59/ 141
PLCopen
for efficiency in automation
3.16. MC_AccelerationProfile
FB-Name MC_AccelerationProfile
This Function Block commands a time-acceleration locked motion profile. After finalizing the acceleration pro-
file, the acceleration goes to 0 (and typically the final velocity is maintained). It stays in the state ‘ContinuousMo-
tion’.
VAR_IN_OUT
B Axis AXIS_REF Reference to the axis
B TimeAcceleration MC_TA_REF Reference to Time / Acceleration. Description – see note
below
VAR_INPUT
B Execute BOOL Start the motion at rising edge
E ContinuousUpdate BOOL See 2.4.6 The input ‘ContinuousUpdate’
E TimeScale REAL Overall time scaling factor of the profile
E AccelerationScale REAL Scale factor for acceleration amplitude
E Offset REAL Overall offset for profile [u/s2]
E BufferMode MC_BUFFER_MODE Defines the chronological sequence of the FB. See 2.4.2
Aborting versus Buffered modes
VAR_OUTPUT
B ProfileCompleted BOOL End of profile reached
E Busy BOOL The FB is not finished and new output values are to be
expected
E Active BOOL Indicates that the FB has control on the axis
E CommandAborted BOOL ‘Command’ is aborted by another command
B Error BOOL Signals that an error has occurred within the Function
Block
E ErrorID WORD Error identification
Notes:
MC_TA_REF is a supplier specific datatype. An example for this datatype is given here below:
The content of Time/Acceleration pair may be expressed in DeltaTime/Acceleration, where Delta could
be the difference in time between two successive points.
TYPE
MC_TA : STRUCT
DeltaTime : TIME;
Acceleration : REAL;
END_STRUCT;
END_TYPE
TYPE
MC_TA_REF : STRUCT
NumberOfPairs : WORD;
MC_TA_Array : ARRAY [1..N] of MC_TA;
END_STRUCT;
END_TYPE
alternatively to this FB, the CAM FB coupled to a virtual master can be used
TC2 Task Force Motion Control March 17, 2011 © 1999 - 2011 copyright by PLCopen
Function Blocks for Motion Control Version 2.0, Published page 60/ 141
PLCopen
for efficiency in automation
MC_AccelerationProfile
AXIS_REF Axis Axis AXIS_REF
MC_TA_REF TimeAcceleration TimeAcceleration MC_TA_REF
BOOL Execute ProfileCompleted BOOL
BOOL ContinuousUpdate Busy BOOL
REAL TimeScale Active BOOL
REAL AccelerationScale CommandAborted BOOL
REAL Offset Error BOOL
MC_BUFFER_MODE BufferMode ErrorID WORD
Advantages:
Compact description of a profile
Smooth profile properties by nature
Low processor power requirements
Disadvantages
Higher programming abstraction level with existing tools
80000.00
60000.00
Part 1 Part 2
40000.00
Acceleration [mm/sec^2]
20000.00
0.00
-20000.00
-40000.00
-60000.00
Time [sec]
TC2 Task Force Motion Control March 17, 2011 © 1999 - 2011 copyright by PLCopen
Function Blocks for Motion Control Version 2.0, Published page 61/ 141
PLCopen
for efficiency in automation
Position
Lift profile (10 segments)
Velocity
6000 80000
5000 60000
Position [inc]
[inc/sec]
4000
Velovity
40000
3000
20000
2000
1000 0
0 -20000
0.000
0.100
0.200
0.300
0.400
0.500
0.600
Time [sec]
TC2 Task Force Motion Control March 17, 2011 © 1999 - 2011 copyright by PLCopen
Function Blocks for Motion Control Version 2.0, Published page 62/ 141
PLCopen
for efficiency in automation
3.17. MC_SetPosition
FB-Name MC_SetPosition
This Function Block shifts the coordinate system of an axis by manipulating both the set-point position as well as the
actual position of an axis with the same value without any movement caused. (Re-calibration with same following er-
ror). This can be used for instance for a reference situation. This Function Block can also be used during motion with-
out changing the commanded position, which is now positioned in the shifted coordinate system.
VAR_IN_OUT
B Axis AXIS_REF Reference to the axis
VAR_INPUT
B Execute BOOL Start setting position in axis
B Position REAL Position unit [u] (Means ‘Distance’ if ‘Relative’= TRUE)
E Relative BOOL ‘Relative’ distance if True, ‘Absolute’ position if False (= Default)
E ExecutionMode MC_EXECUTION ENUM. Defines the chronological sequence of the FB.
_MODE mcImmediately - the functionality is immediately valid and may
influence the on-going motion but not the state (note: is the default
behaviour)
mcQueued - Same functionality as buffer mode ‘Buffered’
VAR_OUTPUT
B Done BOOL ‘Position’ has new value
E Busy BOOL The FB is not finished and new output values are to be expected
B Error BOOL Signals that an error has occurred within the Function Block
E ErrorID WORD Error identification
Note:
‘Relative’ means that ‘Position’ is added to the actual position value of the axis at the time of execution. This results in
a recalibration by a specified distance. ‘Absolute’ means that the actual position value of the axis is set to the value
specified in the ‘Position’ parameter.
MC_SetPosition
AXIS_REF Axis Axis AXIS_REF
BOOL Execute Done BOOL
REAL Position Busy BOOL
BOOL Relative Error BOOL
MC_EXECUTION_MODE ExecutionMode ErrorID WORD
TC2 Task Force Motion Control March 17, 2011 © 1999 - 2011 copyright by PLCopen
Function Blocks for Motion Control Version 2.0, Published page 63/ 141
PLCopen
for efficiency in automation
3.18. MC_SetOverride
FB-Name MC_SetOverride
This Function Block sets the values of override for the whole axis, and all functions that are working on that axis. The
override parameters contribute as a factor to the calculation of the commanded velocity, acceleration and jerk of the
motion.
VAR_IN_OUT
B Axis AXIS_REF Reference to the axis
VAR_INPUT
B Enable BOOL If SET, it writes the value of the override factor continuously. If
RESET it should keep the last value.
B VelFactor REAL New override factor for the velocity
E AccFactor REAL New override factor for the acceleration/deceleration
E JerkFactor REAL New override factor for the jerk
VAR_OUTPUT
B Enabled BOOL Signals that the override factor(s) is (are) set successfully
E Busy BOOL The FB is not finished and new output values are to be expected
B Error BOOL Signals that an error has occurred within the Function Block
E ErrorID WORD Error identification
Notes:
1. The Input AccFactor acts on positive and negative acceleration (deceleration).
2. This Function Block sets the factor. The override factor is valid until a new override is set.
3. The default values of the override factor are 1.0.
4. The value of the overrides can be between 0.0 and 1.0. The behavior of values > 1.0 is vendor specific. Values
< 0.0 are not allowed. The value 0.0 is not allowed for ‘AccFactor’ and ‘JerkFactor’.
5. The value 0.0 set to the ‘VelFactor’ stops the axis without bringing it to the state ‘Standstill’.
6. Override does not act on slave axes. (Axes in the state synchronized motion).
7. The Function Block does not influence the state diagram of the axis.
8. ‘VelFactor’ can be changed at any time and acts directly on the ongoing motion.
9. If in ‘Discrete’ motion, reducing the ‘AccFactor’ and/or ‘JerkFactor’ can lead to a position overshoot – a pos-
sible cause of damage
10. Activating this Function Block on an axis that is under control of MC_PositionProfile, MC_VelocityProfile, or
MC_AccelerationProfile, is vendor specific.
MC_SetOverride
AXIS_REF Axis Axis AXIS_REF
BOOL Enable Enabled BOOL
REAL VelFactor Busy BOOL
REAL AccFactor Error BOOL
REAL JerkFactor ErrorID WORD
TC2 Task Force Motion Control March 17, 2011 © 1999 - 2011 copyright by PLCopen
Function Blocks for Motion Control Version 2.0, Published page 64/ 141
PLCopen
for efficiency in automation
1.0
0.5
AccFactor
0.0
1.0
0.5
VelFactor
0.0
Enable
Enabled
Error
1.0
0.5
Velocity
0.0
t
1 2 3 4
TC2 Task Force Motion Control March 17, 2011 © 1999 - 2011 copyright by PLCopen
Function Blocks for Motion Control Version 2.0, Published page 65/ 141
PLCopen
for efficiency in automation
FB-Name MC_ReadParameter
This Function Block returns the value of a vendor specific parameter. The returned Value has to be converted to Real
if necessary. If not possible, the vendor has to supply a vendor specific FB to read the parameter.
VAR_IN_OUT
B Axis AXIS_REF Reference to the axis
VAR_INPUT
B Enable BOOL Get the value of the parameter continuously while enabled
B ParameterNumber INT Number of the parameter. One can also use symbolic parameter
names which are declared as VAR CONST.
VAR_OUTPUT
B Valid BOOL A valid output is available at the FB
E Busy BOOL The FB is not finished and new output values are to be expected
B Error BOOL Signals that an error has occurred within the Function Block
E ErrorID WORD Error identification
B Value REAL Value of the specified parameter in the datatype, as specified by the
vendor
Note: The parameters are defined in the table below.
MC_ReadParameter
AXIS_REF Axis Axis AXIS_REF
BOOL Enable Valid BOOL
INT ParameterNumber Busy BOOL
Error BOOL
ErrorID WORD
Value REAL
FB-Name MC_ReadBoolParameter
This Function Block returns the value of a vendor specific parameter with datatype BOOL.
VAR_IN_OUT
B Axis AXIS_REF Reference to the axis
VAR_INPUT
B Enable BOOL Get the value of the parameter continuously while enabled
B ParameterNumber INT Number of the parameter. One can also use symbolic parameter
names which are declared as VAR CONST.
VAR_OUTPUT
B Valid BOOL A valid output is available at the FB
E Busy BOOL The FB is not finished and new output values are to be expected
B Error BOOL Signals that an error has occurred within the Function block
E ErrorID WORD Error identification
B Value BOOL Value of the specified parameter in the datatype, as specified by the
vendor
Note: The parameters are defined in the table below
TC2 Task Force Motion Control March 17, 2011 © 1999 - 2011 copyright by PLCopen
Function Blocks for Motion Control Version 2.0, Published page 66/ 141
PLCopen
for efficiency in automation
MC_ReadBoolParameter
AXIS_REF Axis Axis AXIS_REF
BOOL Enable Valid BOOL
INT ParameterNumber Busy BOOL
Error BOOL
ErrorID WORD
Value BOOL
The parameters defined below have been standardized by the task force. Suppliers should use these parameters if they
are offering this functionality.
All read-only parameters as defined may be writable during the initialization phase (supplier dependent).
These parameters are available for use in the application program, and typically are not intended for commissioning
tools like operator panels, etc. (the drive is not visible – only the axis position)
Note: that the most used parameters are accessible via Function Blocks, and are not listed here.
Extensions by any supplier or user are also allowed at the end of the list, although this can affect portability between
different platforms. Parameter-numbers from 0 to 999 are reserved for the standard. Numbers greater than 999 indicate
supplier-specific parameters.
TC2 Task Force Motion Control March 17, 2011 © 1999 - 2011 copyright by PLCopen
Function Blocks for Motion Control Version 2.0, Published page 67/ 141
PLCopen
for efficiency in automation
FB-Name MC_WriteParameter
This Function Block modifies the value of a vendor specific parameter.
VAR_IN_OUT
B Axis AXIS_REF Reference to the axis
VAR_INPUT
B Execute BOOL Write the value of the parameter at rising edge
B ParameterNumber INT Number of the parameter (correspondence between number and
parameter is specified in the table above)
B Value REAL New value of the specified parameter
E ExecutionMode MC_EXECUTION Defines the chronological sequence of the FB.
_MODE mcImmediately - the functionality is immediately valid and may
influence the on-going motion but not the state (note: is the de-
fault behaviour)
mcQueued - Same functionality as buffer mode ‘Buffered’
VAR_OUTPUT
B Done BOOL Parameter successfully written
E Busy BOOL The FB is not finished and new output values are to be expected.
B Error BOOL Signals that an error has occurred within the Function Block
E ErrorID WORD Error identification
Notes: The parameters are defined in the table above (under MC_ReadParameter, writing allowed)
MC_WriteParameter
AXIS_REF Axis Axis AXIS_REF
BOOL Execute Done BOOL
INT ParameterNumber Busy BOOL
REAL Value Error BOOL
MC_EXECUTION_MODE ExecutionMode ErrorID WORD
TC2 Task Force Motion Control March 17, 2011 © 1999 - 2011 copyright by PLCopen
Function Blocks for Motion Control Version 2.0, Published page 68/ 141
PLCopen
for efficiency in automation
FB-Name MC_WriteBoolParameter
This Function Block modifies the value of a vendor specific parameter of type BOOL.
VAR_IN_OUT
B Axis AXIS_REF Reference to the axis
VAR_INPUT
B Execute BOOL Write the value of the parameter at rising edge
B ParameterNumber INT Number of the parameter (correspondence between number and
parameter is specified in the table above)
B Value BOOL New value of the specified parameter
E ExecutionMode MC_EXECUTION Defines the chronological sequence of the FB.
_MODE mcImmediately - the functionality is immediately valid and may
influence the on-going motion but not the state (note: is the de-
fault behaviour)
mcQueued - Same functionality as buffer mode ‘Buffered’.
VAR_OUTPUT
B Done BOOL Parameter successfully written
E Busy BOOL The FB is not finished and new output values are to be expected.
B Error BOOL Signals that an error has occurred within the Function Block
E ErrorID WORD Error identification
Notes: The parameters are defined in the table above (under MC_ReadParameter, writing allowed)
MC_WriteBoolParameter
AXIS_REF Axis Axis AXIS_REF
BOOL Execute Done BOOL
INT ParameterNumber Busy BOOL
BOOL Value Error BOOL
MC_EXECUTION_MODE ExecutionMode ErrorID WORD
TC2 Task Force Motion Control March 17, 2011 © 1999 - 2011 copyright by PLCopen
Function Blocks for Motion Control Version 2.0, Published page 69/ 141
PLCopen
for efficiency in automation
3.21. MC_ReadDigitalInput
FB-Name MC_ReadDigitalInput
This Function Block gives access to the value of the input, referenced by the datatype MC_INPUT_REF. It provides
the value of the referenced input (BOOL)
VAR_IN_OUT
B Input MC_INPUT_REF Reference to the input signal source
VAR_INPUT
B Enable BOOL Get the value of the selected input signal continuously while
enabled
E InputNumber INT Selects the input. Can be part of MC_INPUT_REF, if only one
single input is referenced.
VAR_OUTPUT
B Valid BOOL A valid output is available at the FB
E Busy BOOL The FB is not finished and new output values are to be ex-
pected
B Error BOOL Signals that an error has occurred within the Function Block
E ErrorID WORD Error identification
B Value BOOL The value of the selected input signal
Note: It is not guaranteed that the digital signal will be seen by the FB: a short pulse on the digital input could be over
before the next Function Block cycle occurs.
MC_ReadDigitalInput
MC_INPUT_REF Input Input MC_INPUT_REF
BOOL Enable Valid BOOL
INT InputNumber Busy BOOL
Error BOOL
ErrorID WORD
Value BOOL
TC2 Task Force Motion Control March 17, 2011 © 1999 - 2011 copyright by PLCopen
Function Blocks for Motion Control Version 2.0, Published page 70/ 141
PLCopen
for efficiency in automation
3.22. MC_ReadDigitalOutput
FB-Name MC_ReadDigitalOutput
This Function Block provides access to the value of a digital output, referenced by the datatype MC_OUTPUT_REF. It
provides the value of the referenced output (BOOL).
VAR_IN_OUT
B Output MC_OUTPUT_REF Reference to the signal outputs
VAR_INPUT
B Enable BOOL Get the value of the selected output signal continuously while
enabled
E OutputNumber INT Selects the output. Can be part of MC_OUTPUT_REF, if only
one single output is referenced.
VAR_OUTPUT
B Valid BOOL A valid output is available at the FB
E Busy BOOL The FB is not finished and new output values are to be expected
B Error BOOL Signals that an error has occurred within the the Function Block
E ErrorID WORD Error identification
B Value BOOL The value of the selected output signal
Note: It is not guaranteed that the digital signal will be seen by the FB: a short pulse on the digital output could be over
before the next Function Block cycle occurs.
MC_ReadDigitalOutput
MC_OUTPUT_REF Output Output MC_OUTPUT_REF
BOOL Enable Valid BOOL
INT OutputNumber Busy BOOL
Error BOOL
ErrorID WORD
Value BOOL
TC2 Task Force Motion Control March 17, 2011 © 1999 - 2011 copyright by PLCopen
Function Blocks for Motion Control Version 2.0, Published page 71/ 141
PLCopen
for efficiency in automation
3.23. MC_WriteDigitalOutput
FB-Name MC_WriteDigitalOutput
This Function Block writes a value to the output referenced by the argument ‘Output’ once (with rising edge of Exe-
cute).
VAR_IN_OUT
B Output MC_OUTPUT_REF Reference to the signal output
VAR_INPUT
B Execute BOOL Write the value of the selected output
E OutputNumber INT Selects the output. Can be part of MC_OUTPUT_REF, if only one
single input is referenced.
B Value BOOL The value of the selected output
E ExecutionMode MC_EXECUTION_ Defines the chronological sequence of the FB.
MODE mcImmediately - the functionality is immediately valid and may
influence the on-going motion but not the state (note: is the default
behaviour)
mcQueued - Same functionality as buffer mode ‘Buffered’
VAR_OUTPUT
B Done BOOL Writing of the output signal value is done
E Busy BOOL The FB is not finished and new output values are to be expected
B Error BOOL Signals that an error has occurred within the Function Block
E ErrorID WORD Error identification
Notes: -
MC_WriteDigitalOutput
MC_OUTPUT_REF Output Output MC_OUTPUT_REF
BOOL Execute Done BOOL
INT OutputNumber Busy BOOL
BOOL Value Error BOOL
MC_EXECUTION_MODE ExecutionMode ErrorID WORD
TC2 Task Force Motion Control March 17, 2011 © 1999 - 2011 copyright by PLCopen
Function Blocks for Motion Control Version 2.0, Published page 72/ 141
PLCopen
for efficiency in automation
3.24. MC_ReadActualPosition
FB-Name MC_ReadActualPosition
This Function Block returns the actual position.
VAR_IN_OUT
B Axis AXIS_REF Reference to the axis
VAR_INPUT
B Enable BOOL Get the value of the parameter continuously while enabled
VAR_OUTPUT
B Valid BOOL A valid output is available at the FB
E Busy BOOL The FB is not finished and new output values are to be expected
B Error BOOL Signals that an error has occurred within the Function Block
E ErrorID WORD Error identification
B Position REAL New absolute position (in axis’ unit [u])
MC_ReadActualPosition
AXIS_REF Axis Axis AXIS_REF
BOOL Enable Valid BOOL
Busy BOOL
Error BOOL
ErrorID WORD
Position REAL
TC2 Task Force Motion Control March 17, 2011 © 1999 - 2011 copyright by PLCopen
Function Blocks for Motion Control Version 2.0, Published page 73/ 141
PLCopen
for efficiency in automation
3.25. MC_ReadActualVelocity
FB-Name MC_ReadActualVelocity
This Function Block returns the value of the actual velocity as long as ‘Enable’ is set. ‘Valid’ is true when the data-
output ‘Velocity’ is valid. If ‘Enable’ is Reset, the data loses its validity, and all outputs are reset, no matter if new
data is available.
VAR_IN_OUT
B Axis AXIS_REF Reference to the axis
VAR_INPUT
B Enable BOOL Get the value of the parameter continuously while enabled
VAR_OUTPUT
B Valid BOOL A valid output is available at the FB
E Busy BOOL The FB is not finished and new output values are to be expected
B Error BOOL Signals that an error has occurred within the Function Block
E ErrorID WORD Error identification
B Velocity REAL The value of the actual velocity (in axis’ unit [u/s])
Notes: The output ‘Velocity’ can be a signed value
MC_ReadActualVelocity
AXIS_REF Axis Axis AXIS_REF
BOOL Enable Valid BOOL
Busy BOOL
Error BOOL
ErrorID WORD
Velocity REAL
TC2 Task Force Motion Control March 17, 2011 © 1999 - 2011 copyright by PLCopen
Function Blocks for Motion Control Version 2.0, Published page 74/ 141
PLCopen
for efficiency in automation
3.26. MC_ReadActualTorque
FB-Name MC_ReadActualTorque
This Function Block returns the value of the actual torque or force as long as ‘Enable’ is set. ‘Valid’ is true when the
data-output ‘Torque’ is valid. If ‘Enable’ is Reset, the data loses its validity, and ‘Valid’ is also reset, no matter if new
data is available.
VAR_IN_OUT
B Axis AXIS_REF Reference to the axis
VAR_INPUT
B Enable BOOL Get the value of the parameter continuously while enabled
VAR_OUTPUT
B Valid BOOL A valid output is available at the FB
E Busy BOOL The FB is not finished and new output values are to be expected
B Error BOOL Signals that an error has occurred within the Function Block
E ErrorID WORD Error identification
B Torque REAL The value of the actual torque or force (in technical units)
Notes: The output ‘Torque’ can be a signed value
MC_ReadActualTorque
AXIS_REF Axis Axis AXIS_REF
BOOL Enable Valid BOOL
Busy BOOL
Error BOOL
ErrorID WORD
Torque REAL
TC2 Task Force Motion Control March 17, 2011 © 1999 - 2011 copyright by PLCopen
Function Blocks for Motion Control Version 2.0, Published page 75/ 141
PLCopen
for efficiency in automation
3.27. MC_ReadStatus
FB-Name MC_ReadStatus
This Function Block returns in detail the status of the state diagram of the selected axis.
VAR_IN_OUT
B Axis AXIS_REF Reference to the axis
VAR_INPUT
B Enable BOOL Get the value of the parameter continuously while enabled
VAR_OUTPUT
B Valid BOOL A valid set of outputs is available at the FB
E Busy BOOL The FB is not finished and new output values are to be expected
B Error BOOL Signals that an error has occurred within the Function Block
E ErrorID WORD Error identification
B ErrorStop BOOL See state diagram
B Disabled BOOL See state diagram
B Stopping BOOL See state diagram
E Homing BOOL See state diagram
B Standstill BOOL See state diagram
E DiscreteMotion BOOL See state diagram
E ContinuousMotion BOOL See state diagram
E SynchronizedMotion BOOL See state diagram
MC_ReadStatus
AXIS_REF Axis Axis AXIS_REF
BOOL Enable Valid BOOL
Busy BOOL
Error BOOL
ErrorID WORD
ErrorStop BOOL
Disabled BOOL
Stopping BOOL
Homing BOOL
Standstill BOOL
DiscreteMotion BOOL
ContinuousMotion BOOL
SynchronizedMotion BOOL
TC2 Task Force Motion Control March 17, 2011 © 1999 - 2011 copyright by PLCopen
Function Blocks for Motion Control Version 2.0, Published page 76/ 141
PLCopen
for efficiency in automation
3.28. MC_ReadMotionState
FB-Name MC_ReadMotionState
This Function Block returns in detail the status of the axis with respect to the motion currently in progress.
VAR_IN_OUT
B Axis AXIS_REF Reference to the axis
VAR_INPUT
B Enable BOOL Get the value of the parameter continuously while enabled
E Source MC_SOURCE Defines the source of the relevant data: mcCommandedValue;
mcSetValue, mcActualValue.
VAR_OUTPUT
B Valid BOOL True if a valid set of outputs available
E Busy BOOL The FB is not finished and new output values are to be ex-
pected
B Error BOOL Signals that an error has occurred within the Function block
E ErrorID WORD Error identification
E ConstantVelocity BOOL Velocity is constant. Velocity may be 0. For the actual value a
window is applicable (window is vendor specific)
E Accelerating BOOL Increasing the absolute value of the velocity
E Decelerating BOOL Decreasing the absolute value of the velocity
E DirectionPositive BOOL Signals that the position is increasing
E DirectionNegative BOOL Signals that the position is decreasing
MC_ReadMotionState
AXIS_REF Axis Axis AXIS_REF
BOOL Enable Valid BOOL
MC_SOURCE Source Busy BOOL
Error BOOL
ErrorID WORD
ConstantVelocity BOOL
Accelerating BOOL
Decelerating BOOL
DirectionPositive BOOL
DirectionNegative BOOL
TC2 Task Force Motion Control March 17, 2011 © 1999 - 2011 copyright by PLCopen
Function Blocks for Motion Control Version 2.0, Published page 77/ 141
PLCopen
for efficiency in automation
3.29. MC_ReadAxisInfo
FB-Name MC_ReadAxisInfo
This Function Block reads information concerning an axis, like modes, inputs directly related to the axis, and certain
status information.
VAR_IN_OUT
B Axis AXIS_REF Reference to the axis
VAR_INPUT
B Enable BOOL Get the axis information constantly while enabled
VAR_OUTPUT
B Valid BOOL True if a valid set of outputs is available
E Busy BOOL The FB is not finished and new output values are to be expected
B Error BOOL Signals that an error has occurred within the Function Block
E ErrorID WORD Error identification
E HomeAbsSwitch BOOL Digital home switch input is active
E LimitSwitchPos BOOL Positive hardware end switch is active
E LimitSwitchNeg BOOL Negative hardware end switch is active
E Simulation BOOL Axis is in simulation mode (e.g. motor is simulated)
E CommunicationReady BOOL “Network” is initialized and ready for communication
E ReadyForPowerOn BOOL Drive is ready to be enabled (power on)
E PowerOn BOOL If TRUE shows that the power stage is switched ON
E IsHomed BOOL The absolute reference position is known for the axis (axis is
homed)
E AxisWarning BOOL Warning(s) on the axis is present
MC_ReadAxisInfo
AXIS_REF Axis Axis AXIS_REF
BOOL Enable Valid BOOL
Busy BOOL
Error BOOL
ErrorID WORD
HomeAbsSwitch BOOL
LimitSwitchPos BOOL
LimitSwitchNeg BOOL
Simulation BOOL
CommunicationReady BOOL
ReadyForPowerOn BOOL
PowerOn BOOL
IsHomed BOOL
AxisWarning BOOL
TC2 Task Force Motion Control March 17, 2011 © 1999 - 2011 copyright by PLCopen
Function Blocks for Motion Control Version 2.0, Published page 78/ 141
PLCopen
for efficiency in automation
3.30. MC_ReadAxisError
FB-Name MC_ReadAxisError
This Function Block presents general axis errors not relating to the Function Blocks. (for instance axis errors, drive
errors, communication errors)
VAR_IN_OUT
B Axis AXIS_REF Reference to the axis
VAR_INPUT
B Enable BOOL Get the value of the parameter continuously while enabled
VAR_OUTPUT
B Valid BOOL True if a valid output is available at the FB
E Busy BOOL The FB is not finished and new output values are to be expected
B Error BOOL Signals that an error has occurred within the Function Block
B ErrorID WORD Error identification
E AxisErrorID WORD The value of the axis error. These values are vendor specific
Notes: -
MC_ReadAxisError
AXIS_REF Axis Axis AXIS_REF
BOOL Enable Valid BOOL
Busy BOOL
Error BOOL
ErrorID WORD
AxisErrorID WORD
TC2 Task Force Motion Control March 17, 2011 © 1999 - 2011 copyright by PLCopen
Function Blocks for Motion Control Version 2.0, Published page 79/ 141
PLCopen
for efficiency in automation
3.31. MC_Reset
FB-Name MC_Reset
This Function Block makes the transition from the state ‘ErrorStop’ to ‘Standstill’ or ‘Disabled’ by resetting all inter-
nal axis-related errors – it does not affect the output of the FB instances.
VAR_IN_OUT
B Axis AXIS_REF Reference to the axis
VAR_INPUT
B Execute BOOL Resets all internal axis-related errors
VAR_OUTPUT
B Done BOOL ‘Standstill’ or ‘Disabled’ state is reached
E Busy BOOL The FB is not finished and new output values are to be expected
B Error BOOL Signals that an error has occurred within the Function Block
E ErrorID WORD Error identification
Note: the application of MC_Reset in other states then the state ‘ErrorStop’ is vendor specific
MC_Reset
AXIS_REF Axis Axis AXIS_REF
BOOL Execute Done BOOL
Busy BOOL
Error BOOL
ErrorID WORD
TC2 Task Force Motion Control March 17, 2011 © 1999 - 2011 copyright by PLCopen
Function Blocks for Motion Control Version 2.0, Published page 80/ 141
PLCopen
for efficiency in automation
3.32. MC_DigitalCamSwitch
FB-Name MC_DigitalCamSwitch
This Function Block is the analogy to switches on a motor shaft: it commands a group of discrete output bits to switch
in analogy to a set of mechanical cam controlled switches connected to an axis. Forward and backward movements
are allowed.
VAR_IN_OUT
B Axis AXIS_REF Reference to the axis
B Switches MC_CAMSWITCH_REF Reference to the switching actions.
E Outputs MC_OUTPUT_REF Reference to the signal outputs, directly related to the refer-
enced tracks. (max. 32 per function block) (First output =
first TrackNumber)
E TrackOptions MC_TRACK_REF Reference to structure containing track related properties,
e.g. the ON and OFF compensations per output/track.
VAR_INPUT
B Enable BOOL Enables the ‘Switches’ outputs
E EnableMask DWORD 32 bits of BOOL. Enables the different tracks. Least sig-
nificant data is related to the lowest TrackNumber. With
data SET (to ‘1’ resp. TRUE) the related TrackNumber is
enabled.
E ValueSource MC_SOURCE Defines the source for axis values (e.g. positions):
mcSetValue - Synchronization on set value
mcActualValue - Synchronization on actual value
VAR_OUTPUT
B InOperation BOOL The commanded tracks are enabled
E Busy BOOL The FB is not finished and new output values are to be
expected
B Error BOOL Signals that an error has occurred within the Function
Block
E ErrorID WORD Error identification
Notes:
MC_CAMSWITCH_REFis a vendor specific reference to the pattern data.
MC_OUTPUT_REF is a vendor specific structure linked to the (physical) outputs
MC_TRACK_REF is vendor specific structure containing the track properties, e.g. the compensation per track
(A track is a set of switches related to one output). It can contain the reference to the output also.
This functionality is sometimes called PLS – Phase or Position or Programmable Limit Switch
MC_DigitalCamSwitch
AXIS_REF Axis Axis AXIS_REF
MC_CAMSWITCH_REF Switches Switches MC_CAMSWITCH_REF
MC_OUTPUT_REF Outputs Outputs MC_OUTPUT_REF
MC_TRACK_REF TrackOptions TrackOptions MC_TRACK_REF
BOOL Enable InOperation BOOL
DWORD EnableMask Busy BOOL
MC_SOURCE ValueSource Error BOOL
ErrorID WORD
TC2 Task Force Motion Control March 17, 2011 © 1999 - 2011 copyright by PLCopen
Function Blocks for Motion Control Version 2.0, Published page 81/ 141
PLCopen
for efficiency in automation
This definition of a cam has a start and an end position, so the user can define each single cam, which has a FirstOn-
Position and a LastOnPosition (or time). This Function Block is similar to a mechanical cam but has the additional
advantages that the outputs can be set for a certain time, and to give it a time-compensation and a hysteresis.
The time compensation (OnCompensation and OffCompensation) can be positive or negative. Negative means the
output changes before the switching position is reached.
Hysteresis: This parameter avoids the phenomenon where the output continually switches if the axis is near the switch-
ing point and the actual position is jittering around the switching position. Hysteresis is part of MC_TRACK_REF,
which means that a different hysteresis is possible for each track.
Example of MC_CAMSWITCH_REF
TrackNumber INTEGER 1 1 1 2
TC2 Task Force Motion Control March 17, 2011 © 1999 - 2011 copyright by PLCopen
Function Blocks for Motion Control Version 2.0, Published page 82/ 141
PLCopen
for efficiency in automation
The example below uses the values from the example for MC_CAMSWITCH_REF above. It uses neither
On/OffCompensation, nor hysteresis.
This is the behavior of the outputs, when the axis is moving continuously in the positive direction. The axis is a modulo
axis with a modulo length of 5000 u.
1350 ms
TrackNumber 2 Switch04
W ithout delay
Switch01
125 250
ms ms
TC2 Task Force Motion Control March 17, 2011 © 1999 - 2011 copyright by PLCopen
Function Blocks for Motion Control Version 2.0, Published page 83/ 141
PLCopen
for efficiency in automation
Below the behavior of the outputs, when the axis is moving continuously in the negative direction without
On/OffCompensation and without Hysteresis.
Switch02
TrackNumber
1 Switch03 Switch03
1350 ms
TrackNumber
2 Switch04
TC2 Task Force Motion Control March 17, 2011 © 1999 - 2011 copyright by PLCopen
Function Blocks for Motion Control Version 2.0, Published page 84/ 141
PLCopen
for efficiency in automation
3.33. MC_TouchProbe
FB-Name MC_TouchProbe
This Function Block is used to record an axis position at a trigger event
VAR_IN_OUT
B Axis AXIS_REF Reference to the axis
E TriggerInput MC_TRIGGER_REF Reference to the trigger signal source. Trigger input may be
specified by the AXIS_REF.
VAR_INPUT
B Execute BOOL Starts touch probe recording at rising edge
E WindowOnly BOOL If SET, only use the window (defined hereunder) to accept
trigger events
E FirstPosition REAL Start position from where (positive direction) trigger events
are accepted (in technical units [u]). Value included in win-
dow.
E LastPosition REAL Stop position of the window (in technical units [u]). Value
included in window.
VAR_OUTPUT
B Done BOOL Trigger event recorded
E Busy BOOL The FB is not finished and new output values are to be ex-
pected
E CommandAborted BOOL ‘Command’ is aborted by another command
(MC_AbortTrigger)
B Error BOOL Signals that an error has occurred within the Function Block
E ErrorID WORD Error identification
B RecordedPosition REAL Position where trigger event occurred (in technical units [u])
Notes:
1. Intended for single shot operation, that is the first event after the rising edge at ‘Execute’ is valid for recording
only. Possible following events are ignored
2. One Function Block instance should represent exactly one probing command
3. In case of multiple instances on the same probe and axis, the elements of MC_TRIGGER_REF should be ex-
tended with TouchProbeID - Identification of a unique probing command – this can be linked to MC_AbortTrigger
MC_TouchProbe
AXIS_REF Axis Axis AXIS_REF
MC_TRIGGER_REF TriggerInput TriggerInput MC_TRIGGER_REF
BOOL Execute Done BOOL
BOOL WindowOnly Busy BOOL
REAL FirstPosition CommandAborted BOOL
REAL LastPosition Error BOOL
ErrorID WORD
RecordedPosition REAL
TC2 Task Force Motion Control March 17, 2011 © 1999 - 2011 copyright by PLCopen
Function Blocks for Motion Control Version 2.0, Published page 85/ 141
PLCopen
for efficiency in automation
T RUE
Execute
FALSE t
T RUE
T riggerInput.Signal
FALSE t
T RUE
Done
FALSE t
T RUE
W indowOnly
FALSE t
Axis.Position
LastPosition
RecordedPosition
FirstPosition
accepted accepted
FirstPosition
accepted
LastPosition
Figure 41: Examples of windows, where trigger events are accepted (for modulo axes)
TC2 Task Force Motion Control March 17, 2011 © 1999 - 2011 copyright by PLCopen
Function Blocks for Motion Control Version 2.0, Published page 86/ 141
PLCopen
for efficiency in automation
3.34. MC_AbortTrigger
FB-Name MC_AbortTrigger
This Function Block is used to abort function blocks which are connected to trigger events (e.g. MC_TouchProbe)
VAR_IN_OUT
B Axis AXIS_REF Reference to the axis
E TriggerInput MC_TRIGGER_REF Reference to the trigger signal source. ‘TriggerInput’ may be
specified by the AXIS_REF. See Chapter 3.33 MC_TouchProbe
VAR_INPUT
B Execute BOOL Aborts trigger event at rising edge
VAR_OUTPUT
B Done BOOL Trigger functionality aborted
E Busy BOOL The FB is not finished and new output values are to be expected
B Error BOOL Signals that an error has occurred within the Function Block
E ErrorID WORD Error identification
Notes: -
MC_AbortTrigger
AXIS_REF Axis Axis AXIS_REF
MC_TRIGGER_REF TriggerInput TriggerInput MC_TRIGGER_REF
BOOL Execute Done BOOL
Busy BOOL
Error BOOL
ErrorID WORD
TC2 Task Force Motion Control March 17, 2011 © 1999 - 2011 copyright by PLCopen
Function Blocks for Motion Control Version 2.0, Published page 87/ 141
PLCopen
for efficiency in automation
Postion
Slave
Master Position
Basically, one can differentiate between two types of Camming for both modulo and linear (or finite) master axes:
Periodic mode - repeats the execution of the Cam profile on a continuous basis, even if the CAM profile does not
match the modulo. This means that for a modulo axis with modulo is 360 degrees, and the CAM profiles is speci-
fied for 90 degrees it will be executed 4 times in a modulo. In reverse mode the profile is executed the inverse way.
Non-periodic mode – the CAM profile is run only once. If the master position is outside of the Cam profile, the
slave axis stays in synchronized motion and keeps the last position. In reverse mode, the CAM profile is not exe-
cuted after having reached the ‘EndOfProfile’ position. The 90 degrees example above will be run only once.
Camming may be done with several combined cam tables which are executed sequentially, like a ramp-in, a production
cycle, and a ramp-out. Between the different cam curves may be a gap (wait for trigger) in the execution. However, one
could the buffered mode or use the output ‘EndOfProfile’ to start the next profile.
CAM table
Camming is done with one table (two dimensional – describing master and slave positions together) or two tables - for
master and slave positions separately. The table should be strictly monotonic rising or falling, going both reverse and
forward with the master.
It is allowed and possible to change tables while CAM is running and to change elements in the table while the CAM is
running.
The generation and filling of the CAM table (master, slave) is performed by an external tool, which is supplier specific.
The coupling of the FB MC_CamIn to the table is also supplier-specific.
TC2 Task Force Motion Control March 17, 2011 © 1999 - 2011 copyright by PLCopen
Function Blocks for Motion Control Version 2.0, Published page 88/ 141
PLCopen
for efficiency in automation
TC2 Task Force Motion Control March 17, 2011 © 1999 - 2011 copyright by PLCopen
Function Blocks for Motion Control Version 2.0, Published page 89/ 141
PLCopen
for efficiency in automation
4.2. MC_CamTableSelect
FB-Name MC_CamTableSelect
This Function Block selects the CAM tables by setting the connections to the relevant tables
VAR_IN_OUT
E Master AXIS_REF Reference to the master axis
E Slave AXIS_REF Reference to the slave axis
B CamTable MC_CAM_REF Reference to CAM description
VAR_INPUT
B Execute BOOL Selection at rising edge
E Periodic BOOL 1 = periodic, 0 = non periodic (single-shot)
E MasterAbsolute BOOL 1 = absolute; 0 = relative coordinates
E SlaveAbsolute BOOL 1 = absolute; 0 = relative coordinates
E ExecutionMode MC_EXECUTION_ Defines the chronological sequence of the FB.
MODE mcImmediately - the functionality is immediately valid and may
influence the on-going motion but not the state (note: is the
default behaviour)
mcQueued - Same functionality as buffer mode ‘Buffered’.
VAR_OUTPUT
B Done BOOL Pre-selection done
E Busy BOOL The FB is not finished and new output values are to be ex-
pected
B Error BOOL Signals that an error has occurred within the Function Block
E ErrorID WORD Error identification
E CamTableID MC_CAM_ID Identifier of CAM Table to be used in the MC_CamIn FB
Notes:
A virtual axis can be used as master axis
MC_CAM_REF is a supplier specific data type
MC_CAM_ID is a supplier specific data type
MC_CamTableSelect makes data available. This can include:
1. Starting point of a download of a profile
2. Start to generate a CAM profile
When the Done output is SET, the CamTableID is valid and ready for use in a MC_CamIn FB.
Possible parameters within the structure CAM_TABLE_REF are:
o E MasterPositions REAL, List of expressions of the MasterValues for the ‘CamTable’
o E SlavePositions REAL, List of expressions of the SlaveValues for the ‘CamTable’
MC_CamTableSelect
AXIS_REF Master Master AXIS_REF
AXIS_REF Slave Slave AXIS_REF
MC_CAM_REF CamTable CamTable MC_CAM_REF
BOOL Execute Done BOOL
BOOL Periodic Busy BOOL
BOOL MasterAbsolute Error BOOL
BOOL SlaveAbsolute ErrorID WORD
MC_EXECUTION_MODE ExecutionMode CamTableID MC_CAM_ID
TC2 Task Force Motion Control March 17, 2011 © 1999 - 2011 copyright by PLCopen
Function Blocks for Motion Control Version 2.0, Published page 90/ 141
PLCopen
for efficiency in automation
4.3. MC_CamIn
FB-Name MC_CamIn
This Function Block engages the CAM
VAR_IN_OUT
B Master AXIS_REF Reference to the master axis
B Slave AXIS_REF Reference to the slave axis
VAR_INPUT
B Execute BOOL Start at rising edge
E ContinuousUpdate BOOL See 2.4.6 The input ‘ContinuousUpdate’
E MasterOffset REAL Offset of the master shaft to cam.
E SlaveOffset REAL Offset of slave table.
E MasterScaling REAL Factor for the master profile (default = 1.0). From the
slave point of view the master overall profile is multiplied
by this factor
E SlaveScaling REAL Factor for the slave profile (default = 1.0). The overall
slave profile is multiplied by this factor.
E MasterStartDistance REAL The master distance for the slave to start to synchronize to
the master.
E MasterSyncPosition REAL The position of the master in the CAM profile where the
slave is in-sync with the master. (if the ‘MasterSyncPosi-
tion’ does not exist, at the first point of the CAM profile
the master and slave are synchronized.) Note: the inputs
acceleration, decelerations and jerk are not added here
E StartMode MC_START_MODE Start mode: mcAbsolute, mcRelative, or mcRampIn
E MasterValueSource MC_SOURCE Defines the source for synchronization:
mcSetValue - Synchronization on master set value
mcActualValue - Synchronization on master actual value
E CamTableID MC_CAM_ID Identifier of CAM Table to be used, linked to output of
MC_CamTableSelect
E BufferMode MC_BUFFER_MODE Defines the chronological sequence of the FB. See 2.4.2
Aborting versus Buffered modes
VAR_OUTPUT
B InSync BOOL Is TRUE if the set value = the commanded value.
E Busy BOOL The FB is not finished and new output values are to be
expected
E Active BOOL Indicates that the FB has control on the axis
E CommandAborted BOOL ‘Command’ is aborted by another command
B Error BOOL Signals that an error has occurred within the Function
Block
E ErrorID WORD Error identification
E EndOfProfile BOOL Pulsed output signaling the cyclic end of the CAM Profile
It is displayed every time the end of the cam profile is
reached. In reverse direction, the ‘EndOfProfile’ is dis-
played also at the end of the cam profile (in this case the
first point of the cam profile)
TC2 Task Force Motion Control March 17, 2011 © 1999 - 2011 copyright by PLCopen
Function Blocks for Motion Control Version 2.0, Published page 91/ 141
PLCopen
for efficiency in automation
Notes:
It is not required that the master is stationary
If the actual master and slave positions do not correspond to the offset values when MC_CamIn is executed,
either an error occurs or the system deals with the difference automatically
The Cam is placed either absolute or relative to the current master and slave positions.
Absolute: the profile between master and slave is seen as an absolute relationship.
Relative: the relationship between master and slave is in a relative mode.
Ramp-in is a supplier specific mode. It can be coupled to additional parameters, such as a master-distance pa-
rameter, acceleration parameter, or other supplier specific parameters where the slave to ramp-in into the cam profile
(“ flying coupling”)
This FB is not merged with the MC_CamTableSelect FB because this separation enables changes on the fly
A mechanical analogy to a slave offset is a cam welded with additional constant layer thickness. Because of this
the slave positions have a constant offset and the offset could be interpreted as axis offset of the master shaft, if lin-
ear guided slave tappets are assumed.
MC_CamIn
AXIS_REF Master Master AXIS_REF
AXIS_REF Slave Slave AXIS_REF
BOOL Execute InSync BOOL
BOOL ContiunousUpdate Busy BOOL
REAL MasterOffset Active BOOL
REAL SlaveOffset CommandAborted BOOL
REAL MasterScaling Error BOOL
REAL SlaveScaling ErrorID WORD
REAL MasterStartDistance EndOfProfile BOOL
REAL MasterSyncPosition
MC_START_MODE StartMode
MC_SOURCE MasterValueSource
MC_CAM_ID CamTableID
MC_BUFFER_MODE BufferMode
TC2 Task Force Motion Control March 17, 2011 © 1999 - 2011 copyright by PLCopen
Function Blocks for Motion Control Version 2.0, Published page 92/ 141
PLCopen
for efficiency in automation
4.4. MC_CamOut
FB-Name MC_CamOut
This Function Block disengages the Slave axis from the Master axis immediately
VAR_IN_OUT
B Slave AXIS_REF Reference to the slave axis
VAR_INPUT
B Execute BOOL Start to disengage the slave from the master
VAR_OUTPUT
B Done BOOL Disengaging completed
E Busy BOOL The FB is not finished and new output values are to be expected
B Error BOOL Signals that an error has occurred within the Function Block
E ErrorID WORD Error identification
Notes:
It is assumed that this command is followed by another command, for instance MC_Stop, MC_GearIn, or
any other command. If there is no new command, the default condition should be: maintain last velocity.
After issuing the FB there is no FB active on the slave axis till the next FB is issued (what can result in prob-
lems because no motion command is controlling the axis). Alternatively one can read the actual velocity via
MC_ReadActualVelocity and issue MC_MoveVelocity on the slave axis with the actual velocity as input.
The FB is here because of compatibility reasons
MC_CamOut
AXIS_REF Slave Slave AXIS_REF
BOOL Execute Done BOOL
Busy BOOL
Error BOOL
ErrorID WORD
TC2 Task Force Motion Control March 17, 2011 © 1999 - 2011 copyright by PLCopen
Function Blocks for Motion Control Version 2.0, Published page 93/ 141
PLCopen
for efficiency in automation
4.5. MC_GearIn
FB-Name MC_GearIn
This Function Block commands a ratio between the VELOCITY of the slave and master axis.
VAR_IN_OUT
B Master AXIS_REF Reference to the master axis
B Slave AXIS_REF Reference to the slave axis
VAR_INPUT
B Execute BOOL Start the gearing process at the rising edge
E ContinuousUpdate BOOL See 2.4.6 The input ‘ContinuousUpdate
B RatioNumerator INT Gear ratio Numerator
B RatioDenominator UINT Gear ratio Denominator
E MasterValueSource MC_SOURCE Defines the source for synchronization:
mcSetValue - Synchronization on master set value
mcActualValue - Synchronization on master actual value
E Acceleration REAL Acceleration for gearing in
E Deceleration REAL Deceleration for gearing in
E Jerk REAL Jerk of Gearing
E BufferMode MC_BUFFER_MODE Defines the chronological sequence of the FB. See 2.4.2
Aborting versus Buffered modes
VAR_OUTPUT
B InGear BOOL Is TRUE if the set value = the commanded value.
E Busy BOOL The FB is not finished and new output values are to be
expected
E Active BOOL Indicates that the FB has control on the axis
E CommandAborted BOOL ‘Command’ is aborted by another command
B Error BOOL Signals that an error has occurred within the Function
Block
E ErrorID WORD Error identification
Notes:
1. The slave ramps up to the ratio of the master velocity and locks in when this is reached. Any lost distance
during synchronization is not caught up.
2. The gearing ratio can be changed while MC_GearIn is running, using a consecutive MC_GearIn command
without the necessity to MC_GearOut first
3. After being ‘InGear’, a position locking or just a velocity locking is system specific.
MC_GearIn
AXIS_REF Master Master AXIS_REF
AXIS_REF Slave Slave AXIS_REF
BOOL Execute InGear BOOL
BOOL ContinuousUpdate Busy BOOL
INT RatioNumerator Active BOOL
UINT RatioDenominator CommandAborted BOOL
MC_SOURCE MasterValueSource Error BOOL
REAL Acceleration ErrorID WORD
REAL Deceleration
REAL Jerk
MC_BUFFER_MODE BufferMode
TC2 Task Force Motion Control March 17, 2011 © 1999 - 2011 copyright by PLCopen
Function Blocks for Motion Control Version 2.0, Published page 94/ 141
PLCopen
for efficiency in automation
1
First.Execute
0 t
1
First.InGear
0 t
Ratio
Reached
1
Second.Execute
0 t
1
Second.InGear
0 t
Ratio
Reached
MySlave.Velocity
TC2 Task Force Motion Control March 17, 2011 © 1999 - 2011 copyright by PLCopen
Function Blocks for Motion Control Version 2.0, Published page 95/ 141
PLCopen
for efficiency in automation
4.6. MC_GearOut
FB-Name MC_GearOut
This Function Block disengages the Slave axis from the Master axis
VAR_IN_OUT
B Slave AXIS_REF Reference to the slave axis
VAR_INPUT
B Execute BOOL Start disengaging process at the rising edge
VAR_OUTPUT
B Done BOOL Disengaging completed
E Busy BOOL The FB is not finished and new output values are to be expected
B Error BOOL Signals that an error has occurred within the Function Block
E ErrorID WORD Error identification
Notes:
It is assumed that this command is followed by another command, for instance MC_Stop, MC_GearIn, or
any other command. If there is no new command, the default condition should be: maintain last velocity.
After issuing the FB there is no FB active on the slave axis till the next FB is issued (what can result in prob-
lems because no motion command is controlling the axis). Alternatively one can read the actual velocity via
MC_ReadActualVelocity and issue MC_MoveVelocity on the slave axis with the actual velocity as input.
The FB is here because of compatibility reasons
MC_GearOut
AXIS_REF Slave Slave AXIS_REF
BOOL Execute Done BOOL
Busy BOOL
Error BOOL
ErrorID WORD
TC2 Task Force Motion Control March 17, 2011 © 1999 - 2011 copyright by PLCopen
Function Blocks for Motion Control Version 2.0, Published page 96/ 141
PLCopen
for efficiency in automation
4.7. MC_GearInPos
FB-Name MC_GearInPos
This Function Block commands a gear ratio between the position of the slave and master axes from the synchroniza-
tion point onwards.
VAR_IN_OUT
B Master AXIS_REF Reference to the master axis
B Slave AXIS_REF Reference to the slave axis
VAR_INPUT
B Execute BOOL Start the gearing process at the rising edge
B RatioNumerator INT Gear ratio Numerator
B RatioDenominator UINT Gear ratio Denominator
E MasterValueSource MC_SOURCE Defines the source for synchronization:
mcSetValue - Synchronization on master set value
mcActualValue - Synchronization on master actual value
B MasterSyncPosition REAL The position of the master in the CAM profile where the
slave is in-sync with the master. (if the ‘MasterSyncPosi-
tion’ does not exist, at the first point of the CAM profile
the master and slave are synchronized.) Note: the inputs
acceleration, decelerations and jerk are not added here
B SlaveSyncPosition REAL Slave Position at which the axes are running in sync
E SyncMode MC_SYNC_MODE Defines the way to synchronize (like ‘mcShortest’;
‘mcCatchUp’; ‘mcSlowDown’). Vendor specific
E MasterStartDistance REAL Master Distance for gear in procedure (when the Slave
axis is started to get into synchronization)
E Velocity REAL Maximum Velocity during the time difference ‘StartSync’
and ‘InSync’
E Acceleration REAL Maximum Acceleration during the time difference ‘Start-
Sync’ and ‘InSync’
E Deceleration REAL Maximum Deceleration during the time difference ‘Start-
Sync’ and ‘InSync’
E Jerk REAL Maximum Jerk during the time difference ‘StartSync’ and
‘InSync’
E BufferMode MC_BUFFER_MODE Defines the chronological sequence of the FB. See 2.4.2
Aborting versus Buffered modes
VAR_OUTPUT
E StartSync BOOL Commanded gearing starts
B InSync BOOL Is TRUE if the set value = the commanded value (is calcu-
lated set of values derived of master position and gear
ratio.)
E Busy BOOL The FB is not finished and new output values are to be
expected
E Active BOOL Indicates that the FB has control on the axis
E CommandAborted BOOL ‘Command’ is aborted by another command
B Error BOOL Signals that an error has occurred within the Function
Block
E ErrorID WORD Error identification
TC2 Task Force Motion Control March 17, 2011 © 1999 - 2011 copyright by PLCopen
Function Blocks for Motion Control Version 2.0, Published page 97/ 141
PLCopen
for efficiency in automation
Notes:
1. If ‘MasterStartDistance’ is implemented, any previous motion is continued until master crosses ‘Master-
SyncPosition’ – ‘MasterStartDistance’ in the correct direction (according to the sign of ‘MasterStartDis-
tance’). At that point in time the output ‘StartSync’ is set. When a ‘Stop’ command is executed on the
‘Slave’ axis before the synchronization has happened, it inhibits the synchronization and the function block
issues ‘CommandAborted’
2. If the ‘MasterStartDistance’ is not specified, the system itself could calculate the set point for ‘StartSync’
based on the other relevant inputs.
3. The difference between the ‘SyncModes’ ‘CatchUp’ and ‘SlowDown’ is in the energy needed to synchro-
nize. ‘SlowDown’ costs the lowest energy vs. ‘CatchUp’.
MC_GearInPos
AXIS_REF Master Master AXIS_REF
AXIS_REF Slave Slave AXIS_REF
BOOL Execute StartSync BOOL
INT RatioNumerator InSync BOOL
UINT RatioDenominator Busy BOOL
MC_SOURCE MasterValueSource Active BOOL
REAL MasterSyncPosition CommandAborted BOOL
REAL SlaveSyncPosition Error BOOL
MC_SYNC_MODE SyncMode ErrorID WORD
REAL MasterStartDistance
REAL Velocity
REAL Acceleration
REAL Deceleration
REAL Jerk
MC_BUFFER_MODE BufferMode
TC2 Task Force Motion Control March 17, 2011 © 1999 - 2011 copyright by PLCopen
Function Blocks for Motion Control Version 2.0, Published page 98/ 141
PLCopen
for efficiency in automation
TRUE
Execute
FALSE t
TRUE
StartSync
FALSE t
TRUE
InSync
FALSE t
MasterSyncPosition
MasterStartDistance
SlaveSyncPosition
Velocity
Initial Slave velocity higher
than Master velocity
Master Velocity
Time
Figure 45: Example of the difference between ‘SyncModes’ ‘SlowDown’ (green) and ‘CatchUp’ (red) with dif-
ferent initial velocities of the slave
TC2 Task Force Motion Control March 17, 2011 © 1999 - 2011 copyright by PLCopen
Function Blocks for Motion Control Version 2.0, Published page 99/ 141
PLCopen
for efficiency in automation
Figure 46: Example of MC_GearInPos where the initial velocity of the slave is in the same direction of the mas-
ter
SSync
Figure 47: Example of MC_GearInPos where the initial velocity of the slave is in the inverse direction of the
master
TC2 Task Force Motion Control March 17, 2011 © 1999 - 2011 copyright by PLCopen
Function Blocks for Motion Control Version 2.0, Published page 100/ 141
PLCopen
for efficiency in automation
4.8. MC_PhasingAbsolute
FB-Name MC_PhasingAbsolute
This Function Block creates an absolute phase shift in the master position of a slave axis. The master position is
shifted in relation to the real physical position. This is analogous to opening a coupling on the master shaft for a
moment, and is used to delay or advance an axis to its master. The phase shift is seen from the slave. The master
does not know that there is a phase shift experienced by the slave (MasterPos as seen from the SlaveAxis = Physi-
calMasterPos + PhaseShiftValueSlaveAxis, the phase shift value has the character of a position offset) The phase
shift remains until another ‘Phasing’ command changes it again.
VAR_IN_OUT
B Master AXIS_REF Reference to the master axis
B Slave AXIS_REF Reference to the slave axis
VAR_INPUT
B Execute BOOL Start the phasing process at the rising edge
B PhaseShift REAL Absolut phase difference in master position of the slave
axis [u]
E Velocity REAL Maximum Velocity to reach phase difference [u/s]
E Acceleration REAL Maximum Acceleration to reach phase difference [u/s2]
E Deceleration REAL Maximum Deceleration to reach phase difference [u/s2]
E Jerk REAL Maximum Jerk to reach phase difference [u/s3]
E BufferMode MC_BUFFER_MODE Defines the chronological sequence of the FB. See 2.4.2
Aborting versus Buffered modes
VAR_OUTPUT
B Done BOOL Commanded phasing reached
E Busy BOOL The FB is not finished and new output values are to be
expected
E Active BOOL Indicates that the FB has control on the axis
E CommandAborted BOOL ‘Command’ is aborted by another command
B Error BOOL Signals that an error has occurred within the Function
Block
E ErrorID WORD Error identification
E AbsolutePhaseShift REAL Displays continuously the absolute phase shift [u] while
Busy is set.
Note:
‘Phase’, ‘Velocity’, ‘Acceleration’, ‘Deceleration’ and ‘Jerk’ of a phase shift are controlled by the FB.
For comparison: MC_MoveSuperimposed could also be used to act on the slave axis. MC_Phasing acts on the
master side, as seen from the slave
MC_PhasingAbsolute
AXIS_REF Master Master AXIS_REF
AXIS_REF Slave Slave AXIS_REF
BOOL Execute Done BOOL
REAL PhaseShift Busy BOOL
REAL Velocity Active BOOL
REAL Acceleration CommandAborted BOOL
REAL Deceleration Error BOOL
REAL Jerk ErrorID WORD
MC_BUFFER_MODE BufferMode AbsolutePhaseShift REAL
TC2 Task Force Motion Control March 17, 2011 © 1999 - 2011 copyright by PLCopen
Function Blocks for Motion Control Version 2.0, Published page 101/ 141
PLCopen
for efficiency in automation
0
t
physical master position
velocity
phase velocity
master velocity
0
t
Execute
Done
Figure 48: Timing example of MC_Phasing – both for absolute and relative
TC2 Task Force Motion Control March 17, 2011 © 1999 - 2011 copyright by PLCopen
Function Blocks for Motion Control Version 2.0, Published page 102/ 141
PLCopen
for efficiency in automation
In this example the slave axis follows the master axis (in red – periodically) with a sine cam profile. Both the slave
positions (green) and the slave velocity (blue) are shown. The effect of phasing is shown on the slave axis.
1 2 3 4 5 6
Takte x 10
Master position
TC2 Task Force Motion Control March 17, 2011 © 1999 - 2011 copyright by PLCopen
Function Blocks for Motion Control Version 2.0, Published page 103/ 141
PLCopen
for efficiency in automation
4.9. MC_PhasingRelative
FB-Name MC_PhasingRelative
This Function Block creates a phase shift in the master position of a slave axis relative to the existing phase shift.
The master position is shifted in relation to the real physical position. This is analogous to opening a coupling on
the master shaft for a moment, and is used to delay or advance an axis to its master. The phase shift is seen from
the slave. The master does not know that there is a phase shift experienced by the slave. (MasterPos as seen from
SlaveAxis = PhysicalMasterPos + PhaseShiftValueSlaveAxis, the phase shift value has the character of a position
offset) The phase shift remains until another ‘Phasing’ command changes it again. Relative phase shifts are added
to each other for the applicable phase shift
VAR_IN_OUT
B Master AXIS_REF Reference to the master axis
B Slave AXIS_REF Reference to the slave axis
VAR_INPUT
B Execute BOOL Start the phasing process at the rising edge
B PhaseShift REAL Additional phase difference in master position of the slave axis
[u]
E Velocity REAL Maximum Velocity to reach phase difference [u/s]
E Acceleration REAL Maximum Acceleration to reach phase difference [u/s2]
E Deceleration REAL Maximum Deceleration to reach phase difference [u/s2]
E Jerk REAL Maximum Jerk to reach phase difference [u/s3]
E BufferMode MC_BUFFER_ Defines the chronological sequence of the FB. See 2.4.2
MODE Aborting versus Buffered modes
VAR_OUTPUT
B Done BOOL Commanded phasing reached
E Busy BOOL The FB is not finished and new output values are to be ex-
pected
E Active BOOL Indicates that the FB has control on the axis
E CommandAborted BOOL ‘Command’ is aborted by another command
B Error BOOL Signals that an error has occurred within the Function Block
E ErrorID WORD Error identification
E CoveredPhaseShift REAL Displays continuously the covered phase shift since it was
started
Note:
‘Phase’, ‘Velocity’, ‘Acceleration’, ‘Deceleration’ and ‘Jerk’ of a phase shift are controlled by the FB.
For comparison: MC_MoveSuperimposed could also be used to act on the slave axis. MC_Phasing acts on the
master side, as seen from the slave
MC_PhasingRelative
AXIS_REF Master Master AXIS_REF
AXIS_REF Slave Slave AXIS_REF
BOOL Execute Done BOOL
REAL PhaseShift Busy BOOL
REAL Velocity Active BOOL
REAL Acceleration CommandAborted BOOL
REAL Deceleration Error BOOL
REAL Jerk ErrorID WORD
MC_BUFFER_MODE BufferMode CoveredPhaseShift REAL
TC2 Task Force Motion Control March 17, 2011 © 1999 - 2011 copyright by PLCopen
Function Blocks for Motion Control Version 2.0, Published page 104/ 141
PLCopen
for efficiency in automation
4.10. MC_CombineAxes
FB-Name MC_CombineAxes
This Function Block combines the motion of 2 axes into a third axis with selectable combination method. Basically it
is a calculation of a new position setpoint based on the 2 position setpoints of the input axes.
This FB is reflected in the state diagram like a synchronized motion type. As application example one can work with
a separate profile synchronized to an object on a moving belt, or a rotating knife with flexible covered distance to be
cut.
VAR_IN_OUT
B Master1 AXIS_REF Reference to the first master axis
B Master2 AXIS_REF Reference to the second master axis
B Slave AXIS_REF Reference to the resulting combined axis. Can be a virtual
axis or linked directly to a real axis
VAR_INPUT
B Execute BOOL Start the combination process at the rising edge
E ContinuousUpdate BOOL See 2.4.6 The input ‘ContinuousUpdate’
E CombineMode MC_COM- Defines the type of combination applied to AxisOut :
BINE_MODE mcAddAxes : Addition of the 2 input axes positions
mcSubAxes : Substraction of the 2 input axes positions
E GearRatioNumeratorM1 INT Numerator for the gear factor for master axis 1 towards the
slave
E GearRatioDenominatorM1 INT Corresponding denominator for master axis 1
E GearRatioNumeratorM2 INT Numerator for the gear factor for master axis 2 towards the
slave
E GearRatioDenominatorM2 INT Corresponding denominator for master axis 2
E MasterValueSourceM1 MC_SOURCE Defines the source for synchronization for master axis 1:
mcSetValue - Synchronization on master set value
mcActualValue - Synchronization on master actual value
E MasterValueSourceM2 MC_SOURCE Defines the source for synchronization for master axis 2:
mcSetValue - Synchronization on master set value
mcActualValue - Synchronization on master actual value
E BufferMode MC_BUFFER_ Defines the behavior of the axis: modes are ‘Aborting’,
MODE ‘Buffered’, ‘Blending’
VAR_OUTPUT
B InSync BOOL Is TRUE if the set value = the commanded value.
E Busy BOOL The FB is not finished and new output values are to be
expected
E Active BOOL Indicates that the FB has control on the combined axis
E CommandAborted BOOL ‘Command’ is aborted by another command
B Error BOOL Signals that an error has occurred within the Function Block
E ErrorID WORD Error identification
Note: To stop the motion, the FB has to be interrupted by another FB issuing a new command
TC2 Task Force Motion Control March 17, 2011 © 1999 - 2011 copyright by PLCopen
Function Blocks for Motion Control Version 2.0, Published page 105/ 141
PLCopen
for efficiency in automation
MC_CombineAxes
AXIS_REF Master1 Master1 AXIS_REF
AXIS_REF Master2 Master2 AXIS_REF
AXIS_REF Slave Slave AXIS_REF
BOOL Execute InSync BOOL
BOOL ContinuousUpdate Busy BOOL
MC_COMBINE_MODE CombineMode Active BOOL
INT GearRatioNumeratorM1 CommandAborted BOOL
INT GearRatioDenominatorM1 Error BOOL
INT GearRatioNumeratorM2 ErrorID WORD
INT GearRatioDenominatorM2
MC_SOURCE mcMasterValueSourceM1
MC_SOURCE mcMasterValueSourceM2
MC_BUFFER_MODE BufferMode
TC2 Task Force Motion Control March 17, 2011 © 1999 - 2011 copyright by PLCopen
Function Blocks for Motion Control Version 2.0, Published page 106/ 141
PLCopen
for efficiency in automation
TC2 Task Force Motion Control March 17, 2011 © 1999 - 2011 copyright by PLCopen
Function Blocks for Motion Control Version 2.0, Published page 107/ 141
PLCopen
for efficiency in automation
Vel
MC_CamIn FB
FirstVirtual
0
1
StartGear Start MC_GearIn with SecondVirtual axis and MasterConveyor
0
Vel
MC_GearIn FB on the second virtual axis
SecondVirtual
0
1
StartCombine Start the combination of the 2 virtual axes
0
The combined axes of the virtual axes
(MC_CamIn and MC_GearIn) is still a virtual axis
Vel
CombinedVirtual
0
1
StartGearInPos Start MC_GearInPos of GearAxis to follow CombinedVirtual axes
0
Vel
MC_GearInPos
RealAxis starts after
The RealAxis performs a MC_GearInPos with
MasterDist
the virtual axis created by MC_CombineAxes
0
1
WaveInSynch MC_GearInPos InGear
0
TC2 Task Force Motion Control March 17, 2011 © 1999 - 2011 copyright by PLCopen
Function Blocks for Motion Control Version 2.0, Published page 108/ 141
PLCopen
for efficiency in automation
FF F
REV
This simple example of drilling a hole shows the difference between two modes.
In order to drill the hole, the following steps have to be done:
Step 1: Initialization, for instance at power up.
Step 2: Move forward to drilling position and start the drill turning. In this way it will be fully operational before the
position is reached and then check if both actions are completed.
Step 3: Drill the hole.
Step 4: After drilling the hole we have to wait for the step-chain sequence to finish dwelling to free the hole of any de-
bris, which might have been stuck in the hole.
Step 5: Move drill back to starting position and shut the spindle off. Combining the completion of moving backwards
and stopping the spindle we signal the step-chain to start over.
Velocity Velocity
Position
t
t
Figure 53: Timing diagrams for drilling. Left side no blending, right side with blending
TC2 Task Force Motion Control March 17, 2011 © 1999 - 2011 copyright by PLCopen
Function Blocks for Motion Control Version 2.0, Published page 109/ 141
PLCopen
for efficiency in automation
Initialization
Done
MoveAbsolute
Done
MoveRelative
Done
Ton
Done
MoveAbsolute
Done
INT
Figure 55: Straight forward step-transition chain for drilling example in SFC
TC2 Task Force Motion Control March 17, 2011 © 1999 - 2011 copyright by PLCopen
Function Blocks for Motion Control Version 2.0, Published page 110/ 141
PLCopen
for efficiency in automation
Figure 57: Timing diagram for example above without interference between FB1 and FB2 (‘Aborting’ Mode)
TC2 Task Force Motion Control March 17, 2011 © 1999 - 2011 copyright by PLCopen
Function Blocks for Motion Control Version 2.0, Published page 111/ 141
PLCopen
for efficiency in automation
Figure 58: Timing diagram for example above with FB2 interrupting FB1 (‘Aborting’ Mode)
TC2 Task Force Motion Control March 17, 2011 © 1999 - 2011 copyright by PLCopen
Function Blocks for Motion Control Version 2.0, Published page 112/ 141
PLCopen
for efficiency in automation
TC2 Task Force Motion Control March 17, 2011 © 1999 - 2011 copyright by PLCopen
Function Blocks for Motion Control Version 2.0, Published page 113/ 141
PLCopen
for efficiency in automation
Figure 60: Timing diagram for example above with mode ‘BlendingLow’
(Using lowest velocity (=velocity 2) from final position of FB1 until final position of FB2)
With the blending (and other FBs working on the same axis at the same time (like MC_MoveAdditive)), the system has
to combine the different values working on the axis before giving the positions to the relevant axis.
TC2 Task Force Motion Control March 17, 2011 © 1999 - 2011 copyright by PLCopen
Function Blocks for Motion Control Version 2.0, Published page 114/ 141
PLCopen
for efficiency in automation
Figure 61: Timing diagram for example above with mode ‘Merging1’
(Uses velocity FB1 at final position FB1)
TC2 Task Force Motion Control March 17, 2011 © 1999 - 2011 copyright by PLCopen
Function Blocks for Motion Control Version 2.0, Published page 115/ 141
PLCopen
for efficiency in automation
Start_1
Busy_1
Done_1
CA_1
Active_1
Start_2
Busy_2
Done_2
CA_2
Active_2
Start_3
Busy_3
Done_3
CA_3
Active_3
Velocity
Position
2000
1000
Figure 62: Timing diagram for example above with mode ‘BlendingNext’ motion
nd
With a 2 FB following MC_MoveVelocity all blending modes should work like blending previous or create an error.
TC2 Task Force Motion Control March 17, 2011 © 1999 - 2011 copyright by PLCopen
Function Blocks for Motion Control Version 2.0, Published page 116/ 141
PLCopen
for efficiency in automation
Figure 63: Timing diagram for example above with mode ‘BlendingHigh’ motion
TC2 Task Force Motion Control March 17, 2011 © 1999 - 2011 copyright by PLCopen
Function Blocks for Motion Control Version 2.0, Published page 117/ 141
PLCopen
for efficiency in automation
By submitting these tables to PLCopen, and after approval by PLCopen, the list will be published on the PLCopen web-
site, www.plcopen.org as well as a shortform overview, as specified in Appendix B 2 Supported Data types and
Appendix B 3 Overview of the Function Blocks as below.
In addition to this approval, the supplier is granted access and usage rights of the PLCopen Motion Control logo, as
described in Appendix B 4:
Data types
The data type REAL listed in the Function Blocks and parameters (e.g. for velocity, acceleration, distance, etc.) may be
exchanged to SINT, INT, DINT or LREAL without to be seen as incompliant to this standard, as long as they are con-
sistent for the whole set of Function Blocks and parameters.
Implementation allows the extension of data types as long as the basic data type is kept. For example: WORD may be
changed to DWORD, but not to REAL.
- Basic input/output variables are mandatory Marked in the tables with the letter “B”
- Extended input /output variables are optional Marked in the tables with the letter “E”
- Vendor Specific additions Marked in the vendor’s compliance documentation with “V”
All the vendor specific items will not be listed in the comparison table on the PLCopen website, but in the detailed ven-
dor specific list, which also is published.
All vendor specific in- and outputs of all FBs must be listed in the certification list of the supplier. With this, the certifi-
cation listing from a supplier describes all the I/Os of the relevant FBs, including vendor-specific extensions, and thus
showing the complete FBs as used by the supplier.
TC2 Task Force Motion Control March 17, 2011 © 1999 - 2011 copyright by PLCopen
Function Blocks for Motion Control Version 2.0, Published page 118/ 141
PLCopen
for efficiency in automation
Supplier name
Supplier address
City
Country
Telephone
Fax
Email address
Product Name
Product version
Release date
I hereby state that the following tables as filled out and submitted do match our product as well as the accompanying
user manual, as stated above.
Signature:
TC2 Task Force Motion Control March 17, 2011 © 1999 - 2011 copyright by PLCopen
Function Blocks for Motion Control Version 2.0, Published page 119/ 141
PLCopen
for efficiency in automation
Defined datatypes with MC library: Supported If not supported, which datatype used
BOOL
INT
WORD
REAL
ENUM
UINT
Table 6: Supported datatypes
Within the specification the following derived datatypes are defined. Define which of these structures are used in this
system:
Derived datatypes: Where used Supported Which structure
AXIS_REF Nearly all FBs
MC_DIRECTION MC_MoveAbsolute
(extended) MC_MoveVelocity
MC_TorqueControl
MC_MoveContinuousAbsolute
MC_TP_REF MC_PositionProfile
MC_TV_REF MC_VelocityProfile
MC_TA_REF MC_AccelerationProfile
MC_CAM_REF MC_CamTableSelect
MC_CAM_ID MC_CamTableSelect
(extended) MC_CamIn
MC_START_MODE MC_CamIn
(extended) MC_CamTableSelect
MC_BUFFER_MODE Buffered FBs
MC_EXECUTION_MODE MC_SetPosition
MC_WriteParameter
MC_WriteBoolParameter
MC_WriteDigitalOutput
MC_CamTableSelect
MC_SOURCE MC_ReadMotionState
MC_CamIn
MC_GearIn
MC_GearInPos
MC_CombineAxes
MC_DigitalCamSwitch
MC_SYNC_MODE MC_GearInPos
MC_COMBINE_MODE MC_CombineAxes
MC_TRIGGER_REF MC_TouchProbe
MC_AbortTrigger
MC_INPUT_REF MC_ReadDigitalInput
MC_OUTPUT_REF MC_DigitalCamSwitch
MC_ReadDigitalOutput
MC_WriteDigitalOutput
MC_CAMSWITCH_REF MC_DigitalCamSwitch
MC_TRACK_REF MC_DigitalCamSwitch
Table 7: Supported derived datatypes
TC2 Task Force Motion Control March 17, 2011 © 1999 - 2011 copyright by PLCopen
Function Blocks for Motion Control Version 2.0, Published page 120/ 141
PLCopen
for efficiency in automation
TC2 Task Force Motion Control March 17, 2011 © 1999 - 2011 copyright by PLCopen
Function Blocks for Motion Control Version 2.0, Published page 121/ 141
PLCopen
for efficiency in automation
TC2 Task Force Motion Control March 17, 2011 © 1999 - 2011 copyright by PLCopen
Function Blocks for Motion Control Version 2.0, Published page 122/ 141
PLCopen
for efficiency in automation
TC2 Task Force Motion Control March 17, 2011 © 1999 - 2011 copyright by PLCopen
Function Blocks for Motion Control Version 2.0, Published page 123/ 141
PLCopen
for efficiency in automation
TC2 Task Force Motion Control March 17, 2011 © 1999 - 2011 copyright by PLCopen
Function Blocks for Motion Control Version 2.0, Published page 124/ 141
PLCopen
for efficiency in automation
TC2 Task Force Motion Control March 17, 2011 © 1999 - 2011 copyright by PLCopen
Function Blocks for Motion Control Version 2.0, Published page 125/ 141
PLCopen
for efficiency in automation
TC2 Task Force Motion Control March 17, 2011 © 1999 - 2011 copyright by PLCopen
Function Blocks for Motion Control Version 2.0, Published page 126/ 141
PLCopen
for efficiency in automation
TC2 Task Force Motion Control March 17, 2011 © 1999 - 2011 copyright by PLCopen
Function Blocks for Motion Control Version 2.0, Published page 127/ 141
PLCopen
for efficiency in automation
TC2 Task Force Motion Control March 17, 2011 © 1999 - 2011 copyright by PLCopen
Function Blocks for Motion Control Version 2.0, Published page 128/ 141
PLCopen
for efficiency in automation
TC2 Task Force Motion Control March 17, 2011 © 1999 - 2011 copyright by PLCopen
Function Blocks for Motion Control Version 2.0, Published page 129/ 141
PLCopen
for efficiency in automation
TC2 Task Force Motion Control March 17, 2011 © 1999 - 2011 copyright by PLCopen
Function Blocks for Motion Control Version 2.0, Published page 130/ 141
PLCopen
for efficiency in automation
TC2 Task Force Motion Control March 17, 2011 © 1999 - 2011 copyright by PLCopen
Function Blocks for Motion Control Version 2.0, Published page 131/ 141
PLCopen
for efficiency in automation
TC2 Task Force Motion Control March 17, 2011 © 1999 - 2011 copyright by PLCopen
Function Blocks for Motion Control Version 2.0, Published page 132/ 141
PLCopen
for efficiency in automation
TC2 Task Force Motion Control March 17, 2011 © 1999 - 2011 copyright by PLCopen
Function Blocks for Motion Control Version 2.0, Published page 133/ 141
PLCopen
for efficiency in automation
TC2 Task Force Motion Control March 17, 2011 © 1999 - 2011 copyright by PLCopen
Function Blocks for Motion Control Version 2.0, Published page 134/ 141
PLCopen
for efficiency in automation
TC2 Task Force Motion Control March 17, 2011 © 1999 - 2011 copyright by PLCopen
Function Blocks for Motion Control Version 2.0, Published page 135/ 141
PLCopen
for efficiency in automation
TC2 Task Force Motion Control March 17, 2011 © 1999 - 2011 copyright by PLCopen
Function Blocks for Motion Control Version 2.0, Published page 136/ 141
PLCopen
for efficiency in automation
TC2 Task Force Motion Control March 17, 2011 © 1999 - 2011 copyright by PLCopen
Function Blocks for Motion Control Version 2.0, Published page 137/ 141
PLCopen
for efficiency in automation
TC2 Task Force Motion Control March 17, 2011 © 1999 - 2011 copyright by PLCopen
Function Blocks for Motion Control Version 2.0, Published page 138/ 141
PLCopen
for efficiency in automation
TC2 Task Force Motion Control March 17, 2011 © 1999 - 2011 copyright by PLCopen
Function Blocks for Motion Control Version 2.0, Published page 139/ 141
PLCopen
for efficiency in automation
TC2 Task Force Motion Control March 17, 2011 © 1999 - 2011 copyright by PLCopen
Function Blocks for Motion Control Version 2.0, Published page 140/ 141
PLCopen
for efficiency in automation
In order to use this logo free-of-charge, the relevant company has to fulfill all the following requirements:
1. the company has to be a voting member of PLCopen;
2. the company has to comply with the existing specification, as specified by the PLCopen Task Force Motion
Control, and as published by PLCopen, and of which this statement is a part;
3. this compliance application is provided in written form by the company to PLCopen, clearly stating the appli-
cable software package and the supporting elements of all the specified tables, as specified in the document it-
self;
4. in case of non-fulfillment, which has to be decided by PLCopen, the company will receive a written statement
concerning this from PLCopen. The company will have a one month period to either adopt their software pack-
age in such a way that it complies, represented by the issuing of a new compliance statement, or remove all ref-
erence to the specification, including the use of the logo, from all their specification, be it technical or promo-
tional material;
5. the logo has to be used as is - meaning the full logo. It may be altered in size providing the original scale and
color setting is kept.
6. the logo has to be used in the context of Motion Control.
TC2 Task Force Motion Control March 17, 2011 © 1999 - 2011 copyright by PLCopen
Function Blocks for Motion Control Version 2.0, Published page 141/ 141