EP5 - EtherCAT (Fieldbus and Topology)
Video: https://youtu.be/5ZedOeUvtz8
#PLC #TwinCAT3 #Beckhoff #Motion_Control #Hardware #Industrial_Automation #Networks #Redes_Industriales
Related notes:
- 03 - CPU y Terminales
- Part 3 - Tasks, programs and “Hello world”
- Part 10 - Understanding IO Hardware (using EtherCAT and IO-Link)
- Capítulo 1 - Comunicaciones y Redes de Datos
- Modelo OSI
Table of Contents:
A) Intro - EtherCAT as a "Fieldbus"
Welcome back. This is episode five of learning motion control and I/O with PLCs. I'm using Beckhoff here.
In the last episode, we were talking to some hardware over EtherCAT and were able to read in a prox sensor via a digital 24-volt signal, outputting to these blinking bits, which turned on the lights on our pod.
This essentially means that we could flip any kind of contact or relays.
For example:
I didn't go into much detail about the actual fieldbus that we're using.
Note: A fieldbus is an industrial network system for real-time distributed control. It is a way to connect instruments in a manufacturing plant.
A fieldbus works on a network structure which typically allows daisy-chain, star, ring, branch, and tree network topologies.
Examples:
The fieldbus we've chosen here is Beckhoff's go-to system, which is "EtherCAT"
You can use the PLC without EtherCAT, (but I don't know why anyone would want to do that). It's very tightly integrated and works really well—super flexible.
I'm going to talk about why that is and a few things about it. In the next episode, we'll get into bringing in those servo drives and actually getting them spinning.
A.1) EtherCAT topology (example)
Let's talk a little bit about the topology of an EtherCAT network. I have this picture here,
Over on the left side, we've got our controller—the actual PLC that's running our code.
We've dedicated one of its network cards to being an EtherCAT master.
That will go into an EK1100, which is a bus coupler.
We have our digital inputs and outputs here.
Essentially, that's what we've got up to there,
and then we just put an end cap on it (for example, EL9011) and we're done.
We've got a very small system on our test bench, but this is an example of a much more complicated system. You can have quite a bit of flexibility.
For instance, this section could be inside the control cabinet,
whereas this could jump out of the control cabinet and go over to:
- a few conveyors,
- some extra motors,
- or on the end of a robot,
- etc.
Another example:
What's really cool is that these legs of the topology are just RJ45 Ethernet.
They can end wherever, and everything will be happy.
You can even put in extra slices if you wanted.
This topology is incredibly flexible. You can also set up ring topologies if you want, providing built-in failover for bad cables and redundant masters.
It's one of the things that EtherCAT supports that some other fieldbuses don't. For example, Ethernet should not be connected in a ring without performing some network management. Without managing the ring, Ethernet packets can go in circles forever, using bandwidth.
A.2) Comparing EtherCAT to other Fieldbuses (EtherNET IP)
Talking more about other fieldbuses, I think the best to compare it to are things like DeviceNet....
.... and EtherNet/IP.
EtherNet/IP (to not be confused with Ethernet TCP/IP) is Allen-Bradley's go-to fieldbus.
We can communicate EtherNet/IP through a Beckhoff PLC, but it takes an add-on license to actually communicate with those devices.
For Example: TF6281
Read more here
A.2.1) OSI Model (EtherNet IP vs EtherCAT)
EtherNet/IP can talk to servo drives, I/O, and has a pretty good hold on the market.
What I don't like about EtherNet-IP is it runs on top of Ethernet TCP-IP.
In the OSI model, if you're familiar with it, EtherNet-IP runs on top of Ethernet TCP/IP.
This means it goes through layers like the application, presentation, session, transport, network, data link, and physical layers.
(insert photo of EtherNet and OSI model)
- Physical layers are the actual medium that the electrical signals travel on,
- Data link layer includes things like MAC addressing and how it traverses through switches. Typically, the network is IP (Internet Protocol).
When you make a web request, it goes all the way down to the physical layer, bounces around the world, and comes back up to the other side. This is where Google's server lives, all the way back down and up to your client.
(insert OSI model layers comm)
EtherCAT, on the other hand, skips many of these layers. The PLC talks directly at layer 7 (application layer) with a mailbox system, skipping down to the data link layer. This gives EtherCAT more real-time determinism.
A.2.1) Real-Time and Determinism
Now, I'll explain the difference between real-time and determinism.
A.2.1) Real-Time Performance
If we want to output a square wave from our TwinCAT PLC, with time across the bottom and signals on top,
Real-time performance depends on how quickly the listening device (our PLC, for example) needs to act.
A lower performance system may take longer (working with a small frequency),
while a higher performance system acts faster, potentially in nanoseconds.
How fast would the performance need to be for it to be considered Real-Time?
Real-time in an industrial context may be around 1 millisecond. That is what most PLC brands consider real-time. It really depends on the application and the industry.
(insert pic of PLCs)
Note: for Embedded Systems, working in milliseconds is laughable. They can work with way shorter periods of time. Nanoseconds is their goal.
(insert PIC of microcontrollers and embbeded systems)
A.2.2) Determinism
Determinism, however, is about consistency.
Regardless of speed, determinism ensures that rising edges of signals happen at consistent intervals.
Note: The amount they deviate from this consistency is called jitter.
A.2.2) EtherCAT as a Real-Time Deterministic Fieldbus
EtherCAT is a real-time deterministic fieldbus, setting it apart from many others.
Some other fieldbuses are real-time but not deterministic.
Another similar fieldbus to EtherCAT is Ethernet-IP by Allen-Bradley.
A.2.3) Why EtherCAT is currently superior to EtherNET IP
EtherNET-IP, used by Allen-Bradley, has a flexible topology similar to EtherCAT,
but EtherCAT has superior real performance and determinism, EtherCAT can perform frame updates about 30 times faster.
A.3) Device Profiles with EtherCAT
EtherCAT uses device profiles, such as CANopen and Sercos.
CANopen is used on many servo drives and typically runs over CANbus.
SERCOS (Servo Drive Profile) used to run with optical cables in a high-performance deterministic system.
So, these devices profiles have been encapsulated over EtherCAT.
That means that Beckhoff abstracts these profiles in TwinCAT, so you don't have to worry much about them.
For Example:
- CoE - CANopen over EtherCAT
- SoE - SERCOS over EtherCAT
Lastly, EtherCAT and Ethernet/IP have safety systems, but I haven't used them.
So, this concludes our discussion on EtherCAT. In the next episode, we'll bring in the drives over EtherCAT. Catch the next video for that, and I'll see you over there.
Z) 🗃️ Glossary
File | Definition |
---|---|
EtherCAT | EtherCAT – Ethernet for Control and Automation Technology – is a cost-effective, real-time, international standard that makes Ethernet technologies available at the I/O level. |