The Platform - TheTaoOfFieldbus

Go to content
JJECAT
Chapter 1 : The Platform

 
I got many requests on www.thetaooffieldbus.com website to provide some information about EtherCAT Master side.
For this, I will publish some tutorials which are split in segments concerning the EtherCAT Master‘s development.
The final goal is to deliver an easy install complete ISO image in order to test all the discussed topics.
I start with a tools introduction which is need to build the “toolchain” and step by step we delve to describe the whole solution.
We start from Nuts && Bolts : Hardware Platform and Operating System.

Hardware Platform
=========================

Today there is available an open arena and a complete market where it is possible to select an embedded system. For each flavor, we can choose an hardware based on price, size, power computation, functionalities and so on.
My interest was focused on really something special: Access3 by Azulle
This is a mini PC stick fanless and without any difficulty It is possible to build the smallest EtherCAT master based on PC in the world and I did it :)
 
It is funny because it reversed two concepts:
  • Normally a display is plugged into a PC, this time it is possible to plug a PC into a Display.
  • It is not an embedded PC but a real PC with an embedded shape.
 
It is suitable also for AGV system and mobile Robots because it is powered with 5V and the current absorption is 3A (as Raspberry for example).
Processor

Intel Apollo Lake N3450|Quad Core 1.10 Ghz to 2.20 Ghz
Intel Gemini Lake N4100|Quad Core 1.10Ghz to 2.20 Ghz
Operating System

Windows 10 Pro/Iot/ Ubuntu
BIOS

Wake ON LAN/PXE/Auto Power ON
RAM

2GB /4GB
Storage

32GB/64GB
Wifi

Dual Band 2.4Ghz.5.0Ghz
GPU

Intel HD Graphics 500
Ethernet

1 Gigabit
Bluetooth

4.0
HDMI

Output 1.4b 4K @ 30 fps / 2.0
USB

Ports x2 3.0 Ports

Micro SD

slot Up to 256GB
Audio

Output 3.5mm Jack
Power Supply

5V/3A
Dimensions
5.2in x 2in x 0.75in
Operating System
==============
 
I selected Ubuntu as Operating System because it is open and widespread. Moreover the version LTS 16.04 can guarantee stability for long period and this is a must for Automation purpose.
Alone Ubuntu can not be used to control a fieldbus as EtherCAT. It requires high deterministic synchronization, there is need an RTOS to support this feature.
The Preempt RT version fits for this purpose, because it is simple to install and it allows to work with Posix functions (Software portable).
 
I download it and installed on Access3, the procedure it is straightforward.

I recap the steps below:

//Check the current Ubuntu version
$ uname -r

On the download page of the Linux RT select the kernel that is closest or that is equal to the current non-RT version.
Download the linux version , if there is need , and patch it with the following commands:
$ mkdir -p /usr/src/kernels
$ cd /usr/src/kernels
$ tar xf linux-X.Y.Z.tar.xz
$ mv linux- X.Y.Z linux-X.Y.Z-rtV
$ cd linux-X.Y.Z-rtV
$ xz -d ../patch-X.Y.Z-rtV.patch.xz
$ patch -p1 <../patch-X.Y.Z-rtV.patch

In order to compile the Kernel it is wise to work with the current .config file
$ cp /boot/config-CurrentVersion .config
With the command make menuconfig, select → Processor type and features -> Preemption Model -> Fully Preemptible Kernel (RT)
$ make -j4
$ make modules_install install
$ reboot

With the program cyclictest , It is possible to check the perfomance of the hardware. There are many website that describes how to run it and to get the Histogram plots
JJECAT
=======
 
I developed an EtherCAT Master (JJECAT) in order to run on Linux platform. It is not complicated to modify and to adapt for different configurations of IO and drives.
It works with the exported file from the TwinCAT, so there is no need to invest time to find out the right mappings for the different devices.
I will dedicate a complete section to manage and to adapt it.
For the moment consider it as an hidden engine inside to the system.
Test Experiment
============

The first test is related to control ten drives with Distribuited Clock (DC )with a cycle time of one millisec. I modified the cyclic frame in order to monitor the register 0x990 continuously and to enable the calculations to control the platform jitters.
 
I set up environments to run continuously for 11h (about).
The numerical results are reported  below with plots and values.
The values show the number of cycles vs jitter range.

#Number of Cycles 38725865
#Max Latencies 156µs
#Min Latencies 3µs
#Avg Latencies 8µs
Wireshark Trace
==========
From the trace is possible to check and analyze the logged results.
The first and the second commands are relative to synchronization time.
FPWR writes the value 0x1dc761f2 (PC's clock) inside the register 0x910 (Slave 's clock).
ARMW reports the current time 0x1dc76fcb  read from the same slave (Slave 's clock).
If we compare the two values:

ΔT= 0x1dc76fcb - 0x1dc761f2 = 3545 ns = 3.545 µs

The second picture is relative to the same frame, there are the commands to read the register 0x990.
This register is the next DC ISR inside the slave.
In this way is possible to monitor every cycle time the perfomances of the PC.
Normally there is no need to map all these registers but here it was important to control the PC's jitter.


CPU - Load and Temperature
==================
Below are sketched the CPU's load and the Temperatures relative to the four Cores.
The test was running with youtube streaming video and intentionally some applications as CPU monitor and psensor.
The PC's cover was never hot or warm , this surprise for a fanless device with this power.

Conclusions
=======

At the end of some days of tests I checked that the Access3 is able to control a realtime system without any particular efforts. I found out many interesting points:

  • Compact system with the Intel power

  • Standard hardware and well documented

  • Linux Support

  • Realtime compatibility with Preempt RT

In the next sections we will apply it to different context and applications.
Copyright notice
The website and its content is copyright of Nicola Urbano - ©Nicola Urbano -2010. All rights reserved.
Any redistribution or reproduction of part or all of the contents in any form is prohibited without to contact the Author
Wireshark and the "fin" logo are registered trademarks of the Wireshark foundation. EtherCAT® is registered trademark of ans licensed by Beckhoff Automation GmbH
Back to content