PLCopen运动控制标准 Part2 Extensions 10
PLCopen运动控制标准 Part2 Extensions 10
Technical Paper
PLCopen Technical Committee
DISCLAIMER OF WARRANTIES
THIS DOCUMENT IS PROVIDED ON AN “AS IS” BASIS AND MAY BE SUBJECT TO FUTURE ADDITIONS,
MODIFICATIONS, OR CORRECTIONS. PLCOPEN HEREBY DISCLAIMS ALL WARRANTIES OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING ANY WARRANTY OF 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.
This document is a specification as developed by the PLCopen Task Force Motion Control. As such it is an addition to the
PLCopen Task Force Motion Control, Technical Document Version 1.0.
The present specification was written thanks to the following members of the PLCopen Task Force Motion Control:
V 0.7 May 15, 2003 Comments during meeting May 14 & 15, 2003
V 0.7a July 9, 2003 Added homework in preparation of meeting July
V 0.8 July 18, 2003 Result of Meeting July
V 08A September 4, 2003 Split between Part2, 3 and 4. Added State Diagram
V 0.9 September 24, 2003 Result of the meeting Sept. 22 – 24, and editing by EvdWal
V 0.91 November 21, 2003 Result of feedback –edited by EvdW
V 0.92 December 18, 2003 Results of feedback on V 0.91 – edited by EvdW
V 0.93 February 3 / March 22, 2004 Generation of version for final meeting by EvdW
V 0.94 March 30, 31, 2004 Results of the meeting at Berger Lahr
V 0.95 April 13, 2004 Further editing by EvdW
V 0.99 April 16, 2004 Release for comments – by EvdW
V 0.99a January 20, 2005 Merge with comments – to be released as V. 1.0. MoveContinuous and
MC_Halt added
V. 0.99B Feb. 21, 2005 In preparation for the meeting. Comments added. Results of meeting.
V. 0.99C April 5, 2005 Result of meeting April 4 + 5, 2005 at Bosch Rexroth
V. 099D May 19, 2005 Further editing done by EvdW, incl. State diagram
V. 0.99E May 20, 2005 Added pictures to torque control
V. 0.99F May 25, 2005 Behavior of MC_Halt added
V. 0.99G June 7, 2005 Language checking and corrections
V. 0.99H July 20, 2005 Final corrections. Final version before 1.0
V. 1.0 September 16, 2005 Official Release
Table of Contents
1. GENERAL INTRODUCTION ............................................................................................................................... 7
Table of Figures
Table of Tables
1. General Introduction
At the end of 2001, PLCopen released the first release of the specification of 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 specification 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 of
inter-related specifications:
The PLCopen Motion Control Extensions specification, Part 2, as well as the User Guidelines, Part 3, are additions to the
PLCopen Function Blocks for Motion Control, and should not be seen as stand alone documents.
The objective of this specification “PLCopen Task Force Motion Control Extensions” is:
To define a set of extensions to the Part 1 ‘PLCopen Function Blocks for Motion Control’ specification,
which will serve the majority of users’ application needs.
Administrative Motion
Single Axis Multiple Axis Single Axis Multiple Axis
MC_TouchProbe MC_TorqueControl MC_GearInPos
MC_AbortTrigger MC_MoveContinuous
MC_ReadDigitalInput MC_Halt
MC_ReadDigitalOutput
MC_WriteDigitalOutput
MC_SetPosition
MC_SetOverride
MC_ReadActualVelocity
MC_ReadActualTorque
MC_DigitalCamSwitch
The time taken by the system to respond to a command may vary widely by manufacturer / vendor / supplier and product.
For example in one implementation, writing a variable may result in commanding a request via a serial connection and waiting
for a response, while another implementation might not have a serial connection, resulting is a faster response.
3. State Diagram
The following state diagram is based on the version as defined in ‘Part 1 – Function Blocks for Motion Control’. This
specification adds four Function Blocks: MC_TorqueControl, MC_MoveContinuous, MC_Halt, and MC_GearInPos.
Function Blocks not listed in the state diagram do not affect the State Diagram, meaning that whenever they are called the state
does not change. They are: MC_TouchProbe, MC_AbortTrigger, MC_ReadDigitalInput, MC_ReadDigitalOutput,
MC_WriteDigitalOutput, MC_SetPosition, MC_SetOverride, MC_ReadActualVelocity, MC_ReadActualTorque, and
MC_DigitalCamSwitch.
MC_GearIn(Slave), MC_CamIn(Slave)
MC_Phasing(Slave)
MC_MoveSuperimposed(Slave)
MC_GearInPos (Slave)
MC_GearIn(Slave)
Synchronized MC_CamIn(Slave)
MC_GearInPos (Slave)
Error Motion
MC_MoveVelocity
MC_GearOut
MC_GearIn(Slave) MC_CamOut
MC_CamIn(Slave) MC_Stop
MC_VelocityProfile
MC_GearInPos (Slave) MC_AccelerationProfile
MC_MoveAbsolute MC_TorqueControl
MC_Move Relative MC_GearIn(Slave)
MC_PositionProfile MC_CamIn(Slave)
MC_MoveAbsolute
MC_Halt MC_GearInPos (Slave)
MC_MoveRelative MC_MoveSuperImposed
MC_MoveSuperimposed MC_MoveAbsolute; MC_Move Relative MC_AccelerationProfile
MC_MoveAdditive MC_MoveAdditive; MC_PositionProfile MC_MoveVelocity
MC_PositionProfile MC_Halt MC_VelocityProfile
MC_Halt MC_TorqueControl
MC_Stop MC_Stop
Note1
Error
Error
Stopping
MC_Move Velocity
Error MC_VelocityProfile
Done Note1
MC_Stop MC_AccelerationProfile
MC_TorqueControl
MC_MoveContinuous
Errorstop
MC_MoveAbsolute
MC_MoveRelative
MC_MoveAdditive Note 4
MC_MoveSuperimposed MC_Reset
MC_Stop Note 2
MC_PositionProfile
Error
Error
Done
Homing
Standstill Disabled
Note 3
MC_Home
Note 1: In the ErrorStop and Stopping states all Function Blocks can be called, although they will not be executed, except
MC_Reset which will generate a transition to the Standstill state. If an error occurs while the state machine is in the Stopping
state a transition to the ErrorStop state is generated.
Note 2: Power.Enable = TRUE and there is an error in the Axis.
Note 3: Power.Enable = TRUE and there is no error in the Axis.
Note 4: MC_Stop.Done AND NOT MC_Stop.Execute.
Figure 1: State Diagram
5.1. TouchProbe
FB-Name MC_TouchProbe
The function block is used to record an axis position at a trigger event
VAR_IN_OUT
B Axis AXIS_REF Identifies the axis for which the position should be recorded at a
defined event at the trigger input
E TriggerInput 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 window.
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 Shows that the Function Block is not finished
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])
Note:
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 TRIGGER_REF should be extended
with TouchProbeID - Identification of a unique probing command – this can be linked to MC_AbortTrigger
MC_TouchProbe
AXIS_REF Axis Axis AXIS_REF
TRIGGER_REF TriggerInput TriggerInput TRIGGER_REF
BOOL Execute Done BOOL
BOOL WindowOnly Busy BOOL
REAL FirstPosition CommandAborted BOOL
REAL LastPosition Error BOOL
ErrorID WORD
RecordedPosition REAL
TRUE
Execute
FALSE t
TRUE
TriggerInput.Signal
FALSE t
TRUE
Done
FALSE t
TRUE
WindowOnly
FALSE t
Axis.Position
LastPosition
RecordedPosition
FirstPosition
accepted accepted
FirstPosition
accepted
LastPosition
Figure 3: Examples of windows, where trigger events are accepted (for modulo axes)
5.2. AbortTrigger
FB-Name MC_AbortTrigger
The 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 Identifies the axis to which the trigger functionality is connected.
E TriggerInput TRIGGER_REF Reference to the trigger signal source. TriggerInput may be
specified by the AXIS_REF. See Chapter 5.1 TouchProbe
VAR_INPUT
B Execute BOOL Aborts trigger event at rising edge
VAR_OUTPUT
B Done BOOL Trigger functionality aborted
E Busy BOOL Shows that the Function Block is not finished
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
TRIGGER_REF TriggerInput TriggerInput TRIGGER_REF
BOOL Execute Done BOOL
Busy BOOL
Error BOOL
ErrorID WORD
5.3. ReadDigitalInput
FB-Name MC_ReadDigitalInput
This function block gives access to the value of the input, referenced by the datatype INPUT_REF. It provides the
value of the referenced input (BOOL)
VAR_IN_OUT
B Input 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 INPUT_REF, if only one single
input is referenced.
VAR_OUTPUT
B Valid BOOL Input signal value is valid
E Busy BOOL Shows that the Function Block is not finished
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
INPUT_REF Input Input INPUT_REF
BOOL Enable Valid BOOL
INT InputNumber Busy BOOL
Error BOOL
ErrorID WORD
Value BOOL
5.4. ReadDigitalOutput
FB-Name MC_ReadDigitalOutput
This Function Block provides access to the value of a digital output, referenced by the datatype OUTPUT_REF. It
provides the value of the referenced output (BOOL).
VAR_IN_OUT
B Output 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 OUTPUT_REF, if only one single
output is referenced.
VAR_OUTPUT
B Valid BOOL Output signal value is valid
E Busy BOOL Shows that the Function Block is not finished
B Error BOOL Signals that error has occurred within 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
OUTPUT_REF Output Output OUTPUT_REF
BOOL Enable Valid BOOL
INT OutputNumber Busy BOOL
Error BOOL
ErrorID WORD
Value BOOL
5.5. WriteDigitalOutput
FB-Name MC_WriteDigitalOutput
This function block writes a value to the output referenced by the argument “Output” once (with rising edge of
Execute).
VAR_IN_OUT
B Output 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 OUTPUT_REF, if only one single
input is referenced.
B Value BOOL The value of the selected output
VAR_OUTPUT
B Done BOOL Writing of the output signal value is done
E Busy BOOL Shows that the Function Block is not finished
B Error BOOL Signals that an error has occurred within the Function Block
E ErrorID WORD Error Identification
Notes: -
MC_WriteDigitalOutput
OUTPUT_REF Output Output OUTPUT_REF
BOOL Execute Done BOOL
INT OutputNumber Busy BOOL
BOOL Value Error BOOL
ErrorID WORD
5.6. 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
error). This can be used for instance for a reference situation. This Function Block can be used during motion without
changing the commanded position, which is now positioned in the shifted coordinate system.
VAR_IN_OUT
B Axis AXIS_REF Identifies the axis to work upon
VAR_INPUT
B Execute BOOL Start setting position in axis
B Position REAL Position unit [u] (Means ‘Distance’ if Mode = RELATIVE)
E Mode BOOL RELATIVE =True, ABSOLUTE = False (Default)
VAR_OUTPUT
B Done BOOL Position has new value
E Busy BOOL Shows that the Function Block is not finished
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 Mode Error BOOL
ErrorID WORD
5.7. 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 act as a factor that is multiplied to the commanded velocity, acceleration, deceleration and jerk
of the move function block.
VAR_IN_OUT
B Axis AXIS_REF Identifies the axis to work upon
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 Shows that the Function Block is not finished
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 possible
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
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
5.8. ReadActualVelocity
FB-Name MC_ReadActualVelocity
This Function Block returns the value of the actual velocity as long as Enable is set. Done is true when the data-
output “Velocity” is valid. If Enable is Reset, the data loses its validity, and Done is also reset, no matter if new data
is available.
VAR_IN_OUT
B Axis AXIS_REF Identifies the axis to work upon
VAR_INPUT
B Enable BOOL Get the value of the parameter continuously while enabled
VAR_OUTPUT
B Valid BOOL Valid value is available
E Busy BOOL Shows that the Function Block is not finished
B Error BOOL Signals that an error has occurred within the Function Block
E ErrorID WORD Error identification
B ActualVelocity REAL The value of the actual velocity (in axis’ unit [u/s])
Notes: The output ActualVelocity can be a signed value
MC_ReadActualVelocity
AXIS_REF Axis Axis AXIS_REF
BOOL Enable Valid BOOL
Busy BOOL
Error BOOL
ErrorID WORD
ActualVelocity REAL
5.9. ReadActualTorque
FB-Name MC_ReadActualTorque
This Function Block returns the value of the actual torque or force as long as Enable is set. Done is true when the
data-output “Torque” is valid. If Enable is Reset, the data loses its validity, and Done is also reset, no matter if new
data is available.
VAR_IN_OUT
B Axis AXIS_REF Identifies the axis to work upon
VAR_INPUT
B Enable BOOL Get the value of the parameter continuously while enabled
VAR_OUTPUT
B Valid BOOL Valid value is available
E Busy BOOL Shows that the Function Block is not finished
B Error BOOL Signals that an error has occurred within the Function Block
E ErrorID WORD Error identification
B ActualTorque REAL The value of the actual torque or force (in technical units)
Notes: The output ActualTorque can be a signed value
MC_ReadActualTorque
AXIS_REF Axis Axis AXIS_REF
BOOL Enable Valid BOOL
Busy BOOL
Error BOOL
ErrorID WORD
ActualTorque REAL
5.10. TorqueControl
FB-Name MC_TorqueControl
This function block continuously exerts a torque or force of the specified magnitude. This magnitude is
approached using a defined ramp (TorqueRamp), and the Function Block sets the InTorque output if the
commanded 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 Identifies the axis to work upon
VAR_INPUT
B Execute BOOL Starts on the axis using a rising edge
B Torque REAL Value of the torque (Torque or force in t.u.)
E TorqueRamp REAL The maximum time derivative of the set value of the torque or force
(in t.u. per sec)
E Velocity REAL Absolute value of the maximum velocity.
E Acceleration REAL Value of the maximum acceleration (acceleration is applicable with
same sign of torque and velocity)
E Deceleration REAL Value of the maximum deceleration (deceleration is applicable 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: positive or negative direction.) Note:
current direction and shortest way not applicable.
E BufferMode MC_BufferMode Defines the behavior of the axis: modes are Aborting, Buffered,
Blending
VAR_OUTPUT
B InTorque BOOL Setpoint value of torque or force is reached for the first time
E Busy BOOL Shows that the Function Block is not finished
E Active BOOL Indicates that the Function Block has control on the axis
E CommandAborte BOOL Command is aborted by another command
d
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,
depending 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 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.
MC_TorqueControl
AXIS_REF Axis AXIS_REF
BOOL Execute InTorque BOOL
REAL Torque Busy BOOL
REAL TorqueRamp Active BOOL
REAL Velocity CommandAborted BOOL
REAL Acceleration Error BOOL
REAL Deceleration ErrorID WORD
REAL Jerk
MC_Direction Direction
MC_BufferMode BufferMode
The example below shows the typical behavior of an intermediate “resistive” load (see .Deceleration limit) with some “inertia”
(see .TorqueRamp limit).
.Torque
.Torque Here it is not posible to achieve This section shows the effect of combined
torque target (velocity limit) action of torque and velocity limits
.TorqueRamp
limit
.Velocity
Here there is “.Velocity” limit, so
torque can not be achieved
.Deceleration .Deceleration
limit limit
M C_TorqueControl MC_TorqueControl
With the second example we use opposite signs for Direction & Torque (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 (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 T ime
T orque (setpoint)
- “TorqueRamp”
limiter Real T orque -
Initial velocity from
max
previous state “Deceleration”
limit
max
“Deceleration”
Real Velocity limit
Enable
T ime
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 additional inertia
compensation by modification of the torque setpoint for acceleration / deceleration is common from instantaneous 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.
5.11. 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 to which the switches are connected to
B Switches CAMSWITCH_REF Reference to the switching actions.
E Outputs OUTPUT_REF Reference to the signal outputs, directly related to the referenced
tracks. (max. 32 per function block) (First output = first
TrackNumber)
E TrackOptions 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 significant data
is related to the lowest TrackNumber. With data SET (to ‘1’ resp.
TRUE) the related TrackNumber is enabled.
VAR_OUTPUT
B InOperation BOOL The commanded tracks are enabled
E Busy BOOL Shows that the Function Block is not finished
B Error BOOL Signals that an error has occurred within the Function Block
E ErrorID WORD Error Identification
Notes:
• CAMSWITCH_REF is a vendor specific reference to the pattern data.
• OUTPUT_REF is a vendor specific structure linked to the (physical) outputs
• 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
CAMSWITCH_REF Switches Switches CAMSWITCH_REF
OUTPUT_REF Outputs Outputs OUTPUT_REF
TRACK_REF TrackOptions TrackOptions TRACK_REF
BOOL Enable InOperation BOOL
DWORD EnableMask Busy BOOL
Error BOOL
ErrorID WORD
This definition of a cam has a start and an end position, so the user can define each single cam, which has a FirstOnPosition
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. If (FirstOnPosition > LastOnPosition)
it gives an inverse cam switch, which is off only within these positions.
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 switching
point and the actual position is jittering around the switching position. Hysteresis is part of TRACK_REF, which means that a
different hysteresis is possible for each track.
Example of CAMSWITCHREF
Parameter Type Switch01 Switch02 Switch03 Switch04 … SwitchN
TrackNumber INTEGER 1 1 1 2
The example below uses the values from the example for 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
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
5.12. GearInPos
FB-Name MC_GearInPos
This Function Block commands a gear ratio between the position of the slave and master axes from the
synchronization point onwards.
VAR_IN_OUT
B Master AXIS_REF Reference to master axis
B Slave AXIS_REF Reference to slave axis
VAR_INPUT
B Execute BOOL Start the gearing process at the rising edge
B RatioNumerator INT Gear ratio Numerator
B RatioDenominator INT Gear ratio Denominator
B MasterSyncPosition REAL Master Position at which the axes are running in sync
B SlaveSyncPosition REAL Slave Position at which the axes are running in sync
E SyncMode ENUM Defines the way to synchronize (like ‘Shortest_Way’;
‘Catch_Up’; ‘Slow_Down’). 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 StartSync and
InSync
E Deceleration REAL Maximum Deceleration during the time difference StartSync and
InSync
E Jerk REAL Maximum Jerk during the time difference StartSync and InSync
E BufferMode MC_Buffer Defines the behavior of the axis: modes are Aborting, Buffered,
Mode Blending
VAR_OUTPUT
E StartSync BOOL Commanded gearing starts
B InSync BOOL Commanded gearing completed
E Busy BOOL Shows that the Function Block is not finished
E Active BOOL Indicates that the Function Block has control on the axis
B 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. If MasterStartDistance is implemented, any previous motion is continued until master crosses
"MasterSyncPosition – MasterStartDistance" in the correct direction (according to the sign of
MasterStartDistance). 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.
MC_GearInPos
AXIS_REF Master Master AXIS_REF
AXIS_REF Slave Slave AXIS_REF
BOOL Execute StartSync BOOL
INT RatioNumerator InSync BOOL
INT RatioDenominator Busy BOOL
REAL MasterSyncPosition Active BOOL
REAL SlaveSyncPosition CommandAborted BOOL
ENUM SyncMode Error BOOL
REAL MasterStartDistance ErrorID WORD
REAL Velocity
REAL Acceleration
REAL Deceleration
REAL Jerk
MC_BufferMode BufferMode
TRUE
Execute
FALSE t
TRUE
StartSync
FALSE t
TRUE
InSync
FALSE t
MasterSyncPosition
MasterStartDistance
SlaveSyncPosition
SlaveSyncPosition
Figure 10.1
SlaveSyncPosition
Figure 10.2
SlaveSyncPosition
Figure 10.3
5.13. MoveContinuous
FB-Name MC_MoveContinuous
This function block commands a controlled motion of a specified relative distance ending with the specified velocity.
VAR_IN_OUT
B Axis AXIS_REF
VAR_INPUT
B Execute BOOL Start the motion at rising edge
B Distance REAL Relative distance for the motion [u]
B Velocity REAL Value of the maximum velocity [u/s]
B EndVelocity REAL Value of the end 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 Defines the behavior of the axis: modes are Aborting, Buffered,
Mode Blending
VAR_OUTPUT
B InEndVelocity BOOL Commanded distance reached and running at requested end velocity
E Busy BOOL Shows that the Function Block is not finished
E Active BOOL Indicates that the Function Block has control on the axis
B CommandAborted BOOL Command aborted
B Error BOOL Signals that an error has occurred within the Function Block
E ErrorID INT Error number
Notes:
• If the target is reached and no new motion command is put into the buffer, the axis continues to run with the
specified ‘EndVelocity’.
• This Function Block places the axis into the ”Continuous Motion” state, even during the initial motion by a
relative distance, and remains in the “Continuous Motion” state once the EndVelocity has been reached.
MC_MoveContinuous
AXIS_REF Axis Axis AXIS_REF
BOOL Execute Done BOOL
REAL Distance Started BOOL
REAL Velocity Busy BOOL
REAL EndVelocity Active BOOL
REAL Acceleration Command Aborted BOOL
REAL Deceleration Error BOOL
REAL Jerk ErrorID INT
MC_BufferMode BufferMode
Example of MC_MoveContinuous:
Velocity
500
200 200
1 Cycle
Done FB1
Done FB2
Started FB3
Done FB3
5.14. Halt
FB-Name MC_Halt
This function block commands a controlled motion stop. It aborts any ongoing function block execution. 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
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_BufferMode Defines the behavior of the axis: modes are Aborting, Buffered,
Blending
VAR_OUTPUT
B Done BOOL Zero velocity reached
E Busy BOOL Shows that the Function Block is not finished
E Active BOOL Indicates that the Function Block 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_BufferMode BufferMode CommandAborted BOOL
Error BOOL
ErrorID INT
FB1 FB2
MC_MoveVelocity MC_Halt
Axis_1 Axis InVelocity InVel_1 Axis_1 Axis Done Done_2
Exe_1 Execute Busy Exe_2 Execute Busy
50 Velocity Active 5 Deceleration Active
10 Acceleration CommandAborted Abort_1 0 Jerk CommandAborted Abort_2
10 Deceleration Error BufferMode 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
Listed in this Appendix are the requirements for the compliance statement from the supplier of the Motion Control Function
Blocks. This part should be seen as integral to Part 1 – Function Blocks for Motion Control.
The compliance statement consists of two main groups: supported datatypes and supported Function Blocks, in combination
with the applicable inputs and outputs. The supplier has to fill out the tables for the used datatypes and Function Blocks,
according to their product, committing their support to the specification.
By submitting these tables to PLCopen, as well as those from Part 1, and after approval by PLCopen, the list will be published
on the PLCopen website, www.plcopen.org , as well as a short form overview, as specified in Appendix A 2 Supported
Datatypes and Appendix A 3 Overview of the Function Blocks as below.
In addition to this approval, the supplier is permitted access and usage rights to the PLCopen Motion Control logo, as
described in Part 1, chapter Appendix A4 - The PLCopen Motion Control Logo and Its Usage.
6.2.1. TouchProbe
6.2.2. AbortTrigger
6.2.3. ReadDigitalInput
6.2.4. ReadDigitalOutput
6.2.5. WriteDigitalOutput
6.2.6. SetPosition
6.2.7. SetOverride
6.2.8. ReadActualVelocity
6.2.9. ReadActualTorque
6.2.10. TorqueControl
6.2.12. GearInPos
6.2.13. MoveContinuous
6.2.14. Halt