Part 1 - Basics and Part 2 - Extensions
Function
Blocks for Motion Control Version 2.0 Released (Merge of Part 1
and 2)
Introduction
Part 1, the Basic document (version 1.0) was originally published in November 2001, a 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 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 both users as well as suppliers.
With so many implementations, as well as the first applications, inconsistencies were found in the first specification, as well as additional features to be added. This resulted in an update of the basic document; version 1.1, which was released in April 2005 and implemented in over 30 products.
Part 2, Extensions is an addition to the basic document and should not be
seen as a stand alone document. For example, part 2 adds information to the
state diagram, but only the added transitions are shown in this document,
containing additional function blocks.
In 2007 we started a new phase in PLCopen
Motion Control – the update of the basic specification, known as Part 1
– Basics, and Part 2 - Extensions. With multiple implementations and
many applications running, more and more feedback came in at PLCopen for
items to be clarified or changed, as well as additions. All these
comments were merged in 2 new documents: a “Corrigendum” for the
clarifications and changes, and an “Addendum” for the additions. (Note:
these documents at the current stage are only open for PLCopen members).
This resulted in the decision to merge Part 1 and
Part 2 into one document in order to provide a better overview of these basics.
This document is now released Version
2.0
Definition of the state machine
The
following diagram normatively defines the behavior of the axis at a high level.
This diagram is useful to build a more complicated profile or to treat
exceptions within a program. (In real implementations there may be additional
states at a lower level defined).
The axis is always in one of the defined state (see diagram). Any motion command
is a transition that changes the state of the axis and, as a consequence,
modifies the way the current motion is computed.
There are eight states
defined as shown in the picture below:
A normal procedure
would start in Disabled. In this state the power can be switched on per axis
(via the command Power, see above) which transfers the relevant axis to the
state Standstill. From there one can access the Homing state (via the issue of
the command Home per axis), which after normal completion returns to Stand
Still. From here one can transfer an axis to either Discrete Motion or
Continuous Motion. From these states a coupling to a master axis can be realized
for instance via issuing MC_GearIn. The resulting state for the slave axis is
then Synchronized Motion. Issuing a single axis move command will bring the axis
back to either Discrete or Continuous Motion. Via the state Stopping one can
return to StandStill. ErrorStop is a state the axis transfers to in case of an
error. Via a (manual) Reset command one can return to StandStill, from which the
machine can be moved to an operational state again. Please note that the States
define the functionality of the Function Blocks.
Function Blocks Definitions
A. Axis Ref
The reference to an axis
is done via the derived datatype AXIS_REF. This datatype is supplied by all
manufacturers. It provides the interface towards the motor / drive itself. The
technicalities of the real interface are hidden within the structure and
function block itself. In this way, different architectures, from centralized to
distributed and networked systems, looks the same to the user while giving
access to all relevant parameters.
B. AxisRef as Var_In_Out
The
Axis_Ref is used as Var_In_Out, represented as an input and an output connected
by a horizontal line in a graphical representation of a Function Block. The
variables used within Axis_Ref, acting both as input and output parameters, can
be modified within the Function Block as well as receive values from external
variables. However they are stored externally to the FB, making copying of the
structure unnecessary.
As an example of how this could operate: imagine a Program containing several
function blocks, all linked after each other (left-to-right) and all referring
to the same axis via Axis_Ref. The first FB reads the latest values in Axes_Ref,
and might update some of these values before it finishes its execution. Then the
next FB is started and reads the updated values within Axes_Ref, so uses the
latest values. And these values are internally coupled to the motor itself.
Again, the control architecture can be quite different across systems.
One can use this reference to define one or more virtual axes, in that sense
that it exists as a datastructure but is not coupled to a physical drive and/or
motor.
The Function Blocks for single axis Motion Control
There are motion
related and administrative function blocks defined in both part 1 and 2. The
first movement function block is shown here in some more detail:
|
FB-Name
|
MC_MoveAbsolute
|
|
This
function block commands a controlled motion at a specified absolute
position.
|
Graphical
representation:
|
|
|
MC_MoveAbsolute
|
|
|
|
AXIS_REF
|
|
Axis
|
|
Axis
|
|
AXIS_REF
|
|
BOOL
|
|
Execute
|
|
Done
|
|
BOOL
|
|
REAL
|
|
Position
|
|
Busy
|
|
BOOL
|
|
REAL
|
|
Velocity
|
|
Active
|
|
BOOL
|
|
REAL
|
|
Acceleration
|
|
CommandAborted
|
|
BOOL
|
|
REAL
|
|
Deceleration
|
|
Error
|
|
BOOL
|
|
REAL
|
|
Jerk
|
|
ErrorID
|
|
WORD
|
|
MC_Direction
|
|
Direction
|
|
|
|
|
|
MC_BufferMode
|
|
BufferMode
|
|
|
|
|
|
|
|
|
|
|
|
|
The other single axis
Function Blocks as defined in part 1 and 2 are listed here below in short-form:
- MC_MoveRelative - moves the axis a specified distance relative to the
actual position at the time of the execution.
- MC_MoveAdditive - for a specified relative distance additional to the
original commanded position in the discrete motion state. In the Continuous
Motion the specified relative distance is added to the actual position at the
time of the execution.
- MC_MoveSuperimposed - for a specified relative distance additional to an
existing motion. The existing Motion is not interrupted, but is superimposed by
the additional motion.
- MC_MoveVelocity - for a never ending controlled motion at a specified
velocity.
- MC_MoveContinuous - commands a controlled motion of a specified relative
distance ending with the specified velocity.
- MC_TorqueControl - continuously exerts a torque or force of the specified
magnitude, approached using a defined ramp, and sets the InTorque output if the
torque level is reached.
- MC_SetPosition - 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.
- MC_SetOverride - sets the values of override for the whole axis and all
functions that are working on that axis.
- MC_TouchProbe - is used to record an axis position at a trigger event.
- MC_AbortTrigger - is used to abort function blocks which are connected to
trigger events (e.g. MC_TouchProbe).
- MC_DigitalCamSwitch - provides 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.
- MC_Home - commands the axis to perform the «search home» sequence. The
details of this sequence are manufacturer dependent and can be set by axis’
parameters, as well as the function blocks as defined in Part 5 – Homing
sequences.
- MC_Stop - commands a controlled motion stop and transfers the axis to the
state “Stopping”. It aborts any ongoing function block execution. With the
Done output set, the state is transferred to the StandStill. While the axis is
in state Stopping, no other FB can perform any motion on the same axis.
- MC_Halt - 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.
- MC_Power - switches the power stage on or off.
- MC_ReadStatus - returns in detail the status of the axis with respect to
the motion currently in progress.
- MC_ReadAxisError - Indicates errors not relating to the function blocks.
- MC_Reset -makes the transition from the state ErrorStop to StandStill by
resetting all internal axis-related errors and clearing pending commands.
- MC_ReadParameter & MC_ReadBoolParameter - Returns the value of a
vendor specific parameter.
- MC_WriteParameter & MC_WriteBoolParameter - Modifies the value of a
vendor specific parameter.
- MC_ReadActualPosition - returns the actual position.
- MC_ReadDigitalInput - provides the value of the digital input as
referenced by INPUT_REF.
- MC_ReadDigitalOutput - - provides the value of the digital output as
referenced by OUTPUT_REF.
- MC_WriteDigitalOutput - writes a value to the output referenced by the
argument “Output”once.
- MC_ReadActualVelocity - returns the value of the actual velocity as long
as enabled.
- MC_ReadActualTorque - returns the value of the actual torque as long as
enabled.
- MC_PositionProfile - commands a time-position locked motion profile.
- MC_VelocityProfile - commands a time-velocity locked motion profile.
- MC_AccelerationProfile - commands a time-acceleration locked motion
profile.
Common set of multi-axes Function Blocks
For multi-axes,
coordinated movements, a small set is defined. This set will be extended by
additional application specific libraries. The current defined Function Blocks
are:
-
CamTableSelect - selects the
CAM
tables by setting the pointers to the relevant tables.
-
CamIn -
engages the
CAM.
-
CamOut -
disengages the Slave from the Master axis immediately.
-
GearIn - commands a ratio between the velocity of the slave and master axis.
-
GearOut -
disengages the Slave from the Master axis.
-
MC_GearInPos - commands a gear ratio between the position of the slave and
master axes from the synchronization point onwards.
A. Aborting, merging, and blending
Multiple
function blocks have an input to set the different operating modes, combined
with an output for signalling this. With this input,
the FB can either work in a ‘Non-buffered mode’ (default behavior) or in a
‘Buffered mode’. The difference between those modes is when they should
start their action:
The following modes
have been identified:
- Aborting - Default mode without
buffering. The next FB aborts an ongoing motion and the command is affecting the
axis immediately;
- Buffered - The next FB is
affecting the axis as soon as the previous movement is ‘Done’. There is no
blending;
- BlendingLow - The next FB is
controlling the axis after the previous FB has finished (equal to buffered), but
the axis may 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 FB1;
-
BlendingHigh - blending with
highest velocity of FB 1 and FB 2 at end-position of FB1.
An example
The following example
is an example of a simple
drilling unit:

We use Sequential
Function Chart here to describe the different step for this drilling example.
Step
1: Initialization, for instance at power up.
Step
2: Move forward to drilling position and start driller turning: in
this way it will be fully operational
before the position is reached; 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 the hole free of any stuff which might have stuck in
the hole.
Step
5: Move driller back to starting position and shut the spindle off.
Combining the finishing of moving backwards and stopping the spindle we signal
the step-chain to start over.

Representation
of the drilling example in SFC
The corresponding
timing diagram for the movement is depending on the selected mode. For example:
Timing
diagram for drilling - aborting mode
Timing
diagram for drilling - blending mode
Before you download the motion control library we would like you to fill out
a little form with a few questions.
|