Professional Documents
Culture Documents
and Beckhoff NC
Contents
Page 1 of 33
Application Report No. 200.4.15
GI-PAS EL
• This Application Report provides commissioning instructions for using a 94xx Highline
servo inverter technology application (TA) CiA 402 with EtherCAT communication along
with a guide to integration into the Beckhoff NC environment.
• It describes the procedures to be followed in the Lenze Engineer and Beckhoff TwinCAT
software programs in order to commission such a system.
• This Application Report contains an example program for the Beckhoff PLC which is
available for download from the Lenze homepage www.lenze.com.
EtherCat
Important note:
The software is supplied to the user as described in this document. All risks resulting from its quality or use
remain the responsibility of the user. Users must take appropriate precautions to protect against
maloperation.
We do not take any liability for direct or indirect damage, e.g. profit loss, order loss or any loss regarding
business.
2009
No part of this document may be reproduced or distributed to third parties without the express written
permission of Lenze Automation GmbH.
The greatest care has been taken in compiling the information in this documentation and checking it
against the hardware and software described here. Nevertheless, deviations cannot be ruled out
completely. We do not assume any legal responsibility or liability for damage that may arise from its use.
Necessary corrections will be introduced in subsequent editions.
All trade names in this documentation are trademarks belonging to the related owners
Page 2 of 33
Application Report No. 200.4.15
GI-PAS EL
2. Introduction
This report is intended to explain, with the help of an example, how a Lenze 94xx Highline servo
inverter with TA CiA402 can be commissioned or operated in conjunction with EtherCAT and a
Beckhoff TwinCAT NC.
The reports begins with a description of the configuration requirements on the Lenze 94xx to
enable communication with EtherCAT. It then goes on to give a detailed description of how to
carry out the configuration in the Beckhoff System Manager and how to access data, before
concluding with a description of the TwinCAT NC example program.
The EtherCAT fieldbus system is standardised by the EtherCAT user organisation (ETG). The driving
force behind this is the company Beckhoff. Due to the advanced Ethernet technology used for
EtherCAT, in future, customers can change from other fieldbus systems to EtherCAT or generally
equip new plant models with EtherCAT. EtherCAT is a closed Ethernet system and uses a ring
topology.
The maximum cable length for Ethernet-based fieldbus systems is 100m between two nodes. The
baud rate is 100 Mbit/s.
The EtherCAT E94AYCET communication module supports a baud rate of 100 Mbit/s, is electrically
isolated from EtherCAT and can be externally supplied with 24 V. A maximum of 32 process data
words can be exchanged with the module and the 94xx Highline. In addition, the module is
equipped with an optional parameter channel according to CoE (CAN over EtherCAT) EtherCAT
specification.
Page 3 of 33
Application Report No. 200.4.15
GI-PAS EL
The CiA402 device profile describes predefined functions and modes of variable-speed drives. The
individual process data for the modes are exactly defined. Standardised indices are used for the
parameter setting of the axis and the bus configuration (PDO mapping). The following illustration
shows the CiA 402 modes supported by the Lenze 94xx axis.
• Homing mode
• Interpolated position mode
• Cyclic synchronous position mode (IEC-61800-7)
with additional speed and torque offset (option)
• Cyclic synchronous velocity mode (IEC-61800-7)
with additional speed offset (option)
• Cyclic synchronous torque mode (IEC-61800-7)
with additional torque offset (option)
Page 4 of 33
Application Report No. 200.4.15
GI-PAS EL
For each mode there is a separate dialog available in the Lenze engineering software.
The following dialogs show the PLC setpoints on the left-hand side and the actual values of the
drive on the right-hand side.
The "Interpolated position mode" and the "Cyclic synchronous position mode" only differ in the
PDO mapping variables available. The functions of the modes are exactly the same.
For more detailed information on TA CiA402, please see the Lenze documentation.
3. Components
Lenze hardware
9400 Highline, FW 07.00 or higher
EtherCAT communication module, FW 2.0 or higher
Lenze software
Lenze Engineer Highlevel version 2.10.2 (SP2) or higher
Beckhoff TwinCAT
TwinCAT V 2.11 (build 1539) and System Manager V 2.11.0 (build 1534)
Page 5 of 33
Application Report No. 200.4.15
GI-PAS EL
4. Configuration notes for Lenze Engineer and 94xx Highline TA CiA 402
Page 6 of 33
Application Report No. 200.4.15
GI-PAS EL
4 Enter a project name and choose a storage location for the project.
Click Complete.
5 The Start-up wizard: insert component opens automatically. Go to In this case, a 94xx
the Controller tab, select a 94xx Highline and enter a controller Highline with FV
name. 7.0 has been
selected.
The controller
firmware version is
indicated in the
pull-out clip behind
the keypad slot of
the controller.
Page 7 of 33
Application Report No. 200.4.15
GI-PAS EL
6 You now need to decide which modules are to be inserted into The firmware
which slots. version of the plug-
in modules is
indicated on the
right outside edge.
Click OK to confirm.
7 After inserting the EtherCAT communication module, the following TA CiA 402 requires
dialog appears. at least memory
module MM220.
Memory and safety modules are assigned in the same way. Click
Next to confirm.
Page 8 of 33
Application Report No. 200.4.15
GI-PAS EL
Page 9 of 33
Application Report No. 200.4.15
GI-PAS EL
Click Complete.
12 The axis entered will now appear as follows in the project tree.
Page 10 of 33
Application Report No. 200.4.15
GI-PAS EL
In the following, the settings to be selected for TA CiA 402 in conjunction with the Beckhoff NC
will be described.
The entire process data mapping (meaning of the individual process data) and the CiA 402 mode
to be used for axis operation is configured in the EtherCAT master!
Page 11 of 33
Application Report No. 200.4.15
GI-PAS EL
Page 12 of 33
Application Report No. 200.4.15
GI-PAS EL
The Lenze EtherCAT offers a range of display codes which can be used for diagnostics purposes.
The most important of these are described below.
Page 13 of 33
Application Report No. 200.4.15
GI-PAS EL
A TwinCAT project consists of two components. The TwinCAT System Manager is used to create a
configuration that represents the structure of the automation system. The configuration is stored
in a configuration file (ending xxx.tsm). The TWIN CAT Control software is used to programme a
PLC project which can subsequently be imported into the System Manager.
EtherCAT
Page 14 of 33
Application Report No. 200.4.15
GI-PAS EL
5.1. Configuring the Beckhoff NC with Lenze EtherCAT and TA CiA 402
5 In the example, the EtherCAT master shall use the on-board Beckhoff only
Ethernet connection of the PC. Therefore, an EtherCAT master in guarantees the real
direct mode has been selected. time of an
EtherCAT master if
an on-board
Ethernet interface
of a motherboard
with Intel chipset is
used.
Page 15 of 33
Application Report No. 200.4.15
GI-PAS EL
6 Under the Adapter => compatible Devices tab, you can see which
Ethernet interface can be used as EtherCAT master. Select the
EtherCAT interface.
7 Use the menu Actions => Choose Target System or F8 to select the
target system.
8 When the physical EtherCAT connection to the Lenze EtherCAT An online bus scan
module has been established, you can select Scan Boxes to carry is only possible in
out an online bus scan. the Config mode of
the System
Manager! The
Config mode is
selected via the
following icon
in the System
Manager.
Page 16 of 33
Application Report No. 200.4.15
GI-PAS EL
10 If a CiA 402-conform axis has been found, the following dialog will
appear:
12 As you can see in screen shot 11, the TA CiA402 axis has been For a detailed list of
loaded with Cyclic Synchronous Position Mode and the the CiA 402 modes
corresponding process variables. The process variables are stored and the
under the index corresponding
I-1602 and I-1A02. This can be changed through the PDO process variables,
Assignment by the user depending on the CiA402 mode you want please see the
to use. document default
PDO Mapping xml
file.pdf
In the PDO List you can find the predesigned PDO configurations.
Each PDO configuration is stored under a different index I-1600 to
I1609 and I-1A00 to I-1A09. You can only select one PDO
configuration for RPDO and TPO!
Page 17 of 33
Application Report No. 200.4.15
GI-PAS EL
13 In the example, the following variables have been assigned to the drive in the NC axis:
In the Startup tab, you can see the whole PDO mapping sent to the
slave when the master is started.
Page 18 of 33
Application Report No. 200.4.15
GI-PAS EL
Page 19 of 33
Application Report No. 200.4.15
GI-PAS EL
20 The System Manager does not automatically assign the variables The CiA 402 mode
Mode of Operation and Mode of Operation Display to the NC. is selected via
When using these variables, use the global variables of the PLC Mode of Operation
program and assign the variables manually to the PLC program. and the current CiA
402 mode of the
axis is indicated via
Mode of Operation
Display.
21 For the Lenze CiA402 axis, the mode NEEDS TO BE set via EtherCAT!
This can be done in two different ways: either via the process
variable Mode of Operation or via the CiA 402 index I-6060. The
index can either be set via the CoE parameter channel from the PLC
program or you can insert it in the Startup tab for the EtherCAT
slave.
If the Mode of Operation is set via the index
I-6060, there must be no Mode of Operation process variable
available. Otherwise, this variable would overwrite the value!
Page 20 of 33
Application Report No. 200.4.15
GI-PAS EL
22 In the Startup tab, you can also add additional codes which you The index list in the
want to sent to the slave when the EtherCAT master is started. Click screen shot shows
the right mouse button => context menu => Insert or New to add the PDO mapping
new Startup codes. sent to the slave
when the master is
started.
23 The following dialog contains a list of all CiA 402 indices available
in the Lenze 94xx TA.
24 In the box framed red you can find the Lenze codes.
Page 21 of 33
Application Report No. 200.4.15
GI-PAS EL
25 If you wish to create additional Lenze codes in the Startup dialog,
select the following settings in the Edit CANopen Startup Entry
dialog.
Enter the index using the Lenze formula 24575 – Lenze code and
conversion into hex. Select the subindex and enter the data to be
written in a binary formula into the corresponding data field. In this
case, the value 256 dec (0x00000100) was written to the Lenze
code L-C0011 (24575 – 11 = 24564dex => 0x5FF4).
Page 22 of 33
Application Report No. 200.4.15
GI-PAS EL
29 Enter the scaling factor 0.00228881835937 from chapter 4.2, step The scaling factor
2 in the Parameter tab of the Axis 1_Enc. contains a point
and no comma!
Click Download to
transfer changes in
the Parameter tab
to the NC!
30 To check whether the selected TwinCAT configurations are correct, In the Free Run
activate the configuration in the Free Run mode. mode, the EtherCAT
master runs
For this, check the configuration , activate the configuration
without PLC
and restart the configuration in the Free RUN mode.
program in the
background.
31 After this, download the configuration to the EtherCAT master and
restart the EtherCAT system through the master.
Page 23 of 33
Application Report No. 200.4.15
GI-PAS EL
32 The Online NC user interfaces will now appear online and you can The actual position
work with them. of the axis is
displayed in the red
window.
35 Click Set in the Online NC user interface to enable the axis. Then
click All in the Set Enabling dialog to set all enable bits required.
Page 24 of 33
Application Report No. 200.4.15
GI-PAS EL
36 When the axis has enabled successfully, this will be indicated by To enable the axis,
the bit Ready in the Online dialog. the NC sends the
value 0x31 as
Controlword to the
drive.
Page 25 of 33
Application Report No. 200.4.15
GI-PAS EL
40 In the Functions tab, different start modes, e.g. Absolute position, The different start
can be selected for traversing. For this, a target position and a modes are also
target velocity need to be selected. Click Start to start absolute available as Motion
positioning. FB in the Beckhoff
PLC environment.
Page 26 of 33
Application Report No. 200.4.15
GI-PAS EL
41 Each NC axis has a fixed variable structure for being transferred to From the NC to the
the PLC program. These variables are used in the PLC program. The PLC, the structure is
Beckhoff Motion library is available for this. called
Axis_1_To_PLC and
from the PLC to the
NC
Axis_1_FromPLC
These instructions are based on the Beckhoff PLC example TcNcsample PTPmoveV2_01.exe.
The example is available on the Beckhoff homepage.
Page 27 of 33
Application Report No. 200.4.15
GI-PAS EL
7 The MAIN PRG contains a small program code for traversing the
axis. The axis shall travel forward and backward between 0 and
2000 mm.
Page 28 of 33
Application Report No. 200.4.15
GI-PAS EL
8 Use the MoveAxis POU to traverse the axis. The POU is enabled via
the Execute input and also gets the Target position and Velocity
from this input. Here, the variable structure NcToPlc is needed
again.
9 Save and compile the project and load it into the target system.
10 Go to the System Manager and click the right mouse button to
append a PLC program.
Now you can assign the PLC variable structure NcToPLC to the NC
axis. Repeat this for the variable structure NcFromPLC.
12 After this, restart the System Manager configuration.
13 When the system is in the Run mode and the PLC program has been
started, enable the Lenze CiA402 drive via the variable
bLenzeEnable, bLenzeEnablePositive and bLenzeEnableNegative.
Page 29 of 33
Application Report No. 200.4.15
GI-PAS EL
Beckhoff TwinCAT
PLC Control NC
Index 0x607A
Index 0x607A
Page 30 of 33
Application Report No. 200.4.15
GI-PAS EL
1. With the DC synchronisation, process data acceptance can be synchronised for all slaves.
2. In addition, it is possible to synchronise the controller cycle of the 94xx servo inverter. This is
particularly useful for synchronous operation.
With EtherCAT, the synchronicity between the fieldbus communication and the connected slaves
is not as usual transmitted via the fieldbus, but each slave has its own internal 'clock' for this. One
slave in the network acts as the so-called 'master clock' and the clocks of the other slaves are
adapted to it with the runtimes on the bus being considered. In this way, the internal clock
ensures the synchronous process data acceptance for each slave. The clocks are cyclically re-
adjusted during bus operation.
Page 31 of 33
Application Report No. 200.4.15
GI-PAS EL
9. Wireshark bus analyser with TwinCAT
Page 32 of 33
Application Report No. 200.4.15
GI-PAS EL
7 After completion of the analysis, the recorded telegrams are listed. LWR = Write data
In the example, only the telegrams of the source dell_9F:ab:4c are from master to
of interest. slave
LRD= Read data
from slave to
master
In the user data, you can see the 6 process data bytes in both
directions.
8 Note:
Exact EtherCAT bus analyses can only be carried out with an additional hardware
component from Beckhoff (ET2000).
Page 33 of 33