Ethercat HAL driver

More
7 years 8 months ago #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
7 years 8 months ago #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
7 years 8 months ago - 7 years 8 months ago #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:
Code:
[ 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,
Code:
<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.
[hr]
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:
Code:
~/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:
Code:
~/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: 7 years 8 months ago by rwistort. Reason: fixed attachment TC6.PNG, fix link

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

More
7 years 8 months ago #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

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

More
7 years 8 months ago #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
7 years 8 months ago #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.

Time to create page: 0.177 seconds
Powered by Kunena Forum