EtherCAT Slave

Topics about the Hardware of Revolution Pi
Post Reply
lemariva
Posts: 2
Joined: 21 Feb 2018, 19:26
Answers: 0

EtherCAT Slave

Post by lemariva »

Hi,
I am using the RevPi Core 3 together with an EtherCAT Gateway and first of all, great product! but I have two questions:

1) My setup configuration is the following:
* I have an EtherCAT master (PLC) working with a cycle of 1ms;
* The KUNBUS EtherCAT gateway (it reports V0.0) is connected as a slave to the master;
* I have a counter in the main program (PLC-Program) and its value is updated every 1ms;
* I mapped this variable to the KUNBUS Gateway;
I read and also checked in the

Code: Select all

piControl/project.h
file that you limited the communication with the gateways to an update every 5ms (INTERVAL_PI_GATE). I modified this value to 1ms (I need a sample time of 1ms) and compiled the kernel module again and deployed it. I have a mutithread program fetching the value of the counter every 1ms (I can guarantee that this works - I check and save also the timestamp) but I get the same counter value twice and loss a value between two numbers (Eg. 1, 1, 3, 3, 5, 5 ...) I included a screenshot so you can check what I am getting (datetime corresponds to the timestamp, var0 is the counter). This means that the communication is limited to 2ms.
Is the EtherCAT Gateway the problem? Is there any possibility to modify this? I really need the 1ms. Using another EtherCAT hardware based also on the RPi works. But I really want to use your hardware!

2) The EtherCAT gateway allows 512 bytes. I need DINT (4 bytes) variables. I usually modify the XML config file to concatenate 4 bytes together in the PDO description (Rx / Tx), e.g. the file that I downloaded from your site has a PDO configuration of 32 bytes, I modified it and reduced it to 8 DINTs (I changed the BitLen and the DataType parameters and reduced the number of variables). I use EtherCAT configurator to check that it is correct. It usually works fine, I tested the same procedure with more than one slave. But in this case, I was not able to get the KUNBUS ECS in OP. I got the usually SAFE-OP or BUS-Error states. I read here viewtopic.php?f=3&t=613 that it should be possible. Do you have an XML file with dwords variables? It is almost possible that I am making some mistakes here. Thanks in advance!

Best regards!
Attachments
kunbus-gateway.png
kunbus-gateway.png (20.94 KiB) Viewed 3595 times
User avatar
volker
Posts: 1046
Joined: 09 Nov 2016, 15:41
Answers: 1

Re: EtherCAT Slave

Post by volker »

Hi,
I will try and answer your first question. For the second question I need to consult an Expert for EtherCat (I'm more familiar with Profibus/ProfiNet and Modbus).
so
1) No I'm sorry but you will not be able to get a better result. The PiBridge back plane bus has a cycle time which is more like 2 to 4 ms. So the central process image will only update with this cycle ).
There is no way to decrease this cycle time substantially.
Unser RevPi Motto: Don't just claim it - make it!
Post Reply