EtherCAT Slave Implement

来源:互联网 发布:审计软件优点 编辑:程序博客网 时间:2024/06/05 02:23

Basing on device requiements:

Design criteria:
1.Bus inerface to EtherCAT Network
a.Converter(from 100Base to LVDS(Low Voltage Differential Signaling))
b.Two MII(Media indepandence interface)(PHY Selection Guide)

2.ESC(EtherCAT Slave Controller) and PDI(Process Data Interface)
(1).The ESC is the controller which provides the communication interface between the EtherCAT network and the host controller or the digital I/O (if no host controller is used).
(2).SPI(serial peripheral interface) or 8/16 bit synchronous or asynchronous microcontroller interface(MCI) via parallel port
(3)DPRAM(Double Ports RAM,also call user memory) size and number of SynchManagers
a.SyscManagers ensure data consistency within the DPRAM
b.Mailbox and process data is exchanged via additional DPRAM(also call user memory)
(4).Number of Fieldbus Memory Management Units(FMMUs).In an EtherCAT network,the memory of all slaves can be compiled in the master to a logical memory.This logical memory is managed by FMMUs to map logical addresses to physical addresses in the slaves.
(5).Distrbuted Clocks(DCs,) for synchronization with other slave devices.

3.EEPROM
Ther EEPROM is mounted outside the ESC and connected via IIC with the point to point link(chapter11.3)

4.Application Controller(Host Controller,uC)
To adapt the application software on the host controller to the ESC,sample software software stacks(样本软件栈) are available for communication implementation e.g. the Slave Sample Code(SCC,从站样本代码).If the Device is a 32 bit digital I/O interface,no application controller or additional communication software is neccessary.
The following features are a typival configuration(referring to the Slave Sample Code):
a.EtherCAT State Machine(ESM),including error handling
b.Device diagnosis
c.Master-Slave data synchronization with SyncManager event(no DCs)
d.Mailbox CoE
e.Object Dictionary(20 objects) for process data objects
f.CoE services,including CoE Info services,no segmented transfer

5.Application Layer Communication Protocols
a.CoE:Can application protocol(总线应用协议) over EtherCAT
b.SoE:Servo drive profile(伺服驱动配置文件) over EtherCAT
c.EoE:Ethernet over EtherCAT
d.FoE:File Access over EtherCAT
f.AoE:ADS over EtherCAT

CoE implementation is shown below.

6.Device Profiles
Parameter need to set up,during network initialization.For devices with variable process data structure,the definition of a modular device description(MDP,模块化描述) is available.The MDP is based on the object dictinary defined by CoE.The object dictionary can be describer as a two dimensional list(二维表).Each list entry is identified by an index(0x0000-0xFFFF)which represents an object.Each Object can contain up to 255 sublindices(分目录),also call object entries.
The idea of MDP is to provide a basic structure for masters and configuration tools to handle slaves with complex(modular) structure easily.
Modular Device Profile Structure
Consider an MDP for a line of slave device modules which are connected together on a backbone layer(主干网层面) via LVDS and via a coupler(耦合器) with MII.Figure below shows a schema how to define device profiles such that a modular profile dectionary is set up for the slave device line.
7.Synchrinization with other Devices
EtherCAT provides three different type of synchronization methods.
a.Freerun
The slave device application runs independently of the EtherCAT cycle and is triggered by a loval timer in the ESC
b.Synchonous with ftame reception(Synchronization with SyncManager event)
The slave device application is triggered when new process data is received.The synchronization accuracy depends in the jitter of the message reception(信息接收的跳动) and the delay between the other network nodes(网络节点间的延迟)
c.Distributed Clocks(DC,Synchronization with SYNC0/SYNC1 event)(分布式时钟)
The ESCs contain a nanosecond(纳秒) based timer(DC timer) to provide precise synchronization and time stamping(时间标记).The slave device application is triggered with an additional interrupt signal,which is based on th DC time and is produced by the ESC.Every DC timer in the network is aligned to a master DC clock and provides a high precise synchronization.
(1)Definition of Reference Clock(RC)
a.Measurement/Calculation of the propagation delay time(传播延迟)
b.Drift compensation(漂移补偿)
c.Offset compensation(偏移补偿 )
(2)Interrupt signal
After establishment of DC by the master,the ESC generates fixed time interrupt signals to the PDI,i.e,the uC.Thus,the slave is able to create a constant period.There are following three types of generation of interrupt signals.
-SYNC/LATCH0
-SYNC/LATCH1
IRO(Interrupt occurs by generation of SYNC0/SYMC1 and mask register setting)

7.Tools for EtherCAT Slave Development
Following lists tools that maybe useful for EtherCAT device development.
(1)EtherCAT Configurator:Configurator for loading XML device descriptions(ESI) and for generating XML network configuration description(ENI).Several EtherCAT Masters already include an EtherCAT Configuration Tool.
–Visit the product section of the ETG website for the variety of configuration tools.
–For example, a 30-day trial software is provided by Beckhoff Automation GmbH(ET9000).For development purposes,an EtherCAT configuration tool with master(TwinCAT System Manager) is delivered with the Beckhoff Evaluation Board.
(2)XML Editor:Used to edit or view EtherCAT slave information(ESI) files.Any browser or text editor can be used,for example:
–Altova XML Soy
–Peter’s XML editor
–XML Notepad
(3)Hex File Editor:Used to convert bitmap images(vendors or device logos) to a hex value which is needed in the ESI.Any hex editor is fine.here are two examples:
–HxD
–Mirkwa TinyHexer
(4)Network Monitor:Wireshark(former Ethereal) can be used to monitor frame commucation of EtherCAT net works.
Further Tools:Also consult the product section of the ETG website for a continuative list of tools.