EtherCAT Training PDF
EtherCAT Training PDF
EtherCAT Training PDF
EtherCAT
1. General EtherCAT
o o o o o o Features Sync Unit Frames Working Counter Topology Redundant System 7 2
2.
EtherCAT Master
o o o o o o Topology EtherCAT State State Machine Addressing FrameState DevState
3.
EtherCAT Coupler
o o o CRC Port Status Working Counter
22
4.
EtherCAT Terminal
o
o
29
5. 6.
7. 8.
67 68
Sync Unit
four independent modules (a module defines a set of process data which is consistent and synchronized) combination of data from different slaves (validity of data is important) cyclic process data diagnosis for each sync unit if process data in one sync unit is invalid: separate reaction of control application can be defined for Multi-Task-Operation: each Task has own Sync-Unit/Frame (read/write process data in different task cycles) reduces bus load! Useful for applications with machine parts which can be out of order (planned or unplanned) and the rest of the machine should work. Sync Units help to structure these applications granularity depends on EtherCAT Slaves each EtherCAT Slave defines one or more process data areas which can be exchanged synchronous and consistent The number of independent process data areas depends on the implementation and resources of the EtherCAT Slave Controller (Sync Manager and FMMU channels)
EtherCAT Training
Master Settings
Master Configuration Online: Scan Devices Select EtherCAT Device Offline: Insert EtherCAT Master Device Select and configure network adapter Slaves Configuration Startup Data CANopen over EtherCAT, CoE File over EtherCAT, FoE Firmware Update (Bootstrap)
Slave Settings
Slave Configuration
FrameStates and FrameWcStates Device State Emergency Scan Only in Config Mode available! Checks Network and looks for Slaves Scans the network slave by slave! Flat List of found Slave (no topology) Includes Link Information
Frames
Task with I/O = one Ethernet frame = one to 15 datagrams (one Ethernet frames transports up to 1480 bytes) If more than 15 datagrams necessary new frame with same timing If more than 1480 bytes new frame with same timing
Default: up to 4 tasks with own I/O - If more than 4 frames necessary all low prio I/Os in one (or more) frames with the timing of the low prio task
Every Ethernet frame has a Frame Check Sequence (FCS) FCS has a 16bit CRC frames can be destroyed or damaged while running through the network EtherCAT Master sums CRC errors in master and in every slave CRC errors result from - cabling errors - contact problems - loose contacts - not fixed connectors
EtherCAT Training
Working Counter
Each EtherCAT Telegram ends with a 16 bit Working Counter. Each Slave Controller which successfully process the EtherCAT command (read/write), increases the Working Counter. The Master compares the received Working Counter with the calculated data, it allows the system to determine if the command could be successfully execute.
EtherCAT Training
Topology
Startopologywith RealTime
EK1122
EtherCAT Training
Redundant System
- requires optional TwinCAT software normal setup
redundant setup
If one station is disconnected, powered down or is missing, all remaining stations will still be communicating
Advanced Settings
EtherCAT Master - Advanced Setting Stay at PREOP until sync task is started: In this case EtherCAT is waiting in PREOP with the switching to OP until the triggering task is running (possibly the PLCBootproject). This should be the default setting and usually helps to avoid startup problems.
EtherCAT Training
EtherCAT - Topology
EtherCAT CAN over EtherCAT Profibus over EtherCAT graphically view to all slaves in right topology all diagnostic information directly in one view uses ADS Interface detailled information on click ActiveX control: can also be used in your application
Online
EtherCAT Training
EtherCAT State
EtherCAT Training
Example:
F10 Machine
Layout
10
EtherCAT Training
EtherCAT State Machine
EtherCAT Master Net Id + Port (0xFFFF for Master, Slave Address for Slave) + Index Group + Index Offset = Complete Access
11
EtherCAT Training
Master Interface
ADS Port 65535 (0xFFFF) 0x1 - 0xFFFE (fixed address of a slave device) Meaning General Ads services handled by the master directly. This is an ADS service directed at an individual slave device. The port number is the same as the EtherCAT address of the slave device.
12
EtherCAT Training
Online - Additional Debug Information
13
EtherCAT Training
In every cycle, synchronous with the cycle
- Working Counter checks the reading and/or writing of process data reaction must be done in the application
14
EtherCAT Training
Online - Physical Address
15
EtherCAT Training
Online - Physical Address
Online - AmsNetId
16
EtherCAT Training
Online - AmsNetId
17
EtherCAT Training
InfoData CfgSlaveCount (Configured Slave Count) Actual Slave Count (read)
Every active" slave does count: Passive" slaves and KLs dont count:
EK1100, EK1110, BK1120 EL 1xxx/2xxx/3xxx/4xxx/5xxx/6xxx/9xxx (with diagnostics; like EL9x10) EL 9xxx (without diagnostics, like EL9x00) KLs on the BK1120!
InfoData process images are not updated in every cycle - Update on event/change - Mappable variables - i.e. map NetIds instead of using them directly!
18
EtherCAT Training
Inputs - FrmXState (Frame X State)
Bit 0 (0x0001) 1 (0x0002) 2 (0x0004) .. 14 (0x4000) 15 (0x8000) 15. EtherCAT command not sent complete frame not sent Meaning 1. EtherCAT command not sent 2. EtherCAT command not sent 3. EtherCAT command not sent
Frame Number
19
EtherCAT Training
Inputs - DevState
Bit 0 (0x0001) 1 (0x0002) 2 (0x0004) 3 (0x0008) 4 (0x0010) 5 (0x0020) 6 (0x0040) 7 (0x0080) 8 (0x0100) 9 (0x0200) 10 (0x0400) 11 (0x0800) 12 (0x1000) Meaning Link error detected. I/O locked after link error (I/O reset required) Link error (redundancy adapter) Missing one frame (redundancy mode) Out of send resources (I/O reset required) Watchdog triggered Ethernet driver (miniport) not found I/O reset active At least one device in 'INIT' state At least one device in 'PRE-OP' state At least one device in 'SAFE-OP' state At least one device indicates an error state DC not in sync (DC = distributed clocks)
1 (0x0002)
2 (0x0004)
14 (0x4000) 15 (0x8000) 0x4000 = prevent 15. EtherCAT command from sending (request NOP) Prevent complete frame from sending
20
EtherCAT Training
Output - FrmXWcCtrl (Frame X Watchdog Control)
Bit 0 (0x0001) 1 (0x0002) Meaning 0x0001 = copy data with wrong working counter of 1. EtherCAT command 0x0002 = copy data with wrong working counter of 2. EtherCAT command 0x0004 = copy data with wrong working counter of 4. EtherCAT command
2 (0x0004)
14 (0x4000) 0x4000 = copy data with wrong working counter of 15. EtherCAT command copy data with wrong working counter for all commands
15 (0x8000)
Master Identity
21
Auto Inc Addr: The Auto Increment Address of the EtherCAT slave device. Auto-increment addressing can be used to address each slave device via its physical position in the communication ring. Auto-increment addressing is used during the start-up phase, during which the master assigns the EtherCAT Address to the slaves. The first slave in the ring has an address of 0 and for each following the addresses is decremented (0xFFFF(-1), 0xFFFE(-2) etc.). EtherCAT Addr: The fixed Address of the EtherCAT slave device. This address is set by the master during the start-up phase. To change the default value you have to check the box left to the address.
Advanced settings
Default:
Check of Vendor Id (Beckhoff: 2) Check of Product Code (see below) Dont check Revision Number (example EL3142-0000-0000) If mismatch found, VendorProductRevisionSerial error will be displayed. Vendor ID Baumueller Beckhoff MTS 0x15a (346) 0x02 (2) 0x40 (64)
22
EtherCAT Training
InfoData - State
Bit 0x___1 0x___2 0x___3 0x___4 0x___8 0x0010 0x0020 0x0100 0x0200 0x0400 0x0800 0x1000 0x2000 0x4000 0x8000 Meaning Slave in 'INIT' state Slave in 'PREOP' state Slave in 'BOOT' state Slave in 'SAFEOP' state Slave in 'OP' state Slave signals error Invalid vendorId, productCode... read Slave not present Slave signals link error Slave signals missing link Slave signals unexpected link Communication port A Communication port B Communication port C Communication port D
23
EtherCAT Training
Online - CRC
CRC:
0 0, 0 0, 0, 0 0, 0, 0, 0
24
EtherCAT Training
Port Status
Carrier / Open No Carrier / Closed Incoming EtherCAT frame (left) and outgoing frame (right) Last EtherCAT terminal (no terminal on port B, right)
25
EtherCAT Training
Working Counter - WC
SlaveDiagnosis WcState: Variable of Type BOOL Shows Working Counter State from one EtherCAT Slave 0 (FALSE) = valid Working Counter 1 1 (TRUE) = invalid Working Counter
An invalid Working Counter State means that one EtherCAT Command for updating the Inputs and Outputs has an incorrect WC. With this EtherCAT Command more than one Slave can be addressed. (Every Slave in this command has the same WC 1.) Check the Slave State to see which Slave is responsible for the Working Counter error.
26
EtherCAT Training
EtherCAT command
Meaning APRD NPRD LRD BRD APWR NPWR LWR BWR LRW ARMW Auto Increment Physical Read Node-Addressed Physical Read Logical Read Broadcast Read Auto Increment Physical Write Node-Addressed Physical Write Logical Write Broadcast Write Logical Read Write Auto Increment Physical Read Multiple Write
27
EtherCAT Training
Configuration example with Profibus and CAN with 3 Trigger (additional) Tasks
Tasks
Task
FAST Profibus
to trigger
EtherCAT I/O Profibus I/O
Cycle Time
0.25ms 2ms
Frame
Frame 0 Frame 1
Priority
0 1
CAN
CAN I/O
10ms
Frame 2
CAN
Profibus EtherCAT
28
EtherCAT Training
4. EtherCAT Terminals
Startup Parameter list; example for EL3142
29
EtherCAT Training
InfoData - State (see EK1100 State)
If EL9011 is used, the terminal before will always report State = 0x0008, whether the EL9011 is plugged in or not. If EL9010 is used, the terminal before will report State = 0x0008 when EL9010 is plugged in and State = 0x2408 when EL9010 is not plugged in! (On the EL9010 6 gold contacts PIN 3 and 5 resp. 4 and 6 are internally connected.)
30
EtherCAT Training
Other fieldbusses
Example
31
EtherCAT Training
Profibus Master Terminal EL6731
EL6731 Profibus Master Process Data
Startup Parameter
32
EtherCAT Training
33
EtherCAT Training
CAN Master Terminal EL6751
EtherCAT Process Data and CAN settings below (See FC510x Documentation)
Software Version
34
FB_EcCoeSdoWrite
Name FB_EcSoeRead
Meaning Read Parameter via "Servo Drive Profile over EtherCAT (SoE) (Mailbox communication necessary!) Write Parameter via "Servo Drive Profile over EtherCAT (SoE)
FB_EcSoeWrite
35
EtherCAT Training
Meaning Read CRC-Error Counter from all Slaves Read EtherCAT Addresses from all Slaves Read State and Link State from all Slaves
Meaning Get State from Master Get Number of Slaves from Master Get CRC-Error Counter from one single Slave (for all single Ports A, B, C) Get CANopen Identity from one single Slave Get EtherCAT State and Link State from one single Slave Request a new EtherCAT State for one single Slave Get list of all configured EtherCAT Slaves Get list of all scanned (real existing) EtherCAT Slaves
36
EtherCAT Training
Meaning Opens a FileOverEtherCAT (FoE) connection Gives access to FoE connection Closes a FoE connection Loads a file over a FoE connection
37
EtherCAT Training
PLC Functionblocks Example
38
EtherCAT Training
39