2008 Rostan Edited
2008 Rostan Edited
This paper discusses the requirements on such gateways from the application and
from the device vendor point of view. Besides CANopen gateways, the special re-
quirements of generic CAN to EtherCAT gateways as used e.g. in automotive test bed
applications are considered. It is shown that CANopen protocols can be used to con-
figure the gateway also from the EtherCAT side. Example implementations and their
representation in software tools are shown as well as application examples. It is also
shown that such gateways enable a smooth migration path from CANopen devices
towards Industrial Ethernet.
02-1
iCC 2008 CAN in Automation
non real time tasks such as data acquisi- CANopen to EtherCAT gateway
tion, remote configuration and diagnosis.
CANopen networks are used in a very
broad range of application fields such as
machine control, medical devices, off-road
and rail vehicles, maritime electronics,
building automation as well as power gen-
eration. When considering CANopen to
EtherCAT gateways, the following
CANopen device classification may help to
sort the applications:
Fieldbus devices such as I/O-blocks,
drives, sensors, actuators, valves etc.
which typically are also available with
other common fieldbus interfaces. Here
the CANopen to EtherCAT gateway pre-
Figure 1: Hierarchical Control Architecture
dominantly serves the purpose of integrat-
The system architecture and thus the re- ing such CANopen devices which are not
quirements for gateways change with the yet available with EtherCAT interface.
arrival of real time Ethernet technologies Embedded devices such as small em-
such as EtherCAT (see figure 2). Now the bedded controllers, custom made sensor
Ethernet based system does not only interfaces, specialized hardware compo-
reach the real time characteristics (such nents for machine control used in conjunc-
as reaction and cycle time) of the CAN tion with general purpose fieldbus devices.
based network, but exceeds these per- For special purpose control subsystems –
formance parameters substantially. At the often they include the machine builders
same time EtherCAT overcomes one of dedicated process know how – CANopen
the main constraints of CAN: limited net- so far has been the network of choice,
work extension particular at high baud since the CAN hardware is simple to inte-
rates. grate and CANopen provides the interop-
And since EtherCAT interfaces can also erability. While EtherCAT has similar fea-
be implemented at low costs, the applica- tures and will thus further expand in this
tion range of the Ethernet technology is environment, gateways here are very use-
enhanced towards and beyond the field- ful since one tries to avoid the re-design of
bus level, reaching the embedded system such special hardware if possible even if
level. CANopen is replaced by EtherCAT as
main control network.
Deeply embedded devices in vehicles,
medical devices etc, where no standard
“off the shelf” devices can be used. In con-
junction with such systems gateways are
typically used to enable the classical hier-
archical architecture: local, widely inde-
pendent networks have to be connected to
supervisory or management levels
equipped with EtherCAT. However, Eth-
Figure 2: Flat Control Architecture erCAT is already used as backplane bus
systems and hence in deeply embedded
The real time domain is no longer con- applications. And since EtherCAT slave
cluded in the CAN network, but spans controllers are also available with ex-
across the network technologies. The re- tended temperature ranges, this network is
quirements on the gateways change ac- also beginning to even enter deeply em-
cordingly, since CAN networks are now bedded systems with rigid environmental
used as local extensions of the real time requirements such as mobile machines.
EtherCAT system.
02-2
iCC 2008 CAN in Automation
EtherCAT master
EtherCAT/CAN gateway
evaluate TX
input message
data buffer
CAN
message CAN
handler
EtherCAT frame
create RX ECU 1 ECU n
output message
data buffer
The gateway has to be designed, inte- While transmitting the data of the received
grated and configured in such a way that CAN frames over EtherCAT the reception
no CAN frames are lost. For the reception time of the CAN frame is lost. If this timing
of the CAN frames this means that the information is valuable – in the general
message buffer inside the gateway has to case it is – the Gateway has to provide a
be large enough to store all CAN frames reception time stamp for each received
received within one EtherCAT cycle. CAN frame.
For timing considerations we assume the The send throughput of course also de-
following boundary conditions. The CAN pends of the chosen buffer size. The CAN
bus is operated at 1 Mbit/s. The transmis- data first has to be extracted from the Eth-
sion of a CAN message with one byte erCAT frame. The associated CAN frame
takes about 55µs. If one assumes an Eth- can only be sent once the CAN bus is
erCAT cycle time of 1000µs, in worst case available (bus idle). Therefore a send
18 CAN frames can be received within this buffer is also required. For emptying this
period of time. So the receive buffer at buffer (the CAN send process) the gate-
least has to be able to handle this number way has to provide means to avoid mes-
of CAN frames. sage bursts and thus high bus loads. This
is in particular important at higher CAN bit
Furthermore, within one EtherCAT Frame
rates, since the message burst may ex-
the content of at least of 18 CAN frames
ceed the frame handling capabilities (inter-
has to be transmitted to the EtherCAT
rupt load) of the connected CAN devices.
master, since otherwise a
buffer overflow may occur if
the CAN busload is close to
100% over several cycles.
Accordingly, Table 1 shows
the buffer size requirements
for CAN with 1 Mbit/s and messages with
Figure 4: cyclic CAN frame burst
one data byte.
A burst as shown in figure 4 would occur
in each EtherCAT cycle if the EtherCAT
02-4
iCC 2008 CAN in Automation
frame transports the data of more than mented inside the gateway. The gateway
one CAN frame. Since with longer Ether- then translates the signals into CAN
CAT cycles this behavior is more likely to frames respective interprets received CAN
become problematic, the gateway should frames based on this configuration. Fur-
be able to insert gaps in between the CAN thermore, for data consistency reasons all
frames that it sends. data received within one CAN frame has
to be transported within one EtherCAT
frame, which can be difficult to ensure with
this methodology if the CAN higher layer
protocol is unknown. So while this ap-
proach is simple from the application point
of view, it only works if the CAN protocol
stack is well defined and implemented
inside the Gateway.
Figure 5: Gaps inserted in the send frame se-
quence Therefore the message based approach is
preferable for generic CAN / EtherCAT
In case such gaps are inserted in between gateways while the process data or signal
the Send- Frames it may happen that not oriented approach suits the requirements
all CAN frames can be sent within one in CANopen to EtherCAT gateways better.
EtherCAT cycle. This may also occur if the
CAN bus is busy with higher priority
frames so that the gateways does not get
sufficient bus access with CAN frames of
lower priority. Therefore in send direction
there has to be a flow control mechanism
in order to ensure that there is no buffer
overflow with associated send frame loss.
02-5
iCC 2008 CAN in Automation
The gateway either provides the CAN Both gateway approaches (CAN and
frame queues towards EtherCAT CANopen to EtherCAT) have been
(message gateway, object dictionary implemented e.g. in the Beckhoff
layout see table 2) or represents a number EtherCAT Gateway terminal EL 6751 (see
of CANopen devices (process data picture 3). Its CANopen functionality
gateway, see table 3). It is typically corresponds to the Beckhoff PCI master
configured from the EtherCAT side using card FC5101. It is either available as
the CoE (CANopen over EtherCAT) CANopen master or slave device. The
protocol with the modular device profile master version also supports generic CAN
approach. This versatile profiling model together with message timestamping,
was developed by the EtherCAT flexible bit timing, extended message
Technology Group. It allows one to queues and filter functionality.
configure devices which have a dynamic
parameter set (object dictionary) by writing
the expected module configuration at boot-
up. Alternatively it can be generated
automatically after power-on.
Furthermore, the modular device profile
gives transparent process data and
parameter access to underlying modules
such as the devices connected via
gateway. Details regarding the modular
device profile can be found in [12].
Table 2: Object Dictionary Layout for CAN to
EtherCAT Gateway (message gateway)
face challenges regarding transparency, [8] H. Ekiz, A. Kutlu, M.D. Baba, E.T. Powner:
performance, simple configuration, costs “Design and Implementation of a
and of course standardized uniform CAN/Ethernet Bridge”, Proceedings of the 3rd
software interfaces. It makes sense to International CAN Conference, pp. 11/17-
11/26, 1-2 October 1996, Paris, France
distinguish between the CAN and
CANopen gateway requirements, since [9] H. Ekiz, A. Kutlu, M.D. Baba, E.T. Powner,
"Performance Analysis of a CAN / Ethernet
they lead to different architectural
Bridge", IEEE SICON, 97 Conference, pp. 71-
approaches. A generic CAN gateway, for
85, 14-17 April 1997, Singapore
which the CAN higher layer protocol is a
[10] CiA309 draft standard series: “Interfacing
priori unknown, a message based
CANopen with TCP/IP”, CAN in Automation
approach fits best. For a CANopen e.V.
gateway, one can implement the protocol
[11] H. Zeltwanger: “Embedded and deeply em-
stack in the gateway and provide a
bedded networks for machine internal con-
process image interface on EtherCAT. trols”, Proceedings of the SPS/IPC/Drives
Equipped with EtherCAT such gateways Congress, pp. 443-449, 2003, Nuremberg.
are no bottleneck but provide a full [12] ETG.5001: “Modular Device Profile Specifi-
performance connection to CAN or cation”, EtherCAT Technology Group
CANopen networks. Hence they also build
a smooth migration path from CANopen to
EtherCAT.
Martin Rostan
Beckhoff Automation GmbH
References
Ostendstr. 196, D- 90482 Nürnberg
[1] M. Rostan: “CANopen over EtherCAT – tak- Phone +49 (911) 54056-11
ing a CAN technology to the next level”, Pro- Fax +49 (911) 54056-29
ceedings of the 11th International CAN Con- [email protected]
ference, pp. 12/1-12/8, 8-9 March 2005, www.beckhoff.com
Rome, Italy
[2] IEC 61158-2 (Ed.4.0), Industrial communica-
tion networks - Fieldbus specifications - Part
Mirko Tischer
2: Physical layer specification and service Vector Informatik GmbH
definition Ingersheimer Str. 24, D-70499 Stuttgart
[3] IEC 61158-3/4/5/6-12 (Ed.1.0), Industrial Phone +49 (711) 80670-0
communication networks - Fieldbus specifica- Fax +49 (711) 80670-111
tions - Part 3-12: Data-link layer service defi- [email protected]
nition - Part 4-12: Data-link layer protocol www.vector-informatik.com
specification - Part 5-12: Application layer
service definition - Part 6-12: Application
layer protocol specification -Type 12 elements
(EtherCAT)
[4] IEC 61784-2 (Ed.1.0), Industrial communica-
tion networks - Profiles - Part 2: Additional
fieldbus profiles for real-time networks based
on ISO/IEC 8802-3 I
[5] IEC 61800-7-301/304 (Ed.1.0), Adjustable
speed electrical power drive systems - Part 7-
301: Generic interface and use of profiles for
power drive systems - Mapping of profile type
1 to network technologies - Part 7-304: Ge-
neric interface and use of profiles for power
drive systems - Mapping of profile type 4 to
network technologies
[6] EN 50325-4: Industrial communications sub-
system based on ISO 11898 (CAN) for con-
troller-device interfaces. Part 4: CANopen.
[7] EtherCAT Technology Group website,
http://www.ethercat.org
02-7