Ethercat HAL driver

More
8 years 4 months ago #112145 by ReneCNC
Replied by ReneCNC on topic Ethercat HAL driver
I got it running now, the kernel headers were missing.
Thanks for the tip, checking for compiler warnings.

regards,
Rene
The following user(s) said Thank You: Nico2017
More
8 years 4 months ago - 8 years 4 months ago #112911 by Doyle
Replied by Doyle on topic Ethercat HAL driver
@chimeno

Hi Albert,
I'm trying to get the EL4004 to work with LCNC. I plug it in, and can get it to show up as an Ethercat slave ok. I add it to my XML as described originally by Roschi but still have to tell Linuxcnc about it.

I assume that I have to develop the lcec_el4004.h and lcec_el4004.c files for it to be recognised by LCNC. Can you give me any hints how to do this? I have various files such as el40x2, el41x2, el41x4 which I imagine I can use to "guess" the valid parts. I also need to find the PID number to go in the header file.

But from your post I'm guessing there is an easier way? Any help is appreciated.
Thanks,
David
Last edit: 8 years 4 months ago by Doyle. Reason: direct to poster
More
8 years 4 months ago - 8 years 4 months ago #112937 by chimeno
Replied by chimeno on topic Ethercat HAL driver
Hello david,
it's a pleasure to help you, I do not have the EL4004 right now but I need to finalize a similar one, I'm attaching the new files so that it works for you, you have to edit the file "lcec_el40x4.h" add the PID number yourself, from where you get it, then the terminal executes this command "ethercat slave -v" will leave the "product code" that is, you also have to add the module to the following files, "Kbuild, lcec_conf.h, lcec_conf.c, lcec_main.c, I think that is everything, if you have more questions ask me, I will try to help you.
regards
Chimeno
Attachments:
Last edit: 8 years 4 months ago by chimeno.
The following user(s) said Thank You: Doyle, Nico2017
More
8 years 3 months ago #114746 by Ilya
Replied by Ilya on topic Ethercat HAL driver
Hello everyone,
I need help with the unusual problem:
I use a delta Asda-a2-e servo. They have a function "Z phase offset"
The offset between the motor position and Z phase. The range is from -5000 to +5000. If the position is the same as Z phase, its value is 0. The bigger the value is, the more the offset will be.

I want to use this feature to remove the physical inaccuracies of the endpoints sensors.
I need to do so:
- I pressed the "Home All" button.
- The axis hit the sensor.
- The axis begins to slowly return
- When the axis has moved off the sensor, the motor should continue to drive up to the Z phase (value is 0)

If the parameter P0-17 write the value 18, then you can read the value of the "Z phase" in the parameter P0-09.
ok, i will can done it with help of terminal:
Code:
Part of XML file: .... <Index>#x2009</Index> <Name>DRV's Parameter P0-09</Name> <Type>UDINT</Type> <BitSize>32</BitSize> ..... <Index>#x2011</Index> <Name>DRV's Parameter P0-17</Name> <Type>UINT</Type> <BitSize>16</BitSize> ..... With this command, load the number 18 in the parameter P0-17: ethercat download -p 0 -t uint16 0x2011 0 18 Now i can get the value of the "Z phase" by using the next command: ethercat upload -p 0 -t int32 0x2009 0 Output example: 0x00000652 1618
I don't know English well and hope I explained it clearly
So my question is:
Do you have any ideas to read parameter P0-09 in linuxcnc? I hope for your ideas and help


Thanks,
Ilya
Attachments:
More
8 years 3 months ago #114788 by sqmathlete
Replied by sqmathlete on topic Ethercat HAL driver
@ Ilya

I can seem to find the parameter 0x2009, I think you are talking about the home offset which sounds familiar but I am a bit lost because your example code and the parameter you are asking about are not the same. I think the problem is that you are not looking at the correct manual to map the PDO's . There is a lot of useful info in the ASDA-A2 manual but you need to download the ASDA-A2-E manual from Delta's website. Its about 120 pgs and I would consider it a supplement to the regular manual.

That being said, my understanding is that when you are using the ethercat hal driver from a command terminal you are (probably) in the PRE-OP state. A state where PDO's and SDO's can be mapped freely. A very basic explanation is that when Linuxcnc is starts up, the amp is in PRE-OP mode, at this point Linuxcnc maps any PDO's/SDO's that are in your .xml file to servo. Once Linuxcnc is built the amp is in the OP state and PDO's/SDO's can no longer be mapped. Objects like 0x06C(hex) Actual Velocity can now be read...and obviously depending on the object you may be able to read or write to it. Again look in the ASDA-A2-E manual for a more detailed description of the amplifier state change and a list of available objects.

I can't remember the exact syntax for the .xml file and unfortunately my Linux computer is at the shop with the lathe. Synatx is extremely important in your .xml file so I won't even bother to guess. Both Roschi and Sittner have some great examples to work from though.

What mode are you running in? PT?

Hope this helps
Dan
More
8 years 3 months ago #114801 by Ilya
Replied by Ilya on topic Ethercat HAL driver
The code I attached was factory code, and I didn't change it. More precisely - this xml file I downloaded from the website of the seller, to see the index of the parameters I need.
For linuxcnc, I wrote another xml file using the sittner example, but I can't add a 2009 index parameter to it

Thanks,
ilya
Time to create page: 0.935 seconds
Powered by Kunena Forum