0% found this document useful (0 votes)
863 views159 pages

Twincat 3 - NC PTP

This document provides an overview and instructions for configuring TwinCAT 3 NC PTP motion. It includes sections on safety measures for axis commissioning, NC safety functions, NC/PTP NCI configuration, axis types, and parameters for motion. The parameters for motion section describes settings for axes, encoders, drives, and control loops that define the motion behavior. Technical terms related to motion control are also defined.

Uploaded by

Protheuss01
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
863 views159 pages

Twincat 3 - NC PTP

This document provides an overview and instructions for configuring TwinCAT 3 NC PTP motion. It includes sections on safety measures for axis commissioning, NC safety functions, NC/PTP NCI configuration, axis types, and parameters for motion. The parameters for motion section describes settings for axes, encoders, drives, and control loops that define the motion behavior. Technical terms related to motion control are also defined.

Uploaded by

Protheuss01
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 159

Manual | EN

TF50x0
TwinCAT 3 | NC PTP

2023-06-27 | Version: 2.0.0


Table of contents

Table of contents
1 Foreword .................................................................................................................................................... 5
1.1 Notes on the documentation ............................................................................................................. 5
1.2 For your safety .................................................................................................................................. 6
1.3 Notes on information security............................................................................................................ 7

2 Overview .................................................................................................................................................... 8

3 Safety measures for axis commissioning ............................................................................................ 10

4 NC safety functions ................................................................................................................................ 12

5 NC/PTP NCI Configuration ..................................................................................................................... 14


5.1 SAF task.......................................................................................................................................... 14
5.2 SVB task ......................................................................................................................................... 16
5.3 Image .............................................................................................................................................. 17
5.4 Tables ............................................................................................................................................. 17
5.5 Objects ............................................................................................................................................ 17

6 Axes.......................................................................................................................................................... 19
6.1 Axis types ........................................................................................................................................ 19
6.1.1 Continuous axis................................................................................................................ 19
6.1.2 Encoder Axis .................................................................................................................... 19
6.1.3 Discrete Axis (two speed) ................................................................................................ 19
6.2 NC axis............................................................................................................................................ 20
6.2.1 Axis dialog box ................................................................................................................. 20
6.2.2 Axis component encoder.................................................................................................. 42
6.2.3 Axis component Drive ...................................................................................................... 55
6.2.4 Axis component cyclic interface ....................................................................................... 68

7 Parameters for Motion ............................................................................................................................ 70


7.1 Axes | Axis 1.................................................................................................................................... 70
7.1.1 Reference Velocity ........................................................................................................... 70
7.1.2 Maximum Dynamics, Default Dynamics........................................................................... 72
7.1.3 Manual Motion and Homing ............................................................................................. 73
7.1.4 Fast Axis Stop .................................................................................................................. 75
7.1.5 Limit Switches .................................................................................................................. 77
7.1.6 Monitoring ........................................................................................................................ 77
7.1.7 Setpoint Generator........................................................................................................... 81
7.1.8 NCI Parameters ............................................................................................................... 81
7.1.9 Other Settings .................................................................................................................. 83
7.2 Axes | Axis 1 | Enc .......................................................................................................................... 85
7.2.1 Encoder Evaluation .......................................................................................................... 86
7.2.2 Limit Switches .................................................................................................................. 88
7.2.3 Filter ................................................................................................................................. 89
7.2.4 Homing............................................................................................................................. 89
7.2.5 Other Settings .................................................................................................................. 92
7.3 Axes | Axis 1 | Drive ........................................................................................................................ 93
7.3.1 Output Settings ................................................................................................................ 93
7.3.2 Position and Velocity Scaling ........................................................................................... 94

TF50x0 Version: 2.0.0 3


Table of contents

7.3.3 Torque and Acceleration Scaling ..................................................................................... 96


7.3.4 Valve Diagram.................................................................................................................. 97
7.3.5 Optional Position Command Output Smoothing Filter ..................................................... 98
7.3.6 Sercos Behavior............................................................................................................... 98
7.3.7 Other Settings .................................................................................................................. 99
7.4 Axes | Axis 1 | Ctrl ........................................................................................................................... 99
7.4.1 Monitoring ...................................................................................................................... 101
7.4.2 Position Control Loop..................................................................................................... 102
7.4.3 Velocity Control Loop ..................................................................................................... 105
7.4.4 Observer ........................................................................................................................ 106
7.4.5 Other Settings ................................................................................................................ 107
7.5 Technical Terms............................................................................................................................ 108
7.5.1 Acceleration Feedforward .............................................................................................. 108
7.5.2 Automatic DAC Offset Adjustment ................................................................................. 108
7.5.3 Axis Error ....................................................................................................................... 109
7.5.4 AXIS_REF...................................................................................................................... 109
7.5.5 NC .................................................................................................................................. 110
7.5.6 Path Override (Interpreter Override Types) ................................................................... 110
7.5.7 PTP ................................................................................................................................ 111
7.5.8 PT1 Filter........................................................................................................................ 112
7.5.9 Rapid Traverse............................................................................................................... 112
7.5.10 ReadStatus() .................................................................................................................. 112
7.5.11 Tolerance Ball ................................................................................................................ 113

8 First steps .............................................................................................................................................. 115


8.1 Create project................................................................................................................................ 115
8.2 Create axis .................................................................................................................................... 117
8.2.1 Create simulation axis.................................................................................................... 117
8.2.2 Create AX5000 and NC axis automatically .................................................................... 119
8.2.3 Create AX5000 and NC axis manually........................................................................... 124
8.3 Axis configuration .......................................................................................................................... 129
8.3.1 Limiting positions............................................................................................................ 129
8.4 Moving the axis ............................................................................................................................. 130
8.4.1 Activating a TwinCAT project ......................................................................................... 130
8.4.2 Manual movement via the commissioning dialog........................................................... 131
8.4.3 Simple movement via the PLC....................................................................................... 132
8.5 Scope integration .......................................................................................................................... 136

9 Special NC functionalities .................................................................................................................... 141


9.1 Modulo positioning ........................................................................................................................ 141
9.2 External set value generation........................................................................................................ 144
9.3 NC Backlash Compensation ......................................................................................................... 146
9.3.1 Mechanical backlash...................................................................................................... 146
9.3.2 NC Implementing of the TwinCAT Position Correction .................................................. 148
9.3.3 NC Implementing the TwinCAT Backlash Compensation.............................................. 148
9.4 Discrete Axis (two speed) ............................................................................................................. 149

10 Support and Service ............................................................................................................................. 157

4 Version: 2.0.0 TF50x0


Foreword

1 Foreword

1.1 Notes on the documentation


This description is only intended for the use of trained specialists in control and automation engineering who
are familiar with applicable national standards.
It is essential that the documentation and the following notes and explanations are followed when installing
and commissioning the components.
It is the duty of the technical personnel to use the documentation published at the respective time of each
installation and commissioning.

The responsible staff must ensure that the application or use of the products described satisfy all the
requirements for safety, including all the relevant laws, regulations, guidelines and standards.

Disclaimer

The documentation has been prepared with care. The products described are, however, constantly under
development.
We reserve the right to revise and change the documentation at any time and without prior announcement.
No claims for the modification of products that have already been supplied may be made on the basis of the
data, diagrams and descriptions in this documentation.

Trademarks

Beckhoff®, TwinCAT®, TwinCAT/BSD®, TC/BSD®, EtherCAT®, EtherCAT G®, EtherCAT G10®, EtherCAT P®,
Safety over EtherCAT®, TwinSAFE®, XFC®, XTS® and XPlanar® are registered trademarks of and licensed by
Beckhoff Automation GmbH.
Other designations used in this publication may be trademarks whose use by third parties for their own
purposes could violate the rights of the owners.

Patent Pending

The EtherCAT Technology is covered, including but not limited to the following patent applications and
patents:
EP1590927, EP1789857, EP1456722, EP2137893, DE102015105702
with corresponding applications or registrations in various other countries.

EtherCAT® is a registered trademark and patented technology, licensed by Beckhoff Automation GmbH,
Germany

Copyright

© Beckhoff Automation GmbH & Co. KG, Germany.


The reproduction, distribution and utilization of this document as well as the communication of its contents to
others without express authorization are prohibited.
Offenders will be held liable for the payment of damages. All rights reserved in the event of the grant of a
patent, utility model or design.

TF50x0 Version: 2.0.0 5


Foreword

1.2 For your safety


Safety regulations

Read the following explanations for your safety.


Always observe and follow product-specific safety instructions, which you may find at the appropriate places
in this document.

Exclusion of liability

All the components are supplied in particular hardware and software configurations which are appropriate for
the application. Modifications to hardware or software configurations other than those described in the
documentation are not permitted, and nullify the liability of Beckhoff Automation GmbH & Co. KG.

Personnel qualification

This description is only intended for trained specialists in control, automation, and drive technology who are
familiar with the applicable national standards.

Signal words

The signal words used in the documentation are classified below. In order to prevent injury and damage to
persons and property, read and follow the safety and warning notices.

Personal injury warnings

DANGER
Hazard with high risk of death or serious injury.

WARNING
Hazard with medium risk of death or serious injury.

CAUTION
There is a low-risk hazard that could result in medium or minor injury.

Warning of damage to property or environment

NOTICE
The environment, equipment, or data may be damaged.

Information on handling the product

This information includes, for example:


recommendations for action, assistance or further information on the product.

6 Version: 2.0.0 TF50x0


Foreword

1.3 Notes on information security


The products of Beckhoff Automation GmbH & Co. KG (Beckhoff), insofar as they can be accessed online,
are equipped with security functions that support the secure operation of plants, systems, machines and
networks. Despite the security functions, the creation, implementation and constant updating of a holistic
security concept for the operation are necessary to protect the respective plant, system, machine and
networks against cyber threats. The products sold by Beckhoff are only part of the overall security concept.
The customer is responsible for preventing unauthorized access by third parties to its equipment, systems,
machines and networks. The latter should be connected to the corporate network or the Internet only if
appropriate protective measures have been set up.

In addition, the recommendations from Beckhoff regarding appropriate protective measures should be
observed. Further information regarding information security and industrial security can be found in our
https://www.beckhoff.com/secguide.

Beckhoff products and solutions undergo continuous further development. This also applies to security
functions. In light of this continuous further development, Beckhoff expressly recommends that the products
are kept up to date at all times and that updates are installed for the products once they have been made
available. Using outdated or unsupported product versions can increase the risk of cyber threats.

To stay informed about information security for Beckhoff products, subscribe to the RSS feed at https://
www.beckhoff.com/secinfo.

TF50x0 Version: 2.0.0 7


Overview

2 Overview
TF5000 TwinCAT NC PTP is the basis for controlling simple axes up to complex multi-axis systems.
• TF5000: Up to 10 axes (extendable up to a maximum of 255 axes).
• TF5010: Extension of TF5000 to up to 25 axes (extendable to a maximum of 255 axes).
• TF5020: Extension of TF5000 to up to 255 axes.

Axis objects

The real axes are represented by axis objects. This results in a separation between physical and logical axis.
Rotatory and linear, electric and hydraulic drives can thus be programmed in the same way. In addition, the
axis object can simulate an axis. Initial program tests without physical hardware are thus possible. The
control of the axes can be configured in various conformations (position or velocity interface) and various
controllers. The axes are configured in TwinCAT Engineering.
• Supports electrical and hydraulic servo drives, frequency converter drives, stepper motor drives, DC
drives, switched drives (two-speed axes [} 149]), simulation axes and encoder axes [} 19].
• Supports various encoders such as incremental encoder, absolute encoder, digital interface to the
drives such as EtherCAT, SERCOS, SSI, Lightbus, PROFIBUS DP/MC, Pulse Train.
• Provides standard axis functions such as start, stop, reset, referencing, velocity override, master/slave
couplings, electronic gearing, online position compensation.
• Provides convenient methods for axis commissioning.
• Contains online monitors for all axis state variables, such as actual/setpoint values, enables, control
values, online axis tuning.
• Forcing of axis variables.
• Configuration of all axis parameters, such as measuring system, drive parameters and position
controller.
• Configurable controller structures: P control, PID control, PID with velocity pre-control, PID with velocity
and acceleration pre-control.

Programming

For programming, the Tc2_MC2 library provides PLCopen-compliant administrative and motion-initiating
function blocks. In addition to the pure movements of an axis from an initial position to a target position,
movements of two axes can also be operated in a gear coupling. This is referred to as gearing.

A coordinated master-slave motion with non-linear relationships is called cam plate coupling. These can be
added to the TwinCAT NC PTP by TF5050 | TwinCAT NC Camming.

TF5060 | TwinCAT NC FIFO AXES extends the TwinCAT NC PTP with a table coupling concept for arbitrary,
usually not cyclically recurring processes. In this case, rather than having one master-slave table prescribed
in advance, the latest axis positions are constantly "topped up" by a PLC program.

Another addition to the axis coupling is TF5055 | TwinCAT Flying Saw. Here, a slave axis is coupled 'flying' to
a moving master axis at a specific position. As the name suggests, such couplings are often used when, for
example, a board needs to be cut with a saw on a moving conveyor belt.
• Programming is carried out via PLCopen-compliant IEC 61131-3 function blocks of the Tc2_MC2
library.
• Online master/slave and slave/master conversion
• "Flying Saw" (diagonal saw) with TF5055 | TwinCAT Flying Saw
• Cam plates with TF5050 | TwinCAT NC Camming
(supported by TwinCAT 3 CAM Design Editor [optional])
• FIFO axes with TF5060 | TwinCAT NC FIFO AXES
• External setpoint generators [} 144]
• Multi-master coupling

8 Version: 2.0.0 TF50x0


Overview

Further information
• PLC libraries
• ADS specification for NC

TF50x0 Version: 2.0.0 9


Safety measures for axis commissioning

3 Safety measures for axis commissioning


Axis commissioning includes:

1. In particular, the knowledge and use of NC security functionalities,


2. taking the necessary safety precautions and
3. compliance with a specific sequence of commissioning steps.

DANGER
Danger to life or risk of serious injury or damage to property due to unintentional
movements of the axis
When commissioning axes, there is a movement of them and the mechanics coupled to them, which
creates a hazard for people and a risk of damage to the machine. The following safety measures provide
guidelines for safe commissioning. The actual measures to be taken depend on the axis and its
surroundings.
As a general rule, "Don't take an action whose consequence you can't estimate."

General safety precautions

Inform yourself about the safety instructions and commissioning steps of your drive, such as: AX8000 and
the NC safety functions [} 12] and use them.

Handling the emergency stop case is one of the most important and safety-relevant features of a machine.
For this reason it is usual for an additional hardware safety circuit to be built on top of all the logical (logical
axis enables) and software enables (PLC: controller and feed enables). Extensive statutory regulations exist
governing the reaction and the implementation in hardware of the emergency stop system. Here we only
make reference to these.

Within the limits prescribed by the statutory regulations, there remains often a degree of free choice as to
how, for instance, NC axes are stopped in the event of an emergency stop. In some cases the mechanical
properties of the machine mean that it is not always possible to bring axes that are moving to an abrupt halt
(e.g. abruptly output of 0.0 V of an analog interface). It is therefore quite common for NC axes to be slowed
following special braking ramps in an emergency stop situation, after which they are then electrically and
mechanically locked.

One of the first procedures for commissioning a machine is to test the emergency stop circuit. We begin
with safe, standard situations (the axes are stationary under emergency stop conditions, although special
attention must be paid here to axes that move vertically). The testing then moves on to more complicated
cases (axes moving slowly, then axes moving rapidly).

It is possible, in order to test and commission rapidly, to set the logical axis enables (controller and feed
enables) and the velocity override of the axes from the TwinCAT development environment via the Axis
online dialog [} 38] for the particular axis*. This is, however, only possible if the axis interface is not
involved in cyclical exchange with the PLC (mapping between the NC and PLC tasks). In that case, the
single write of information from the development environment would immediately be overwritten again by the
cyclic data exchange. It must, however, be pointed out that this procedure can be very dangerous, because
the usual safety monitoring and manipulation facilities of the PLC are disabled. Therefore, this feature can be
safely used on an axis test rig with endless axes.
*It is extremely inadvisable to use this facility on a real machine.

Essential requirements

The description below covers all the steps of commissioning an axis. Several types of axis and a range of
different situations are covered. In each step, all the settings which must be made are mentioned, even when
they are identical with the settings of the previous step. In practice, only some of the listed (partial) steps are
actually executed for an axis.

Before you can begin the commissioning itself, a number of preparations must be made:
• Check their completeness and correctness of all the electrical connections.
• All parts of the axis (encoder, drive, controller, PLC interface) must be of appropriate types, and must
be provided with the correct resources (PLC variables, I/O hardware in the fieldbus etc.).

10 Version: 2.0.0 TF50x0


Safety measures for axis commissioning

• The NC architecture must not only be created, but must also be written into the registry, and TwinCAT
must be started with it.

Safety precautions

The following safety precautions must be taken:


• Ensure that no one can enter or reach into the machine: the machine can behave unpredictably during
commissioning.
• Isolate those parts of the equipment on which you are currently working. Anything that is not needed
must be safely shut down as it may interfere or distract.
• Inform all persons in the vicinity that there is an increased risk of accidents and that they must keep the
necessary distance from the machine.
• Make sure you are alone in the hazardous area. Only necessary and instructed as well as competent
persons should be present in case of need.

Sequence

It is necessary to observe a particular sequence, because the individual steps of axis commissioning are
built logically on each other. The sequence, however, does depend on the particular axis composition, i.e. on
the combination of the encoder, controller and drive types.

TF50x0 Version: 2.0.0 11


NC safety functions

4 NC safety functions
A monitoring function (watchdog) is provided in order to monitor the operation and regular updating of the
cyclical interface between the PLC and the NC. In addition, there is task runtime overrun monitoring for each
task and position lag monitoring and end position monitoring for the NC axes.

NOTICE
No safety functions in the sense of safety technology
The NC safety functionalities are purely functional settings that are not safety functions in the sense of
safety technology.

There are further monitoring options on the hardware side.


Also find out about other safety measures for axis commissioning [} 10].

Watchdog for cyclic axis interface between PLC and NC

The watchdog (function monitoring) functionality between the cyclic axis interface of the PLC and NC should
always be activated. This is the case if any value other than zero is entered for the watchdog. The value
specifies the number of sequential task cycles following which the watchdog will trigger if no new information
has been transferred between the NC and the PLC. If the watchdog is triggered, the corresponding axis
interface (PlcToNc or NcToPlc) is cleared, i.e. zeroed.

Example: When the watchdog is active, it is ensured in the following cases that the NC axes are stopped by
means of the removal of the controller and feed enable caused by the watchdog. When:
• the PLC is stopped
• an infinite loop has been programmed within the PLC
• an FPU exception occurs

Task time-out monitoring

For purposes of diagnosis and analysis the task time-out monitoring should be activated. This is true both for
the SAF task (I/O task of the NC) and for the SVB task of the NC. As regards content this monitoring has no
effect, but should there be an occasion where an unexpected task time-out occurs, the response is in the
form of a message box and an additional entry in the event display.

Position lag monitoring, end position monitoring, target position control

Right from the start of any operations each axis should be driven with both "position lag monitoring" and "end
position monitoring" active. Even if an axis that has not yet been optimized travels with sometimes very large
lag errors, these elementary monitoring mechanisms should not be switched off, but should be
parameterized accordingly (Position Lag Monitoring [} 29]).
Furthermore, there is the option of automatically checking the target position (Target Position Monitoring
[} 32]).

Direction inversion, direction monitoring

There are functionalities, e.g. position compensation on a master axis, which can cause an inversion of the
direction of movement. To avoid an unwanted direction of travel, there is a direction-dependent feed enable
that stops the axis instantaneously if it travels in the wrong direction.

Maximum velocity

Furthermore, there is the possibility to define the maximum allowed velocity of an axis in the axis parameters
or to limit the output of the drive in percent.

For example, it can happen that, by mistake, the direction of actuation of the axis control loop (positive
feedback) is altered as a result of changeover of drive or encoder polarity, and the axis, with full logical
consistency, drives towards the mechanical end position at maximum output value.

In the following situations the maximum velocity can be exceeded:

12 Version: 2.0.0 TF50x0


NC safety functions

• by position compensation of the master or slave axes


• by setting or changing the coupling factor of a slave axis or (indirectly) of the flying saw
• by externally generated data in the FIFO or the table slave axes

Stop

All master axes can be stopped at any time.

Notice The flying saw is the only slave axis that has a stop function. However, there are situations
when a flying saw cannot be stopped.

Slave axes can be stopped by disconnecting them online and converting them into master axes, which can
then be stopped. The FIFO axes and the NCI group can be stopped.

Hardware monitoring

It may be that a facility in an emergency situation (emergency stop, watchdog, etc.) must not be allowed
under any circumstances, for mechanical or other reasons, to halt abruptly its axes in the next I/O cycle (e.g.
to output 0 V suddenly). Such behavior can only be ensured via the drive hardware that is present. To this
end most manufacturers offer simple digital circuitry options that ensure that an axis is brought to a halt in a
defined way (braking ramp, standstill window for electrical deactivation of the control system and activation
of the brakes, etc.).

TF50x0 Version: 2.0.0 13


NC/PTP NCI Configuration

5 NC/PTP NCI Configuration


A NC/PTP NCI Configuration is divided into the following sections:

NC-Task 1 SAF [} 14] • SAF task


• Task for the block execution
• Task in which the setpoint generation takes place.
• Task that serves the fieldbus IO of the NC.
NC-Task 1 SVB [} 16] • SVB task
• Task for the block preparation
• Linking and "Look-Ahead" of NCI segments
• no effect on single-axis movements (PTP)
• not responsible for the fieldbus IO of the NC
Image [} 17] • NC process image
Tables [} 17] • Tables, e.g. for cams
Objects [} 17] • additional TCOM objects
Axes [} 19] • NC axis configuration.

Additionally, channels of the following types can be added to the configuration:


NC Channel (for • TF5100 | TwinCAT 3 NC I
Interpolation)
NC Channel (for FIFO • TF5055 | TwinCAT 3 NC FIFO Axes
Axes)
NC Channel • TF511x | TwinCAT 3 Kinematic Transformation
(for Kinematic
Transformation)

5.1 SAF task


The block execution task (SAF task) directly executes commands that do not require preprocessing or have
been prepared by the SVB task [} 16] and handles cyclic communication with the drive devices.
• motion commands of the Tc2_MC2 library, like MC_MoveAbsolute, MC_MoveRelative,
MC_MoveVeloctiy etc.
• coupling axes
• cyclic setpoint generation for all axes and output to drives
• cyclic acquisition of the actual position and position control, if not directly controlled by the drive
• I/O communication, e.g. for the evaluation of latch positions

Task tab

The SAF task is configured via the NC/PTP NCI Configuration node below the MOTION node, which is
called NC-Task 1 SAF by default. Details about the task dialog can be found in the TE1000 | TwinCAT 3 XAE
documentation.

14 Version: 2.0.0 TF50x0


NC/PTP NCI Configuration

Settings tab

Retain data

TwinCAT-NC uses retain data to restore the position of individual axes with absolute measured value system
at system startup. The Retain setting determines globally whether data required for this purpose is saved
when the system is stopped and loaded when the system is started. In addition, the storage must be
parameterized for each axis that requires such data (see Data Persistence [} 37]).

NOTICE
Prevent data loss
If retain data is used, it is recommended that the system is backed up with a UPS so that the data can be
stored safely even if the supply voltage fails.

• None: No retain data is saved or loaded.


• Store only: No retain data is loaded at system startup. Retain data is saved when the system is
stopped. This setting is only used for compatibility with old configurations.
• Load/Store: Retain data is stored at system stop and loaded at system start. If there is no data or only
corrupt data at system startup, the system aborts the startup process with an error.
The system cannot be started in this mode when the retain data is configured for the first time, so the
Mode Load (if available)/Store should be set first and then reset to Load/Store after a successful
system start.

TF50x0 Version: 2.0.0 15


NC/PTP NCI Configuration

• Load (if available)/Store: Retain data is stored at system stop and loaded at system start. If there is no
data or only corrupt data at system startup, the system starts without retain data.
Axes that rely on retain data are in the "not referenced" state. The application should check this state
and take action.

Symbol Names

The setting Symbol Names, Language independent specifies that the generic part of the symbol name is not
changed. This is then always held in English.

For example, without this setting Axes.Axis 1.SetPos would change to Achsen.Axis 1.SetPos when switching
language from English to German, while with the setting it would remain English.

Online tab

The Online tab shows the utilization of the task over time and indicates the number of cycle time overruns.
Details can be found in the TE1000 | TwinCAT 3 XAE documentation.

5.2 SVB task


The block preparation task (SVB task) prepares selected commands so that they can subsequently be
executed quickly in the SAF task [} 14].
These are for example:
• Operation of the axes in the development environment via the Axis online dialog [} 38].
• Homing sequence, which can be started e.g. with MC_Home.
• Group commands for kinematic, FIFO and NCI groups

16 Version: 2.0.0 TF50x0


NC/PTP NCI Configuration

Settings in relation to the SAF task

In relation to the SAF task, a higher cycle time and a lower priority should be selected for the SVB task, as is
also the case by default.

5.3 Image
Under Image the process image of the SAF task is displayed.

General information on the process image of a task can be found in the documentation TE1000 | TwinCAT 3
XAE.

5.4 Tables
Electronic cam plates describe a nonlinear relationship between a master and a slave axis in a coupled axis
system.

Valve characteristic curves are required for the control of hydraulic axes. They describe a non-linear
relationship between the target velocity of an NC axis and the variable output to the controlled device.

Electronic cam plates and valve characteristic curves can be managed under Tables.

Further information:
• Motion Diagrams
TE1510 | TwinCAT 3 CAM Design Tool
TF5050 | TwinCAT 3 NC Camming
• Valve Diagrams
TE1500 | TwinCAT 3 Valve Diagram Editor

5.5 Objects
TwinCAT 3 has a modular structure.

This modular structure is also used for Motion Control.

TF50x0 Version: 2.0.0 17


NC/PTP NCI Configuration

The individual motion objects can be channel-dependent, e.g. axes in the axis channel or kinematic
transformations from the "NC Channel (for Kinematic Transformation)" or channel-independent.

The independent objects are managed via the Objects node. These are, for example, the Collision
Avoidance and Coordinated Motion groups.

18 Version: 2.0.0 TF50x0


Axes

6 Axes

6.1 Axis types


TwinCAT supports different axis types. The axis type must be set when creating an axis at Motion > Axes:

The most important axis types are described below with their characteristics.

6.1.1 Continuous axis


A continuous axis in TwinCAT means that a drive hardware is to be operated that can process continuous
setpoint specifications.

It is irrelevant in which form or with which hardware these specifications are ultimately made. This can be a
drive controller that follows continuous position or even continuous velocity setpoints. This group includes
digital servo drive controllers. But this can also be a hardware that follows an analog value.

Usually, an actual value is also provided by this hardware.

6.1.2 Encoder Axis


In the TwinCAT context, one speaks of an encoder axis if a pure encoder system is to be integrated into the
system as an axis object.

Encoder axes do not have "Drive" or "Ctrl" as sub-elements of the axis.

An encoder axis can be used in the system as master of couplings, but never be slave.

A special feature of the encoder axis is that the setpoint corresponds to the actual value, since this axis type
does not have its own setpoint generator. If couplings are set up with an encoder axis, they are therefore
indirectly coupled to the actual value (couplings in the TwinCAT system are always setpoint-based).

This leads to the fact that a noise component is to be seen in the setpoint and is also transferred to slave
axes.

6.1.3 Discrete Axis (two speed)


This TwinCAT axis type (Two-Speed) enables the positioning of a so-called rapid/creep axis. Such an axis
can be physically made up of a motor with two speeds (switching of the pole pair numbers), or alternatively
by a motor that can be driven at two speeds with the help of a frequency inverter.

The TwinCAT axis type Two-Speed represents a special form of an axis. The following pages do not deal
with this TwinCAT axis type in particular, but assume a Continuous axis [} 19] or Encoder axis [} 19].

TF50x0 Version: 2.0.0 19


Axes

Detailed information for this special type can be found in the chapter Discrete Axis (two speed) [} 149] under
the special NC functionalities [} 141].

6.2 NC axis

6.2.1 Axis dialog box

6.2.1.1 General

Property Description
Name Selected name of the object.
Do not assign an object name more than once!
Object Id 32-bit identification number that is automatically assigned and unique within a
project.
Type Axis type [} 19]
The axis type is defined when the axis is created and cannot be changed later.
Comment Freely editable field for user notes.
Id Identification number of the axis, which is assigned consecutively. When an axis is
deleted, the number becomes free again and can be assigned to a new axis.
Disabled Option to disable an axis
Create symbols This option generates typical symbol names that are used in TwinCAT Scope, for
example.

6.2.1.2 Settings
In the Settings tab essential settings like linking the NC axis with hardware and PLC as well as type and unit
can be made.

20 Version: 2.0.0 TF50x0


Axes

Setting Description
Link To I/O… The Link button opens a dialog for linking the NC axis with the
drive hardware under I/O.
The link is displayed in the field to the right.
Link To PLC… The Link button opens a dialog for linking the NC axis with the
PLC instance of the axis.
The link is displayed in the field to the right.
Axis Type Type of connected drive hardware and protocol used.
Unit Physical unit of the position of the axis. The unit can be chosen
arbitrarily and edited in the Unit input field. It should be noted
that the scaling factor of the axis must be set accordingly (see
Encoder parameters).
Standard: Millimeter (mm)
Display (only) Adjustments to the display in the online axis dialog. These
settings do not affect data in the process image.
Position Changes the position display by one thousand digit (mm/µm)
Velocity Display of velocity in mm/min instead of mm/s.
The default time reference in NC and PLC remains the second
regardless of the display setting.
Modulo Display of the modulo position instead of the absolute position.
Result
Position Position
Velocity Velocity
Acceleration Acceleration
Jerk Jerk
Axis Cycle Time / Access Divider
Divider The axis is executed in every nth cycle of the NC-SAF task
with the cycle time divider. The divider can be set to a value
greater than 1 to reduce the system load for low-priority axes.
Modulo With a cycle time divider greater than 1, the modulo value
determines in which NC-SAF cycle the axis is processed. Axes
with the same modulo are processed in the same cycle. For

TF50x0 Version: 2.0.0 21


Axes

Setting Description
even distribution of the system load, the axes should be
distributed to different modulo values.
Example: Divider=4, Modulo 0..3
Cycle Time (ms) Axis cycle time

6.2.1.3 Parameter
Various axis settings can be made via the Parameter tab, which are described below.

6.2.1.3.1 Reference Velocity

At MOTION | NC-Task 1 SAF | Axes | Axis 1 | Drive | Parameter.

Solely Reference Velocity also at MOTION | NC-Task 1 SAF | Axes | Axis 1 | Parameter | Maximum
Dynamics.

Analogously, for different identifiers.

22 Version: 2.0.0 TF50x0


Axes

Reference Velocity at Output Ratio [0.0 … 1.0]

Scaling and Physical Limit

For analog control the Reference Velocity at a certain Output Ratio matches the analog input control signal
with the resulting physical velocity of axis motion. Furthermore, for control via a digital interface, e.g. SoE or
CoE, and for analog control the Reference Velocity at Output Ratio 1.0 prescribes a physical velocity limit
not to be exceeded by setpoint generation and positional control.

Proportional Relationship for Analog Control

When drive controllers with analog inputs for their velocity control are used, the Reference Velocity combines
e.g. an input bias value for control with a physical velocity or a number of revolutions per minute of the
controlled axis. Comparatively, the analog input bias value may result from a kind of potentionmeter dividing
a voltage range for control. Similarly, a controlling current may be applied as an input source. For zero
control signal there is zero physical velocity. At a particular Output Ratio there is a corresponding Reference
Velocity, thus establishing a proportional relationship. For analog control, e.g. ±10V, the Reference Velocity
at Output Ratio 1.0 prescribes the setpoint velocity at the corresponding maximum output of e.g. 10V.

Pair of Numbers

Some drive setups may not be put into operation at their upper physical velocity limit corresponding to an
Output Ratio of 1.0. Instead, at a reasonably reduced velocity allocated for first driving experiences the
Reference Velocity may be determined at a reduced Output Ratio lower than 1.0. Thus, the link between
controlling input signal and physical velocity of motion is established by a pair of numbers, the Reference
Velocity and the Output Ratio adjoined to it. Internally, the scaling calculation is done by TwinCAT and it
calculates a Reference Velocity at Output Ratio 1.0. When for an Output Ratio 1.0 an axis is controlled at
its designed upper physical boundary setpoint, it is controlled at its reference velocity.

Reference Velocity and Maximum Velocity

The Reference Velocity at Output Ratio 1.0 determines an upper physical limit for velocity control. So far,
there is no appropriate way to go faster. On the other hand, the parameter Maximum Velocity establishes an
upper limit for velocity control from a logical point of view. So far, there is no intended accomplishment to
drive beyond the Maximum Velocity limit, even though this might be physically possible up to the boundary
set by the Reference Velocity at Output Ratio 1.0. The Reference Velocity at Output Ratio 1.0 should not
succeed the Maximum Velocity. When the Maximum Velocity exceeds the Reference Velocity at Output
Ratio 1.0, an error message will be thrown. Likewise, at an axis start velocities exceeding the Reference
Velocity at Output Ratio 1.0 will be rejected by an NC error. Tacitly, cyclic controller output is limited to the
Reference Velocity at Output Ratio 1.0 without throwing an error.

Minimum Drive Output Limitation [-1.0 … 1.0]

To limit velocity and thus to protect hardware a lower output limit can be set for driving the axis. If just a part
of the output data type is valid it is necessary to limit the minimum output value. The Minimum Drive Output
Limitation is a directionally dependend limitation of the total output. The value 1.0 corresponds to unlimited
output of 100%. Typically, using this parameter one refers to a velocity output signal for the drive in
connection with position control. In exceptional cases the application of this parameter may refer to a torque
value or a current value.

Maximum Drive Output Limitation [-1.0 … 1.0]

To limit velocity and thus to protect hardware an upper output limit can be set for driving the axis. If just a
part of the output data type is valid it is necessary to limit the maximum output value. The Maximum Drive
Output Limitation is a directionally dependend limitation of the total output. The value 1.0 corresponds to
unlimited output of 100%. Typically, using this parameter one refers to a velocity output signal for the drive in
connection with position control. In exceptional cases the application of this parameter may refer to a torque
value or a current value.

6.2.1.3.2 Maximum Dynamics, Default Dynamics

TF50x0 Version: 2.0.0 23


Axes

Dynamic-Parameters
• Velocity Vel,
• Acceleration Acc,
• Deceleration Dec,
• Jerk.

The jerk is the derivative of acceleration or deceleration with respect to time. Thus, it describes how quickly
acceleration or deceleration change.

“Maximum Dynamic-Values” and “Default Dynamic-Values”

Range of Values • Absolute values.


• Unsigned.
• Positive.
• Different from zero.

Limits • With respect to their absolute values, “maximum dynamic-values” exceed their cor-
responding “default dynamic-values”.
• Formally allowed: With respect to its absolute value, a “maximum dynamic-value”
equals its corresponding “default dynamic-value”.

Tc2_NC2 Library, Tc2_MC2 Library

Tc2_NC2,Tc2_MC2 • If the input value "0.0" is assigned to a motion function block for one of the dynam-
Default values ics parameters "Acc, Dec or Jerk", the value "0.0" is replaced by a default value for
this parameter.
• If no input value is assigned to a motion function block for one of the dynamic pa-
rameters "Acc, Dec or Jerk", this dynamic parameter is set to "0.0", and the value
"0.0" is replaced by a default value for this parameter.

Tc2_NC2, Tc2_MC2 • The maximum dynamic range is regarded as an actual physical limit for the corre-
Maximum dynamics sponding axis.
• Values exceeding the values prescribed by the maximum velocity are not accepted
and will lead to an error.
• Values that exceed the maximum acceleration and deceleration are accepted and
not rejected.

24 Version: 2.0.0 TF50x0


Axes

Tc2_NC2 • During an "Online Transformation" from slave to master, various measures are
"Online taken to prevent the maximum velocity being exceeded or the direction of move-
Transformation" ment being reversed.
• Examples of such measures are increasing the jerk or increasing the acceleration
or deceleration to the maximum value.
• From slave to master: Decoupling a slave axis in an accelerated or decelerated
movement.

Tc3_McCoordinatedMotion Library, Tc3_McCollisionAvoidance Library

Tc3_Mc • If for one of the dynamic-parameters “Acc, Dec, jerk” the input value “0.0” is as-
CoordinatedMotion signed to a motion function block, this assignment leads to an error that means that
Tc3_Mc this value is not allowed.
CollisionAvoidance • If for one of the dynamic-parameters “Acc, Dec, jerk” you would like to refer to a de-
Default Values fault value at a motion function block, this parameter has to be set to the constant
value “MC_Default”.

Tc3_Mc Vel, Acc, Dec


CoordinatedMotion • For the dynamic-parameters “Vel, Acc, Dec” the parameterized values are used.
Tc3_Mc
CollisionAvoidance • For the dynamic-parameters “Vel, Acc, Dec” maximum values can be parameter-
Maximum Dynamics ized at a motion function block using the constant value “MC_Maximum”.
Jerk
• There is no maximum value for the jerk.
• The jerk is set to the value “unlimited”. Simultaneously, a three-phase-profile or a
three-phase-acceleration-setter is applied for motion.
Default Values
• It is allowed to parameterize default values that exceed their corresponding maxi-
mum values.
• If a default value is parameterized that exceeds ist corresponding maximum value,
a warning will be given, but no error is thrown.
• At a Tc3_McCoordinatedMotion-function block or a Tc3_McCollisionAvoidance-
function block parameterized default values using the constant value MC_Default
will be mutually limited to the corresponding maximum values without giving an er-
ror message.

6.2.1.3.3 Manual Motion and Homing

bCalibrationCam

A boolean input of MC_Home. It evaluates the signal of a reference cam. This reference signal may be
coupled into the control unit via a digital input.

TF50x0 Version: 2.0.0 25


Axes

Homing Velocity (towards plc cam)

Velocity used by an MC_Home function block driving towards a reference cam within the standard homing
sequence when the HomingMode MC_DefaultHoming is selected and the input bCalibrationCam is
evaluated.

Homing Velocity (off plc cam)

Velocity used by an MC_Home function block driving off a reference cam within the standard homing
sequence when the HomingMode MC_DefaultHoming is selected and the input bCalibrationCam is
evaluated.

Buttons in the Online Dialog

The buttons -- F1, - F2, + F3 and ++ F4 are in the “MOTION | NC-Task 1 SAF | Axes | Axis 1 | Online” dialog.

Manual Velocity (Fast)

Online

Velocity used for MOTION | NC-Task 1 SAF | Axes | Axis 1 | Online | -- F1.

Velocity used for MOTION | NC-Task 1 SAF | Axes | Axis 1 | Online | ++ F4.

Analogously, for different identifiers.

MC_Jog

Velocity used by an MC_Jog function block applied on the axis when its input JogForward or its input
JogBackwards is TRUE and MC_JOGMODE_STANDARD_FAST is selected as its Mode.

Manual Velocity (Slow)

Online

Velocity used for MOTION | NC-Task 1 SAF | Axes | Axis 1 | Online | - F2.

Velocity used for MOTION | NC-Task 1 SAF | Axes | Axis 1 | Online | + F3.

Analogously, for different identifiers.

MC_Jog

Velocity used by an MC_Jog function block applied on the axis when its input JogForward or its input
JogBackwards is TRUE and MC_JOGMODE_STANDARD_SLOW is selected as its Mode.

26 Version: 2.0.0 TF50x0


Axes

Jog Increment (Forward)

Unused.

Explicitly, this parameter is not used in any current TC3 motion library. Still, this parameter itself can be read
or be written or be employed by the user indirectly, e.g. within a user-made function block or within an HMI.

Jog Increment (Backward)

Unused.

Explicitly, this parameter is not used in any current TC3 motion library. Still, this parameter itself can be read
or be written or be employed by the user indirectly, e.g. within a user-made function block or within an HMI.

MC_JOGMODE_INCHING

The MC_Jog function block enables an axis to be moved via manual keys. The key signal can be linked
directly to the JogForward or the JogBackwards input. The desired operating mode is prescribed by the
input Mode. Applying mode MC_JOGMODE_INCHING a rising edge at one of the jog inputs moves the axis by
a certain distance that is assigned at the input Position.

Further Information:
• MC_Jog (PLC library Tc2_MC2)

6.2.1.3.4 Fast Axis Stop

Fast Axis Stop

Usually a stop is triggered by PLC code using MC_Stop. However, there are special applications within that
the time delay of stop has to be as small as possible. Within this situation the input Drive.Inputs.In.nState4
comes into play triggering a stop directly without being mapped via the PLC process image.

TF50x0 Version: 2.0.0 27


Axes

Drive Status 4 (manually linked):


0x80 (1000 0000) = Fast Axis Stop (digital IO interrupt)

Variable nState4

The variable Drive.Inputs.In.nState4 can be mapped to any event source. Note its data type USINT and the
bit nState4.7 being responsible for the Fast Axis Stop.

Fast Axis Stop

For an axis the Fast Axis Stop is performed when its Drive.Inputs.In.nState4.7 variable exhibits the signal
type that is selected within the drop-down list "Fast Axis Stop Signal Type (optional)" and differs from “OFF
(default)”.

Signal Type

The “Fast Axis Stop Signal Type (optional)” enumeration specifies six elements:
• OFF (default)
For any signal type that the Drive.Inputs.In.nState4.7 variable exhibits no Fast Axis Stop is performed.
• Rising Edge
A Fast Axis Stop is performed when the Drive.Inputs.In.nState4.7 bit exhibits a rising edge.
• Falling Edge
A Fast Axis Stop is performed when the Drive.Inputs.In.nState4.7 bit exhibits a falling edge.
• Both Edges
A Fast Axis Stop is performed when the Drive.Inputs.In.nState4.7 bit exhibits a rising edge and a falling
edge, respectively. Alternatively, a Fast Axis Stop is performed when the Drive.Inputs.In.nState4.7 bit
exhibits a falling edge and a rising edge, respectively.
• High Active
A Fast Axis Stop is performed when the Drive.Inputs.In.nState4.7 bit appears high active.
• Low Active
A Fast Axis Stop is performed when the Drive.Inputs.In.nState4.7 bit appears low active.

Optional

An optional fast axis parameter has to differ from zero to be applied when a Fast Axis Stop is performed.

Acceleration, Deceleration, Jerk

28 Version: 2.0.0 TF50x0


Axes

When a Fast Axis Stop is performed on the corresponding axis within the boundaries prescribed by the
“Maximum Dynamics” the “Fast Acceleration (optional)” float value accelerates the axis, the “Fast
Deceleration (optional)” float value decelerates the axis and the “Fast Jerk (optional)” float value is applied.
When a Fast Axis Stop is not performed, not any fast axis parameter is applied.

Further Information:
• MC_Stop (PLC library Tc2_MC2)

6.2.1.3.5 Limit Switches

Limit Switches

The Limit Switches parameters can be set at MOTION | NC-Task 1 SAF | Axes | Axis 1 | Parameter.

Alternatively, the Limit Switches parameters can be set at MOTION | NC-Task 1 SAF | Axes | Axis 1 | Enc |
Parameter.

Analogously, for different identfiers.

Soft Position Limit Minimum Monitoring

FALSE: Soft Position Limit Minimum Monitoring is not activated.

TRUE: Soft Position Limit Minimum Monitoring is activated.

Minimum Position

Lower position boundary for the axis not to be descended when the Soft Position Limit Minimum Monitoring
is activated. Commands that violate this lower boundary are rejected.

Soft Position Limit Maximum Monitoring

FALSE: Soft Position Limit Maximum Monitoring is not activated.

TRUE: Soft Position Limit Maximum Monitoring is activated.

Maximum Position

Upper position boundary for the axis not to be exceeded when the Soft Position Limit Maximum Monitoring is
activated. Commands that violate this upper boundary are rejected.

6.2.1.3.6 Monitoring

TF50x0 Version: 2.0.0 29


Axes

Position Lag Monitoring

When position lag monitoring is performed, the Position Lag Error is monitored, and if prescribed limits of
position and time are exceeded, a runtime error is thrown.

Position Lag Error = Actual Position - Current Setpoint Position.

The Position Lag Monitoring parameters can be set at MOTION | NC-Task 1 SAF | Axes | Axis 1 |
Parameter.

Alternatively, the Position Lag Monitoring parameters can be set at MOTION | NC-Task 1 SAF | Axes | Axis 1
| Ctrl | Parameter.

Analogously, for different identfiers.

TRUE: Position Lag Monitoring is activated.

FALSE: Position Lag Monitoring is not activated.

Maximum Position Lag Value and Maximum Position Lag Filter Time

The Maximum Position Lag Value is the upper boundary for the permitted position lag error not to be
exceeded for a time longer than the Maximum Position Lag Filter Time when the Position Lag Monitoring is
activated. Otherwise, the NC axis will be stopped instantaneously by a zero voltage output and the NC axis
will be placed into the logical “error” state throwing the error 0x4550.

30 Version: 2.0.0 TF50x0


Axes

[5]

[6] [7]

[9]

[8]

[1]
[2] [3]

[4]

Position Range Monitoring

[1] • Nominal value of the target position.

[2] • Position Range Window.

[3] • Position Range Window.

[4] Variable Axis.Status.InPositionArea:


Position Range • If the parameter “Position Range Monitoring” is set on TRUE and …
Monitoring
• … if the actual position resides within this range [4],
• then the variable Axis.Status.InPositionArea is set on TRUE.

NC-Online: “In Pos. Range” – Axis.Status.InPositionArea


The value of variable Axis.Status.InPositionArea corresponds to the state of the checkbox
“In Pos. Range” within the group box “Status (phys.)” of the NC-Online dialog. If the variable
Axis.Status.InPositionArea is set on TRUE, the checkbox “In Pos. Range” is checked.

TF50x0 Version: 2.0.0 31


Axes

Target Position Monitoring

[5] • Nominal value of the target position.

[6] • Target Position Window.

[7] • Target Position Window.

[8], [9] Target position:


Target Position • If the parameter “Target Position Monitoring” is set on TRUE and …
Monitoring • … if the actual position resides for at least the duration “Target Position Monitoring
Time” [9] uninterruptedly until actual time within this range [8],
• then the variable Axis.Status.InTargetPosition is set on TRUE.

NC-Online: “In Target Pos.” – Axis.Status.InTargetPosition


The value of the variable Axis.Status.InTargetPosition corresponds to the state of the
checkbox “In Target Pos.” within the group box “Status (phys.)” of the NC-Online dialog. If the
variable Axis.Status.InTargetPosition is set on TRUE, the checkbox “In Target Pos.” is
checked.

In-Target Alarm

FALSE: The In-Target Alarm is not activated.

TRUE: The In-Target Alarm is activated.

In-Target Timeout

When the In-Target Alarm is activated and the axis does not stay within the Target Position Window for the
In-Target Timeout time, the NC axis reports the error 0x435C. Thereby, time measurement is started when
the axis has reached its nominal position.

Motion Monitoring

Motion Monitoring checks whether an axis is actually moving while it is executing a motion command. This
makes it possible, for example, to detect the mechanical blocking of an axis at an early stage.

The parameter is set to TRUE to activate Motion Monitoring, otherwise no monitoring takes place.

32 Version: 2.0.0 TF50x0


Axes

Motion Monitoring Window

The Motion Monitoring Window defines the distance that the encoder (actual position) should be expected to
travel during one cycle of the NC SAF task. Here a value/distance/length of some encoder increments can
be set.

Motion Monitoring Time

Monitoring starts as soon as the axis executes a motion command and ends when the axis comes to a
logical standstill. If its actual position does not change by more than the Motion Monitoring Window in at least
one NC cycle during the Motion Monitoring Time, the NC axis outputs the error 0x435D.

6.2.1.3.7 Setpoint Generator

Setpoint Generator Type

The only available option is “7 Phases (optimized)”.

Velocity Override Type

Reduced (iterated): The override is based on the maximum velocity of the profile calculated by the setpoint
generator. Confer to parameter description at “MOTION | NC-Task 1 SAF | Axes | Axis 1 | Maximum
Dynamics | Maximum Velocity [} 23]”.

Original (iterated): The override is based on the maximum parameterized velocity of the actual command
currently performed. Thus, it can happen that e.g. 80 percent override and 100 percent override result in the
same nominal velocity.

Look at section Path Override (Interpreter Override Types) [} 110] for more information on path override.

6.2.1.3.8 NCI Parameters

Rapid Traverse Velocity (G0)

The Rapid Traverse Velocity is used, when a G0 interpreter command is running. Look at section Rapid
Traverse [} 112] for a short description of the G0 interpreter command.

TF50x0 Version: 2.0.0 33


Axes

Segment Transitions

Segments are geometrical objects. We regard them as curves in terms of differential geometry that are
parameterized by their arc length.

A segment transition from a segment S_in to a segment S_out is classified in geometrical terms as type
Ck. Thereby, k is a natural number (including 0) describing k continuous arc length differentials for each
segment and corresponding k^th derivatives at the transition point.

C0 transitions: Have a knee-point at the transition point.

C1 transitions: Appear smooth, but are not smooth in dynamic terms. At the segment transition point there is
a step change in acceleration.

C2 transitions: Are dynamically smooth their smoothness merely being restricted by jerk.

Ck transitions: Are dynamically smooth.

Segment Dynamics

Velocity v: The segment setpoint velocity v changes from v_in to v_out at the segment transition. At the
segment transition the setpoint velocity is always reduced to the lower one of the two values.

Acceleration a: At the segment transition the current path acceleration is always reduced to zero.

Jerk j: At the segment transition the jerk changes according to the segment transition geometry. This jerk
change can cause significant step change in dynamics.

Velocity Reduction Modes for C0 Transitions

Several reduction methods are available for C0 transitions. One of them is the VELOJUMP reduction
method. The VELOJUMP reduction method reduces the velocity after permitted step changes in velocity for
each axis.

The VELOJUMP Reduction Method for C0 Transitions

Basically, v_link = min(v_in, v_out). For the axis [i] the permitted absolute step change in velocity
is v_jump[i] = C0[i] * min(A+[i], -A-[i]) * T. Thereby, C0[i] is the reduction factor, A+[i],
A-[i] are the acceleration or deceleration limits for the axis [i] and T is the cycle time. The VELOJUMP
reduction method ensures that the path velocity at segment transition v_link is reduced, whereby the
absolute step change in the axis setpoint velocity of axis [i] is at most v_jump[i]. Nevertheless, v_min
has priority: If v_link is less than v_min, v_link is set to v_min. In case of movement reversal with no
programmed stop there will be a step change in axis velocity.

Velo Jump Factor

The reduction factor C0[i] is the Velo Jump Factor.

Tolerance ball auxiliary axis

Look at section Tolerance Ball [} 113] for more information.

Max. position deviation, aux. axis

Introduced for future enhancements.

34 Version: 2.0.0 TF50x0


Axes

6.2.1.3.9 Other Settings

Position Correction

The Position Correction can be activated at MOTION | NC-Task 1 SAF | Axes | Axis 1 | Parameter.

Alternatively, the Position Correction can be activated at MOTION | NC-Task 1 SAF | Axes | Axis 1 | Enc |
Parameter.

Analogously, for different identfiers.

FALSE: The Position Correction is disabled.

TRUE: The Position Correction is enabled.

The variable axis.PlcToNc.PositionCorrection is of data type LREAL and belongs to the structure
PLCTONC_AXIS_REF. If Position Correction is enabled, this variable adds an additional offset onto the target
position. Note, that this correction does not affect software limits.

Filter Time Position Correction (P-T1)

The filter time for the PT-1 filter that filters variations within the Actual Position Correction with the filter time
set here. Consult section PT1 Filter [} 112] for more information on a PT1 filter.

See also:

MC_PositionCorrectionLimiter
• TwinCAT 3 PLC Lib: Tc2_MC2

The function block MC_PositionCorrectionLimiter adds the correction value


PositionCorrectionValue to the actual position value of the axis. Depending on the CorrectionMode
the position correction value is either written directly or filtered.

To use the MC_PositionCorrectionLimiter function block successfully the Position


Correction has to be enabled by setting the parameter Position Correction TRUE.

Backlash

This parameter remain merely for compatibility issues. See NC Backlash Compensation for further
information.

TF50x0 Version: 2.0.0 35


Axes

Error Propagation Mode

For the slave axis the error propagation can be delayed.

‘INSTANTANEOUS’: Error propagation will be not delayed.

‘DELAYED’: Error propagation will be delayed by the Error Propagation Delay.

Error Propagation Delay

The delay time by that error propagation for the slave axis will be delayed if ‘DELAYED’ is selected as Error
Propagation Mode.

When within runtime an error appears at a slave axis the corresponding master axis will be set to error state
not before the time assigned here has ellapsed. A state of interest of the slave axis, in particular its error
state, can be watched by PLC code. Thus, the erroneous slave axis may be uncoupled to safely prevent the
whole axis combine from falling into error state.

Couple slave to actual values if not enabled

FALSE: Not Coupled.

TRUE: Coupled. The slave axis will follow the actual master position while and even though the master is
disabled.

Velocity Window and Filter Time for Velocity Window

The coupled slave axis follows the master axis within the Velocity Window. When velocity deviations beyond
the Velocity Window exceed the Filter Time for Velocity Window, an error will be thrown.

Allow motion commands to slave axis

Generally speaking, an axis is in PTP mode for the whole time. The point is to transform a slave axis into a
master axis indirectly. Thus, it is uncoupled implicitly without PLC code having to engage MC_GearOut.

TRUE: To the slave axis a PTP command can be triggered without having to set the axis into PTP mode
before.

FALSE: Before a PTP command can be triggered to the slave axis, the slave axis has to be set into PTP
mode.

Allow motion commands to external setpoint axis

FALSE: Before a PTP command can be triggered to the external setpoint axis, the external setpoint axis has
to be set into PTP mode.

TRUE: To the external setpoint axis a PTP command can be triggered without having to set the axis into PTP
mode before.

36 Version: 2.0.0 TF50x0


Axes

Dead Time Compensation (Delay Velo and Position)

This parameter remains merely for compatibility issues. Do not use it within new projects.

Data Persistence

The Data Persistence is used for special encoder issues.

FALSE: The Data Persistence is not activated.

TRUE: The Data Persistence is activated.

6.2.1.4 Dynamics
The axis dynamics can be configured via the Parameter tab as well as via the Dynamics tab.

In this dialog the default axis dynamics is set. The default values are used if no explicit dynamics data are
given to a travel command.

The dynamics data Acceleration, Deceleration and Jerk can be entered here either directly or they are
determined indirectly via an acceleration time to the maximum velocity. In addition to the acceleration time,
the slider is used to determine the ratio of jerk and acceleration, thus selecting a rather stiff or smooth
setting.

TF50x0 Version: 2.0.0 37


Axes

6.2.1.5 Online
The Online tab is the main dialog for online axis operation. Here the enable can be set and after this the
corresponding axis can be moved manually. In addition, the most important axis states are displayed when
the configuration is active.

DANGER
Risk of injury due to movement of axes!
The commissioning results in a movement of axes.
• Make sure that neither you nor others are harmed by the movement, e.g. by maintaining a suitable
safety distance.
• Do not perform any action whose consequences you cannot estimate

WARNING
Incorrect axis position during initial commissioning
Without referencing / calibrating the axis position, the displayed axis position may deviate from the actual
axis position.
• Perform a homing to determine the correct actual position using a reference signal.

The dialog is divided into the display of the most important axis states, the setting of the axis enable, input
fields as well as function keys for controller settings and travel commands. The units of the values depend on
the set "Base" unit.

Display

The actual position of the axis is determined from the feedback of the encoder system and displayed in the
large unlabeled field.

Setpoint Position The target position is specified by the NC during a movement.


Lag Distance The lag error is the difference between the nominal and actual position.
Actual Velocity The actual velocity of the axis is determined by deriving the actual position.
Setpoint Velocity The target velocity is calculated by the NC during a movement.
Override The override set by the user (0..100%) is displayed here.
Total/Control Output Total output of the NC axis to the drive in % and position control portion of the
output in %.

38 Version: 2.0.0 TF50x0


Axes

Error Axle error code. An axis error can be deleted with the reset key.

Set enables

Via the button Set the controller enable, the feed enables and the override of the axis can be set.

Input fields for position controller setting

If the NC axis is operated in velocity mode (CSV), the position is controlled by the NC. At this point the two
most important parameters, the gain factor Kv and the reference velocity, can be set. Further setting options
can be found in the parameters of the axis.

Input fields for travel commands

Target Position: Target position for a subsequent travel command (F5)

Target Velocity: Velocity of a subsequent travel command (F5)

Function button

Button Key Description


F1 Reverse travel with Manual Velocity (Fast)

F2 Reverse travel with "Manual Velocity (Slow)"

F3 Forward travel with "Manual Velocity (Slow)"

F4 Forward travel with "Manual Velocity (Fast)"

F5 Start, with the values set in the input fields and the set dynamics.

F6 Stop

F8 Reset

F9 Calibrate with the values set in the "Global" menu.


Notice The signal source of the referencing cam can be set in the encoder
parameters (Homing Sensor Source). In the default setting, the referencing
cam signal must be mapped into the axis data structure
(Axis.PlcToNc.ControlDword.5) by the PLC so that the sequence triggered
with F9 can react to the cam.

6.2.1.6 Functions
In the Functions tab the most important commands for commissioning can be given to the axis.

TF50x0 Version: 2.0.0 39


Axes

Different travel commands like absolute start, relative start or endless travel can be selected in the Extended
Start frame . The necessary parameters below will adjust according to the selection of the start type. Thus, in
reverse mode, there are two target positions between which the axis moves back and forth.

The drive output can be set to a fixed value for commissioning in the Raw Drive Output frame. This setting
must be used very carefully.

The axis position can be set to a new value in the Set Actual Position frame.

Set Target Position changes the target position of the axis during a travel command.

6.2.1.7 Coupling
Two axes can be coupled with each other in the Coupling tab. To do this, first select the master axis and the
desired coupling method, e.g. linear coupling. Afterwards, necessary parameters, such as the gear ratio, can
be entered. The Couple button executes the coupling, Decouple decouples the axes again.

40 Version: 2.0.0 TF50x0


Axes

6.2.1.8 Compensation
A superimposed travel command can be triggered during the travel of an axis in the Compensation tab
(position compensation or superposition).

TF50x0 Version: 2.0.0 41


Axes

6.2.2 Axis component encoder

6.2.2.1 General

Property Description
Name Selected name of the object.
Object Id 32-bit identification number that is automatically assigned and unique within a
project.
Type Encoder type
The selected encoder type is displayed at this point. Changes of the encoder type
can be done via the NC-Encoder [} 42] dialog.
Comment Freely editable field for user notes.
Id Identification number of the encoder, which is assigned consecutively. When an
encoder is deleted, the number becomes free again and can be assigned to a new
encoder.
Disabled An encoder cannot be disabled on its own, but only by disabling the entire axis.
Create symbols This option generates typical symbol names that are used in TwinCAT Scope, for
example.

6.2.2.2 NC-Encoder

Property Description
Link To (all Types) Every encoder that is not of the "Simulation encoder" type must be associated with
an actual value acquisition module. In the simplest case, this is done automatically
with the linking of the axis to the drive. In individual cases, in particular when
unknown hardware components are integrated in the system, these links must be
established manually , see Process image [} 51].
Type Encoder type selection

6.2.2.3 Parameter

Encoder

Depending on their operating modes encoders determine the actual position, actual velocity or actual
acceleration or deceleration. Regularly, actual values fluctuate intemperately. So, for each mode a
parameterizable filter is available to ensure a reasonable resolution.

42 Version: 2.0.0 TF50x0


Axes

A wide variety of encoder versions is supported. Available are absolute and incremental encoders.
Furthermore, there are simulation encoders and there are special encoders for the determination of force.

The encoder parameters include scaling, zero offset shift and the modulo factor. There are encoder
parameters for software end locations and for reference travel.

6.2.2.3.1 Encoder Evaluation

Invert Encoder Counting Direction

If set TRUE, the parameter Invert Encoder Counting Direction inverts the counting direction of the encoder.
• FALSE: The polarity of the axis movement agrees with the counting direction of the acquisition
hardware.
• TRUE: The polarity of the axis movement is opposite to the counting direction of the acquisition
hardware.

WARNING
Risk of Unexpected Movements
If the encoder counting direction and the motor polarity do not match with each other, the axis will make
unexpected movements.

Scaling Factor Numerator and Scaling Factor Denominator (default: 1.0)

The scaling factor is subdivided into a numerator and a denominator. It converts displacement increments
into axis positions or calculates a user unit out of encoder increments.

Position Bias

The position bias is an offset used for absolute encoders to align their position within the machine coordinate
system and thus to specify the machine-dependent zero point. Thereby, the position bias offset value is
added to the encoder position to determine the axis position.

TF50x0 Version: 2.0.0 43


Axes

Modulo Factor (e.g. 360.0°)

The value of the Modulo Factor (e.g. 360.0°) is the value to calculate modulo turns and modulo positions out
of the absolute axis position. For rotating axes the Modulo Factor is the “distance” represented by one
rotation. For instance, 360.0° should be entered here, if the actual rotational value is acquired in degrees.

Tolerance Window for Modulo Start

The Tolerance Window for Modulo Start should be big enough to allow backward movements, if a modulo
forward command is running inside the window area. Vice versa, the Tolerance Window for Modulo Start
should be big enough to allow forward movements, if a modulo backward command is running inside the
window area.

Further Information:
• Notes on modulo positioning (PLC library Tc2_MC2)

Encoder Mask (maximum encoder value)

The encoder mask defines the number of allowed increments until the feedback value flows over. Thereby,
the increments are not the real encoder increments.

Encoder Sub Mask (absolute range maximum value)

The encoder submask defines the number of increments per motor turn.

Noise level of simulation encoder

Setting a level this parameter creates artificial noise for the simulation axis to make it appear more realistic.

Reference System

Use the Reference System parameter to select how the encoder values should be interpreted:

INCREMENTAL

INCREMENTAL mode does not use absolute characteristics of the physical feedback system, but can be
used with both incremental and absolute encoder systems. After starting the control, homing is required to
initialize the actual position of the axis.

INCREMENTAL (singleturn absolute)

This mode extends the INCREMENTAL mode and can be used instead.

44 Version: 2.0.0 TF50x0


Axes

If in this mode the retain data of the NC-SAF task and the axis parameter Data Persistence are activated, the
system starts up with the last stored position. If a single-turn absolute encoder is used at the same time, a
deviation of up to half an encoder revolution is also taken into account and the axis can be operated within
these limits without homing. The absolute range of the encoder system is defined by the parameter Encoder
Sub Mask.

ABSOLUTE

The ABSOLUTE mode can be used with multi-turn absolute encoder systems. The prerequisite is that the
encoder system or the motor is installed in such a way that there can't be overflow of the position feedback
within the travel path. An overflow would be acknowledged with a runtime error.

ABSOLUTE MULTITURN RANGE (with single overflow)

The ABSOLUTE MULTITURN RANGE mode can also be used with multi-turn absolute encoder systems.
The encoder system can be installed in any way, so that a maximum of one overflow may occur in the travel
path. To ensure correct evaluation, the two end positions must be parameterized.

The total travel path must be less than the absolute range of the encoder. The absolute range of the encoder
system is defined by the parameter Encoder Mask.

ABSOLUTE SINGLETURN RANGE (with single overflow)

The ABSOLUTE SINGLETURN RANGE mode can be used with single-turn absolute encoder systems. The
encoder system can be installed in such a way that an overflow is located in the travel path. To ensure
correct evaluation, the two end positions must be parameterized.

The total travel path must be less than the absolute range of the encoder, i.e. less than one encoder
revolution. The absolute range of the encoder system is defined by the parameter Encoder Sub Mask.

ABSOLUTE (modulo)

The ABSOLUTE (modulo) mode can be used when the travel path of an axis exceeds the absolute range of
the encoder system. For example, in the case of an endlessly running conveyor belt.

To initialize the position of the axis correctly at system start, the retain data of the NC-SAF task and the
parameter Data Persistence of the axis must be activated. Furthermore, the parameter Modulo Factor of the
encoder of the NC axis must be parameterized correctly. The axis position is initialized to this module range
after the system startup.

When switched off, the axis may be mechanically displaced by a maximum of half of the absolute range.
This maximum distance is defined by the Encoder Sub Mask parameter. The Encoder Sub Mask is typically
set to the increments of one motor revolution, but can also be set to the entire absolute range here.

6.2.2.3.2 Limit Switches

Limit Switches

The Limit Switches parameters can be set at MOTION | NC-Task 1 SAF | Axes | Axis 1 | Parameter.

Alternatively, the Limit Switches parameters can be set at MOTION | NC-Task 1 SAF | Axes | Axis 1 | Enc |
Parameter.

Analogously, for different identfiers.

TF50x0 Version: 2.0.0 45


Axes

Soft Position Limit Minimum Monitoring

FALSE: Soft Position Limit Minimum Monitoring is not activated.

TRUE: Soft Position Limit Minimum Monitoring is activated.

Minimum Position

Lower position boundary for the axis not to be descended when the Soft Position Limit Minimum Monitoring
is activated. Commands that violate this lower boundary are rejected.

Soft Position Limit Maximum Monitoring

FALSE: Soft Position Limit Maximum Monitoring is not activated.

TRUE: Soft Position Limit Maximum Monitoring is activated.

Maximum Position

Upper position boundary for the axis not to be exceeded when the Soft Position Limit Maximum Monitoring is
activated. Commands that violate this upper boundary are rejected.

6.2.2.3.3 Filter

Filter Time for Actual Position (P-T1)

Filter time for the PT1 filtering of the actual position.

In the case of very noisy encoder signals, it may therefore be necessary to filter the position value with a low
filter time.

Filtering the position leads to a position distortion.

Filter Time for Actual Velocity (P-T1)

Filter time for the PT1 filtering of the actual velocity.

Filter Time for Actual Acceleration (P-T1)

Filter time for the PT1 filtering of the actual acceleration.

Further information: PT1 filter

See section PT1 Filter [} 112] for further information on the PT1 filter.

6.2.2.3.4 Homing
Homing refers to an axis initialization run during which the correct actual position is determined by means of
a reference signal. This can be NC-guided, as described here.

Alternatively, there is also drive-guided homing, which is performed independently by a suitable drive without
the influence of the control system. For details, please refer to the documentation of the drive system used.

46 Version: 2.0.0 TF50x0


Axes

Procedure

1. The axis is at a random position.


2. The axis moves in the parameterized direction and searches for the reference switch (referencing
cam/calibration cam).
3. The axis reverses as soon as the referencing cam is detected.
4. The axis moves away from the referencing cam and detects the falling edge of the cam signal.
5. The axis continues to move and searches for the sync pulse (latch signal or zero pulse of the
encoder).
6. The reference position is set and the axis stops. The standstill position of the axis deviates slightly
from the reference position.

Parameterization

The parameterization is done via the following encoder parameters:

Invert Direction for Calibration Cam Search

For the default homing sequence the direction for calibration cam search can be inverted.
• FALSE: cam is looked for in the direction of positive movement.
• TRUE: cam is looked for in the direction of negative movement.

Invert Direction for Sync Impuls Search

For the default homing sequence the direction for sync pulse search can be inverted.
• FALSE: sync pulse is looked for in the direction of positive movement.
• TRUE: sync pulse is looked for in the direction of negative movement.

TF50x0 Version: 2.0.0 47


Axes

Home Position (Calibration Value)

The Home Position is the position value that will be assigned to the axis when the sync pulse appears within
the homing. This is done exactly with the sync pulse while in motion. Since the axis then stops, the standstill
position deviates from the parameterized value. The referencing is nevertheless exact.

Reference Mode (Sync condition)

The parameter Reference Mode offers the opportunity to select which signal shall be used for sync impulse
search:
• ‘Default’ / ‘Homing Sensor Only (PLC cam or digital input 1..8)’
◦ The simplest way of referencing an axis where only the cam signal is evaluated. Another sync
signal is not used, so this setting should only be selected if the axis does not offer more extensive
options.
• ‘Hardware Sync (Feedback reference pulse)’
◦ Some encoder systems provide a sync pulse per revolution (zero track) in addition to the count.
The homing precision can be enhanced by selecting this mode, if the encoder evaluation logic is
able to pick up the sync pulse. The precision is comparable with Software Sync. Hardware Sync
mode may require parameterization or special wiring of the drive or encoder system.
• ‘Hardware Latch 1 (pos. edge)’, ‘Hardware Latch 1 (neg. edge)’
◦ Hardware latch responds to an external latch signal in addition to the cam signal. For this purpose,
the latch mechanism must be configured in the drive and the latch input must be wired.
• ‘Software Sync’
◦ Software Sync mode enhances the homing precision by additionally detecting the encoder count
overflow after an encoder or motor revolution, after the reference cam signal has been detected.
This mode requires a part-absolute encoder (e.g. resolver) with constant overflow interval relative
to the reference cam. Overflow detection is parameterized via the Reference Mask parameter.
• ‘Application (PLC code)’
◦ In this case, the entire homing procedure must be programmed in the PLC:
In this case, the NC sets bit 23 in the "NcApplicationRequest" status, which is polled by the PLC.
Via MC_ReadApplicationRequest the request of the NC can be determined in the PLC. So far only
0 = NONE and 1 = HOMING is supported (see 0x33 at "Index offset" specification for axis
parameter). In the case of homing, the PLC can perform the sequence itself by moving the axis.

Homing Sensor Source


• Default PLC Cam (MC_Home)
◦ By default the homing sensor signal comes from the PLC with the function block MC_Home with
the parameter bCalibrationCam, which is automatically linked to the PlcToNc.ControlWordD.7.
• Digital Input [1-8]
◦ Alternatively, a digital input linked to the NC process can be used. For this purpose, a general
Drive Status Byte with 8 digital inputs is defined in the process image (Drive->Inputs->nState8),
which can serve as a signal source for the homing sensor. A digital input to be used must
therefore be mapped manually to the desired position in this byte.
◦ Notice The digital inputs 1 and 2 may differ depending on the hardware used. For the
MDP703/733 hardware (e.g. EL7031, EL7041, EL7201, EL7411) the direct digital inputs E1
and E2 of the terminal are used instead, which are located in the Drive.nState2 byte of the
terminal at bit position 3 (E1) and 4 (E2). The lower two bits of Drive.nState8 are not
assigned in this case.

Further information
• Homing on the AX5000
• MC_Home in the Tc2_MC2

6.2.2.3.5 Other Settings

48 Version: 2.0.0 TF50x0


Axes

Encoder Mode

The parameter Encoder Mode offers the opportunity to select which values shall be calculated from the
encoder position:
• ‘POS’: The actual position is determined.
• ‘POSVELO’: The actual position and the actual velocity are determined.
• ‘POSVELOACC’: The actual position, the actual velocity and the actual acceleration are determined.

Position Correction

The Position Correction can be activated at MOTION | NC-Task 1 SAF | Axes | Axis 1 | Parameter.

Alternatively, the Position Correction can be activated at MOTION | NC-Task 1 SAF | Axes | Axis 1 | Enc |
Parameter.

Analogously, for different identfiers.

FALSE: The Position Correction is disabled.

TRUE: The Position Correction is enabled.

The variable axis.PlcToNc.PositionCorrection is of data type LREAL and belongs to the structure
PLCTONC_AXIS_REF. If Position Correction is enabled, this variable adds an additional offset onto the target
position. Note, that this correction does not affect software limits.

Filter Time Position Correction (P-T1)

The filter time for the PT-1 filter that filters variations within the Actual Position Correction with the filter time
set here. Consult section PT1 Filter [} 112] for more information on a PT1 filter.

See also:

MC_PositionCorrectionLimiter
• TwinCAT 3 PLC Lib: Tc2_MC2

The function block MC_PositionCorrectionLimiter adds the correction value


PositionCorrectionValue to the actual position value of the axis. Depending on the CorrectionMode
the position correction value is either written directly or filtered.

To use the MC_PositionCorrectionLimiter function block successfully the Position


Correction has to be enabled by setting the parameter Position Correction TRUE.

6.2.2.4 Time Compensation


A requirement for high-precision conversion of positions into times and vice versa is precise dead time
compensation of the axes. For data acquisition, this can be enabled and configured via the Time
Compensation tab of the axis encoder (e.g. Axis 1 > Enc).

TF50x0 Version: 2.0.0 49


Axes

Parameter Description Type Unit


Time Compensation Mode Enabling/disabling the dead time compensation of the enum
Encoder axis encoder incl. selection of the mode:
• OFF
• ON (with velocity) (recommended)
• ON (with velocity and acceleration)
IO Time is absolute Default FALSE bool
Must be set to TRUE if the encoder supplies an
absolute timestamp (special case).
Encoder Delay in Cycles Additional delays by entire I/O cycles. This time is not double
a fixed value, but changes with the cycle time.
Additional Encoder Delay Fixed time value in μs caused by the hardware used. double µs

Further details on dead time compensation can be found in the documentation TF5065 TwinCAT 3 | PLC
Motion Control XFC/XFC NC I.

6.2.2.5 Online

Property Description
Position Actual position of the encoder
Id Automatically assigned encoder ID
Uncorrected Position Actual position without corrections, such as position correction or position
filtering

50 Version: 2.0.0 TF50x0


Axes

Property Description
Correction Position correction
Hard Increments Incremental counter value from the encoder hardware
Soft Increments Evaluated incremental counter value of the NC
Modulo Actual Pos Modulo actual position (calculated with the parameterized modulo factor)
Modulo Turns Integer modulo revolutions (calculated from the actual position)
Latch Pos. Diff. Position difference between the referencing cam and the latch event, which is
determined during homing.
Calibration Flag If an absolute encoder system is configured, it is calibrated from the start. An
incremental encoder system is only calibrated after homing.
The calibration state can be changed manually via the Set and Reset buttons.
Set Actual Position The actual position can be set manually here. The position is set directly as
entered in the "Absolute" mode. The position is shifted by this amount in the
"Relative" mode.

6.2.2.6 Process image


The process image (cyclic interface) of an axis is used to connect it to different drive components. In the
simplest case, a link is established between the axis and the drive and the necessary links between the
process images are made automatically. In individual cases, in particular when unknown hardware
components are integrated in the system, these links must be established manually.

Notice The data structures described here form an internal interface between NC drivers and
connected drive hardware. This interface is constantly under development and can change in the
future.

Encoder process image of an axis

Various encoder hardware or the corresponding Bus Terminals for detecting the position of an axis are
connected via the encoder process image (cyclic data exchange). Insofar as this hardware is directly
supported by the system, no manual configuration of individual variables is necessary.

Depending on the encoder/drive, the NC variables can be interpreted as signed or unsigned. In addition,
the nDataIn variables can be linked with 2 or 4 byte references. (In the special case not discussed here
also with 8 byte references)

TF50x0 Version: 2.0.0 51


Axes

Input data to the encoder process image of an axis

NC-In vari- Data type Description


able
nDataIn1 UDINT / DINT Current actual position of the encoder or the drive in increments. The
or (4 byte) number of allowed increments is defined in the encoder parameter Encoder
Mask (maximum encoder value) [} 44].
nDataIn1[0 or
] UINT or INT (2
byte)

52 Version: 2.0.0 TF50x0


Axes

NC-In vari- Data type Description


able
The incremental value is processed by the NC and converted to the actual
position in physical units, e.g. mm or degrees. Overflows of the incremental
values are also counted by the NC. The system normally makes no
distinction between incremental and absolute encoders, see encoder
parameter Reference System [} 44].
Mapping with:
• SoE: S-0-0051 Position feedback 1 value
• CoE: 0x6064 Position actual value
nDataIn2 UDINT / DINT Optional actual latch position of the encoder or the drive in increments.
or (4 byte) The incremental value is processed by the NC and converted to the actual
nDataIn2[0 or position in physical units, e.g. mm or degrees.
] UINT / INT (2 (See function block MC_TouchProbe.)
byte)
nState1 USINT Optional status information
For example Participant in Data Exchange, Encoder Error, communication
to Position Latch or Register Communication.
nState2 USINT Additional optional status information
For example, communication to Position Latch, communication Encoder
Reset, communication to Read an Absolute Position
nState3 USINT reserved
nState4 USINT Optional fieldbus-dependent I/O status such as WcState (Working Counter)
in the case of EtherCAT or CdlState in the case of Beckhoff Lightbus.
Meaning:
0 = I/O data valid
1 = I/O data invalid
nDataIn3 UDINT / DINT Mapping with:
(4 byte) • SoE: S-0-0130 Touch probe position 1 (positive edge)
or • CoE: 0x60BA Touch probe position 1 (positive edge)
UINT / INT (2
byte)
nDataIn4 UDINT / DINT Mapping with
(4 byte) • SoE (S-0-0131): Touch probe position 1 (negative edge)
or • CoE (0x60BB): Touch probe position 1 (negative edge)
UINT / INT (2
byte)
nDataIn5 UDINT / DINT Mapping with:
(4 byte) • SoE: S-0-0132 Touch probe position 2 (positive edge)
or • CoE: 0x60BC Touch probe position 2 (positive edge)
UINT / INT (2
byte)
nDataIn6 UDINT / DINT Mapping with:
(4 byte) • SoE: S-0-0133 Touch probe position 2 (negative edge)
or • CoE: 0x60BD Touch probe position 2 (negative edge)
UINT / INT (2
byte)
nState5 USINT Mapping with:
• SoE: S-0-0409 Probe 1 positive edge latched
• CoE: 0x60B9 (low byte) Status touch probe 1 + 2
nState6 USINT Mapping with:

TF50x0 Version: 2.0.0 53


Axes

NC-In vari- Data type Description


able
• SoE: S-0-0410 Probe 1 negative edge latched
• CoE (0x60B9, high byte): Status touch probe 1 + 2
nState7 USINT Mapping with:
• SoE: S-0-0411 Probe 2 positive edge latched
nState8 USINT Mapping with:
• SoE: S-0-0412 Probe 2 negative edge latched
nDcInputTi DINT Optional: Used for NC dead time compensation of the encoder.
me
nDataIn7 UDINT / DINT Actual drive velocity from the drive device or from the encoder/feedback.
(4 byte) Mapping with:
or • SoE: S-0-0040 Velocity feedback 1 value
UINT / INT (2 • CoE:
byte)
◦ 0x606C Actual velocity value (4 Byte)
◦ 0x6044 Actual velocity for velocity mode (2 bytes), alternative if
0x606C is not available.

Output data from the encoder process image of an axis

I/O variable Data type Description


nOutData1 UDINT / Current actual position of the encoder or drive in increments, which the NC
DINT (4 byte) copies directly from the input variable nInData1 to the output variable
or nOutData1.

UINT / INT
(2 byte)
nOutData2 UDINT / reserved
DINT (4 byte)
or
UINT / INT
(2 byte)
nCtrl1 USINT Optional control information
For example, communication to Position Latch, communication Encoder
Reset, Register Communication
nCtrl2 USINT Additional optional control information
For example, communication to Position Latch, communication Encoder
Reset, communication to Read an Absolute Position
nCtrl3 USINT reserved
nCtrl4 USINT reserved
nOutData3 UDINT / reserved
DINT (4 byte)
or
UINT / INT
(2 byte)
nOutData4 UDINT / reserved
DINT (4 byte)
or
UINT / INT
(2 byte)
nOutData5 UDINT / reserved
DINT (4 byte)

54 Version: 2.0.0 TF50x0


Axes

I/O variable Data type Description


or
UINT / INT
(2 byte)
nOutData6 UDINT / reserved
DINT (4 byte)
or
UINT / INT
(2 byte)
nCtrl5 USINT Mapping with:
• SoE: S-0-0405 (low byte) Probe 1 enable
• CoE: 0x60B8 (low byte) Control Touch probe 1+2
nCtrl6 USINT Mapping with:
• SoE: S-0-0406 (low byte) Probe 2 enable
• CoE: 0x60B8 (high byte) Control Touch probe 1+2
nCtrl7 USINT reserved
nCtrl8 USINT reserved

6.2.3 Axis component Drive

6.2.3.1 General

Property Description
Name Selected name of the object.
Object Id 32-bit identification number that is automatically assigned and unique within a
project.
Type Drive type
The selected drive type is displayed at this point. Changes to the drive type can be
made via the NC-Drive [} 56] [} 42] dialog.
Comment Freely editable field for user notes.
Id Identification number of the drive, which is assigned consecutively. When a drive is
deleted, the number becomes free again and can be assigned to a new encoder.
Disabled A drive cannot be disabled on its own, but only by disabling the entire axis.
Create symbols This option generates typical symbol names that are used in TwinCAT Scope, for
example.

TF50x0 Version: 2.0.0 55


Axes

6.2.3.2 NC-Drive

Fig. 1:

Property Description
Link To (all Types) The button is used to establish the connection to the drive hardware. Note that drive
devices containing both the motor and the encoder are linked via the link button of
the higher-level NC axis. Only with separate devices (e.g. encoder terminal/analog
output terminal) is the drive output linked at this point.
Type After a configured drive device or output terminal has been selected, the drive type
sets itself to match it.

6.2.3.3 Parameter

Drive

The drive transfers the output voltage to the power section of the motor. A wide variety of drive versions is
supported: E.g. servo drives, low speed drives, high speed drives, stepper motor drives. The drive
parameters include the motor polarity and the reference speed.

Analog Drive

Within this context analog does not mean that the speed is represented by a voltage (e.g. ±10 V) or a current
(e.g. ±20 mA), but rather that the axis can be adjusted over an effectively continuous range of values. This
kind of adjustment is also possible for drives with digital interfaces such as the BISSI Terminals of type
KL5051. Employing such a digital interface a speed can be adjusted like controlling an analog value, even
though being transported in the form of digital information.

6.2.3.3.1 Output Settings

Invert Motor Polarity

If set TRUE, the parameter Invert Motor Polarity inverts the polarity of the motor and thus inverts the direction
of motor rotation.
• FALSE: In response to positive drive the axis moves in the direction of larger positions.
• TRUE: In response to positive drive the axis moves in the direction of smaller positions.

WARNING
Risk of Unexpected Movements
If the encoder counting direction and the motor polarity do not match with each other, the axis will make
unexpected movements.

56 Version: 2.0.0 TF50x0


Axes

Reference Velocity at Output Ratio [0.0 … 1.0]

Look at section Reference Velocity [} 22].

6.2.3.3.2 Position and Velocity Scaling

Output Scaling Factor (Position)

Habitually, the drive parameter Output Scaling Factor (Position) does not evoke an effect. In principle, to
avoid to infer its future use the user should not change the default value 1.0 of this parameter.

The positional output scaling is already set by the encoder input scaling. Regularly, the positional input
scaling equals the positional output scaling for a drive. For this reason, the drive parameter Output Scaling
Factor (Position) is currently not evaluated. Instead, solely the encoder parameters Scaling Factor
Numerator and Scaling Factor Denominator do the scaling work and have to be adjusted for accurate
scaling.

Output Scaling Factor (Velocity)

When a drive controler operates in velocity precontrol mode, the NC output value has to be scaled. To do
this scaling there are two possibilities whose choice depends on the type of the employed drive controller.

1. Analog drive controllers, e.g. supplied by a ±10V terminal:


This type of drive controllers is scaled applying the Reference Velocity parameter.
2. Digital drive controllers to those an absolute digital velocity setpoint value is transferred, e.g. CANopen
DS402:
This type of drive controllers is scaled applying the Output Scaling Factor (Velocity) parameter.

Following, a tabular comparison shows, when the Reference Velocity parameter or the Output Scaling Factor
(Velocity) parameter has to be applied.

Drive Type Scaling with Scaling with


Reference Velocity Output Scaling Factor
(Velocity)

M2400_DAC1 x

M2400_DAC2 x

M2400_DAC3 x

M2400_DAC4 x

KL4XXX x

KL4XXX_NONLINEAR x

TWOSPEED x

STEPPER x

TF50x0 Version: 2.0.0 57


Axes

SERCOS x

KL5051 x

AX2000_B200 x

SIMO611U x

UNIVERSAL x

NCBACKPLANE x

CANOPEN_LENZE x

DS402_MDP742 x

AX2000_B900 x

AX2000_B310 x

AX2000_B100 x

KL2531 x

KL2532 x

TCOM_DRV x

MDP_733 x

MDP_703 x (x)*
*
Also possible, but should be regularly left on the value 1.0.

Output Delay (Velocity)

The output of the velocity value can be delayed by the Output Delay (Velocity) time.

Minimum Drive Output Limitation [-1.0 … 1.0]

To limit velocity and thus to protect hardware a lower output limit can be set for driving the axis. If just a part
of the output data type is valid it is necessary to limit the minimum output value. The Minimum Drive Output
Limitation is a directionally dependend limitation of the total output. The value 1.0 corresponds to unlimited
output of 100%. Typically, using this parameter one refers to a velocity output signal for the drive in
connection with position control. In exceptional cases the application of this parameter may refer to a torque
value or a current value.

58 Version: 2.0.0 TF50x0


Axes

Maximum Drive Output Limitation [-1.0 … 1.0]

To limit velocity and thus to protect hardware an upper output limit can be set for driving the axis. If just a
part of the output data type is valid it is necessary to limit the maximum output value. The Maximum Drive
Output Limitation is a directionally dependend limitation of the total output. The value 1.0 corresponds to
unlimited output of 100%. Typically, using this parameter one refers to a velocity output signal for the drive in
connection with position control. In exceptional cases the application of this parameter may refer to a torque
value or a current value.

6.2.3.3.3 Torque and Acceleration Scaling

This group of parameters creates an optional acceleration as a servo control that is supposed to act before a
lag distance evolves. It may set e.g. a torque value.

Input Scaling Factor (Actual Torque)

The gain factor for the optional servo control.

Input P-T1 Filter Time (Actual Torque)

Time for the P-T1 filter. This time comes as an input to the P-T1 filter.

Input P-T1 Filter (Actual Torque Derivative)

Derivative of the actual torque to be scaled. This derivative comes as an input to the P-T1 filter.

Consult section PT1 Filter [} 112] for more information on a PT1 filter.

Output Scaling Factor (Torque)

Sometimes an optional output scaling for torque is needed.

Output Delay (Torque)

The output of the torque value can be delayed by the Output Delay (Torque) time.

Output Scaling Factor (Acceleration)

Sometimes an optional output scaling for acceleration is needed. (E.g. for NC acceleration feedforward.
Consult section Acceleration Feedforward [} 108] for more information on acceleration feedforward.)

Output Delay (Acceleration)

The output of the acceleration value can be delayed by the Output Delay (Acceleration) time.

TF50x0 Version: 2.0.0 59


Axes

6.2.3.3.4 Valve Diagram

Within this section cam tables are employed to construct linear position coupling. Thus, for numerical control
e.g. a hydraulic axis may be treated similarly to a servo axis.

A cam plate is a relation R that describes non-linear position coupling between a master axis and a slave
axis:
• y = R(x),
• x-axis: master axis position,
• y-axis: slave axis position.

This relation is stored within a valve diagram table. Within this table the number pairs (x, y) are discrete.

Valve Diagram: Table Id

Each valve diagram table has its own identification number Id. It is assigned serially to each table. The table
Id uniquely identifies the cam plate in the TwinCAT system.

Valve Diagram: Interpolation type

Two interpolation types


• ‘LINEAR’ or
• ‘SPLINE’

can be selected to join the discrete number pairs (x, y) within the valve diagram table.

Valve Diagram: Output offset [-1.0 … 1.0]

This parameter allows to adjust a zero transition of a position coupling curvature through the origin. Thus,
e.g. a hysteresis branch can be adjusted to run through the origin.

TwinCAT PLC Hydraulics Library

Employing a cam plate relation some simple types of hydraulic axes can be controlled like servo axes. For
more intricate types of hydraulic axes follow
• TwinCAT PLC Hydraulics or
https://infosys.beckhoff.com/content/1033/tcplclibhydraulics30/index.html

to find information on controlling them with the TwinCAT PLC Hydraulics Library.

6.2.3.3.5 Optional Position Command Output Smoothing Filter

60 Version: 2.0.0 TF50x0


Axes

Smoothing Filter Type and Smoothing Filter Time

When
• ‘OFF (default)’

is selected position command output smoothing is deactivated.

As filter types
• ‘Moving Average’ or
• ‘P-Tn’

can be selected. Both modes refer to the position setpoint value.

‘Moving Average’: As an output the Moving Average Filter creates an average over a set of position
setpoint values that comes as an input to the filter. Thereby, the Smoothing Filter Time prescribes the time
interval over that the average spans. Values of the input set are created by position setpoint generation.
Thus, the value generation frequency is determined by the cycle time of the task generating the setpoint
values.
When a new value is generated e.g. each 1ms and the Smoothing Filter Time is set to e.g. 20ms an average
is taken over 20 values. Thereby, the influence of a setpoint value is perceptible for 20ms.

‘P-Tn’: As an output the P-Tn Filter creates an average over a set of position setpoint values that comes as
an input to the filter. Thereby, the Smoothing Filter Time prescribes the time constant of the P-Tn Filter.
Values of the input set are created by position setpoint generation. Thus, the value generation frequency is
determined by the cycle time of the task generating the setpoint values.

Smoothing Filter Order (P-Tn only)

The order of the employed P-Tn smoothing filter.

Smoothing Filter

In some applications position command output smoothing is used to reduce vibrations of machine parts. This
smoothing forms an additional filter that should be handled with care. This filter cannot be compensated by a
static dead time.

6.2.3.3.6 Sercos Behavior

C1D Error Tolerance

Some C1D errors of the hardware drive can be delayed by setting this parameter to ‘IGNORE SELECTED
ERRORS’.

6.2.3.3.7 Other Settings

Drive Mode

Currently, there is merely one drive mode, the ‘STANDARD’ drive mode. In principle, other modes are
imaginable implementing a more open system.

TF50x0 Version: 2.0.0 61


Axes

Drift Compensation (DAC-Offset)

This value is added to the drive control level. In this way, a constant offset can be added to the output to
compensate zero errors in analog drives, for instance.
Confer section Automatic DAC Offset Adjustment [} 108].

Following Error

The Following Error is equal to the Lag Distance, also called Position Lag Error.

Position Lag Error = Actual Position - Current Setpoint Position.

Following Error Calculation

Following error calculation can be done with the NC or inside the hardware drive. For all hardware drives
working in position control mode the calculation should be done externally on the hardware drive.

‘Intern’: The Following Error Calculation is done within TwinCAT internally.

‘Extern’: The Following Error Calculation is done within the drive controller externally.

6.2.3.4 Time Compensation


A requirement for high-precision conversion of positions into times and vice versa is precise dead time
compensation of the axes. The dead time compensation can be enabled and configured via Drive > Tab
Time Compensation in the output direction.

Parameter Description Type Unit


Time Compensation Mode Drive Enabling/disabling the dead time enum
(position mode only) compensation of the axis drive incl.
selection of the mode:
• OFF
• ON (with velocity) (recom-
mended)

62 Version: 2.0.0 TF50x0


Axes

Parameter Description Type Unit


• ON (with velocity and accel-
eration)
IO Time is absolute Default FALSE bool
Must be set to TRUE if an absolute
timestamp is present (special case).
Task Delay in Cycles Delay due to NC SAF cycle time. double
Default 1
Drive Delay in Cycles Additional delays by entire I/O cycles. This double
time is not a fixed value, but changes with
the cycle time.
Additional Drive Delay Fixed time value in μs caused by the double µs
hardware used.

Further details on dead time compensation can be found in the documentation TF5065 TwinCAT 3 | PLC
Motion Control XFC/XFC NCI.

6.2.3.5 Process image


The process image (cyclic interface) of an axis is used to connect it to different drive components. In the
simplest case, a link is established between the axis and the drive and the necessary links between the
process images are made automatically. In individual cases, in particular when unknown hardware
components are integrated in the system, these links must be established manually.

Notice The data structures described here form an internal interface between NC drivers and
connected drive hardware. This interface is constantly under development and can change in the
future.

Drive process image of an axis

Various drive hardware or the corresponding Bus Terminals (+/- 10V, PWM etc.) are connected via the drive
process image. Insofar as this hardware is directly supported by the system, no manual configuration is
necessary.

TF50x0 Version: 2.0.0 63


Axes

Input data to the drive process image of an axis

NC-In vari- Data type Description


able
nDataIn1 UDINT / Optional lag error (position control deviation, i.e. target position minus actual
DINT (4 byte) position) of the I/O Drive in increments. Exclusively for the operation mode
Cyclic Position Mode (e.g. for EtherCAT, SERCOS, CANopen).
or
This quantity is processed by the NC accordingly and processed
UINT / INT
mathematically as an "external" lag distance in physical units (e.g. in mm or
(2 byte)
degrees).

64 Version: 2.0.0 TF50x0


Axes

NC-In vari- Data type Description


able
Mapping with:
• SoE: S-0-0189 Following error
• CoE: 0x60F4 Following error actual value
nDataIn2 UDINT / reserved
DINT (4 byte)
or
UINT / INT
(2 byte)
nState1 USINT Optional status information
e.g.: Drive Error, Drive Enable/Disable, Communication Drive State Machine
(e.g. EtherCAT, SERCOS, CANopen, Profibus), Register Communication.
Mapping with
• SoE: S-0-0135 Drive Statusword
• CoE: 0x6041 Statusword
nState2 USINT Additional optional status information.
e.g.: Drive Error, Drive Enable/Disable, Communication Drive State Machine
(e.g. EtherCAT, SERCOS, CANopen, Profibus), Register Communication.
Mapping with:
• SoE: S-0-0135 Drive statusword
• CoE: 0x6041 Statusword
nState3 USINT reserved
nState4 USINT Optional fieldbus-dependent I/O status such as WcState (Working Counter) in
the case of EtherCAT or CdlState in the case of Beckhoff Lightbus.
nDataIn3 UDINT / Optional actual torque/force value of the I/O Drive in increments.
DINT (4 byte) This variable is processed by the NC accordingly and processed
or mathematically as "ActTorque" in physical units (e.g. % or A).
UINT / INT nDataIn3[0] mapping with:
(2 byte) • SoE: S-0-0084 Torque feedback value (2 byte)
• CoE: 0x6077 Torque actual value (2 byte)
nDataIn4 UDINT / reserved
DINT (4 byte)
or
UINT / INT
(2 byte)
nDataIn5 UDINT / reserved
DINT (4 byte)
or
UINT / INT
(2 byte)
nDataIn6 UDINT / reserved
DINT (4 byte)
or
UINT / INT
(2 byte)
nState5 USINT Mapping with:
• CoE: 0x6061 Modes of operation display
nState6 USINT reserved
nState7 USINT reserved

TF50x0 Version: 2.0.0 65


Axes

NC-In vari- Data type Description


able
nState8 USINT reserved
nDcOutput DINT Optional: Used for NC dead time compensation of the drive.
Time

Output data from the drive process image of an axis

NC-Out vari- Data type Description


able
nDataOut1 UDINT / Current target velocity or current target position in increments
DINT (4 byte) The target velocity or target position of the NC in physical units, e.g. mm or
or degrees, is mathematically converted back to an incremental value by the
NC and transferred to the drive. Overflows of the incremental value are
UINT / INT
hereby taken into account by the NC in the target position.
(2 byte)
Depending on the drive type, a standardization of the target velocity or target
position is carried out in increments. If the drive type Universal Drive has
been selected, nOutData1 contains the overall velocity (incl. position control
part) with sign.
Mapping with:
• SoE: S-0-0047 Target Position
• CoE:
◦ 0x607A Target position
◦ 0x6062 Nominal position,
Alternative if 0x607A is not available
nDataOut2 UDINT / Current target velocity or current target position in increments
DINT (4 byte) The target velocity or target position of the NC in physical units, e.g. mm or
or degrees, is mathematically converted back to an incremental value by the
NC and transferred to the drive. Overflows of the incremental value are
UINT / INT
hereby taken into account by the NC in the target position.
(2 byte)
Depending on the drive type, a standardization of the target velocity or target
position is carried out in increments. If the Universal Drive type has been
selected, nOutData2 contains the value of the overall velocity (incl. position
control part, without sign).
Mapping with:
• SoE: S-0-0036 Target velocity (4 byte)
• CoE:
◦ 0x60FF Target velocity (4 byte)
◦ 0x606B Nominal velocity (4byte),
Alternative if 0x60FF is not available.
◦ 0x6042 Target velocity for velocity mode (for frequency inverter) (2
byte),
Alternative if 0x60FF and 0x606B are not available.
nCtrl1 USINT Optional control information
e.g.: Drive Reset, Drive Enable/Disable, Communication Drive State Machine
(e.g. EtherCAT, SERCOS, CANopen, Profibus), Register Communication.
Mapping with:
• SoE: S-0-0134 Master Controlword
• CoE: 0x6040 Controlword
nCtrl2 USINT Additional optional control information
Digital direction output of the setpoint generation (corresponds to the sign of
the target velocity, hence without position controller)

66 Version: 2.0.0 TF50x0


Axes

NC-Out vari- Data type Description


able
Digital Outputs Setpoint Generator:
0x41 (0100 0001) = Minus
0x42 (0100 0010) = Plus
0x80 (1000 0000) = Stop
The only exception is the AX2xxx-B200/B900 drive. In this case,
communication takes place with the Drive State Machine.
Mapping with
• SoE: S-0-0134 Master Controlword
• CoE: 0x6040 Controlword
nCtrl3 USINT Additional optional control information
Digital direction output or drive stages of the total output (sum of setpoint
generation and position controller) Digital Outputs (Setpoint Generator +
Position Controller):
0x41 (0100 0001) = Minus
0x42 (0100 0010) = Plus
0x80 (1000 0000) = Stop
nCtrl4 USINT reserved
nDataOut3 UDINT / Current target acceleration (2nd time derivative of target position) in
DINT (4 byte) increments. Optionally, it can also contain the current target torque in
increments (e.g. from an extended transformation with dynamic model).
or
The target acceleration and the target torque can be available either
UINT / INT
individually or as a sum of the individual variables (depending on the
(2 byte)
parameterization of the output scaling).
The output size is signed.
Mapping with:
• SoE: S-0-0081 Torque offset (2 byte)
• CoE: 0x60B2 Torque offset (2 byte)
nDataOut4 UDINT / Mapping with:
DINT (4 byte) • SoE: S-0-0080 Torque command value
or (corresponds to SetTorque multiplied by the output scaling)
UINT / INT • CoE:
(2 byte) ◦ 0x6071 Target torque/force (2 byte)
(corresponds to SetTorque multiplied by the output scaling)
◦ 0x6074 Nominal Torque (2 byte),
Alternative if 0x6071 is not available.
nDataOut5 UDINT / Mapping with:
DINT (4 byte) • SoE: S-0-0485 High velocity limit value
or • CoE: 0x60C9 High velocity limit value
UINT / INT
(2 byte)
nDataOut6 UDINT / Mapping with:
DINT (4 byte) • SoE: S-0-0484 Low velocity limit value
or • CoE: 0x60C8 Low velocity limit value
UINT / INT
(2 byte)
nCtrl5 USINT Mapping with:
• CoE: 0x6060 Mode of operation
nCtrl6 USINT reserved
nCtrl7 USINT reserved
nCtrl8 USINT reserved

TF50x0 Version: 2.0.0 67


Axes

6.2.4 Axis component cyclic interface


Cyclic process image of an axis

The PLC is connected via the cyclic process image of an axis. For this purpose, an instance of the AXIS_REF
structure is created in the PLC, which is then linked to the cyclic process image.

The structures are described in the documentation of the library Tc2_MC2:

PLCTONC_AXIS_REF

68 Version: 2.0.0 TF50x0


Axes

NCTOPLC_AXIS_REF

TF50x0 Version: 2.0.0 69


Parameters for Motion

7 Parameters for Motion

7.1 Axes | Axis 1

At “MOTION | NC-Task 1 SAF | Axes | Axis 1” the file card Parameter displays the parameter groups
• Maximum Dynamics,
• Default Dynamics,
• Manual Motion and Homing,
• Fast Axis Stop,
• Limit Switches,
• Monitoring,
• Setpoint Generator,
• NCI Parameter,
• Other Settings.

7.1.1 Reference Velocity

70 Version: 2.0.0 TF50x0


Parameters for Motion

At MOTION | NC-Task 1 SAF | Axes | Axis 1 | Drive | Parameter.

Solely Reference Velocity also at MOTION | NC-Task 1 SAF | Axes | Axis 1 | Parameter | Maximum
Dynamics.

Analogously, for different identifiers.

Reference Velocity at Output Ratio [0.0 … 1.0]

Scaling and Physical Limit

For analog control the Reference Velocity at a certain Output Ratio matches the analog input control signal
with the resulting physical velocity of axis motion. Furthermore, for control via a digital interface, e.g. SoE or
CoE, and for analog control the Reference Velocity at Output Ratio 1.0 prescribes a physical velocity limit
not to be exceeded by setpoint generation and positional control.

Proportional Relationship for Analog Control

When drive controllers with analog inputs for their velocity control are used, the Reference Velocity combines
e.g. an input bias value for control with a physical velocity or a number of revolutions per minute of the
controlled axis. Comparatively, the analog input bias value may result from a kind of potentionmeter dividing
a voltage range for control. Similarly, a controlling current may be applied as an input source. For zero
control signal there is zero physical velocity. At a particular Output Ratio there is a corresponding Reference
Velocity, thus establishing a proportional relationship. For analog control, e.g. ±10V, the Reference Velocity
at Output Ratio 1.0 prescribes the setpoint velocity at the corresponding maximum output of e.g. 10V.

Pair of Numbers

Some drive setups may not be put into operation at their upper physical velocity limit corresponding to an
Output Ratio of 1.0. Instead, at a reasonably reduced velocity allocated for first driving experiences the
Reference Velocity may be determined at a reduced Output Ratio lower than 1.0. Thus, the link between
controlling input signal and physical velocity of motion is established by a pair of numbers, the Reference
Velocity and the Output Ratio adjoined to it. Internally, the scaling calculation is done by TwinCAT and it
calculates a Reference Velocity at Output Ratio 1.0. When for an Output Ratio 1.0 an axis is controlled at
its designed upper physical boundary setpoint, it is controlled at its reference velocity.

Reference Velocity and Maximum Velocity

The Reference Velocity at Output Ratio 1.0 determines an upper physical limit for velocity control. So far,
there is no appropriate way to go faster. On the other hand, the parameter Maximum Velocity establishes an
upper limit for velocity control from a logical point of view. So far, there is no intended accomplishment to
drive beyond the Maximum Velocity limit, even though this might be physically possible up to the boundary
set by the Reference Velocity at Output Ratio 1.0. The Reference Velocity at Output Ratio 1.0 should not
succeed the Maximum Velocity. When the Maximum Velocity exceeds the Reference Velocity at Output
Ratio 1.0, an error message will be thrown. Likewise, at an axis start velocities exceeding the Reference
Velocity at Output Ratio 1.0 will be rejected by an NC error. Tacitly, cyclic controller output is limited to the
Reference Velocity at Output Ratio 1.0 without throwing an error.

Minimum Drive Output Limitation [-1.0 … 1.0]

To limit velocity and thus to protect hardware a lower output limit can be set for driving the axis. If just a part
of the output data type is valid it is necessary to limit the minimum output value. The Minimum Drive Output
Limitation is a directionally dependend limitation of the total output. The value 1.0 corresponds to unlimited
output of 100%. Typically, using this parameter one refers to a velocity output signal for the drive in
connection with position control. In exceptional cases the application of this parameter may refer to a torque
value or a current value.

TF50x0 Version: 2.0.0 71


Parameters for Motion

Maximum Drive Output Limitation [-1.0 … 1.0]

To limit velocity and thus to protect hardware an upper output limit can be set for driving the axis. If just a
part of the output data type is valid it is necessary to limit the maximum output value. The Maximum Drive
Output Limitation is a directionally dependend limitation of the total output. The value 1.0 corresponds to
unlimited output of 100%. Typically, using this parameter one refers to a velocity output signal for the drive in
connection with position control. In exceptional cases the application of this parameter may refer to a torque
value or a current value.

7.1.2 Maximum Dynamics, Default Dynamics

Dynamic-Parameters
• Velocity Vel,
• Acceleration Acc,
• Deceleration Dec,
• Jerk.

The jerk is the derivative of acceleration or deceleration with respect to time. Thus, it describes how quickly
acceleration or deceleration change.

“Maximum Dynamic-Values” and “Default Dynamic-Values”

Range of Values • Absolute values.


• Unsigned.
• Positive.
• Different from zero.

Limits • With respect to their absolute values, “maximum dynamic-values” exceed their cor-
responding “default dynamic-values”.
• Formally allowed: With respect to its absolute value, a “maximum dynamic-value”
equals its corresponding “default dynamic-value”.

Tc2_NC2 Library, Tc2_MC2 Library

Tc2_NC2,Tc2_MC2 • If the input value "0.0" is assigned to a motion function block for one of the dynam-
Default values ics parameters "Acc, Dec or Jerk", the value "0.0" is replaced by a default value for
this parameter.

72 Version: 2.0.0 TF50x0


Parameters for Motion

• If no input value is assigned to a motion function block for one of the dynamic pa-
rameters "Acc, Dec or Jerk", this dynamic parameter is set to "0.0", and the value
"0.0" is replaced by a default value for this parameter.

Tc2_NC2, Tc2_MC2 • The maximum dynamic range is regarded as an actual physical limit for the corre-
Maximum dynamics sponding axis.
• Values exceeding the values prescribed by the maximum velocity are not accepted
and will lead to an error.
• Values that exceed the maximum acceleration and deceleration are accepted and
not rejected.

Tc2_NC2 • During an "Online Transformation" from slave to master, various measures are
"Online taken to prevent the maximum velocity being exceeded or the direction of move-
Transformation" ment being reversed.
• Examples of such measures are increasing the jerk or increasing the acceleration
or deceleration to the maximum value.
• From slave to master: Decoupling a slave axis in an accelerated or decelerated
movement.

Tc3_McCoordinatedMotion Library, Tc3_McCollisionAvoidance Library

Tc3_Mc • If for one of the dynamic-parameters “Acc, Dec, jerk” the input value “0.0” is as-
CoordinatedMotion signed to a motion function block, this assignment leads to an error that means that
Tc3_Mc this value is not allowed.
CollisionAvoidance • If for one of the dynamic-parameters “Acc, Dec, jerk” you would like to refer to a de-
Default Values fault value at a motion function block, this parameter has to be set to the constant
value “MC_Default”.

Tc3_Mc Vel, Acc, Dec


CoordinatedMotion • For the dynamic-parameters “Vel, Acc, Dec” the parameterized values are used.
Tc3_Mc
CollisionAvoidance • For the dynamic-parameters “Vel, Acc, Dec” maximum values can be parameter-
Maximum Dynamics ized at a motion function block using the constant value “MC_Maximum”.
Jerk
• There is no maximum value for the jerk.
• The jerk is set to the value “unlimited”. Simultaneously, a three-phase-profile or a
three-phase-acceleration-setter is applied for motion.
Default Values
• It is allowed to parameterize default values that exceed their corresponding maxi-
mum values.
• If a default value is parameterized that exceeds ist corresponding maximum value,
a warning will be given, but no error is thrown.
• At a Tc3_McCoordinatedMotion-function block or a Tc3_McCollisionAvoidance-
function block parameterized default values using the constant value MC_Default
will be mutually limited to the corresponding maximum values without giving an er-
ror message.

7.1.3 Manual Motion and Homing

TF50x0 Version: 2.0.0 73


Parameters for Motion

bCalibrationCam

A boolean input of MC_Home. It evaluates the signal of a reference cam. This reference signal may be
coupled into the control unit via a digital input.

Homing Velocity (towards plc cam)

Velocity used by an MC_Home function block driving towards a reference cam within the standard homing
sequence when the HomingMode MC_DefaultHoming is selected and the input bCalibrationCam is
evaluated.

Homing Velocity (off plc cam)

Velocity used by an MC_Home function block driving off a reference cam within the standard homing
sequence when the HomingMode MC_DefaultHoming is selected and the input bCalibrationCam is
evaluated.

Buttons in the Online Dialog

The buttons -- F1, - F2, + F3 and ++ F4 are in the “MOTION | NC-Task 1 SAF | Axes | Axis 1 | Online” dialog.

Manual Velocity (Fast)

Online

Velocity used for MOTION | NC-Task 1 SAF | Axes | Axis 1 | Online | -- F1.

Velocity used for MOTION | NC-Task 1 SAF | Axes | Axis 1 | Online | ++ F4.

Analogously, for different identifiers.

MC_Jog

Velocity used by an MC_Jog function block applied on the axis when its input JogForward or its input
JogBackwards is TRUE and MC_JOGMODE_STANDARD_FAST is selected as its Mode.

Manual Velocity (Slow)

Online

Velocity used for MOTION | NC-Task 1 SAF | Axes | Axis 1 | Online | - F2.

Velocity used for MOTION | NC-Task 1 SAF | Axes | Axis 1 | Online | + F3.

Analogously, for different identifiers.

MC_Jog

74 Version: 2.0.0 TF50x0


Parameters for Motion

Velocity used by an MC_Jog function block applied on the axis when its input JogForward or its input
JogBackwards is TRUE and MC_JOGMODE_STANDARD_SLOW is selected as its Mode.

Jog Increment (Forward)

Unused.

Explicitly, this parameter is not used in any current TC3 motion library. Still, this parameter itself can be read
or be written or be employed by the user indirectly, e.g. within a user-made function block or within an HMI.

Jog Increment (Backward)

Unused.

Explicitly, this parameter is not used in any current TC3 motion library. Still, this parameter itself can be read
or be written or be employed by the user indirectly, e.g. within a user-made function block or within an HMI.

MC_JOGMODE_INCHING

The MC_Jog function block enables an axis to be moved via manual keys. The key signal can be linked
directly to the JogForward or the JogBackwards input. The desired operating mode is prescribed by the
input Mode. Applying mode MC_JOGMODE_INCHING a rising edge at one of the jog inputs moves the axis by
a certain distance that is assigned at the input Position.

Further Information:
• MC_Jog (PLC library Tc2_MC2)

7.1.4 Fast Axis Stop


Fast Axis Stop

Usually a stop is triggered by PLC code using MC_Stop. However, there are special applications within that
the time delay of stop has to be as small as possible. Within this situation the input Drive.Inputs.In.nState4
comes into play triggering a stop directly without being mapped via the PLC process image.

TF50x0 Version: 2.0.0 75


Parameters for Motion

Drive Status 4 (manually linked):


0x80 (1000 0000) = Fast Axis Stop (digital IO interrupt)

Variable nState4

The variable Drive.Inputs.In.nState4 can be mapped to any event source. Note its data type USINT and the
bit nState4.7 being responsible for the Fast Axis Stop.

Fast Axis Stop

For an axis the Fast Axis Stop is performed when its Drive.Inputs.In.nState4.7 variable exhibits the signal
type that is selected within the drop-down list "Fast Axis Stop Signal Type (optional)" and differs from “OFF
(default)”.

Signal Type

The “Fast Axis Stop Signal Type (optional)” enumeration specifies six elements:
• OFF (default)
For any signal type that the Drive.Inputs.In.nState4.7 variable exhibits no Fast Axis Stop is performed.
• Rising Edge
A Fast Axis Stop is performed when the Drive.Inputs.In.nState4.7 bit exhibits a rising edge.
• Falling Edge
A Fast Axis Stop is performed when the Drive.Inputs.In.nState4.7 bit exhibits a falling edge.
• Both Edges
A Fast Axis Stop is performed when the Drive.Inputs.In.nState4.7 bit exhibits a rising edge and a falling
edge, respectively. Alternatively, a Fast Axis Stop is performed when the Drive.Inputs.In.nState4.7 bit
exhibits a falling edge and a rising edge, respectively.
• High Active
A Fast Axis Stop is performed when the Drive.Inputs.In.nState4.7 bit appears high active.
• Low Active
A Fast Axis Stop is performed when the Drive.Inputs.In.nState4.7 bit appears low active.

Optional

An optional fast axis parameter has to differ from zero to be applied when a Fast Axis Stop is performed.

Acceleration, Deceleration, Jerk

76 Version: 2.0.0 TF50x0


Parameters for Motion

When a Fast Axis Stop is performed on the corresponding axis within the boundaries prescribed by the
“Maximum Dynamics” the “Fast Acceleration (optional)” float value accelerates the axis, the “Fast
Deceleration (optional)” float value decelerates the axis and the “Fast Jerk (optional)” float value is applied.
When a Fast Axis Stop is not performed, not any fast axis parameter is applied.

Further Information:
• MC_Stop (PLC library Tc2_MC2)

7.1.5 Limit Switches

Limit Switches

The Limit Switches parameters can be set at MOTION | NC-Task 1 SAF | Axes | Axis 1 | Parameter.

Alternatively, the Limit Switches parameters can be set at MOTION | NC-Task 1 SAF | Axes | Axis 1 | Enc |
Parameter.

Analogously, for different identfiers.

Soft Position Limit Minimum Monitoring

FALSE: Soft Position Limit Minimum Monitoring is not activated.

TRUE: Soft Position Limit Minimum Monitoring is activated.

Minimum Position

Lower position boundary for the axis not to be descended when the Soft Position Limit Minimum Monitoring
is activated. Commands that violate this lower boundary are rejected.

Soft Position Limit Maximum Monitoring

FALSE: Soft Position Limit Maximum Monitoring is not activated.

TRUE: Soft Position Limit Maximum Monitoring is activated.

Maximum Position

Upper position boundary for the axis not to be exceeded when the Soft Position Limit Maximum Monitoring is
activated. Commands that violate this upper boundary are rejected.

7.1.6 Monitoring

TF50x0 Version: 2.0.0 77


Parameters for Motion

Position Lag Monitoring

When position lag monitoring is performed, the Position Lag Error is monitored, and if prescribed limits of
position and time are exceeded, a runtime error is thrown.

Position Lag Error = Actual Position - Current Setpoint Position.

The Position Lag Monitoring parameters can be set at MOTION | NC-Task 1 SAF | Axes | Axis 1 |
Parameter.

Alternatively, the Position Lag Monitoring parameters can be set at MOTION | NC-Task 1 SAF | Axes | Axis 1
| Ctrl | Parameter.

Analogously, for different identfiers.

TRUE: Position Lag Monitoring is activated.

FALSE: Position Lag Monitoring is not activated.

Maximum Position Lag Value and Maximum Position Lag Filter Time

The Maximum Position Lag Value is the upper boundary for the permitted position lag error not to be
exceeded for a time longer than the Maximum Position Lag Filter Time when the Position Lag Monitoring is
activated. Otherwise, the NC axis will be stopped instantaneously by a zero voltage output and the NC axis
will be placed into the logical “error” state throwing the error 0x4550.

78 Version: 2.0.0 TF50x0


Parameters for Motion

[5]

[6] [7]

[9]

[8]

[1]
[2] [3]

[4]

Position Range Monitoring

[1] • Nominal value of the target position.

[2] • Position Range Window.

[3] • Position Range Window.

[4] Variable Axis.Status.InPositionArea:


Position Range • If the parameter “Position Range Monitoring” is set on TRUE and …
Monitoring
• … if the actual position resides within this range [4],
• then the variable Axis.Status.InPositionArea is set on TRUE.

NC-Online: “In Pos. Range” – Axis.Status.InPositionArea


The value of variable Axis.Status.InPositionArea corresponds to the state of the checkbox
“In Pos. Range” within the group box “Status (phys.)” of the NC-Online dialog. If the variable
Axis.Status.InPositionArea is set on TRUE, the checkbox “In Pos. Range” is checked.

TF50x0 Version: 2.0.0 79


Parameters for Motion

Target Position Monitoring

[5] • Nominal value of the target position.

[6] • Target Position Window.

[7] • Target Position Window.

[8], [9] Target position:


Target Position • If the parameter “Target Position Monitoring” is set on TRUE and …
Monitoring • … if the actual position resides for at least the duration “Target Position Monitoring
Time” [9] uninterruptedly until actual time within this range [8],
• then the variable Axis.Status.InTargetPosition is set on TRUE.

NC-Online: “In Target Pos.” – Axis.Status.InTargetPosition


The value of the variable Axis.Status.InTargetPosition corresponds to the state of the
checkbox “In Target Pos.” within the group box “Status (phys.)” of the NC-Online dialog. If the
variable Axis.Status.InTargetPosition is set on TRUE, the checkbox “In Target Pos.” is
checked.

In-Target Alarm

FALSE: The In-Target Alarm is not activated.

TRUE: The In-Target Alarm is activated.

In-Target Timeout

When the In-Target Alarm is activated and the axis does not stay within the Target Position Window for the
In-Target Timeout time, the NC axis reports the error 0x435C. Thereby, time measurement is started when
the axis has reached its nominal position.

Motion Monitoring

Motion Monitoring checks whether an axis is actually moving while it is executing a motion command. This
makes it possible, for example, to detect the mechanical blocking of an axis at an early stage.

The parameter is set to TRUE to activate Motion Monitoring, otherwise no monitoring takes place.

80 Version: 2.0.0 TF50x0


Parameters for Motion

Motion Monitoring Window

The Motion Monitoring Window defines the distance that the encoder (actual position) should be expected to
travel during one cycle of the NC SAF task. Here a value/distance/length of some encoder increments can
be set.

Motion Monitoring Time

Monitoring starts as soon as the axis executes a motion command and ends when the axis comes to a
logical standstill. If its actual position does not change by more than the Motion Monitoring Window in at least
one NC cycle during the Motion Monitoring Time, the NC axis outputs the error 0x435D.

7.1.7 Setpoint Generator

Setpoint Generator Type

The only available option is “7 Phases (optimized)”.

Velocity Override Type

Reduced (iterated): The override is based on the maximum velocity of the profile calculated by the setpoint
generator. Confer to parameter description at “MOTION | NC-Task 1 SAF | Axes | Axis 1 | Maximum
Dynamics | Maximum Velocity [} 72]”.

Original (iterated): The override is based on the maximum parameterized velocity of the actual command
currently performed. Thus, it can happen that e.g. 80 percent override and 100 percent override result in the
same nominal velocity.

Look at section Path Override (Interpreter Override Types) [} 110] for more information on path override.

7.1.8 NCI Parameters

Rapid Traverse Velocity (G0)

The Rapid Traverse Velocity is used, when a G0 interpreter command is running. Look at section Rapid
Traverse [} 112] for a short description of the G0 interpreter command.

TF50x0 Version: 2.0.0 81


Parameters for Motion

Segment Transitions

Segments are geometrical objects. We regard them as curves in terms of differential geometry that are
parameterized by their arc length.

A segment transition from a segment S_in to a segment S_out is classified in geometrical terms as type
Ck. Thereby, k is a natural number (including 0) describing k continuous arc length differentials for each
segment and corresponding k^th derivatives at the transition point.

C0 transitions: Have a knee-point at the transition point.

C1 transitions: Appear smooth, but are not smooth in dynamic terms. At the segment transition point there is
a step change in acceleration.

C2 transitions: Are dynamically smooth their smoothness merely being restricted by jerk.

Ck transitions: Are dynamically smooth.

Segment Dynamics

Velocity v: The segment setpoint velocity v changes from v_in to v_out at the segment transition. At the
segment transition the setpoint velocity is always reduced to the lower one of the two values.

Acceleration a: At the segment transition the current path acceleration is always reduced to zero.

Jerk j: At the segment transition the jerk changes according to the segment transition geometry. This jerk
change can cause significant step change in dynamics.

Velocity Reduction Modes for C0 Transitions

Several reduction methods are available for C0 transitions. One of them is the VELOJUMP reduction
method. The VELOJUMP reduction method reduces the velocity after permitted step changes in velocity for
each axis.

The VELOJUMP Reduction Method for C0 Transitions

Basically, v_link = min(v_in, v_out). For the axis [i] the permitted absolute step change in velocity
is v_jump[i] = C0[i] * min(A+[i], -A-[i]) * T. Thereby, C0[i] is the reduction factor, A+[i],
A-[i] are the acceleration or deceleration limits for the axis [i] and T is the cycle time. The VELOJUMP
reduction method ensures that the path velocity at segment transition v_link is reduced, whereby the
absolute step change in the axis setpoint velocity of axis [i] is at most v_jump[i]. Nevertheless, v_min
has priority: If v_link is less than v_min, v_link is set to v_min. In case of movement reversal with no
programmed stop there will be a step change in axis velocity.

Velo Jump Factor

The reduction factor C0[i] is the Velo Jump Factor.

Tolerance ball auxiliary axis

Look at section Tolerance Ball [} 113] for more information.

Max. position deviation, aux. axis

Introduced for future enhancements.

82 Version: 2.0.0 TF50x0


Parameters for Motion

7.1.9 Other Settings

Position Correction

The Position Correction can be activated at MOTION | NC-Task 1 SAF | Axes | Axis 1 | Parameter.

Alternatively, the Position Correction can be activated at MOTION | NC-Task 1 SAF | Axes | Axis 1 | Enc |
Parameter.

Analogously, for different identfiers.

FALSE: The Position Correction is disabled.

TRUE: The Position Correction is enabled.

The variable axis.PlcToNc.PositionCorrection is of data type LREAL and belongs to the structure
PLCTONC_AXIS_REF. If Position Correction is enabled, this variable adds an additional offset onto the target
position. Note, that this correction does not affect software limits.

Filter Time Position Correction (P-T1)

The filter time for the PT-1 filter that filters variations within the Actual Position Correction with the filter time
set here. Consult section PT1 Filter [} 112] for more information on a PT1 filter.

See also:

MC_PositionCorrectionLimiter
• TwinCAT 3 PLC Lib: Tc2_MC2

The function block MC_PositionCorrectionLimiter adds the correction value


PositionCorrectionValue to the actual position value of the axis. Depending on the CorrectionMode
the position correction value is either written directly or filtered.

To use the MC_PositionCorrectionLimiter function block successfully the Position


Correction has to be enabled by setting the parameter Position Correction TRUE.

Backlash

This parameter remain merely for compatibility issues. See NC Backlash Compensation for further
information.

TF50x0 Version: 2.0.0 83


Parameters for Motion

Error Propagation Mode

For the slave axis the error propagation can be delayed.

‘INSTANTANEOUS’: Error propagation will be not delayed.

‘DELAYED’: Error propagation will be delayed by the Error Propagation Delay.

Error Propagation Delay

The delay time by that error propagation for the slave axis will be delayed if ‘DELAYED’ is selected as Error
Propagation Mode.

When within runtime an error appears at a slave axis the corresponding master axis will be set to error state
not before the time assigned here has ellapsed. A state of interest of the slave axis, in particular its error
state, can be watched by PLC code. Thus, the erroneous slave axis may be uncoupled to safely prevent the
whole axis combine from falling into error state.

Couple slave to actual values if not enabled

FALSE: Not Coupled.

TRUE: Coupled. The slave axis will follow the actual master position while and even though the master is
disabled.

Velocity Window and Filter Time for Velocity Window

The coupled slave axis follows the master axis within the Velocity Window. When velocity deviations beyond
the Velocity Window exceed the Filter Time for Velocity Window, an error will be thrown.

Allow motion commands to slave axis

Generally speaking, an axis is in PTP mode for the whole time. The point is to transform a slave axis into a
master axis indirectly. Thus, it is uncoupled implicitly without PLC code having to engage MC_GearOut.

TRUE: To the slave axis a PTP command can be triggered without having to set the axis into PTP mode
before.

FALSE: Before a PTP command can be triggered to the slave axis, the slave axis has to be set into PTP
mode.

Allow motion commands to external setpoint axis

FALSE: Before a PTP command can be triggered to the external setpoint axis, the external setpoint axis has
to be set into PTP mode.

TRUE: To the external setpoint axis a PTP command can be triggered without having to set the axis into PTP
mode before.

84 Version: 2.0.0 TF50x0


Parameters for Motion

Dead Time Compensation (Delay Velo and Position)

This parameter remains merely for compatibility issues. Do not use it within new projects.

Data Persistence

The Data Persistence is used for special encoder issues.

FALSE: The Data Persistence is not activated.

TRUE: The Data Persistence is activated.

7.2 Axes | Axis 1 | Enc


Encoder

Depending on their operating modes encoders determine the actual position, actual velocity or actual
acceleration or deceleration. Regularly, actual values fluctuate intemperately. So, for each mode a
parameterizable filter is available to ensure a reasonable resolution.

A wide variety of encoder versions is supported. Available are absolute and incremental encoders.
Furthermore, there are simulation encoders and there are special encoders for the determination of force.

The encoder parameters include scaling, zero offset shift and the modulo factor. There are encoder
parameters for software end locations and for reference travel.

At “MOTION | NC-Task 1 SAF | Axes | Axis 1 | Enc” the file card Parameter displays the parameter groups
• Encoder Evaluation,

TF50x0 Version: 2.0.0 85


Parameters for Motion

• Limit Switches,
• Filter,
• Homing,
• Other Settings.

7.2.1 Encoder Evaluation

Invert Encoder Counting Direction

If set TRUE, the parameter Invert Encoder Counting Direction inverts the counting direction of the encoder.
• FALSE: The polarity of the axis movement agrees with the counting direction of the acquisition
hardware.
• TRUE: The polarity of the axis movement is opposite to the counting direction of the acquisition
hardware.

WARNING
Risk of Unexpected Movements
If the encoder counting direction and the motor polarity do not match with each other, the axis will make
unexpected movements.

Scaling Factor Numerator and Scaling Factor Denominator (default: 1.0)

The scaling factor is subdivided into a numerator and a denominator. It converts displacement increments
into axis positions or calculates a user unit out of encoder increments.

Position Bias

The position bias is an offset used for absolute encoders to align their position within the machine coordinate
system and thus to specify the machine-dependent zero point. Thereby, the position bias offset value is
added to the encoder position to determine the axis position.

86 Version: 2.0.0 TF50x0


Parameters for Motion

Modulo Factor (e.g. 360.0°)

The value of the Modulo Factor (e.g. 360.0°) is the value to calculate modulo turns and modulo positions out
of the absolute axis position. For rotating axes the Modulo Factor is the “distance” represented by one
rotation. For instance, 360.0° should be entered here, if the actual rotational value is acquired in degrees.

Tolerance Window for Modulo Start

The Tolerance Window for Modulo Start should be big enough to allow backward movements, if a modulo
forward command is running inside the window area. Vice versa, the Tolerance Window for Modulo Start
should be big enough to allow forward movements, if a modulo backward command is running inside the
window area.

Further Information:
• Notes on modulo positioning (PLC library Tc2_MC2)

Encoder Mask (maximum encoder value)

The encoder mask defines the number of allowed increments until the feedback value flows over. Thereby,
the increments are not the real encoder increments.

Encoder Sub Mask (absolute range maximum value)

The encoder submask defines the number of increments per motor turn.

Noise level of simulation encoder

Setting a level this parameter creates artificial noise for the simulation axis to make it appear more realistic.

Reference System

Use the Reference System parameter to select how the encoder values should be interpreted:

INCREMENTAL

INCREMENTAL mode does not use absolute characteristics of the physical feedback system, but can be
used with both incremental and absolute encoder systems. After starting the control, homing is required to
initialize the actual position of the axis.

INCREMENTAL (singleturn absolute)

This mode extends the INCREMENTAL mode and can be used instead.

TF50x0 Version: 2.0.0 87


Parameters for Motion

If in this mode the retain data of the NC-SAF task and the axis parameter Data Persistence are activated, the
system starts up with the last stored position. If a single-turn absolute encoder is used at the same time, a
deviation of up to half an encoder revolution is also taken into account and the axis can be operated within
these limits without homing. The absolute range of the encoder system is defined by the parameter Encoder
Sub Mask.

ABSOLUTE

The ABSOLUTE mode can be used with multi-turn absolute encoder systems. The prerequisite is that the
encoder system or the motor is installed in such a way that there can't be overflow of the position feedback
within the travel path. An overflow would be acknowledged with a runtime error.

ABSOLUTE MULTITURN RANGE (with single overflow)

The ABSOLUTE MULTITURN RANGE mode can also be used with multi-turn absolute encoder systems.
The encoder system can be installed in any way, so that a maximum of one overflow may occur in the travel
path. To ensure correct evaluation, the two end positions must be parameterized.

The total travel path must be less than the absolute range of the encoder. The absolute range of the encoder
system is defined by the parameter Encoder Mask.

ABSOLUTE SINGLETURN RANGE (with single overflow)

The ABSOLUTE SINGLETURN RANGE mode can be used with single-turn absolute encoder systems. The
encoder system can be installed in such a way that an overflow is located in the travel path. To ensure
correct evaluation, the two end positions must be parameterized.

The total travel path must be less than the absolute range of the encoder, i.e. less than one encoder
revolution. The absolute range of the encoder system is defined by the parameter Encoder Sub Mask.

ABSOLUTE (modulo)

The ABSOLUTE (modulo) mode can be used when the travel path of an axis exceeds the absolute range of
the encoder system. For example, in the case of an endlessly running conveyor belt.

To initialize the position of the axis correctly at system start, the retain data of the NC-SAF task and the
parameter Data Persistence of the axis must be activated. Furthermore, the parameter Modulo Factor of the
encoder of the NC axis must be parameterized correctly. The axis position is initialized to this module range
after the system startup.

When switched off, the axis may be mechanically displaced by a maximum of half of the absolute range.
This maximum distance is defined by the Encoder Sub Mask parameter. The Encoder Sub Mask is typically
set to the increments of one motor revolution, but can also be set to the entire absolute range here.

7.2.2 Limit Switches

Limit Switches

The Limit Switches parameters can be set at MOTION | NC-Task 1 SAF | Axes | Axis 1 | Parameter.

Alternatively, the Limit Switches parameters can be set at MOTION | NC-Task 1 SAF | Axes | Axis 1 | Enc |
Parameter.

Analogously, for different identfiers.

88 Version: 2.0.0 TF50x0


Parameters for Motion

Soft Position Limit Minimum Monitoring

FALSE: Soft Position Limit Minimum Monitoring is not activated.

TRUE: Soft Position Limit Minimum Monitoring is activated.

Minimum Position

Lower position boundary for the axis not to be descended when the Soft Position Limit Minimum Monitoring
is activated. Commands that violate this lower boundary are rejected.

Soft Position Limit Maximum Monitoring

FALSE: Soft Position Limit Maximum Monitoring is not activated.

TRUE: Soft Position Limit Maximum Monitoring is activated.

Maximum Position

Upper position boundary for the axis not to be exceeded when the Soft Position Limit Maximum Monitoring is
activated. Commands that violate this upper boundary are rejected.

7.2.3 Filter

Filter Time for Actual Position (P-T1)

Filter time for the PT1 filtering of the actual position.

In the case of very noisy encoder signals, it may therefore be necessary to filter the position value with a low
filter time.

Filtering the position leads to a position distortion.

Filter Time for Actual Velocity (P-T1)

Filter time for the PT1 filtering of the actual velocity.

Filter Time for Actual Acceleration (P-T1)

Filter time for the PT1 filtering of the actual acceleration.

Further information: PT1 filter

See section PT1 Filter [} 112] for further information on the PT1 filter.

7.2.4 Homing
Homing refers to an axis initialization run during which the correct actual position is determined by means of
a reference signal. This can be NC-guided, as described here.

TF50x0 Version: 2.0.0 89


Parameters for Motion

Alternatively, there is also drive-guided homing, which is performed independently by a suitable drive without
the influence of the control system. For details, please refer to the documentation of the drive system used.

Procedure

1. The axis is at a random position.


2. The axis moves in the parameterized direction and searches for the reference switch (referencing
cam/calibration cam).
3. The axis reverses as soon as the referencing cam is detected.
4. The axis moves away from the referencing cam and detects the falling edge of the cam signal.
5. The axis continues to move and searches for the sync pulse (latch signal or zero pulse of the
encoder).
6. The reference position is set and the axis stops. The standstill position of the axis deviates slightly
from the reference position.

Parameterization

The parameterization is done via the following encoder parameters:

Invert Direction for Calibration Cam Search

For the default homing sequence the direction for calibration cam search can be inverted.
• FALSE: cam is looked for in the direction of positive movement.
• TRUE: cam is looked for in the direction of negative movement.

Invert Direction for Sync Impuls Search

90 Version: 2.0.0 TF50x0


Parameters for Motion

For the default homing sequence the direction for sync pulse search can be inverted.
• FALSE: sync pulse is looked for in the direction of positive movement.
• TRUE: sync pulse is looked for in the direction of negative movement.

Home Position (Calibration Value)

The Home Position is the position value that will be assigned to the axis when the sync pulse appears within
the homing. This is done exactly with the sync pulse while in motion. Since the axis then stops, the standstill
position deviates from the parameterized value. The referencing is nevertheless exact.

Reference Mode (Sync condition)

The parameter Reference Mode offers the opportunity to select which signal shall be used for sync impulse
search:
• ‘Default’ / ‘Homing Sensor Only (PLC cam or digital input 1..8)’
◦ The simplest way of referencing an axis where only the cam signal is evaluated. Another sync
signal is not used, so this setting should only be selected if the axis does not offer more extensive
options.
• ‘Hardware Sync (Feedback reference pulse)’
◦ Some encoder systems provide a sync pulse per revolution (zero track) in addition to the count.
The homing precision can be enhanced by selecting this mode, if the encoder evaluation logic is
able to pick up the sync pulse. The precision is comparable with Software Sync. Hardware Sync
mode may require parameterization or special wiring of the drive or encoder system.
• ‘Hardware Latch 1 (pos. edge)’, ‘Hardware Latch 1 (neg. edge)’
◦ Hardware latch responds to an external latch signal in addition to the cam signal. For this purpose,
the latch mechanism must be configured in the drive and the latch input must be wired.
• ‘Software Sync’
◦ Software Sync mode enhances the homing precision by additionally detecting the encoder count
overflow after an encoder or motor revolution, after the reference cam signal has been detected.
This mode requires a part-absolute encoder (e.g. resolver) with constant overflow interval relative
to the reference cam. Overflow detection is parameterized via the Reference Mask parameter.
• ‘Application (PLC code)’
◦ In this case, the entire homing procedure must be programmed in the PLC:
In this case, the NC sets bit 23 in the "NcApplicationRequest" status, which is polled by the PLC.
Via MC_ReadApplicationRequest the request of the NC can be determined in the PLC. So far only
0 = NONE and 1 = HOMING is supported (see 0x33 at "Index offset" specification for axis
parameter). In the case of homing, the PLC can perform the sequence itself by moving the axis.

Homing Sensor Source


• Default PLC Cam (MC_Home)
◦ By default the homing sensor signal comes from the PLC with the function block MC_Home with
the parameter bCalibrationCam, which is automatically linked to the PlcToNc.ControlWordD.7.
• Digital Input [1-8]
◦ Alternatively, a digital input linked to the NC process can be used. For this purpose, a general
Drive Status Byte with 8 digital inputs is defined in the process image (Drive->Inputs->nState8),
which can serve as a signal source for the homing sensor. A digital input to be used must
therefore be mapped manually to the desired position in this byte.
◦ Notice The digital inputs 1 and 2 may differ depending on the hardware used. For the
MDP703/733 hardware (e.g. EL7031, EL7041, EL7201, EL7411) the direct digital inputs E1
and E2 of the terminal are used instead, which are located in the Drive.nState2 byte of the
terminal at bit position 3 (E1) and 4 (E2). The lower two bits of Drive.nState8 are not
assigned in this case.

Further information
• Homing on the AX5000
• MC_Home in the Tc2_MC2

TF50x0 Version: 2.0.0 91


Parameters for Motion

7.2.5 Other Settings

Encoder Mode

The parameter Encoder Mode offers the opportunity to select which values shall be calculated from the
encoder position:
• ‘POS’: The actual position is determined.
• ‘POSVELO’: The actual position and the actual velocity are determined.
• ‘POSVELOACC’: The actual position, the actual velocity and the actual acceleration are determined.

Position Correction

The Position Correction can be activated at MOTION | NC-Task 1 SAF | Axes | Axis 1 | Parameter.

Alternatively, the Position Correction can be activated at MOTION | NC-Task 1 SAF | Axes | Axis 1 | Enc |
Parameter.

Analogously, for different identfiers.

FALSE: The Position Correction is disabled.

TRUE: The Position Correction is enabled.

The variable axis.PlcToNc.PositionCorrection is of data type LREAL and belongs to the structure
PLCTONC_AXIS_REF. If Position Correction is enabled, this variable adds an additional offset onto the target
position. Note, that this correction does not affect software limits.

Filter Time Position Correction (P-T1)

The filter time for the PT-1 filter that filters variations within the Actual Position Correction with the filter time
set here. Consult section PT1 Filter [} 112] for more information on a PT1 filter.

See also:

MC_PositionCorrectionLimiter
• TwinCAT 3 PLC Lib: Tc2_MC2

The function block MC_PositionCorrectionLimiter adds the correction value


PositionCorrectionValue to the actual position value of the axis. Depending on the CorrectionMode
the position correction value is either written directly or filtered.

To use the MC_PositionCorrectionLimiter function block successfully the Position


Correction has to be enabled by setting the parameter Position Correction TRUE.

92 Version: 2.0.0 TF50x0


Parameters for Motion

7.3 Axes | Axis 1 | Drive


Drive

The drive transfers the output voltage to the power section of the motor. A wide variety of drive versions is
supported: E.g. servo drives, low speed drives, high speed drives, stepper motor drives. The drive
parameters include the motor polarity and the reference speed.

Analog Drive

Within this context analog does not mean that the speed is represented by a voltage (e.g. ±10 V) or a current
(e.g. ±20 mA), but rather that the axis can be adjusted over an effectively continuous range of values. This
kind of adjustment is also possible for drives with digital interfaces such as the BISSI Terminals of type
KL5051. Employing such a digital interface a speed can be adjusted like controlling an analog value, even
though being transported in the form of digital information.

At “MOTION | NC-Task 1 SAF | Axes | Axis 1 | Drive” the file card Parameter displays the parameter groups
• Output Settings,
• Position and Velocity Scaling,
• Torque and Acceleration Scaling,
• Valve Diagram,
• Other Settings.

Furthermore, the parameter groups


• Optional Position Command Output Smoothing Filter,
• Sercos Behavior

may appear.

7.3.1 Output Settings

TF50x0 Version: 2.0.0 93


Parameters for Motion

Invert Motor Polarity

If set TRUE, the parameter Invert Motor Polarity inverts the polarity of the motor and thus inverts the direction
of motor rotation.
• FALSE: In response to positive drive the axis moves in the direction of larger positions.
• TRUE: In response to positive drive the axis moves in the direction of smaller positions.

WARNING
Risk of Unexpected Movements
If the encoder counting direction and the motor polarity do not match with each other, the axis will make
unexpected movements.

Reference Velocity at Output Ratio [0.0 … 1.0]

Look at section Reference Velocity [} 70].

7.3.2 Position and Velocity Scaling

Output Scaling Factor (Position)

Habitually, the drive parameter Output Scaling Factor (Position) does not evoke an effect. In principle, to
avoid to infer its future use the user should not change the default value 1.0 of this parameter.

The positional output scaling is already set by the encoder input scaling. Regularly, the positional input
scaling equals the positional output scaling for a drive. For this reason, the drive parameter Output Scaling
Factor (Position) is currently not evaluated. Instead, solely the encoder parameters Scaling Factor
Numerator and Scaling Factor Denominator do the scaling work and have to be adjusted for accurate
scaling.

Output Scaling Factor (Velocity)

When a drive controler operates in velocity precontrol mode, the NC output value has to be scaled. To do
this scaling there are two possibilities whose choice depends on the type of the employed drive controller.

1. Analog drive controllers, e.g. supplied by a ±10V terminal:


This type of drive controllers is scaled applying the Reference Velocity parameter.
2. Digital drive controllers to those an absolute digital velocity setpoint value is transferred, e.g. CANopen
DS402:
This type of drive controllers is scaled applying the Output Scaling Factor (Velocity) parameter.

Following, a tabular comparison shows, when the Reference Velocity parameter or the Output Scaling Factor
(Velocity) parameter has to be applied.

Drive Type Scaling with Scaling with


Reference Velocity Output Scaling Factor
(Velocity)

94 Version: 2.0.0 TF50x0


Parameters for Motion

M2400_DAC1 x

M2400_DAC2 x

M2400_DAC3 x

M2400_DAC4 x

KL4XXX x

KL4XXX_NONLINEAR x

TWOSPEED x

STEPPER x

SERCOS x

KL5051 x

AX2000_B200 x

SIMO611U x

UNIVERSAL x

NCBACKPLANE x

CANOPEN_LENZE x

DS402_MDP742 x

AX2000_B900 x

AX2000_B310 x

AX2000_B100 x

KL2531 x

KL2532 x

TCOM_DRV x

MDP_733 x

MDP_703 x (x)*
*
Also possible, but should be regularly left on the value 1.0.

Output Delay (Velocity)

The output of the velocity value can be delayed by the Output Delay (Velocity) time.

TF50x0 Version: 2.0.0 95


Parameters for Motion

Minimum Drive Output Limitation [-1.0 … 1.0]

To limit velocity and thus to protect hardware a lower output limit can be set for driving the axis. If just a part
of the output data type is valid it is necessary to limit the minimum output value. The Minimum Drive Output
Limitation is a directionally dependend limitation of the total output. The value 1.0 corresponds to unlimited
output of 100%. Typically, using this parameter one refers to a velocity output signal for the drive in
connection with position control. In exceptional cases the application of this parameter may refer to a torque
value or a current value.

Maximum Drive Output Limitation [-1.0 … 1.0]

To limit velocity and thus to protect hardware an upper output limit can be set for driving the axis. If just a
part of the output data type is valid it is necessary to limit the maximum output value. The Maximum Drive
Output Limitation is a directionally dependend limitation of the total output. The value 1.0 corresponds to
unlimited output of 100%. Typically, using this parameter one refers to a velocity output signal for the drive in
connection with position control. In exceptional cases the application of this parameter may refer to a torque
value or a current value.

7.3.3 Torque and Acceleration Scaling

This group of parameters creates an optional acceleration as a servo control that is supposed to act before a
lag distance evolves. It may set e.g. a torque value.

Input Scaling Factor (Actual Torque)

The gain factor for the optional servo control.

Input P-T1 Filter Time (Actual Torque)

Time for the P-T1 filter. This time comes as an input to the P-T1 filter.

Input P-T1 Filter (Actual Torque Derivative)

Derivative of the actual torque to be scaled. This derivative comes as an input to the P-T1 filter.

Consult section PT1 Filter [} 112] for more information on a PT1 filter.

96 Version: 2.0.0 TF50x0


Parameters for Motion

Output Scaling Factor (Torque)

Sometimes an optional output scaling for torque is needed.

Output Delay (Torque)

The output of the torque value can be delayed by the Output Delay (Torque) time.

Output Scaling Factor (Acceleration)

Sometimes an optional output scaling for acceleration is needed. (E.g. for NC acceleration feedforward.
Consult section Acceleration Feedforward [} 108] for more information on acceleration feedforward.)

Output Delay (Acceleration)

The output of the acceleration value can be delayed by the Output Delay (Acceleration) time.

7.3.4 Valve Diagram

Within this section cam tables are employed to construct linear position coupling. Thus, for numerical control
e.g. a hydraulic axis may be treated similarly to a servo axis.

A cam plate is a relation R that describes non-linear position coupling between a master axis and a slave
axis:
• y = R(x),
• x-axis: master axis position,
• y-axis: slave axis position.

This relation is stored within a valve diagram table. Within this table the number pairs (x, y) are discrete.

Valve Diagram: Table Id

Each valve diagram table has its own identification number Id. It is assigned serially to each table. The table
Id uniquely identifies the cam plate in the TwinCAT system.

Valve Diagram: Interpolation type

Two interpolation types


• ‘LINEAR’ or
• ‘SPLINE’

can be selected to join the discrete number pairs (x, y) within the valve diagram table.

Valve Diagram: Output offset [-1.0 … 1.0]

This parameter allows to adjust a zero transition of a position coupling curvature through the origin. Thus,
e.g. a hysteresis branch can be adjusted to run through the origin.

TwinCAT PLC Hydraulics Library

Employing a cam plate relation some simple types of hydraulic axes can be controlled like servo axes. For
more intricate types of hydraulic axes follow

TF50x0 Version: 2.0.0 97


Parameters for Motion

• TwinCAT PLC Hydraulics or


https://infosys.beckhoff.com/content/1033/tcplclibhydraulics30/index.html

to find information on controlling them with the TwinCAT PLC Hydraulics Library.

7.3.5 Optional Position Command Output Smoothing Filter

Smoothing Filter Type and Smoothing Filter Time

When
• ‘OFF (default)’

is selected position command output smoothing is deactivated.

As filter types
• ‘Moving Average’ or
• ‘P-Tn’

can be selected. Both modes refer to the position setpoint value.

‘Moving Average’: As an output the Moving Average Filter creates an average over a set of position
setpoint values that comes as an input to the filter. Thereby, the Smoothing Filter Time prescribes the time
interval over that the average spans. Values of the input set are created by position setpoint generation.
Thus, the value generation frequency is determined by the cycle time of the task generating the setpoint
values.
When a new value is generated e.g. each 1ms and the Smoothing Filter Time is set to e.g. 20ms an average
is taken over 20 values. Thereby, the influence of a setpoint value is perceptible for 20ms.

‘P-Tn’: As an output the P-Tn Filter creates an average over a set of position setpoint values that comes as
an input to the filter. Thereby, the Smoothing Filter Time prescribes the time constant of the P-Tn Filter.
Values of the input set are created by position setpoint generation. Thus, the value generation frequency is
determined by the cycle time of the task generating the setpoint values.

Smoothing Filter Order (P-Tn only)

The order of the employed P-Tn smoothing filter.

Smoothing Filter

In some applications position command output smoothing is used to reduce vibrations of machine parts. This
smoothing forms an additional filter that should be handled with care. This filter cannot be compensated by a
static dead time.

7.3.6 Sercos Behavior

98 Version: 2.0.0 TF50x0


Parameters for Motion

C1D Error Tolerance

Some C1D errors of the hardware drive can be delayed by setting this parameter to ‘IGNORE SELECTED
ERRORS’.

7.3.7 Other Settings

Drive Mode

Currently, there is merely one drive mode, the ‘STANDARD’ drive mode. In principle, other modes are
imaginable implementing a more open system.

Drift Compensation (DAC-Offset)

This value is added to the drive control level. In this way, a constant offset can be added to the output to
compensate zero errors in analog drives, for instance.
Confer section Automatic DAC Offset Adjustment [} 108].

Following Error

The Following Error is equal to the Lag Distance, also called Position Lag Error.

Position Lag Error = Actual Position - Current Setpoint Position.

Following Error Calculation

Following error calculation can be done with the NC or inside the hardware drive. For all hardware drives
working in position control mode the calculation should be done externally on the hardware drive.

‘Intern’: The Following Error Calculation is done within TwinCAT internally.

‘Extern’: The Following Error Calculation is done within the drive controller externally.

7.4 Axes | Axis 1 | Ctrl


Controller

The purpose of the controller is to operate on the basis of setpoint velocities or other setpoint magnitudes
(e.g. acceleration) and on the basis of setpoint magnitude differences as following errors. Controller
operation is performed in a way to keep following errors as small as possible and to prevent any axis to
undergo any overshots in position or velocity.

Supported is a wide variety of controller versions: Servo position controllers and special controllers for
particular axis types.

TF50x0 Version: 2.0.0 99


Parameters for Motion

Controller Types
• Position Controllers: Control the actual position to follow the setpoint position as precisely as possible.
Position controller P, following error proportional controller, position controller with two P constants,
following error proportional controller with different constants for the stationary state and for movement,
position PID-T1 controller with proportional acceleration feed forward.
• Controllers for Axes: Servo axes, stepper motors, low-speed axes, high-speed axes.

At “MOTION | NC-Task 1 SAF | Axes | Axis 1 | Ctrl” the file card Parameter displays the parameter groups
• Monitoring,
• Position Control Loop,
• Other Settings.

Furthermore, the parameter groups


• Velocity Control Loop,
• Observer

may appear.

Controller Types and their Parameters

The following table lists the available controller types and shows what parameters configure (“x”) or do not
configure (“-”) each one of them.

100 Version: 2.0.0 TF50x0


Parameters for Motion

with two P constants (with Ka)

with Observer (Torque)


Position controller PID

velocity PID controller

(Position by SERCOS)
Two speed controller
velocity PI controller
Position controller P

SERCOS controller
Stepper controller
Position controller

Position P and

Position P and
(with Ka)

(Torque)
Monitoring: x x x x x x x x
Position Lag Monitoring x x x x x x x x
Maximum Position Lag Value x x x x x x x x
Maximum Position Lag Filter Time x x x x x x x x
Position Control Loop: x x x x x x x x
Position control: Dead Band Position Deviation - x x - x - - -
Position control: Proportional Factor Kv x - x x x - - -
Position control: Proportional Factor Kv (standstill) - x - - - - - -
Position control: Proportional Factor Kv (moving) - x - - - - - -
Position control: Integral Action Time Tn - - x - - - - -
Position control: Derivative Action Time Tv - - x - - - - -
Position control: Damping Time Td - - x - - - - -
Position control: Min./max. limitation I-Part [0.0 … 1.0] - - x - - - - -
Position control: Min./max. limitation D-Part [0.0 … 1.0] - - x - - - - -
Disable I-Part during active positioning - - x - - - - -
Position control: Velocity threshold V dyn [0.0 … 1.0] - x - - - - - -
Feedforward Acceleration: Proportional Factor Ka - x x x x - - -
Feedforward Velocity: Pre-Control Weighting [0.0 … 1.0] x x x x x x x x
Velocity Control Loop: - - - x x - - -
Velocity control: Proportional Factor Kv - - - x x - - -
Velocity control: Integral Action Time Tn - - - x x - - -
Velocity control: Derivative Action Time Tv - - - x - - - -
Velocity control: Damping Time Td - - - x - - - -
Velocity control: Min./max. limitation D-Part [0.0 … 1.0] - - - x - - - -
Velocity control: Min./max. limitation I-Part [0.0 … 1.0] - - - x x - - -
Observer: - - - - x - - -
Velocity Filter: Time Constant T - - - - x - - -
Observer Mode - - - - x - - -
Motor: Torque Constant Kt - - - - x - - -
Motor: Moment of Inertia Jm - - - - x - - -
Bandwidth f0 - - - - x - - -
Correction Factor Kc - - - - x - - -
Other Settings: x x x x x x x x
Controller Mode x x x x x x x x
Auto Offset x x - - - - - -
Offset Timer x x - - - - - -
Offset Limit (of Calibration Velocity) x x - - - - - -
Slave coupling control: Proportional Factor Kcp x x x - - - - -
Controller Outputlimit [0.0 … 1.0] x x x x x - - -

7.4.1 Monitoring

TF50x0 Version: 2.0.0 101


Parameters for Motion

Position Lag Monitoring

When position lag monitoring is performed, the Position Lag Error is monitored, and if prescribed limits of
position and time are exceeded, a runtime error is thrown.

Position Lag Error = Actual Position - Current Setpoint Position.

The Position Lag Monitoring parameters can be set at MOTION | NC-Task 1 SAF | Axes | Axis 1 |
Parameter.

Alternatively, the Position Lag Monitoring parameters can be set at MOTION | NC-Task 1 SAF | Axes | Axis 1
| Ctrl | Parameter.

Analogously, for different identfiers.

TRUE: Position Lag Monitoring is activated.

FALSE: Position Lag Monitoring is not activated.

Maximum Position Lag Value and Maximum Position Lag Filter Time

The Maximum Position Lag Value is the upper boundary for the permitted position lag error not to be
exceeded for a time longer than the Maximum Position Lag Filter Time when the Position Lag Monitoring is
activated. Otherwise, the NC axis will be stopped instantaneously by a zero voltage output and the NC axis
will be placed into the logical “error” state throwing the error 0x4550.

7.4.2 Position Control Loop


Via fieldbus a setpoint velocity is transfered to the drive controller. Feeding back via fieldbus the actual axis
position is transfered to TwinCAT thus forming a Position Control Loop. Employing this loop positional
control can be carried out.

Position control: Dead Band Position Deviation

In contrast to position control in the drive device, in TwinCAT Dead Band Position Deviation is only effective
for position control if, for example, the velocity interface to the drive is configured. It defines a range in which
the controller is inactive. This parameter is a symmetrical window based on the assumption that the position
lag error with respect to the position control (position control deviation) within this window is zero. Position
control is therefore disabled within the window.

This functionality is required because certain axes and mechanical systems may cause a stationary
oscillation around the target position. The parameter can be used to enforce "calm". The parameterizable
deviation around the exact target position is accepted.

There are axes that are not capable of position control or have insufficient holding torque around standstill,
so that a certain inaccuracy around the target position is accepted.

For other real effects, such as pronounced static friction (with tear-off torque) or pronounced slack, dead
band position deviation can also be used to enforce "calm" for an accepted accuracy.

102 Version: 2.0.0 TF50x0


Parameters for Motion

Position control: Proportional Factor Kv

The Proportional Factor Kv is the proportional gain factor of the P component of the P-controller. Output
velocity = feed forward velocity + Kv * following error.

Position control: Proportional Factor Kv (standstill)

The Proportional Factor Kv (standstill) Kvs is the proportional gain factor of the P component of the P-
controller, when the axis stands stationarily still. Output velocity when stationary =
feedforward velocity + Kvs * following error.

Position control: Proportional Factor Kv (moving)

The Proportional Factor Kv (moving) Kvf is the proportional gain factor of the P component of the P-
controller, when the axis is moving. Output velocity when moving = feedforward velocity +
Kvf * following error.

Position control: Velocity threshold V dyn [0.0 … 1.0]

A PP controller uses two P constants


• Kv (standstill) Kvs and
• Kv (moving) Kvf

and a velocity threshold vdyn to define a function for a velocity dependent kv factor. When the value of the
quotient “setpoint velocity / reference velocity” resides within the velocity threshold interval [- vdyn … + vdyn]
the gain factor of the P-controller is linearly interpolated from the proportional factor Kv (moving) Kvf
towards the proportional factor Kv (standstill) Kvs at zero velocity. The diagram below illustrates the
connections.

TF50x0 Version: 2.0.0 103


Parameters for Motion

The sample is parameterized with Kvs = 50, Kvf = 10 and v_dyn = 0.2.

Position control: Integral Action Time Tn

Integral Action Time Tn of the I component of the PID-controller. Integration time.

Position control: Derivative Action Time Tv

Rate time Tv of the real D component (D-T1 component) of the PID-controller.

Position control: Damping Time Td

Damping time Td of the real D component (D-T1 component) of the PID-controller.

Position control: Min./max. limitation I-Part [0.0 … 1.0]

I-part limitation of the PID-controller.

104 Version: 2.0.0 TF50x0


Parameters for Motion

Position control: Min./max. limitation D-Part [0.0 … 1.0]

D-part limitation of the PID-Controller.

Disable I-Part during active positioning

The I-part of the PID-controller can be disabled during active positioning.

Feedforward Acceleration: Proportional Factor Ka

The acceleration feedforward proportional factor Ka is the gain factor when NC acceleration feedforward
control is used. Output velocity component = Ka * setpoint acceleration.

Additional Information: Acceleration Feedforward

Consult section Acceleration Feedforward [} 108] for more information on Acceleration Feedforward.

Feedforward Velocity: Pre-Control Weighting [0.0 … 1.0]

This parameter is a relative weighting of the feedforward. Thereby, the default parameter value 1.0
corresponds to 100% feedforward weighting. Velocity feedforward precontrol weighting can be reduced to
avoid an overshot in position.

7.4.3 Velocity Control Loop


Habitually, velocity control is performed within the drive controller by the velocity controller unit. This velocity
controller is depicted within the controller overview of the Drive Manager. When velocity control is brought
into the TwinCAT runtime this software velocity control unit has to be configured. The velocity control loop
parameters configure the software velocity control within the TwinCAT runtime.

Velocity control: Proportional Factor Kv

The Proportional Factor Kv is the gain factor of the P-controller.

TF50x0 Version: 2.0.0 105


Parameters for Motion

Velocity control: Integral Action Time Tn

Integral Action Time Tn of the I component of the PID-controller. Integration time.

Velocity control: Derivative Action Time Tv

Rate time Tv of the real D component (D-T1 component) of the PID-controller.

Velocity control: Damping Time Td

Damping time Td of the real D component (D-T1 component) of the PID-controller.

Velocity control: Min./max. limitation D-Part [0.0 … 1.0]

D-part limitation of the PID-controller.

Velocity control: Min./max. limitation I-Part [0.0 … 1.0]

I-part limitation of the PID-controller.

7.4.4 Observer

Velocity Filter: Time Constant T

Part of the observer model for determining velocities.

Observer Mode

As an Observer Mode
• ‘OFF’ or
• ‘LUENBERGER’

can be selected. The Observer Mode implements an observer model for determining velocities.

Motor: Torque Constant Kt

Part of the observer model.

106 Version: 2.0.0 TF50x0


Parameters for Motion

Motor: Moment of Inertia Jm

Part of the observer model.

Bandwidth f0

Part of the observer model.

Correction Factor Kc

Part of the observer model.

7.4.5 Other Settings

Controller Mode

Currently, only the ‘STANDARD’ controller mode can be selected.

Auto Offset

The auto offset parameters merely influence the behavior of the P-controller and the PP-controller. To
activate the
• Offset Timer

and the
• Offset Limit (of Calibration Velocity)

the parameter Auto Offset has to be set on TRUE.

The auto offset parameters are designed for an analog axis interface. A real axis may not be fully stopped at
a zero velocity setpoint, but may drift slightly. This drift behavior may be due to offset problems, temperature
problems or other reasons. The auto offset is supposed to act as an adaptive and automatic offset
coordination to compensate slight drifts and thus to prevent the axis from drifting apart. On digital interfaces
the auto offset has no effect.

The automatic offset adjustment calculates and activates a DAC offset that minimizes the following error in
the position control.
Confer section Automatic DAC Offset Adjustment [} 108].

Offset Timer

For control the offset timer has a similar effect as an I-part.

Offset Limit (of Calibration Velocity)

For a P-controller or for a PP-controller within the interval [- Offset limit … + Offset limit] the offset will
automatically be adjusted. A relative control. At a limit the offset is kept constant not going beyond it.

TF50x0 Version: 2.0.0 107


Parameters for Motion

Slave coupling control: Proportional Factor Kcp

This parameter influences merely the control loop in TwinCAT NC. The slave coupling control proportional
factor Kcp is the gain factor for an additional P-controller. This P-controller is trying to minimize the difference
of master and slave position lag to enhance the accuracy.

Controller Outputlimit [0.0 … 1.0]

Controller output limit can be set within the interval [0.0 … 1.0].

7.5 Technical Terms

7.5.1 Acceleration Feedforward


In addition to proportional feedback of the following error nearly all position controllers contain a proportional
acceleration feedforward: The K_a factor. This acceleration feedforward should normally only be used in
association with the proportional component of the position controller: The K_v factor. Acceleration
feedforward control requires to adjust the axis for strict symmetry:
• When stationary, the following error is symmetrical about 0 (DAC offset).
Confer section Automatic DAC Offset Adjustment [} 108].
• When moving steadily, the following error is symmetrical about 0 (reference velocity).
• Set K_v.
• Measure the extreme value of the acceleration a_+max and the associated following error d_+max in
the middle of the acceleration phase. Measure the extreme value of the deceleration a_-max and the
associated following error d_-max in the middle of the braking phase.
• K_a+ = K_v * d_+max / a_+max,
K_a- = K_v * d_-max / a_-max,
K_a = (K_a+ + K_a-) / 2.

7.5.2 Automatic DAC Offset Adjustment


Any controller with no I component has automatic DAC offset adjustment as an option. This adjustment is
only active when the velocity feedforward of the axis falls below a certain magnitude. This limited activity
prevents the DAC offset adjustment from being affected by the dynamic behavior of the axis. If the axis is
subject to position control or is moving at a suitably low velocity, an offset velocity is generated by integrating
the control velocity. This offset velocity is added to the output. The negative feedback of the position control
loop results in a PT1 behavior creating an exponential function.

Offset Adjustment Parameters

Offset filter time: Data type Double. Unit sec. Time constant for the offset adjustment.

Offset limit: Data type Double. A relative control. At a limit the offset is kept constant not going beyond it.

108 Version: 2.0.0 TF50x0


Parameters for Motion

Quite possibly, the behavior of the offset adjustment could be affected at runtime. Suitably, a range of
“switches” is available: For instance, at runtime the PLC or another ADS device can modify time constant
parameters or feedforward limit parameters.

The offset adjustment could be switched off entirely. Doing so, it is not always possible to avoid a jump in the
output voltage. Therefore, a soft deactivation can be achieved with the “fade out” mode. A fade out reduces
the adjustment to zero over time while following its own curve. To keep the adjustment steady for a period of
time the “hold” mode can be activated. E.g., the “hold” mode is suitable when stopping the power section of a
drive temporarily. Performing such a stop it would be impossible for the offset not to run out of control if the
offset adjustment was to remain active.

7.5.3 Axis Error


The variables axis.Status.Error and axis.Status.ErrorID belong to the ST_AxisStatus data
structure.

The boolean variable axis.Status.Error displays the StateDWord bit 31 and refers to the axis error
state. When the boolean variable axis.Status.Error is TRUE, it indicates that there is an error for the
axis.

The variable axis.Status.ErrorID of data type UDINT refers to the error ID of the reported error and
displays the axis error code.

7.5.4 AXIS_REF
PROGRAM MAIN
VAR
axis: AXIS_REF;
END_VAR

axis.ReadStatus();

MC axis variable

The PLC axis variable MAIN.axis has the data type AXIS_REF.

The data type AXIS_REF:


• contains information about an axis,
• is an interface between the PLC and the NC and
• is given to the MC function blocks as a reference to an axis.

Refreshing the status data structure in AXIS_REF


The status data structure Status of the type ST_AxisStatus contains additional or prepared
status and diagnostic information about an axis. The structure is not cyclically refreshed, but has to
be updated by the PLC program
Calling the ReadStatus() action from AXIS_REF updates the status data structure and should
be done once at the beginning of each PLC cycle.
The status information does not change within a PLC cycle. After calling ReadStatus(), the
current status information can be accessed in AXIS_REF within the entire PLC program.
The nature of the status data structure is purely informative. Therefore, its use is not mandatory.

TF50x0 Version: 2.0.0 109


Parameters for Motion

7.5.5 NC
TwinCAT NC is an assembly of function groups used for the control and regulation of axes or of
synchronized axis groups. An NC task consists of one or more channels of type PTP channel, FIFO channel
or NCI channel, and their subsidiary parts. Generally, immediately after start-up the NC axes find themselves
in one or more PTP channels. Particularly, they are moved to a different channel through a process of
reconfiguration then, if necessary.

7.5.6 Path Override (Interpreter Override Types)


The path override is a velocity override. Consequently, changing the override creates a new velocity, but
does not affect the ramps (acceleration or jerk). The applicable override types merely differ in terms of their
underlying reference velocity.

The parameterization takes place in the interpolation channel under the group parameters.

Option “Reduced (iterated)”

Based on the reduced velocity (default).

Because of the relevant dynamic parameters (braking distance, acceleration etc.) it is not possible for the
programmed velocity, depicted by the blue line, to be achieved in every segment. For this reason, for each
geometric segment a velocity, depicted by the red line, is calculated that may possibly be reduced compared
to the programmed velocity. In the standard case, the override is made with reference to this possibly
reduced segment velocity.

The advantage of this override type is that the machine operates with an approximately linear reduction in
velocity when override values are small. Therefore, “Reduced (iterated)” is the correct setting for most
applications:

vres = vmax * Override.

110 Version: 2.0.0 TF50x0


Parameters for Motion

Option “Original (iterated)”

Based on the programmed path velocity.

The override value is based on the velocity programmed by the user. The maximum segment velocity has
merely a limiting effect.

Option “Reduced [0 … >100%]”

Based on internally reduced velocity with the option to specify a value greater than 100%.

From TwinCAT V2.10, Build 1329.

Generally, the override type behaves like “Reduced (iterated)”. More specifically, with this override type it is
possible to travel along the path more quickly than programmed in the G-Code. There is no limitation to
120%, for example. The maximum possible path velocity is limited by the maximum velocities of the axis
components (G0 velocity) and their dynamics.

If limitation to a particular value, e.g. 120%, is required, this limitation can be set within the PLC project.

7.5.7 PTP
PTP stands for point-to-point. PTP axis functionality is a control process for one-dimensional positioning of
axes, in particular servo axes, but also other types of axes. One-dimensional does not necessarily mean
linear. It simply means that one component is interpolated in some specified coordinate system (Cartesian
coordinates, polar coordinates).

PTP is a licence level for basic axis numerical control. PTP forms the basis of the whole of TwinCAT NC,
because at system start-up the axes are normally in PTP mode, and thus are position controlled. The
extended TwinCAT NC functionalities are achieved on the basis of the PTP modes by reconfiguration (FIFO,
NCI) or by coupling (all slave types).

TF50x0 Version: 2.0.0 111


Parameters for Motion

7.5.8 PT1 Filter


A PT1 filter is a transfer function that performs convex interpolation between a new value x_n and an old
value (from one cycle before) x_a. The filter time parameter, a nonnegative value in the unit of seconds, has
to be entered into the calculation. If I = SAF cycle time / (SAF cycle time + filter time),
then x = I * x_n + (1-I) * x_a. The filter time should be finite. For the filter time being a positive
value I resides within the open interval from 0 to 1. If the filter time is close to 0.0, the new value has a high
weighting. If the filter time is long, the older value has a relatively high weighting.

7.5.9 Rapid Traverse


Command G0
Cancellation G1, G2 or G3

• Rapid traverse is used to position the tool quickly, and is not to be used for machining the workpiece.
With G0 the axes are moved with linear interpolation as fast as possible. The velocity is calculated with
MIN (Rapid Traverse Velocity (G0), Reference Velocity, Maximum Velocity).
• If a number of axes are to be driven in rapid traverse the velocity is determined by that axis that
requires the most time for its movement.
• An accurate stop (G60) is cancelled with G0.
• The rapid traverse velocity is set for each axis individually at “MOTION | NC-Task 1 SAF | Axes | Axis 1
| NCI Parameter | Rapid Traverse Velocity (G0)”.

7.5.10 ReadStatus()
See section AXIS_REF [} 109].

112 Version: 2.0.0 TF50x0


Parameters for Motion

7.5.11 Tolerance Ball

[1]

[2]
[3]

[4]

[1] Glue dot.

[2] Segment, geometrical element, here: line.

[3] Tolerance ball.

[4] Transition, smooth path.

Motivation

TF50x0 Version: 2.0.0 113


Parameters for Motion

Dynamical- • Segment transitions that are not two times steadily differentiable with respect to
Steadiness their spatial coordinate lead to dynamic-unsteadinesses, if at this transition the path
velocity is not reduced to zero value.
• Segment transitions can be smoothed out using Bézier-splines leading to the dy-
namics for the whole path to be steady at the segment transition, even though path
velocity differs from zero.

Smoothening • Tolerance balls are used to smooth out dynamic unsteadiness at segment transi-
tions.

Faster • Smoothening permitts faster dynamics.


Dynamics • The maximum segment transition velocity calculated by the system in advance has
the value VeloLink.
• The user can change the system parameter C2 for C2-velocity reduction online.
• The segment transition velocity has the value C2 x VeloLink.

Definition

Segment Transition • For the smoothening a tolerance ball is placed around each segment transition.

Permitted • Up to the extend that the path stays within the tolerance ball, this path may deviate
Path Deviation from its predefined geometry within this tolerance ball.

Parameter

Radius • The user adjusts the radius of the tolerance ball.

Range of Validity

No • The radius of the tolerance ball is valid modally for all segment transitions that at
Exact Halt, the segment transition do not imply an exact halt or a stop.
No Stop

Algorithmic Behavior

Adaptive • Automatically, the radii of the tolerance balls are set adaptively.

Inhibit • Setting the radii adaptively prevents from overlap of the tolerance balls. Otherwise,
Overlap especially for small segments an overlap of tolerance balls could occur.

At the • Within the tolerance ball there is no override.


Segment Transition • Entering the tolerance ball the path acceleration obtains zero value.
• Entering the tolerance ball the path velocity obtains the value of the segement tran-
sition velocity.
• Within the tolerance ball the path acceleration stays at zero value.
• Within the tolerance ball the path velocity remains at the value of the segment tran-
sition velocity.
• The override induced change of velocity level is interrupted within the tolerance ball
and is continued after leaving the tolerance ball.

114 Version: 2.0.0 TF50x0


First steps

8 First steps
The necessary steps for creating a project, moving an axis and analyzing this movement are explained in the
following.

DANGER
Acute risk of injury when using real axes
• Only specialist personnel with extensive knowledge in the areas of electrical engineering / drive
technology are allowed to install and commission the equipment.
• Check that all live connection points are protected against accidental contact.
• Never undo the electrical connections to the motor when it is live.
• The surface temperature of the motor can exceed 100 °C in operation. Check (measure) the
temperature of the motor. Wait until the motor has cooled down below 40 °C before touching it.
• Make sure that, even if the drive starts to move unintentionally, no danger can result for personnel or
machinery.

1. Create project [} 115]


2. Create axis [} 117]
◦ Create simulation axis [} 117]
◦ Create AX5000 and NC axis manually [} 124]
◦ Create AX5000 and NC axis automatically [} 119]
3. Axis configuration [} 129]
◦ Setting dynamics
◦ Limiting positions [} 129]
4. Moving the axis [} 130]
◦ Manual movement via the commissioning dialog [} 131]
◦ Simple movement via the PLC [} 132]
5. Scope integration [} 136]

8.1 Create project


TwinCAT Motion is fully integrated in the TwinCAT system. A standard TwinCAT project is therefore the
starting point for every TwinCAT Motion application:
1. Open the TwinCAT XAE Shell or a Visual Studio with integrated TwinCAT.

TF50x0 Version: 2.0.0 115


First steps

2. Open the dialog New > Project.

3. Select TwinCAT XAE Project, name and location.

ð A TwinCAT project with the selected name is created.

116 Version: 2.0.0 TF50x0


First steps

Next step

Create axis [} 117]

8.2 Create axis


An axis can be created both with and without a link to the real drive hardware. For the first steps we
recommend to do without the real drive hardware and to create the axis as a simulation axis:
• Create simulation axis [} 117]

The creation of the axis with real drive hardware can be done manually as well as automatically and is
explained below using the example of an AX5000. The steps can also be transferred to other servo drives:
• Create AX5000 and NC axis manually [} 124]
• Create AX5000 and NC axis automatically [} 119]

8.2.1 Create simulation axis


In order to familiarize yourself with TwinCAT Motion and to test new programs as well as functions, the use
of simulation axes is recommended. In this section you will learn how to create such a simulation axis.
1. By default, the Motion node is shown within a TwinCAT project. If this is not the case, you can show it by
right-clicking on the TwinCAT project in the Solution Explorer > Show Hidden Configurations > Show
MOTION Configuration.
2. Below the Motion node you can insert various Motion configurations. To do this, right click Motion > Add
New Item.

3. Select NC/PTP NCI Configuration and confirm with OK.

ð The NC/PTP NCI Configuration [} 14] is now below the Motion node.

TF50x0 Version: 2.0.0 117


First steps

4. Axes can be added to the configuration with a right click on Axes > Add New Item.

5. For a simulation axis, select the type Continuous Axis and confirm your selection with OK.
Details on the axis types can be found here [} 19].

118 Version: 2.0.0 TF50x0


First steps

ð A simulation axis is created. You can recognize it by the fact that no link to the I/O is listed in the axis
dialog Settings [} 20] and the axis type Standard (Mapping via Encoder and Drive) is selected.
Details about the axis dialogs can be found here [} 20].

Alternative steps

Instead of a simulation axis, a real axis can alternatively be created:


• Create AX5000 and NC axis manually [} 124]
• Create AX5000 and NC axis automatically [} 119]

Next steps

Before moving the axis [} 130], it should be configured:


• Setting dynamics
• Limiting positions [} 129]

8.2.2 Create AX5000 and NC axis automatically


After you have familiarized yourself with a simulation axis (Create simulation axis [} 117]), you can familiarize
yourself with an axis that is linked to real drive hardware. Here, the example of an AX5000 is used to explain
how the drive hardware can be automatically created in TwinCAT Engineering and linked to an NC axis.

Requirements:
• Control voltage: 24 VDC
• EtherCAT connection with master card
• TwinCAT in Config Mode

TF50x0 Version: 2.0.0 119


First steps

Scan Devices
1. First the bus is scanned for connected EtherCAT devices.

2. Confirm the hint that not all device types can be found automatically.

3. Select the EtherCAT interface card.

120 Version: 2.0.0 TF50x0


First steps

4. Scan for connected devices (Scan for boxes).

ð The AX5000 was found and is displayed below the device.

Scan Motors
5. Beckhoff motors with integrated name plate can be automatically detected and added to the
configuration. To do this, confirm the "Scan Motors" message with Yes.
If you do not use a corresponding motor, please perform this step using the documentation for setting up
an AX5000 manually.

ð The detected feedback system and the detected motor are displayed at the following location: Drive
> Drive Manager > Channel > Configuration > Motor and Feedback
The scan step can also be restarted via the button Scan feedback 1 / motor*.
The TwinCAT 3 Drive Manger 2 (TE5950) also provides a commissioning tool for Beckhoff Drive

TF50x0 Version: 2.0.0 121


First steps

Technology. With this you can read the connected motors again. It also supports you during
parameterization and configuration.

Append link axis to NC


6. Append link axis to NC

ð If there was no NC configuration in the project yet, it has now been created.
ð Axis objects corresponding to the drive were automatically created in the NC configuration and

122 Version: 2.0.0 TF50x0


First steps

ð the axis objects were automatically linked to the drive scanned under I/O.

7. Afterwards, you will be asked if you want to activate Free Run. This is not mandatory for the next steps,
so the question may be answered as you wish with Yes or No.

ð An AX5000 with the associated standard NC configuration is now created.

Alternative steps
• Create simulation axis [} 117]
• Create AX5000 and NC axis manually [} 124]

Next steps

Before moving the axis [} 130], it should be configured:


• Setting dynamics
• Limiting positions [} 129]

TF50x0 Version: 2.0.0 123


First steps

8.2.3 Create AX5000 and NC axis manually


After you have familiarized yourself with a simulation axis (Create simulation axis [} 117]), you can now deal
with an axis that is linked to real drive hardware. Here, the example of an AX5000 is used to explain how the
drive hardware can be created manually in TwinCAT Engineering and linked to an NC axis.

Requirements
• TwinCAT is in ConfigMode

Create Devices

The AX5000 communicates via EtherCAT.

1. Click the path I/O > Devices > Add New Item...

2. Open the dialog Insert Device.


3. Select an EtherCAT Master.

124 Version: 2.0.0 TF50x0


First steps

4. Confirm your selection with OK.

ð The EtherCAT master is added.


5. Click the path Devices > Device 1 (EtherCAT) > Add New Item...

ð The dialog Insert EtherCAT Device opens.

TF50x0 Version: 2.0.0 125


First steps

6. In the Insert EtherCAT Device dialog, select the AX5000 actually used and confirm with OK.

ð An EtherCAT master with the AX5000 used is created under I/O.

Append link axis to NC automatically

Linking the axis automatically


When the AX5000 is created, TwinCAT asks whether the axis should be linked to the NC
configuration. By confirming this message with OK this step is done automatically. This has the
advantage that the objects are correctly linked and settings such as the Axis Type are automatically
set correctly.

What happens after the confirmation of the NC configuration?


• If there was no NC configuration in the project yet, it was created.
• Axis objects were automatically created in the NC configuration according to the drive.
• The axis objects were automatically linked to the drive scanned under I/O.

126 Version: 2.0.0 TF50x0


First steps

Append link axis to NC manually

If you have acknowledged the query with Cancel, you can create and link the NC configuration and axis
objects manually.
1. To do this, first carry out the steps as for Creating a simulation axis [} 117].
2. At Axis > Settings > Axis Type, select SERCOS Drive.
3. The NC axis must be linked to the channel of the AX5000 under I/O. To do this, click Axis > Settings >
Link To I/O....
ð The dialog Select I/O Box/Terminal opens.
4. Select the channel of your AX5000 to which you want to link the NC axis.
ð The NC axis is linked to the drive channel.

Select feedback and motor


ü A digital name plate is required for this purpose.
1. To add a feedback system and motor, go to I/O > Devices > Drive Manager Channel > Configuration
> Motor and Feedback.
2. Via Scan feedback 1 / motor* you can scan the feedback system and the motor as described at Create
AX5000 and NC axis automatically [} 119] and thus add them automatically.
3. Alternatively, you can select the feedback system via Select feedback 1* using the following dialog and
confirm with OK.

4. Confirm the following hint.

ð The feedback system has been selected.

TF50x0 Version: 2.0.0 127


First steps

5. Via Select motor* you get to the following dialog. Select the motor and confirm with OK.

6. Select the power supply of the motor and confirm with OK.

7. Confirm the following query with OK.

ð Now adjustments can be made automatically to the NC axis. Please note the points mentioned at
Axis configuration [} 129].
ð Feedback system and motor are configured.

Alternative steps
• Create simulation axis [} 117]
• Create AX5000 and NC axis automatically [} 119]

128 Version: 2.0.0 TF50x0


First steps

Next steps

Before moving the axis [} 130], it should be configured:


• Setting dynamics
• Limiting positions [} 129]

8.3 Axis configuration

8.3.1 Limiting positions


To prevent collisions, monitoring and limiting positions can be activated in the form of software limit switches
and position lag monitoring.

No safety functions in the sense of safety technology


Purely functional settings are explained in this section; these are not safety functions in the sense of
safety technology.

Activating the software limit switches

If the software limit switch monitoring is activated for the axis, the axis does not move beyond the set
position (max./min. end position).

Activation steps:
1. Select the NC axis for which you wish to activate the software limit switches.
2. Open the Parameter dialog for this NC axis.
3. Set the value TRUE for the parameter Limit Switches: Soft Position Limit Minimum Monitoring.
Use the corresponding drop-down box in the table column Offline Value.
4. Set the value TRUE for the parameter Limit Switches: Soft Position Limit Maximum Monitoring.
Use the corresponding drop-down box in the table column Offline Value.
5. Use the Limit Switches: Minimum Position parameter to set a value for the smallest position value that
can be approached that allows sufficient freedom of movement and excludes the possibility of a collision.
6. Use the Limit Switches: Maximum Position parameter to set a value for the largest position value that
can be approached that provides sufficient freedom of movement and eliminates the possibility of a
collision.
ð With the next Activate configuration [} 130] you have activated the software limit switches for the
selected NC axis.

Activating the position lag monitoring

The position lag monitoring function checks whether the current position lag of an axis has exceeded the
limit value. The lag distance is the difference between the set value (control value) and the actual value
reported back. Here, monitoring takes place both at standstill and during the movement of an axis.

TF50x0 Version: 2.0.0 129


First steps

Activation steps:
1. Select the NC axis for which you want to activate position lag monitoring.
2. Open the Parameter dialog for this NC axis.
3. Set the value TRUE for the parameter Monitoring: Position Lag Monitoring.
Use the corresponding drop-down box in the Offline Value table column.
4. Use the Monitoring: Maximum Position Lag Value parameter to set a value for the maximum
permissible lag distance that provides sufficient control freedom and eliminates the possibility of a
collision.
The default value is usually suitable.
5. Set a value for the parameter Monitoring: Maximum Position Lag Filter Time that provides sufficient
control freedom and excludes the possibility of a collision.
The default value is usually suitable.
ð With the next Activate configuration [} 130] you have activated the position lag monitoring for the
selected NC axis.

8.4 Moving the axis

8.4.1 Activating a TwinCAT project


ü Execute the TwinCAT project with the following steps.

1. Activate the configuration via or via the Visual Studio Menu > TwinCAT > Activate Configuration.
2. If no licenses have been activated yet on the target system, the following dialog appears. For an initial
test you can create a trial license by selecting Yes and entering a security code.

ð You will then be asked whether you want to restart TwinCAT.

130 Version: 2.0.0 TF50x0


First steps

3. Confirm the restart with Yes.

Alternatively, a restart can be triggered via or via the Visual Studio Menu > TwinCAT > Restart
TwinCAT System.

ð The TwinCAT project is activated and the axes can be moved manually via the commissioning
dialog. More here [} 131].
ð If, on the other hand, you want to move an axis via the PLC, create a PLC in advance according to
Simple movement via the PLC [} 132] and activate the TwinCAT project again.

4. Log in the PLC via or via Visual Studio Menu > PLC > Login.

5. Then start the PLC via or via the Visual Studio Menu > PLC > Start.

8.4.2 Manual movement via the commissioning dialog


After creating and configuring an axis, you can move it via the Commissioning dialog [} 38]. The prerequisite
for this is that the TwinCAT project has been activated [} 130] and no link to the PLC exists or the PLC has
not been started. Otherwise, the PLC has priority.

DANGER
Risk of injury due to movement of axes!
The commissioning results in a movement of axes.
• Make sure that neither you nor others are harmed by the movement, e.g. by maintaining a suitable
safety distance.
• Do not perform any action whose consequences you cannot estimate

WARNING
Incorrect axis position during initial commissioning
Without referencing / calibrating the axis position, the displayed axis position may deviate from the actual
axis position.
• Perform a homing to determine the correct actual position using a reference signal.

TF50x0 Version: 2.0.0 131


First steps

Enable axis

Via Enabling > Set the corresponding dialog opens, with which the axis and the movement directions can be
enabled and the override can be set. Only when the axis and the direction of movement are enabled, it is
possible to move the axis in the corresponding direction of movement.

==>

Manual movement of the axis

The axis can be moved manually via the buttons or function keys F1-F4. The velocity set in the axis
parameters [} 74] is used for "Manual Velocity (Fast)" or "Manual Velocity (Slow)".

8.4.3 Simple movement via the PLC


After creating and configuring an NC axis, you can create a PLC project and move the axis via this.

132 Version: 2.0.0 TF50x0


First steps

DANGER
Risk of injury due to movement of axes!
The commissioning results in a movement of axes.
• Make sure that neither you nor others are harmed by the movement, e.g. by maintaining a suitable
safety distance.
• Do not perform any action whose consequences you cannot estimate

WARNING
Incorrect axis position during initial commissioning
Without referencing / calibrating the axis position, the displayed axis position may deviate from the actual
axis position.
• Perform a homing to determine the correct actual position using a reference signal.

Creating a PLC project


1. Right click in the Solution Explorer on PLC > Add new Item...

TF50x0 Version: 2.0.0 133


First steps

2. Select the name and location in the dialog Add New Item.

ð The PLC project was created.

Integrating a PLC library

The Tc2_MC2 library contains the PLCopen specified Motion Control function blocks. These can be used to
manage NC axes and program movements.
1. Right click on References > Add library...

2. Select the library Tc2_MC2 and confirm with OK.


ð The library is now added and can be viewed by double-clicking it.

134 Version: 2.0.0 TF50x0


First steps

Writing a PLC program

All necessary data types and function blocks for a simple PLC Motion program are contained in the library
Tc2_MC2.

AXIS_REF

For each axis one instance of the data type AXIS_REF is required, which is the interface between PLC and
NC. It contains all the information about the axis that is given to the MC function blocks as a reference.

MC_Power

The function block MC_Power is used to enable an axis and its directions of movement.

MC_Reset

The function block MC_Reset can be used to reset an error on an axis.

MC_MoveAbsolute

MC_MoveAbsolute is a simple Motion function block that can be used to position an axis to an absolute
target position.

Simple programming
1. Open in the PLC project at POUs the MAIN(PRG).
2. Add the following declarations to MAIN(PRG).
PROGRAM MAIN
VAR
axis : AXIS_REF;
fbPower : MC_Power;
fbStop : MC_Stop;
fbReset : MC_Reset;
fbMoveAbsolute : MC_MoveAbsolute;
enableAxis : BOOL;
executeStop : BOOL;
executeReset : BOOL;
executeMove : BOOL;
override : LREAL := 100;
position : LREAL := ???; // ToDo: set to a reachable position
velocity : LREAL := ???; // ToDo: set velocity for move absolute
END_VAR
3. Insert the following program code into MAIN(PRG).
fbPower(
Axis := axis,
Enable := enableAxis,
Enable_Positive := enableAxis,
Enable_Negative := enableAxis,
Override := override,
BufferMode := ,
Options := ,
Status => ,
Busy => ,
Active => ,
Error => ,
ErrorID =>);
fbStop(
Axis := axis,
Execute := executeStop, // The command is executed with a positive edge.
Deceleration := , // If the value is ≤ 0, the deceleration
// parameterized with the last Move command is used.
Jerk := , // If the value is ≤ 0, the jerk parameterized
// with the last Move command is used.
Options := ,
Done => ,
Busy => ,
Active => ,
CommandAborted => ,
Error => ,
ErrorID => );

TF50x0 Version: 2.0.0 135


First steps

fbReset(
Axis := axis,
Execute := executeReset, // The command is executed with a positive edge.
Done => ,
Busy => ,
Error => ,
ErrorID => );
fbMoveAbsolute(
Axis := axis,
Execute := executeMove, // The command is executed with a positive edge.
Position := position,
Velocity := velocity,
Acceleration := , // If the value is 0, the standard acceleration from
// the axis configuration in the System Manager is used.
Deceleration := , // If the value is 0, the standard deceleration from
// the axis configuration in the System Manager is used.
Jerk := , // If the value is 0, the standard jerk from the axis
// configuration in the System Manager is applied.
BufferMode := MC_BufferMode.MC_Buffered,
Options := ,
Done => ,
Busy => ,
Active => ,
CommandAborted => ,
Error => ,
ErrorId => );
4. For the call from fbMoveAbsolute, adjust the target position and the dynamics according to your real
axis.
5. Build the PLC project.
ð The axis instance of the AXIS_REF should now be displayed among the PLC instances in the
Solution Explorer.
6. Link the PLC instance of AXIS_REF with the axis instance of the NC.

7. Activate the TwinCAT project .

8. Log in the PLC and start , as described here [} 130].


9. Check that the target position specified at fbMoveAbsolute can be approached safely with the
specified dynamics. Adjust them as needed.
10. If you are sure that there is no danger from the movement specified at fbMoveAbsolute, you can
enable the controller for the axis by setting the variable enableAxis online to TRUE.
11. If the controller enable was successful (fbPower.Active = TRUE), the motion command can then be
activated with executeMove.
ð Via fbStop.Execute = TRUE the motion command can be stopped prematurely if required.
ð An axis error can be reset via fbReset.Execute := TRUE.

8.5 Scope integration


TwinCAT 3 Scope can be used to record variable values and display them in various diagrams. For a PTP
axis, for example, position and dynamics in an XT diagram may be of interest. There is a simplified way to do
this, which is described below. Further details can be found in the TE13xx | TwinCAT 3 Scope View
documentation.
ü Automatically name all variables according to the scheme AxisName.ParameterName (recommended
procedure).
1. Open the Scope settings at Menu > Scope > Options.
2. At Scope > General set the Channel Name Detail Level to "2".

136 Version: 2.0.0 TF50x0


First steps

3. Right click on the NC axis (Axis 1) in the Solution Explorer and select Add to Scope.

TF50x0 Version: 2.0.0 137


First steps

ð If there is no Measurement Project in the Solution yet, the dialog Create new Project opens.
4. Select Empty Measurement Project as the project type and a name for your Measurement Project and
confirm with OK.

ð A Measurement Project has been created.


ð The Measurement Project contains a Scope Project.
ð Variables for position, velocity and acceleration of the selected axis are already added to the Scope
Data Pool and to a YT diagram.

138 Version: 2.0.0 TF50x0


First steps

5. Activate the TwinCAT project .

6. Switch TwinCAT to the Run mode .

7. Start Scope recording .


8. Move the axis (via the Commissioning dialog [} 131] or via the PLC [} 132]).
DANGER Observe the safety instructions!

9. Stop Scope recording .

TF50x0 Version: 2.0.0 139


First steps

ð Positions and dynamics of the axis have been recorded and can be displayed by the Scope View.

For further details, such as adding more variables to the Data Pool, and creating new/different diagrams,
please refer to the TE13xx | TwinCAT 3 Scope View documentation.

140 Version: 2.0.0 TF50x0


Special NC functionalities

9 Special NC functionalities

9.1 Modulo positioning


The modulo positioning can be applied to closed linear axes as well as to rotary axes. TwinCAT does not
distinguish between these types. A modulo axis has a consecutive absolute position in the range ±∞. The
modulo position of the axis is simply a piece of additional information about the absolute axis position.
Modulo positioning represents the required target position in a different way. As opposed to absolute
positioning, in which the user clearly specifies the target, the absolute target position is formed from the
following parameters in modulo positioning:
• Modulo target position
• Modulo Factor
• Tolerance Window
• Direction, see MC_DIRECTION
• (Additional Turns, see ST_MoveAbsoluteCAOptions)

Modulo Factor

The modulo positioning basically refers to an adjustable Modulo Factor, which is set in the TwinCAT
Engineering. The axis and its use must be observed here, for example:
• If a PTP axis is used, the Modulo Factor of the axis encoder applies; details in the Notes on the modulo
positioning of a PTP axis.

• If, for example, a mover is used on an XTS system in a CA group, the Rail Length set in the CA group
applies.

TF50x0 Version: 2.0.0 141


Special NC functionalities

• If an XPlanar mover is used, its "C-axis" modulo can be positioned. Here, the Modulo Factor is set as
"C coordinated modulus" in the Init parameters of the XPlanar mover.

Modulo Tolerance Window

The Modulo Tolerance Window defines a position window around the current modulo set position of the axis.
The window width corresponds to twice the specified value (set position ± tolerance value) and is specified in
the TwinCAT Engineering:
• In the case of a PTP axis or an axis in a CA group, the Tolerance Window is defined in the axis
encoder

• In the case of the C-axis of an XPlanar mover, the Tolerance Window is defined in the Init parameters
of the XPlanar mover.

The positioning of an axis is always referenced to its current actual position. Unintentional revolutions may
be performed if the actual position and the target position are very close to each other, for example, if the
actual position is minimally greater than the target position and Direction = mcDirectionPositive
was selected. This can occur in particular if the actual position is determined inaccurately (e.g. on account of
incorrect positioning due to the axis stalling, or due to the finite resolution of the encoder). In order to avoid
this, a tolerance window for modulo positioning can be set. If the distance between the start and target
positions is less than or equal to the Tolerance Window, then the target position is driven to by the shortest
route (as with Direction = mcDirectionShortestWay), i.e. also contrary to the direction specified.

142 Version: 2.0.0 TF50x0


Special NC functionalities

Examples
• Modulo Factor = 100
• Tolerance Window = 1

Parameter Direction Absolute Target posi- Parameter Relative Absolute Modulo end
Startposi- tion Additional path end posi- position
tion Turns tion
mcDirectionPositive 110 10 0 0 110 10
mcDirectionPositive 110.9 10 0 -0.9 110 10
mcDirectionPositive 112 10 0 98 110 10
mcDirectionPositive 95 10 0 15 110 10
mcDirectionPositive 110 110 0 ERROR: INVALID TARGET POSITION

mcDirectionPositive 110 10 3 300 410 10


mcDirectionPositive 110.9 10 3 299.1 410 10
mcDirectionPositive 112 10 3 398 410 10

TF50x0 Version: 2.0.0 143


Special NC functionalities

Parameter Direction Absolute Target posi- Parameter Relative Absolute Modulo end
Startposi- tion Additional path end posi- position
tion Turns tion
mcDirectionPositive 95 10 3 315 410 10
mcDirectionPositive 110 110 3 ERROR: INVALID TARGET POSITION

mcDirectionNegative 110 10 0 0 110 10


mcDirectionNegative 109.9 10 0 0.1 110 10
mcDirectionNegative 108 10 0 -98 10 10
mcDirectionNegative 95 10 0 -85 10 10
mcDirectionNegative 110 110 0 ERROR: INVALID TARGET POSITION

mcDirectionNegative 410 10 3 -300 110 10


mcDirectionNegative 409.9 10 3 -299.9 110 10
mcDirectionNegative 408 10 3 -398 10 10
mcDirectionNegative 495 10 3 -385 10 10
mcDirectionNegative 410 110 3 ERROR: INVALID TARGET POSITION

mcDirectionShortestWay 440 50 0 10 450 50


mcDirectionShortestWay 440 10 0 -30 410 10

mcDirectionShortestWay 440 50 1 ERROR: INVALID ADDITIONAL TURN


COUNT

Further samples

Further examples without the Additional Turns parameter can be found in the Notes on the modulo
positioning of a PTP axis.

9.2 External set value generation


External setpoint generation (external setpoint specification) enables the implementation of individual
setpoint generators within the PLC, or appropriate connection of existing internal and external generators,
and their simple and transparent integration into the TwinCAT system. Axes can be positioned either with an
external setpoint generator alone, or superposition (mixing) of existing internal generators and external
setpoint sources is possible.

These characteristics and the fact that an axis can change its different operation modes at runtime (e.g.
interpolating path axis (NCI), master PTP axis, slave axis, external setpoint generation) further increase the
flexibility of a TwinCAT axis.
The superimposition of internal and external setpoint sources generally enables a wide range of new
applications and solutions.

Examples of use:
• External setpoint specification can be used for implementing an individual new setpoint profile, which is
not available in TwinCAT NC. This profile can be mathematically very simple or as complex as
necessary. Since the externally generated setpoint profile can also be superimposed on the standard
profile, corrective functions can thus also be supplemented.
In this way, a position-based setpoint profile can be implemented for systems that are difficult to control
or non-linear, for example a position-based deceleration ramp for hydraulic axes.
• One application for the superposition (mixing) of two internal setpoint sources is the combination of
interpolating path processing (NCI) and the 'flying saw' function (PTP slave). Multi-dimensional
machining, e.g. a circle, on a moving workpiece is thus possible, which previously was only possible
with stationary workpieces. This measure increases the efficiency of a machine.

144 Version: 2.0.0 TF50x0


Special NC functionalities

• External setpoint generation can also be used in order to enable a certain lead time (in the multi-digit
second range) between the unit generating the setpoints (e.g. the execution of a DIN-NC program
feeding virtual axes) and the real axes. Collision monitoring and strategies for collision avoidance can
then be realized.
• A further important application are coordinate transformations (restricted to regular and unambiguous
transformations without singularities), e.g. geometries such as a 'two-bar linkage' or conversion
between rotary and translatory coordinates.

This new function is available with the PLC function blocks MC_ExtSetPointGenEnable and
MC_ExtSetPointGenDisable in the Tc2_MC2 library. Furthermore, there is an example for an external setpoint
generator (3-phase profile with acceleration rectangle), see section TwinCAT NC-PTP Examples.

Activation of the external setpoint generation:

The adoption of the external setpoint specifications is initiated by an ADS axis function from the PLC with the
function block MC_ExtSetPointGenEnable. The axis start types absolute (1) or relative (2) and, if sensible
and required, the target position of the axis, are specified as parameters. This target position has either an
absolute or relative effect, depending on the starting mode, and enables position and target position window
monitoring (PEH). Thus, enabling the external setpoint generation is similar to a conventional axis start.
A status bit of the axis reference Axis.Status.ExtSetPointGenEnabled informs about the status, namely
whether the external setpoint generation, is enabled or disabled.

So that enabling is accepted without errors:


• no axis error should be present
• the controller and feed enables must be active
• the drive hardware must be ready to operate
• the axis must not be coupled (no slave)

To be observed:
• In case of an axis error (runtime error of the axis) or an axis reset (including edge change of the
software controller enable) the external setpoint specification is automatically disabled (similar to
an abortion of PTP axis positioning in case of a runtime error or axis reset).
• If only external setpoint generation is carried out, both absolute and relative start types are
permitted.
If external setpoint generation is started in parallel or in addition to internal setpoint generation
(PTP), only the relative starting mode is possible, since the internal positioning is ultimately
always converted to an absolute start, and it is not possible to have two absolute positions
simultaneously.
• Whilst external positioning can be activated during an active internal PTP positioning via the
relative start type, the opposite case is not permitted.
• If the external setpoint generation is already active and this is activated for the repeated time,
then the start types must match, otherwise this is answered with an error.
The repeated activation of the external setpoint generation can be useful insofar as here the
target position is taken over each time and thus the target position window monitoring (PEH) is
updated.

Disabling the external setpoint generation:

External setpoint specification is switched off from the PLC via the function block
MC_ExtSetPointGenDisable. A feedback is given by the already mentioned status bit of the axis reference
Axis.Status.ExtSetPointGenEnabled.

After disabling the external setpoint generation, the external target position is taken over for exactly
one more cycle.

TF50x0 Version: 2.0.0 145


Special NC functionalities

Specification of setpoints via the cyclic axis interface:

After faultless activation of the external setpoint generation, in each PLC cycle a setpoint packet can now be
created at the axis interface. A setpoint package consists of the external set position, target velocity, set
acceleration and set direction (-1, 0, +1).
The set direction is of particular importance here, because setpoints are only accepted and applied internally
if this is not equal to zero (0: no movement). For the complete range of external setpoint generation, the
direction flag therefore has to be set overlapping at the start and at the end.

To be observed:
• After resetting of the set direction to zero, the external target position is taken over for exactly
one further SAF cycle.
• The set direction should already be set to a value not equal zero (i.e. -1 or +1) one cycle before
and for one more cycle after the motion. This provides a safe time frame that is guaranteed to
prevent a value being ignored, either at the start or at the end.

Settings of the PLC task:

The PLC task that generates and specifies the setpoints must operate synchronously, i.e. with the same
cycle time as the NC SAF task (port 501). This PLC task also has to have the same high priority, perhaps an
even higher one, than the NC-SVB task (port 511).

Optimization options:

Dead time caused by transport via the cyclic axis interface can be compensated for an axis. This dead time
compensation can be set by means of the dialogs on the encoder and drive of the NC axis (ON (with
velocity)).

9.3 NC Backlash Compensation

9.3.1 Mechanical backlash


Mechanical backlash is the difference in position between a drive or an encoder and the load. Mechanical
backlash arises due mechanical tolerances in the drivetrain. This causes a difference between the required
and the actual position of the load. This is especially important when the direction of motion is reversed.

There are three types of mechanical backlash:

Positive backlash

Positive backlash occurs in systems where the measuring system is directly coupled to the drive. In this case
the backlash exists between the drive and the load. When the direction of motion is reversed, the measuring
system will detect a change in position before the load has moved. So the encoder, which here measures
the position of the load indirectly, leads the actual position of the load. As a consequence, the load will not
reach the set position, it will be shorten by the length of the backlash.

In the figure below, a movement from left to right is defined as a positive movement.

146 Version: 2.0.0 TF50x0


Special NC functionalities

The encoder leads the load (e.g. machine table), so the measured encoder position, leads the actual position
of the table. Therefore the table’s movement will be too short.

In this case enter a positive correction value for the backlash (= normal case).

Negative backlash

Negative backlash occurs in systems where a mechanical tolerance exists between the drive and the
measuring system. When the direction of motion is reversed the load immediately moves in the new direction
and the measuring system won’t detect the changed position. In this case the load will travel further than
required. The encoder, which measures the position of the load directly, lags behind the actual position of
the machine part.

The encoder lags behind the actual position of the load (e.g. machine table). Therefore the table will travel
too far.

In this case enter a negative correction value for the backlash.

Neutral backlash

In systems, neutral backlash is an exception. In this case the measuring system is directly coupled to the
load and electrically connected with the drive. Here the encoder position and the load position are the same.
Now when the drive’s direction of motion is reversed, the backlash will be automatically compensated. The
position control loop is closed around the drivetrain because the encoder is coupled to the load directly. The
set position can be reached with no further compensation.

The encoder is directly coupled with the load (e.g. machine table) and ensuring steady state
accuracy. No special settings are required.

General Hints and Notes:


• Implemention of positive or negative backlash compensation is the same in TwinCAT (only the sign of
the backlash value differs). A positive backlash is parameterized as positive value, a negative as
negative value.

• A negative backlash is undesirable, because an axis with a backlash in the encoder system is difficult
to control (stationery vibrations / oscillations). Typically there are further steps necessary to solve this
problem.

TF50x0 Version: 2.0.0 147


Special NC functionalities

• It is not necessary to differentiate between position interface (position control in the drive) and velocity
interface (position control in TwinCAT), because they have the same effect. This applies to all variants
of backlashes.

• In case of neutral backlash there is no compensation action necessary, even though there is a
mechanical backlash. The encoder system is coupled to the machine table therefore enforcing steady
state accuracy.

• If a referencing (homing) of an axis is necessary, do the homing with backlash compensation


deactivated also position correction deactivated. The last driving direction defines if the left or the right
edge is the point of reference by defining a reference position (see NC Implementing the TwinCAT
Backlash Compensation [} 148]).

9.3.2 NC Implementing of the TwinCAT Position Correction


TwinCAT position correction is used for the backlash compensation.

The following table shows a description of TwinCAT position correction for drives in cyclic position and
velocity interfaces.

Implementation and effect of Position Correction resp.


Backlash Compensation
Implementation 1. The backlash correction is subtracted from the set posi-
tion which is transmitted to the drive.
2. The backlash correction is added to the actual position
which is transmitted from the encoder.
Effect in the Position Interface Description / Effect:
(position control in the Drive) By manipulating the set position which is transmitted to the
drive the backlash will be driven (subtraction of position
correction, see case 1).
To realize that the monitored actual value is correct, this
backlash correction is subtracted from the transmitted actual
value (addition of the position correction, see case 2).
Effect in the Velocity Interface Description / Effect:
(position control in TwinCAT) In the velocity interface no set position is transmitted to the
drive, so correcting the set position would have no effect.
By correcting the actual position which is transmitted from the
encoder to the drive a position difference is created. The
closed loop position controller in TwinCAT controls, by
means of this position difference (“lag error”) that the
backlash is driven (addition of the position correction, see
case 2).

9.3.3 NC Implementing the TwinCAT Backlash Compensation


Overview of the effect of the backlash compensation differentiating by type of backlash and reference
position (left or right edge):
• Positive backlash: Drive resp. external encoder has no backlash – backlash value is positive.
• Negative backlash: Additional external encoder has a backlash – backlash value is negative.

Implementation and effect of backlash


compensation
Reference position at the left edge Backlash compensation in negative
direction
Positive direction:
• No manipulation

148 Version: 2.0.0 TF50x0


Special NC functionalities

Implementation and effect of backlash


compensation
Negative direction:
• Manipulation of the actual position
+backlash
• Manipulation of the set position
-backlash

Reference position at the right edge Backlash compensation in positive


direction
Positive direction:
• Manipulation of the actual position
-backlash
• Manipulation of the set position +back-
lash
Negative direction:
• No manipulation

9.4 Discrete Axis (two speed)


This TwinCAT axis type (Two-Speed) enables the positioning of a so-called rapid/creep axis. Such an axis
can be physically made up of a motor with two speeds (switching of the pole pair numbers), or alternatively
by a motor that can be driven at two speeds with the help of a frequency inverter.

The typical positioning of such an axis is first of all made at high speed up to a parameterization distance
away from the target position (creep distance in positive or negative direction). From this position you switch
to slow traverse, so that the physical velocity (actual velocity) is reduced to a slower constant velocity. The
slow traverse is then also switched off at a closer distance from the target (braking distance) and the brake is
then activated after a parameterized time (delay time for brake incidence).

This particular positioning sequence is for the sole purpose of ensuring that the axis reaches its target
position in the most accurate and repeatable way.

In case a positioning inaccuracy occurs depending on the last physical direction of travel (typical effect of a
backlash), then a looping distance is activated. This looping distance has the effect that the target position is
always approached from the same direction thus reducing the backlash influence. In case of an axis stop
basically the same sequence is run through as for positioning without looping distance. However the priority
for an axis stop lies on a shorter braking distance or time and not on the positioning accuracy. There is the
separate parameter (looping distance for stop) for stopping in the shortest possible distance.

General

There are two equal possibilities available for the physical control of the axis, in the form of discrete travel
signals.

Use of the 6 bits in ControlByte

bMinusHigh Rapid traverse, negative direction


bMinusLow Slow traverse, negative direction
bPlusHigh Rapid traverse, positive direction
bPlusLow Slow traverse, positive direction
bBreak Braking bit
bBreakInv inverted braking bit

Use of the 6 bits in ExtControlByte

TF50x0 Version: 2.0.0 149


Special NC functionalities

bDirectionMinus Negative direction


bDirectionPlus Positive direction
bVeloLow Slow traverse
bVeloHigh Rapid traverse
bBreak Braking bit
bBreakInv inverted braking bit

A master-slave coupling is not possible with rapid/creep axis.

An axis start will only be initiated if the distance from the target point is in fact larger than the
parameterized braking distance.

Velocity and override

Starting velocity value range v Interpretation of the start velocity at override


100%
v > 50 Rapid traverse
0 < v ≤ 50 Slow traverse
v≤0 Error

Value range override Interpretation of the override value


Override > 50% Rapid traverse
0% < Override ≤ 50% Slow traverse
Override = 0% Stationary (tolerance window: <0.01% )

An override modification (also override = 0) only takes effect within the main travel phase.
If the override is set to 0 within one of the braking phases, the initiated braking phase is ended
without being influenced.

I/O configuration: Drive interface for rapid/creep axes NC → I/O (12 bytes)

No. Data type Byte Bit Def.- Variable Description


Range name
1 UINT32 0-3 - - nOutData1 Drive output data 1 (NC->I/O)
2 UINT32 4-7 - - nOutData2 Drive output data 2 (NC->I/O)
3 UINT8 8 - - nControlBy Control byte
te
0 0/1 bMinusHig Direction: negative velocity: fast
h
1 0/1 bMinusLo Direction: negative velocity: slow
w
2 0/1 bPlusLow Direction: positive velocity: slow
3 0/1 bPlusHigh Direction: positive velocity: fast
4 0/1 - RESERVE
5 0/1 - RESERVE
6 0/1 bBreakInv Inverse braking bit (0 ≡ ACTIVE, 1 ≡ PASSIVE)
7 0/1 bBreak Braking bit (0 ≡ PASSIVE, 1 ≡ ACTIVE)
4 UINT8 9 - - nExtContro Extended control byte
lByte
0 0/1 bDirection Direction: negative
Minus
1 0/1 bDirection Direction: positive
Plus

150 Version: 2.0.0 TF50x0


Special NC functionalities

No. Data type Byte Bit Def.- Variable Description


Range name
2 0/1 bVeloLow Velocity: slow
3 0/1 bVeloHigh Velocity: high
4 0/1 - RESERVE
5 0/1 - RESERVE
6 0/1 bBreakInv Inverse braking bit (0 ≡ ACTIVE, 1 ≡ PASSIVE)
7 0/1 bBreak Braking bit (0 ≡ PASSIVE, 1 ≡ ACTIVE)
5 UINT16 10-11 - - nReserved Reserved bytes

Parameters of the rapid/creep axes

Parameter Description
Creep distance positive The creep distance in the positive direction gives the distance to the target
direction position, below which the velocity changes from rapid to creep velocity, if the
direction of travel is positive.
If a looping distance is selected then this distance is based on the movement
reversal point.
This distance is denoted by Δp1 in positioning example 1 [} 153]
Creep distance negative The creep distance in the negative direction gives the distance to the target
direction position, below which the velocity changes from rapid to creep velocity, if the
direction of travel is negative.
If a looping distance is selected then this distance is based on the movement
reversal point.
Braking distance positive The braking distance in the positive direction gives the distance to the target
direction position, below which the creep velocity is switched off, if the direction of travel is
positive.
This distance is denoted by Δp2 in positioning example 1 [} 153]
Braking distance The braking distance in the negative direction gives the distance to the target
negative direction position, below which the creep velocity is switched off, if the direction of travel is
negative.
Brake incidence delay This delay time gives the start-up delay of the brakes after switching off of the
time in pos. direction creep velocity, if the direction of travel is positive.
In positioning example 1 [} 153], this time is between the times T4 and T5.
Brake incidence delay This delay time gives the start-up delay of the brakes after switching off of the
time in negative direction creep velocity, if the direction of travel is negative.
Rapid to creep velocity This waiting time is between the switching off of the rapid velocity and switching
delay time on of the creep velocity.

TF50x0 Version: 2.0.0 151


Special NC functionalities

Parameter Description
In positioning example 1 [} 153] , this time is between the times T2 and T3.
Creep distance for stop The creep distance for stop gives the distance that is covered with the creep
velocity after calling up the stop. This creep distance is usually selected shorter
than the creep distances in positive and negative direction, since the axis should
stop as soon as possible and the exact positioning is not a priority.
This distance is denoted by Δp1 in positioning example 3 [} 155]
Brake release delay The brake is released immediately the axis is started and after elapse of the
brake release delay either the rapid or creep velocity is activated depending on
the displacement.
In positioning example 1 [} 153] , this time is between the times T0 and T1.
Pulse time in positive This parameter is not evaluated and therefore has no effect.
direction
Pulse time in negative This parameter is not evaluated and therefore has no effect.
direction

Parameter Description
OPERATION MODE: The looping distance can be activated with this flag. The looping distance is for
looping distance approaching the target position always from the same direction. In the case of a
positive (negative) looping distance a target position in the positive (negative)
direction is increased by the amount of the looping distance and the target then
approached from the opposite direction. Consequently the target position in case
of a positive looping distance is always approached with negative velocity and a
negative looping distance with positive velocity.
Looping distance (+ / -) The looping distance gives the distance, by which the target position is exceeded
if necessary so that it is possible to move to the target position from the required
direction.
This distance is denoted by creep distance (looping distance) in positioning
example 2 [} 154]

Axis movement state (nAxisState in cyclic interface):

Axis movement state (nAxisState in cyclic interface):


nAxisState Description
0 Set value generator not active
20 Axis stopped
21 Main travel phase: High or low speed travel in relation to the start
speed and override

152 Version: 2.0.0 TF50x0


Special NC functionalities

nAxisState Description
22 Braking phase: High-to-low speed delay time active
23 Braking phase: Low speed travel
24 Braking phase: Delay time for brake incidence active

Positioning examples:

Positioning examples

1) Positioning A → B, without loop movement

Positioning A → B, without loop movement

TF50x0 Version: 2.0.0 153


Special NC functionalities

Fig. 2: TcNcTwoSpeed_Positioning1

2) Positioning A → B, with loop movement > 0.0

2) Positioning A → B, with loop movement > 0.0

154 Version: 2.0.0 TF50x0


Special NC functionalities

Fig. 3: TcNcTwoSpeed_Positioning2

3) Stop call up in case of active positioning

TF50x0 Version: 2.0.0 155


Special NC functionalities

156 Version: 2.0.0 TF50x0


Support and Service

10 Support and Service


Beckhoff and their partners around the world offer comprehensive support and service, making available fast
and competent assistance with all questions related to Beckhoff products and system solutions.

Download finder

Our download finder contains all the files that we offer you for downloading. You will find application reports,
technical documentation, technical drawings, configuration files and much more.

The downloads are available in various formats.

Beckhoff's branch offices and representatives

Please contact your Beckhoff branch office or representative for local support and service on Beckhoff
products!

The addresses of Beckhoff's branch offices and representatives round the world can be found on our internet
page: www.beckhoff.com

You will also find further documentation for Beckhoff components there.

Beckhoff Support

Support offers you comprehensive technical assistance, helping you not only with the application of
individual Beckhoff products, but also with other, wide-ranging services:
• support
• design, programming and commissioning of complex automation systems
• and extensive training program for Beckhoff system components
Hotline: +49 5246 963-157
e-mail: [email protected]

Beckhoff Service

The Beckhoff Service Center supports you in all matters of after-sales service:
• on-site service
• repair service
• spare parts service
• hotline service
Hotline: +49 5246 963-460
e-mail: [email protected]

Beckhoff Headquarters

Beckhoff Automation GmbH & Co. KG

Huelshorstweg 20
33415 Verl
Germany
Phone: +49 5246 963-0
e-mail: [email protected]
web: www.beckhoff.com

TF50x0 Version: 2.0.0 157


More Information:
www.beckhoff.com/tf5000

Beckhoff Automation GmbH & Co. KG


Hülshorstweg 20
33415 Verl
Germany
Phone: +49 5246 9630
[email protected]
www.beckhoff.com

Common questions

Powered by AI

Electronic cam plates in TwinCAT 3 require careful handling as they describe a nonlinear relationship between a master and a slave axis in a coupled axis system. Valve characteristic curves are necessary for controlling hydraulic axes, indicating a non-linear relationship between the target velocity of an NC axis and the variable output to the controlled device. Such configurations are managed under Tables in TwinCAT 3, which facilitate motion diagrams (as detailed in TE1510 | TwinCAT 3 CAM Design Tool TF5050) and valve diagrams (TE1500 | TwinCAT 3 Valve Diagram Editor) to ensure precise motion control and system efficiency .

Performing homing with digital inputs in TwinCAT 3 involves using a Drive Status Byte with 8 digital inputs to provide a signal source for the homing sensor. The process image must have an appropriate mapping for these inputs to the desired position. The digital inputs are mapped manually in the process image and differ depending on the hardware used, such as MDP703/733 hardware, which employs the terminal's direct digital inputs E1 and E2. It's essential to ensure compatibility and correct placement of inputs to accurately home an axis and maintain precision in operations .

The Minimum and Maximum Drive Output Limitation parameters in TwinCAT 3 restrict the velocity output to ensure hardware protection. The Minimum Drive Output Limitation sets a lower bound, while the Maximum Drive Output Limitation sets an upper bound for the drive's output. Both parameters provide a directional-dependent limitation of the total output, allowing control over the velocity, torque, or current output to prevent operating beyond safe limits, thereby safeguarding the hardware . The values range from -1.0 to 1.0, where 1.0 represents an unrestricted output of 100% . By constraining output within these bounds, the parameters help in avoiding mechanical overloading and excessive wear and tear on system components ."}

TwinCAT 3 supports various encoder modes that impact how encoder position values are calculated: 1. **INCREMENTAL Mode**: Requires homing to initialize the actual position. This mode doesn't rely on the absolute characteristics of the feedback system and can be used with both incremental and absolute encoders . 2. **INCREMENTAL (singleturn absolute)**: Extends the incremental mode by considering retained data from the last stored position. If a single-turn absolute encoder is used, deviations up to half an encoder revolution can be accounted for . 3. **ABSOLUTE Mode**: Suitable for multi-turn absolute encoders. It prevents overflow of position feedback, which would result in runtime errors. This mode ensures the system's position is initialized without additional homing if installed correctly . 4. **ABSOLUTE MULTITURN RANGE (with single overflow)**: Allows for a single overflow during travel and requires correct end position parameterization . 5. **ABSOLUTE SINGLETURN RANGE (with single overflow)**: Permits travel paths with overflow within one revolution and is defined by the Encoder Sub Mask . 6. **ABSOLUTE (modulo)**: Used when travel exceeds the absolute range, such as in endlessly running systems like conveyor belts. It requires activation of retain data and correct Modulo Factor parameterization for accurate position initialization . These modes, influenced by parameters like the Modulo Factor and Encoder Sub Mask, determine how the encoder values are calculated and maintained during system operation .

The Reference Velocity and Maximum Velocity parameters play crucial roles in controlling axis speed limitations in TwinCAT 3. Reference Velocity at an Output Ratio of 1.0 establishes the upper physical limit for axis velocity, ensuring the controlled velocity does not exceed a predefined maximum at that ratio. It sets a ceiling on how fast the axis can physically move, corresponding to input signals for analog control or digital commands like SoE or CoE . Maximum Velocity, however, defines a logical speed limit that setpoint generation should not exceed . Both parameters must be consistent; exceeding the Reference Velocity at 1.0 with the Maximum Velocity can result in an error, preventing velocities beyond the set limits . These parameters ensure safety by preventing hardware exceeds its designed speed, thus protecting the system from potential damage .

In TwinCAT 3, the velocity scaling parameters affect digital drive controllers by determining how the NC output value is adjusted in velocity precontrol mode using the Output Scaling Factor (Velocity). This scaling is necessary for digital controllers like CANopen DS402 to ensure accurate velocity setpoints are sent to the drive . Torque scaling parameters can be adjusted similarly, allowing for optional output scaling of torque values, which may be necessary to match the servo control requirements or compensate for dynamic model transformations . These parameters might be adjusted to ensure proper synchronization between digital setpoints and physical motion, allowing for precise control over drive behavior and protecting hardware by setting output limits . Additionally, accurate scaling helps in maintaining system stability and avoiding errors during operation ."}

In TwinCAT 3, the process image serves as a cyclical interface that connects an axis with various drive components by establishing links between the process images of the axis and the drive hardware. When the hardware is directly supported by the system, these links are configured automatically. However, challenges arise when dealing with unknown hardware because these connections must then be manually established to integrate the drive components correctly . This manual setup involves configuring the interface between NC drivers and the connected hardware, which can be complex due to ongoing developments and changes in the interface structures .

TwinCAT 3 handles different axis types, each with distinct features and significance, in its Motion Control systems. One type is the **Continuous Axis**, where drive hardware processes continuous setpoint specifications for position or velocity, utilizing digital servo drive controllers or hardware following an analog value . Another is the **Encoder Axis**, used when integrating a pure encoder system as an axis object. Encoder axes lack their own setpoint generator, meaning the setpoint matches the actual value. This axis can serve as a master in coupling but not as a slave, leading to noise in the setpoint transferred to slave axes . Finally, the **Discrete Axis (Two-Speed)** supports motors with different pole pair numbers or frequency inverters, enabling rapid and creep positioning but does not feature prominently as compared to Continuous or Encoder axes . Each type plays a key role in setting up motion systems, with Continuous and Encoder axes being more versatile and commonly applied in various configurations ."}

Time Compensation in TwinCAT 3 is crucial for precise high-precision motion control, which involves converting positions into times and vice versa with dead time compensation of the axes. This ensures accurate synchronization and positioning by compensating for delays inherent in the system . It can be configured through the Time Compensation tab either in the drive settings for the output direction or the axis encoder settings for data acquisition. Configuration involves enabling dead time compensation and selecting the mode, such as 'OFF', 'ON (with velocity)', or 'ON (with velocity and acceleration)' . Additional settings include specifying whether IO time is absolute, encoder or drive delay in cycles, and extra fixed delays due to hardware .

Unanswerable Question

You might also like