Ethercat HAL driver

More
20 Feb 2019 00:47 #126800 by gbcwbz
Replied by gbcwbz on topic Ethercat HAL driver
IgH EtherCAT Master use ESI information in EEPROM of servo to configure, if that information is not correct it will not work properly.

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

More
20 Feb 2019 20:49 #126831 by chimeno
Replied by chimeno on topic Ethercat HAL driver
Hi guys,
I just added another driver to the collection, I attach the files modified only with the EK1122, a greeting Chimeno
Attachments:

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

More
23 Feb 2019 00:42 - 23 Feb 2019 04:01 #126968 by rwistort
Replied by rwistort on topic Ethercat HAL driver
Hello all
I am still striking out with my ProNet servo drive. Totally.
You'll recall that, using the generic driver, hal loads lcec with dmesg errors:
[ 4391.188853] EtherCAT 0: Domain0: Logical address 0x00000000, 14 byte, expected working counter 3.
[ 4391.188856] EtherCAT 0:   Datagram domain0-0-main: Logical offset 0x00000000, 14 byte, type LRW.
My ProNet drive remains in PREOP, and all my hal pins are zeros.
Every time.

Chimeno suggested that I "should load the whole servo configuration through the generic module before reaching your OP status."
Using the attached pronet_5.xml, I tried to do so with sdoConfig stanzas, with the usual, familiar result.
Can you confirm that my byte ordering is correct? In this code fragment, for example,
<sdoConfig idx="1A02" subIdx="1">
  <sdoDataRaw data="10 00 41 60"/> 
</sdoConfig>
I am trying to assign data meaning "idx=0x6041, subidx=0 bitlen=16" to the sdo at 0x1A02:1. (I tried it a couple ways)

There is a 'startup' tab in TwinCAT which lists a startup sequence which includes initialization of the un-used TX- and RXPDOs.

Attachment not found


The items flagged in red look mighty odd to me for an 8-bit field, but I suppose that, with the right endian-ness it might work.
I tapped this startup sequence, in order, into a bunch of sdoConfig tags and fed them to lcec's generic driver.
This xml is attached as pronet_6.xml and, once again, I got the same old error.

Chimeno also suggests that "a clue would be to look at the error report in the driver through the TWINCAT3 program to see what error it gives you." I'm afraid I have no clue how to do that.


I've started to think that ...
There is only so much I can screw up in linuxcnc-ethercat, but
there is ever so much I can screw up in TwinCAT3.
So I want to focus now on what I might be getting wrong when I use TwinCAT3 to configure my drive in Windows.

I am quite the noob on TwinCAT, but I've got it modelling a master and my proNet slave. I can read in the mfr's xml, change its pdos, activate the config, and watch it turn the motor. So we can rule out that the servo, the network card, and the cables are a problem.

The way I understand it, the TwinCAT configuration step boils down to selecting parameter defaults and a pdo arrangement that works, and then writing them to the eeprom so that the settings survive a power cycle. Is that about right?

There must be a hundred references, in this forum, to:
Step 1: Configure your drive with TwinCAT
But there's not a single piece of prose describing how to do that, because it seems that TwinCAT, like long division, is something everybody learned to do long ago.
Except me.

I struggled with it, and here are the steps I go through when I try to write my ProNet eeprom. Does anybody (everybody) do it differently? Am I doing it right?
I kind of suspect not, because when I 'do my thing' in TwinCAT3 and then boot back into linux, my slave does, indeed, have the configuration which I (think I) just burned into it:
~/linuxcnc-ethercat/examples/c3pr> ethercat pdos
SM0: PhysAddr 0x1000, DefaultSize  128, ControlRegister 0x36, Enable 1
SM1: PhysAddr 0x1080, DefaultSize  128, ControlRegister 0x32, Enable 1
SM2: PhysAddr 0x1100, DefaultSize    6, ControlRegister 0x74, Enable 1
  RxPDO 0x1602 ""
    PDO entry 0x6040:00, 16 bit, ""
    PDO entry 0x607a:00, 32 bit, ""
SM3: PhysAddr 0x1d00, DefaultSize    6, ControlRegister 0x30, Enable 1
  TxPDO 0x1a02 ""
    PDO entry 0x6041:00, 16 bit, ""
    PDO entry 0x6064:00, 32 bit, ""
    PDO entry 0x6077:00, 16 bit, ""
But then if I power-cycle the slave, it comes back with a trivial PDO config:
~/linuxcnc-ethercat/examples/c3pr> ethercat pdos
SM0: PhysAddr 0x1000, DefaultSize  128, ControlRegister 0x36, Enable 1
SM1: PhysAddr 0x1080, DefaultSize  128, ControlRegister 0x32, Enable 1
SM2: PhysAddr 0x1100, DefaultSize    6, ControlRegister 0x74, Enable 1
SM3: PhysAddr 0x1d00, DefaultSize    6, ControlRegister 0x30, Enable 1
In both cases, I can't get lcec to start my slave in OP mode.
So it looks to me as though the eeprom did not get updated. It would be nice if I am simply pressing the wrong button.

At this point, I am out of ideas, and reaching out, again, for help.
I feel like a monkey at a keyboard, trying to pump out Shakespeare.
How sharper than a serpent's tooth is etherCAT!

Thanks,
Reid
Attachments:
Last edit: 23 Feb 2019 04:01 by rwistort. Reason: fixed attachment TC6.PNG, fix link

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

More
23 Feb 2019 05:15 #126983 by sqmathlete
Replied by sqmathlete on topic Ethercat HAL driver
@Ried

Going back to step 1 is a good idea, your in way too deep in my opinion.
Have a look at this, Chapter 2 from the Delta ASDA-A2-E manual. Once you've got it working in Twincat, write a basic xml file for LinuxCNC, forget about SDO's, custom drivers and the like. For now just get the amp to show up in preop mode with all of the control word pins and mode pins available in hal show as well as the status word. Note: Formatting is very important in the xml file, the smallest mistake will give weird errors.

Once you've got LinuxCNC up and running, in halshow, I would try to directly set the halpins for Mode, then control word 0x06, 0x07,0x0F. You should see the status word change as you modify the control word. If linuxCNC won't open keep looking for a mistake in the xml file until it does.

Kind Regards,
Dan



This browser does not support PDFs. Please download the PDF to view it: Download PDF

Attachments:

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

More
24 Feb 2019 12:11 #127048 by shameless
Replied by shameless on topic Ethercat HAL driver
Hi,
I have built ethercat and the linuxcnc-ethercat driver for linuxcnc. Could you give me some clues that how to use it to control my asda?
Regards!

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

More
24 Feb 2019 20:02 #127065 by rwistort
Replied by rwistort on topic Ethercat HAL driver
Light bulb.
Jaw drop.
Uh oh.
Head smack.
Woo hoo!
Drum roll. Ratta tat. Tatta tat. Rattatattatat.

I left out the addf's for lcec.read-all() and lcec.write-all().
And I think we can all agree:
That was dumb.

Keep moving, folks.
Nothing to see.
Thank you.
So long.
Reid

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

More
12 Mar 2019 00:16 - 12 Mar 2019 00:43 #128409 by Grotius
Replied by Grotius on topic Ethercat HAL driver
Chimeno,

My bechhoff boxes are becoming bigger every week !!

I have some drivers to share. Maybe open a new github channel for this.

Reid, Chopin...


Never give up !! Make your own driver in lcec.
Buy one of the working ethercat servo drives. Test this one. Compare it. And write C code.
Btw, i never used twincat. Beckhoff is visiting me next week. To look what i am doing. B)
I have no nucleair power plant. Only a cnc machine with some custom made c code.
So where is your power? It's in the community. Without them i was lost. With them we are great and powerfull !!!

Forget about twincat. I can sent you python based command's for reading out the ethercat manual chapters step by step.

Take your time. If i have more time i can look inside your issue. But only if i have the same servo drive at my place.

@rwistort,

Don't fall in the linuxcnc booby trap about the servo time thread (PID). Better is to use the base time thread with ethercat 0-1 nanoseconds if you want to be fast. B)
Last edit: 12 Mar 2019 00:43 by Grotius.
The following user(s) said Thank You: chimeno

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

More
12 Mar 2019 20:40 - 12 Mar 2019 20:41 #128469 by chimeno
Replied by chimeno on topic Ethercat HAL driver

Chimeno,

My bechhoff boxes are becoming bigger every week !!

I have some drivers to share. Maybe open a new github channel for this.

Hello Grotius, it would be nice to see the boxes inside, they must be awesome !! would be good the subject of github although I think it would be better to be able to integrate everything in the sittner github, the work done is impressive.
I just finished another Beckhoff module "EL6090" attached the files to add to the ethercat master,
regards
Chimeno

Last edit: 12 Mar 2019 20:41 by chimeno.

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

More
22 Mar 2019 19:51 #129279 by chimeno
Replied by chimeno on topic Ethercat HAL driver
Hello guys, I just pogramar EL6224, for now only for the functions dig-in and dig-out, works quite well. a greeting
Chimeno

The following user(s) said Thank You: Grotius

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

More
22 Mar 2019 20:44 #129287 by Grotius
Replied by Grotius on topic Ethercat HAL driver
@Chimeo,

A kind of bi-direction smart link. Was it hard to code this item?
When would you use this item?



Attachments:

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

Time to create page: 0.331 seconds
Powered by Kunena Forum