EtherCat - CATIO module Help

More
2 years 4 months ago - 2 years 4 months ago #303320 by BHar
Hi There,

I have been trying to setup a "CAT-IO" ethercat IO board, it's not unlike the DIEWU DIO board RodW made a config for.
Using the rpi-4-debian-bookworm-6.1.54-rt15-arm64-ext4-2023-11-17-1731 image, worked well.
Ethercat is up and running, ethecat-conf.xml seems to be accepted, I have only set up the outputs so far as I'm trying to do it piecemeal to reduce complexity.

Issue is, while I can see the pins in halshow, and I can set them - the outputs don't actually turn on at the IO device.

dmesg shows:
[18011.371947] EtherCAT: Requesting master 0...
[18011.371968] EtherCAT: Successfully requested master 0.
[18011.372513] EtherCAT 0: Domain0: Logical address 0x00000000, 42 byte, expected working counter 1.
[18011.372518] EtherCAT 0:   Datagram domain0-0-main: Logical offset 0x00000000, 42 byte, type LWR.
[18011.372664] EtherCAT 0: Master thread exited.
[18011.372673] EtherCAT 0: Starting EtherCAT-OP thread.

I also don't see it going OP in $ethercat slaves, is it supposed to show OP here after linuxcnc is started and dmseg shows 'Starting EtherCAT-OP thread' as above?

cnc@CNC:~$ ethercat slaves 
0  0:0  PREOP  +  IMC IO MODEL with EtherCAT

Here is The ethercat-conf.xml  - sadly I cannot find anywhere any documentation on the spec for this document, so some is a guess, parts I'm unsure about are in bold.

<!-- 
 Slave0 EtherCat IO Card "CAT-IO"
  www.aliexpress.us/item/3256805154534518....pt=glo2usa4itemAdapt
-->
<masters>
  <master idx="0" appTimePeriod="1000000" refClockSyncCycles="1">
    <slave idx="0" type="generic" vid="0x00090588" pid="0x00109252" configPdos="true">
    <dcConf assignActivate="300" sync0Cycle="*1" sync0Shift="0"/>    
     <syncManager idx="3" dir="out">
        <pdo idx="1600">            
            <!-- Digtial Outputs -->
          <pdoEntry idx="2300" subIdx="01" bitLen="16" halType="complex">
            <complexEntry bitLen="1" halPin="out-01" halType="bit"/>
            <complexEntry bitLen="1" halPin="out-02" halType="bit"/>
            <complexEntry bitLen="1" halPin="out-03" halType="bit"/>
            <complexEntry bitLen="1" halPin="out-04" halType="bit"/>
            <complexEntry bitLen="1" halPin="out-05" halType="bit"/>
            <complexEntry bitLen="1" halPin="out-06" halType="bit"/>
            <complexEntry bitLen="1" halPin="out-07" halType="bit"/>
            <complexEntry bitLen="1" halPin="out-08" halType="bit"/>
            <complexEntry bitLen="1" halPin="out-09" halType="bit"/>
            <complexEntry bitLen="1" halPin="out-10" halType="bit"/>
            <complexEntry bitLen="1" halPin="out-11" halType="bit"/>
            <complexEntry bitLen="1" halPin="out-12" halType="bit"/>
            <complexEntry bitLen="1" halPin="out-13" halType="bit"/>
            <complexEntry bitLen="1" halPin="out-14" halType="bit"/>
            <complexEntry bitLen="1" halPin="out-15" halType="bit"/>
            <complexEntry bitLen="1" halPin="out-16" halType="bit"/>
          </pdoEntry>  
        </pdo>
     </syncManager>  
    </slave>    
  </master>
</masters>  

Im just testing it in a simple my-mill sim setup, that I have added the lcec lines to:
Top of my-mill.hal file:
# If you make changes to this file, they will be
# overwritten when you run stepconf again
loadrt [KINS]KINEMATICS
loadrt [EMCMOT]EMCMOT base_period_nsec=[EMCMOT]BASE_PERIOD servo_period_nsec=[EMCMOT]SERVO_PERIOD num_joints=[KINS]JOINTS
loadusr -W lcec_conf ethercat-conf.xml
loadrt lcec
loadrt sim_parport names=parport.0
setp parport.0.reset-time 5000
loadrt stepgen step_type=0,0,0
loadrt pwmgen output_type=1


Code:
[code]I'm sorry to ask whats likely a simple question - I have tried for a few days and read everything I can before coming here to get help! Can anyone pick the issue with my setup?  
[/code]
Last edit: 2 years 4 months ago by BHar. Reason: Formatting fixes

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

More
2 years 4 months ago #303323 by paul_chx
In your ethercat_conf.xml check that vid and pid are correct - maybe remove the leading zeros. Just an idea, though. Had similar behavior when I mistyped the pid for a servo drive.
The following user(s) said Thank You: BHar

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

More
2 years 4 months ago - 2 years 4 months ago #303326 by jjdege
Replied by jjdege on topic EtherCat - CATIO module Help
HI
This worked with another device, I don't know if it can help you.
Maybe the idx needs to be fixed

File Attachment:

File Name: ethercat-c...mple.xml
File Size:1.69 KB


HI
Last edit: 2 years 4 months ago by jjdege.

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

More
2 years 4 months ago #303332 by BHar
Replied by BHar on topic EtherCat - CATIO module Help
Thanks Paul_chx
I gave that a shot, though it did not seem to make a difference.

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

More
2 years 4 months ago #303333 by BHar
Replied by BHar on topic EtherCat - CATIO module Help
Thanks jjdege
I notice the VID PID didnt in your file include the 0X, as mentioned by Paul.

Your comment, "Maybe the idx needs to be fixed"
The IDX were one of the parameters I could not find any documentation on.
I notice the formatting of your file is quite different - Ill try to reformat my file to match and see if that's the trick.
Thanks!

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

More
2 years 4 months ago #303339 by BHar
Replied by BHar on topic EtherCat - CATIO module Help
Can anyone tell me if I should expect the output from $ ethercat slaves
"0 0:0 PREOP + IMC IO MODEL with EtherCAT"
to change from PREOP to OP once LinuxCNC has successfully opened LCEC has read in the ethercat-conf.xml file?

And If I should be able to click the set and clr buttons in halshow and see the outputs go on an off?
This is what I have been using to test success or more accurately failure so far.

Also, is there any documentation on the XML file. 
I have just been gleaning what I can from dmsg but would love to know what I should see on success and what some of the error messages mean
For Example are lines 2 & 3 here a message, warning or error?

[35038.277874] EtherCAT: Successfully requested master 0.
[35038.278683] EtherCAT 0: Domain0: Logical address 0x00000000, 2 byte, expected working counter 1.
[35038.278688] EtherCAT 0:   Datagram domain0-0-main: Logical offset 0x00000000, 2 byte, type LWR.
[35038.278728] EtherCAT 0: Master thread exited.
[35038.278736] EtherCAT 0: Starting EtherCAT-OP thread.


 

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

Time to create page: 0.491 seconds
Powered by Kunena Forum