Ethercat HAL driver

More
10 Sep 2017 08:25 #98760 by sirop
Replied by sirop on topic Ethercat HAL driver


what do you mean by that? processes that come from the master (ex. plc -> external to Lcnc) or processes that come from Lcnc itself? Those should synchronize with a normal file hal ... or in the case of motion data with the kinematic ... Iunderstand badly?

regards
Giorgio


Any process data between the master and its slave is synced by the means of EtherCAT.

Interesting is what happens within the slave: the EtherCAT network can be synced within under 1us, but a typical Linuxcnc installation
would have a latency of at least 10 us nowadays, wouldn't it?

Suppose you run the EtherCAT network at 500 us cycle time, then your EtherCAT LinuxCNC slave might need to run its internal HAL processes at 250 us cycle time in order to cope with the higher latency of LinuxCNC software.
The following user(s) said Thank You: bkt

Please Log in or Create an account to join the conversation.

More
10 Sep 2017 16:22 #98779 by bkt
Replied by bkt on topic Ethercat HAL driver
ok ... you are right ... I did not evaluate this aspect .... so I will have the slave card that will pass the ethercat packages not interesting for Lcnc and will take those directed to the slave Lcnc .... i will have to create a sort of queque for the input packages if was too much in too little time, in these way the response is everytime complete, not in 500us cile, but complete ... this way the card will respect the 500us and Lcnc will not have to chase anyone .... of course everything that my lcnc slave will do will write registers on the Master .... and it will be the Master to steer on the need to synchronize. .... do you think it might be the right way to proceed?
If so, I should only create an rt component to communicate with the board, fixing what you can read or write.

What do you think about it?

regards
Giorgio

Please Log in or Create an account to join the conversation.

More
10 Sep 2017 16:38 #98781 by sirop
Replied by sirop on topic Ethercat HAL driver

If so, I should only create an rt component to communicate with the board, fixing what you can read or write.

What do you think about it?

regards
Giorgio


I have not yet looked through the SDks of these EtherCAT PCIE cards.
What's there solution? Some kind of double buffer?
Is IO for such a card managed through polling or is it event driven?
The following user(s) said Thank You: bkt

Please Log in or Create an account to join the conversation.

More
11 Sep 2017 06:17 - 11 Sep 2017 06:33 #98816 by bkt
Replied by bkt on topic Ethercat HAL driver

1) What's there solution? Some kind of double buffer?
2) Is IO for such a card managed through polling or is it event driven?


1) these is my solution for syncronisation problem ...
2) not read the drive of card yet ... I think download and read it in these days. My choice was made solely on the basis of support for the kernel rt-preemt linux or not. In fact there are 5/6 slave ethercat cards reported on the beckhoff site, but there are at least another 5/6 manufacturers ... 2/3 at least they are based on anybus ... others have a fcpa and the ET1100 chip ... not all they have linux support, so I chose the ones who have the best support ... (eds would otherwise be better but the only card cost is very high like a cheap industrial pc) ... just i read drive of those I choose will give you more information.

My intention of slaves uses is not for controlling drive, but for a sort of nml over ethercat instead over ethernet ... and having never programmed an fgpa, I want to get out of this unknown.

Any how my interest to these type of slaves card is because connecting Lcnc ethercat master into a ethercat network with a plc as master maybe not so simple operation ... I read that not all plc master product is compatible with these type of operation and sometimes one of the masters is not seen by the master "commander" (plc) ... so I do not want to find it in this situation. This "problem" is known for some famous brands of plc ...
Last edit: 11 Sep 2017 06:33 by bkt.

Please Log in or Create an account to join the conversation.

More
24 Oct 2017 03:34 #100714 by sqmathlete
Replied by sqmathlete on topic Ethercat HAL driver
Hi All,

I am still having a problem getting my delta asda-a2e amps out of the pre-op state :S

File Attachment:

File Name: ecat_asda_..._bit.xml
File Size:2 KB

File Attachment:

File Name: ecat-lathe.ini
File Size:3 KB

File Attachment:

File Name: ecat_lathe_config.hal
File Size:1 KB

File Attachment:

File Name: ecat_lathe_sim.hal
File Size:1 KB

File Attachment:

File Name: ecat_asda_config.xml
File Size:2 KB
using an xml file similar to roschi's_cnc (

File Attachment:

File Name: ethercat_config_n.xml
File Size:7 KB
ethercat_config_n.xml) I.e the control word and status word broken out into bits and then interfacing with classic ladder. At this point my tactic is trying to start up linuxcnc and have the amp come up in the op state then use the halcmd to mimic the ladder logic. However, the amp is always in the pre-op state. This config is the bitwise lathe.

The other configuration uses an xml file with the status word and control word as u32 values. In this scenario the amp will often start up in the op state, then through halcmd I can set the values accordingly and the amp turns on the amp no problem. Home the axis and linuxcnc will run a program.

Hoping that someone can enlighten me, I'm just not sure what I am missing. Why does the one config come up in the op-state and the bitwise lathe does not.

Note: often it is difficult to shutdown linuxcnc and then start it up again and have the amp come on in the op state. Usually I have to shut everything off and restart to get the link up consistent if at all.

Also, if I run ethercat slaves -v, in the CoE details, Enable SDO Info: no (????) and Enable Upload at Startup: no (???) Do these need to be set to yes to upload SDO through the XML file? I'm not a %100 sure but I think I observed that SDO data that I was in the file did not seem to have any effect on the amp.

Any help would greatly be appreciated. I have spent way too many hours at this over the past few months and just can't seem to figure out what I am missing.

Kind Regards,
Dan

Please Log in or Create an account to join the conversation.

More
24 Oct 2017 04:16 #100716 by sirop
Replied by sirop on topic Ethercat HAL driver

Hi All,


Hoping that someone can enlighten me, I'm just not sure what I am missing. Why does the one config come up in the op-state and the bitwise lathe does not.


Look through github.com/sittner/linuxcnc-ethercat/blo...-conf_X.xml#L98-L116 to understand how a "complex" type ( aka "special32" by roshi) is set up with hal types of shorter length, halType="bit", for example.

This line of ecat_asda_config_bit.xml
<pdoEntry idx="6040" subIdx="00" bitLen="16" halPin="x-drive-control" halType="bit"/>
does look like an error for me.

Either use
halType="u32"
or -- if you want bitwise splitting --
halType="complex"
.
The following user(s) said Thank You: sqmathlete

Please Log in or Create an account to join the conversation.

More
29 Oct 2017 22:17 - 30 Oct 2017 05:01 #100994 by CORBETT
Replied by CORBETT on topic Ethercat HAL driver
Hi Everyone,

I hate to waste people's time, but I am starting to waste my own over this. I have been following the EtherCAT driver and have installed the driver and can see the EK1100 and Slaves when typing “Ethercat Slaves” in the Terminal, but I am stuck on where you will generate the pins for the Beckhoff Slaves. Will the pins be generated in the XML file or when configuring the HAL file. I used one of the simple xml examples, but with my slaves listed. I can load the xml in halcmd (loadusr -W lcec_conf myfile.xml) and have tried a few different xml configurations, but still have not figured out the pins. My first goal is to wire an external E-Stop to a EL1004 slave to start figuring things out. Basically, I need to know how to generate the slave pins in order to tie them to the iocontrol.0.emc-enable-in and iocontrol.0.user-enable-out to make the E-stop loop. Once I see how this is performed, then I can build all the other I/O functions. I am under the assumption the pdoEntry idx's are the pins, but wanted to check with everyone on here to make sure I am going down the correct path. The following is what I put together for the XML file if I was using only the EK1100 bus module and 1pc of the EL1004 slave to do some simple testing of a E-stop input.

<masters>
<master idx="0" appTimePeriod="1000000" refClockSyncCycles="1000">
<slave idx="0" type="EK1100" name="Busklemme"/>
<slave idx="1" type="EL1004"/>

<syncManager idx="1" dir="in">
<pdo idx="0x0f00">
<pdoEntry idx="6000" subIdx="01" bitLen="16" halPin="iocontrol.0.emc-enable-in" halType="u32"/>
<pdoEntry idx="6000" subIdx="02" bitLen="48" halPin="iocontrol.0.user-enable-out" halType="u32">
</pdoEntry>
</pdo>
</syncManager>

</master>
</masters>

If anyone will please take time and help me figure out what I am missing, I would appreciate it. The first thing is just making sure if I am on the right path.

Thanks,
Robert
Last edit: 30 Oct 2017 05:01 by CORBETT. Reason: To clarify my question

Please Log in or Create an account to join the conversation.

More
30 Oct 2017 14:09 #101016 by sqmathlete
Replied by sqmathlete on topic Ethercat HAL driver
Hi Robert,

From what I can tell you have a multiple of errors. Note: formatting in .xml files is critical.

1) "<slave idx="1" type="EL1004"/>" should be <slave idx=1 type="EL1004 name="your-pin-name-here" /> in order to create the pins.
2) Those pins are then connected in your hal file to iocontrol,motion etc not defined as a pdo in your sync manager.
3) know what type of variable both the server and the client are expecting "iocontrol.0.emc-enable-in" & "iocontrol.0.user-enable-out"
are bit values not u32.
4) download a copy of the Igh master manual and a copy of the Cia402 manual. These are very useful to help understand how to
define pdo's.
5) Be prepared to do some reading,

Good Luck,
Dan

Please Log in or Create an account to join the conversation.

More
30 Oct 2017 14:50 #101017 by CORBETT
Replied by CORBETT on topic Ethercat HAL driver
Dan,

Thanks for getting back with me so quick. I will look through the 2 manuals and see if I can figure more of this out. I have drove myself nuts looking through the internet with several dead ends and wasted time.

Thanks,
Robert

Please Log in or Create an account to join the conversation.

More
01 Nov 2017 18:24 #101142 by sqmathlete
Replied by sqmathlete on topic Ethercat HAL driver
Hi Frank,

I haven't had a lot of time to try anything with the amps but I have been trying to understand the example and your answer fully before I launch into that.

Either use halType="u32"

This is a point that has been mystifying to me, I will try to explain my meager understanding in the hopes that I will be corrected or that others may learn.

From what I can tell if you define the objects 0x6040 Conrol Word, and 0x6060 Mode as u32 values in your xml, you are able to set the required values for start-up in your hal file (without writing any raw sdo data in your xml file). Keep in mind that the amp is still in the pre-op state when the hal file is read. Which makes sense since it is recommended to download all sdo data (or write parameters?) when the slave is in the pre-op state. Then when linuxcnc starts up, the slave is in the op-state BUT, for example changing modes is not possible since linuxcnc has no way to change state. example set 0x6060 from 0x08 CSP mode to 0x06 Home mode. Which is fine...kinda if you do not want to use the internal homing routine of the servo amps. Roschi see's this early in the development and mention's this around pg 4? of this thread. He? develops the "special32" bit so that linuxCNC can control individual bits in the control word and mode objects, or read 0x6061 mode-op-status as feed back into classic ladder/etc.

or -- if you want bitwise splitting --halType="complex"


The newly developed "complex" variable builds on the complex32 variable but is not limited to 32 bits. Similar to the "complex32", the 'complex" variable breaks out the objects into individual bits which can then be connected to io/motion/classic ladder pins and the resulting combination of bits is then sent back to the amp as an "octet string" i.e. 1 byte at time = 2 hex values satisfying the objects 16 bit "u32" variable requirement and allowing linuxCNC to interact with the objects.

In theory this all seems like this should work and probably does which makes me think that the problem lies in the settings of the amplifier, or there is a slight difference between "proven?" delta asda-a2 and asda-a2-e amplifiers. However, the ASDA-A2-E amps conform to Cia402 standard and should be similar in set-up to Roschi's Stroeber amps. In fact the manuals are very similar...

Or perhaps there is something wrong with my files? Who knows at this point...I will try again when I get a chance.

Kind Regards,
Dan

Please Log in or Create an account to join the conversation.

Time to create page: 0.284 seconds
Powered by Kunena Forum