Ethercat HAL driver
Thanks for the tip, checking for compiler warnings.
regards,
Rene
Please Log in or Create an account to join the conversation.
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
Please Log in or Create an account to join the conversation.
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
Please Log in or Create an account to join the conversation.
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:
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
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
Please Log in or Create an account to join the conversation.
- sqmathlete
- Offline
- Premium Member
- Posts: 118
- Thank you received: 17
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
Please Log in or Create an account to join the conversation.
For linuxcnc, I wrote another xml file using the sittner example, but I can't add a 2009 index parameter to it
Thanks,
ilya
Please Log in or Create an account to join the conversation.
I do not know if I can help you, I do not know much English and I am not a programmer, and I do not use ASDA-A2-E, I hope I can give you some clue, do not know if you have registered P0-09 in the initial configuration in TX_PDO?
regards
Chimeno
Please Log in or Create an account to join the conversation.
- sqmathlete
- Offline
- Premium Member
- Posts: 118
- Thank you received: 17
In your linuxcnc code try something like
<sdoConfig idx="6060" subIdx="0"><sdoDataRaw data ="60 60 00 02 00 08 00"/></sdoConfig>
note: data is in hex little-end-in format.
regards,
Dan
Please Log in or Create an account to join the conversation.
Do you mean the ethercat-config configuration.xml?
For each servo I wrote this:
<slave idx="0" type="DeASDA" name="3A1">
<dcConf assignActivate="300" sync0Cycle="*1" sync0Shift="-25000"/>
</slave>
In the first message I attached the factory xml file. In this file you can find the following line - "DRV's Parameter P0-09".
I also will attach it, hope this will help you understand what I mean.
@ Dan
I didn't quite understand how I would know what to write in data
I tried using your example, but the servo remains in PREOP mode after starting linuxcnc
In my xml file, I describe my servos as shown above
Can I add "sdoConfig" tags directly there? Or do I have to use type="generic"?
Thanks,
ilya
Please Log in or Create an account to join the conversation.
- sqmathlete
- Offline
- Premium Member
- Posts: 118
- Thank you received: 17
Things are getting a bit confusing and I feel like we might be heading down a rabbit hole, so lets just step back a minute. What you are interested in is
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.
From the ASDA-A2 manual P0-09 CM1 Status Monitor Register is defined from P0-17
If the parameter P0-17 write the value 18, then you can read the value of the "Z phase" in the parameter P0-09.
What this says to me is that you are "monitoring" the value of the Z-phase offset or in other words you are trying to read that number not set it.
This leads me to believe that it is more of a problem with the set up of your homing routine.
If you are using the internal homing routine of the amp
1)What number is your homing routine?
2)Does it correspond to one that uses the Z-phase of the encoder?
If this is all good then I would look at object 0x607C Home Offset (ASDA-A2-E manual). you will be able to set the object with the code format from above. Also, you probably need to use the generic form and break out all the pins like Chimeno said.
If you are not using the internal homing routine then can you just specify HOME_OFFSET in the .ini file?
regards,
Dan
Please Log in or Create an account to join the conversation.