Rutronik News

Communication in Hard Real Time

  Rutronik

Ethernet protocols are making inroads into the industrial sector as the world of work becomes increasingly networked and automated. The office world and the world of production lines might be growing ever closer – but the type of Ethernet protocols used in PCs for Internet communication cannot be transferred one-to-one into automation technology. However, developers have come up with suitable solutions to this problem.

The key difference between Ethernet protocols for home computers and those for industrial applications is the real-time requirements: Both fulfill the criteria, yet the first type only delivers soft real-time performance. This means that a response is produced according to specified timing requirements, but only if this is possible. For example, data may be delayed or become unsynchronized during a video call. The picture then shakes slightly, but the participants can nevertheless see and understand each other. The system still works.

However, this would be completely unacceptable for controlling, e.g., a pick-and-place robot. In this situation, a gripper arm must move along a predefined path, possibly rotate around various axes, and pick up an object. Several motors work in unison to control the drive. If a motor fails to perform exactly within a given time window, the gripper arm will still reach its destination, but may end up in the wrong place at the wrong time while moving along the defined path. This could result in collisions or even accidents. This situation demands a hard real-time system. In order words, a System that guarantees a response to events within a predefined time window. The system is therefore deterministic.

 

Real time is not really real time

A protocol that meets both soft and hard real time requirements is EtherCAT. EtherCAT has become popular due to very short cycle times and low communication jitter. In contrast to similar protocols, dedicated hardware is available for EtherCAT slaves. The functional principle is based upon hardware-integrated function blocks (so-called IPs), since algorithms implemented in the hardware are significantly faster. The processing of messages in the software would lead to additional latency periods. In many cases, this hardware is achieved using an additional ASIC (usually ET1200 or ET1100 from Beckhoff).

 

The advantages of ethernet with the simplicity of a fieldbus.

In terms of its complexity, integrating EtherCAT is comparable to using a fieldbus, but offers the benefits of Ethernet. It is thus possible to integrate Ethernet without developers having to deal with technical intricacies such as SNMP or TCP/IP communication and the associated problems. The actual protocol stack is no longer time critical. This demands very little computing capacity from the controller. Moreover, this is provided free of charge to members of the EtherCAT Technology Group. ETG membership is also free.

 

Microcontroller with integrated EtherCAT

Some semiconductor manufacturers even go one step further and integrate the EtherCAT IP developed by Beckhoff in their products. The world's first microcontroller with integrated EtherCAT IP was launched by Infineon: The XMC4300 and the XMC4800 even take the additional latency in the communication between MCU and ASCI out of the equation. They are powered by ARM Cortex™ M4 and run at 144 MHz. The XMC4300 is designed as a gateway controller and can replace the ASIC and the controller in less advanced applications. Besides reducing costs and the number of components, it also facilitates development. Infineon's development platform DAVE™ with an integrated application-oriented app for programming EtherCAT slaves provides excellent performance.

The XMC4800 runs with the same core as the XMC4300 at 144 MHz, but offers much more in terms of peripheral devices, flash, and RAM. It can be used, e.g., to simultaneously control two industrial motors, while the controller assumes communication with the EtherCAT network.

Most of the currently applied EtherCAT slaves employ an 8-bit controller and an ASIC for communication. The ASIC or the applied module account for the majority of the component costs. If both elements are replaced with a fully integrated EtherCAT controller module, it results in a reduced number of external components and thus less cost and space required. This enables the cost-efficient integration of more intelligence into the EtherCAT slaves. This also means less traffic on the bus, because a lot of data is already processed locally. A CortexM4 with integrated floating point unit for calculating floating point numbers offers a lot more opportunities than a simple 8-bit controller.

 

EtherCAT for existing applications

Microchip has taken a slightly different path: The LAN9252 is a 3-port EtherCAT slave controller with dual integrated PHYs. The LAN9252 is available in a 9x9 QFN package. This provides system developers, for instance, with a space-saving solution for implementing EtherCAT in an existing application. The LAN9252 can be easily connected to almost all microcontrollers via SPI/SQI or parallel bus. The SQI interface enables a high data throughput rate with a simple board layout. The LAN9252 is of particular interest when employing known microcontrollers for a new application in order to continue using existing know-how in the form of written software adapted to specific controllers. Members of the EtherCAT Organization have free access to the EtherCAT stack. The LAN9252 can be used for simple applications such as the switching or reading of digital inputs and outputs, even without an additional microcontroller.

But what happens if an application being developed should be able to use other protocols besides EtherCAT to communicate? Device development in various versions based on communication via EtherNet/IP, PROFINET or similar protocols would then require a unique hardware design - and have to bear all the associated costs. Alternatively, the entire hardware could be executed in one device version. This would however result in certain hardware elements not being used, depending on which version is run.

Renesas provides a solution for this situation: The R‑IN32M3-EC is a SoC (System on Chip), which - similar to the LAN9252 from Microchip - can assume communication and features integrated PHYs. In addition to EtherCAT, the R‑IN32M3-EC also supports EtherNet/IP, PROFINET (RT), Modbus TCP, CC-Link, CANopen, and other protocols. The SoC allows the development of hardware that is suitable for various protocols; only the software has to be adapted. Moreover, the R-IN comes with an integrated accelerator for the real-time operating system. The response time for protocols with a software stack is then five times faster than with a conventional software solution. The integrated Cortex™ M3 operates at 100 MHz and can assume certain tasks from a host microcontroller.

After the success of R-IN, Renesas went a step further and launched the RZ/T1, a fully integrated microprocessor: The complete multi-protocol solution of the R-IN, combined with a 600 MHz ARM Cortex™ R4F real-time core and deterministic response behavior, make the RZ/T1 an ideal microprocessor module for applications in the high‑end motor control sector and industrial communication.

 

Stacks for EtherCAT communication

Even manufacturers that have not yet integrated EtherCAT as hardware IP in their products recognize the trend. For example, STMicroelectronics in cooperation with software suppliers offers various stacks as source codes or binary files that enable STM32 controllers to be used as EtherCAT slaves. Needless to say, additional hardware is necessary, as the EtherCAT protocol must be implemented at hardware level. Every combination with an R‑IN or LAN9252 is possible. Many developers recognize the flexibility provided by a solution consisting of a microcontroller with a separate transceiver, particularly when various protocols need to be supported. The large ARM Cortex™ portfolio from STMicroelectronics includes the right controller for practically every application.

 

Original IPs from Beckhoff

All the solutions presented here use original IPs from Beckhoff and thus continue to build on the original implementation of the EtherCAT inventor. This guarantees the best possible compatibility from the start.

 

Complete EtherCAT solutions

EtherCAT is usually used in environments that demand utmost reliability and stability. Interference resistance and cable lengths are influenced extensively by the signal quality. Favorably priced MEMS oscillators, such as the Microchip DSC100x, offer extensive reliability in terms of FIT, shock and vibration resistance, as well as excellent temperature stability and an extra small footprint. Crystals or crystal oscillators are ideal for meeting strict tolerance requirements and achieving very high temperature stability. The FA-238 series from EPSON is a recommendable 25 MHz crystal. The low-jitter oscillator series SG-210STF is a good choice for ultra-precise applications. If the Ethernet PHYs have not yet been integrated in the EtherCAT solutions, it is important to pay attention to the quality of manufacture. The KSZ8061, for example, delivers outstanding anti-interference performance with cable diagnostics, uniquely low emissions and - particularly important - extremely low latency and startup times.

 

Components can be found at www.rutronik24.com.