Issue with LinuxCNC Pins showing zero

More
1 year 8 months ago #322048 by mc_cubus
Hello Everyone,
I'm have an IFC2411 confocal sensor (Micro-Epsilon) on my EtherCAT network. The sensor is recognized and appears in OP state:
Code:
0  0:0  OP  +  ECOMODUL 1  0:1  OP  +  PD4-Ex-E-65-1 EtherCAT Drive (CoE) 2  0:2  OP  +  ECAT-2513 4-Port EtherCAT Junction(IN/OUT1) 3  0:3  OP  +  ECAT-2513 4-Port EtherCAT Junction(OUT2/OUT3) 4  0:4  OP  +  IFC2411
I can do an SDO read of 0x6000:01 and get non-zero distance values—proving the sensor is physically measuring and returning data internally:
Code:
ethercat upload -p 4 0x6000 0x01 --type uint32 0x001d6fe3 1929187

The ethercat pdos -p 4 says:
Code:
SM0: PhysAddr 0x1000, DefaultSize 1024, ControlRegister 0x26, Enable 1 SM1: PhysAddr 0x1400, DefaultSize 1024, ControlRegister 0x22, Enable 1 SM2: PhysAddr 0x1800, DefaultSize    0, ControlRegister 0x64, Enable 1 SM3: PhysAddr 0x1818, DefaultSize   24, ControlRegister 0x20, Enable 1   TxPDO 0x1a00 ""     PDO entry 0x6000:01, 32 bit, ""   TxPDO 0x1a30 ""     PDO entry 0x6010:01, 32 bit, ""   TxPDO 0x1a80 ""     PDO entry 0x6030:01, 32 bit, ""   TxPDO 0x1ae0 ""     PDO entry 0x7000:01, 32 bit, ""   TxPDO 0x1ae8 ""     PDO entry 0x7001:01, 32 bit, ""   TxPDO 0x1af0 ""     PDO entry 0x7002:01, 32 bit, ""

However, in LinuxCNC’s HAL pins (e.g.
Code:
lcec.0.IFC2411Sensor.ifc2411-distance
), the value stays at 0.
Code:
halcmd show pin lcec.0.IFC2411Sensor Component Pins: Owner   Type  Dir         Value  Name     37  s32   OUT             0  lcec.0.IFC2411Sensor.ifc2411-counter ==> ifc2411-counter     37  s32   OUT             0  lcec.0.IFC2411Sensor.ifc2411-distance ==> ifc2411-distance     37  s32   OUT             0  lcec.0.IFC2411Sensor.ifc2411-frequency ==> ifc2411-frequency     37  s32   OUT             0  lcec.0.IFC2411Sensor.ifc2411-intensity ==> ifc2411-intensity     37  s32   OUT             0  lcec.0.IFC2411Sensor.ifc2411-shutter ==> ifc2411-shutter     37  s32   OUT             0  lcec.0.IFC2411Sensor.ifc2411-timestamp ==> ifc2411-timestamp     37  bit   OUT          TRUE  lcec.0.IFC2411Sensor.slave-online     37  bit   OUT          TRUE  lcec.0.IFC2411Sensor.slave-oper     37  bit   OUT         FALSE  lcec.0.IFC2411Sensor.slave-state-init     37  bit   OUT          TRUE  lcec.0.IFC2411Sensor.slave-state-op     37  bit   OUT         FALSE  lcec.0.IFC2411Sensor.slave-state-preop     37  bit   OUT         FALSE  lcec.0.IFC2411Sensor.slave-state-safeop


The slave is defined in ethercat_conf.xml as follows:
Code:
<slave idx="4" name="IFC2411Sensor" type="generic" vid="0x00000607" pid="0x62ece209" configPdos="true">                          <syncManager idx="3" dir="in">                 <!-- Channel 1 distance 1 TxPDOMap OV1 -->                 <pdo idx="1a00">                   <pdoEntry idx="6000" subIdx="01" bitLen="32" halPin="ifc2411-distance" halType="s32"/>                 </pdo>                 <!-- Channel 1 intensity 1 TxPDOMap OV1 -->                 <pdo idx="1a30">                   <pdoEntry idx="6010" subIdx="01" bitLen="32" halPin="ifc2411-intensity" halType="s32"/>                 </pdo>                 <!-- Channel 1 shutter TxPDOMap OV1 -->                 <pdo idx="1a80">                   <pdoEntry idx="6030" subIdx="01" bitLen="32" halPin="ifc2411-shutter" halType="s32"/>                 </pdo>                 <!-- Counter TxPDOMap OV1 -->                 <pdo idx="1ae0">                   <pdoEntry idx="7000" subIdx="01" bitLen="32" halPin="ifc2411-counter" halType="s32"/>                 </pdo>                 <!-- Time stamp TxPDOMap OV1 -->                 <pdo idx="1ae8">                   <pdoEntry idx="7001" subIdx="01" bitLen="32" halPin="ifc2411-timestamp" halType="s32"/>                 </pdo>                 <!-- Frequency TxPDOMap OV1 -->                 <pdo idx="1af0">                   <pdoEntry idx="7002" subIdx="01" bitLen="32" halPin="ifc2411-frequency" halType="s32"/>                 </pdo>             </syncManager>         </slave>

The .hal file contains the following mappings:
Code:
#PDOs to HAL Pins mapping for IFC2411 Confocal Sensor net ifc2411-distance <= lcec.0.IFC2411Sensor.ifc2411-distance net ifc2411-intensity <= lcec.0.IFC2411Sensor.ifc2411-intensity net ifc2411-shutter <= lcec.0.IFC2411Sensor.ifc2411-shutter net ifc2411-counter <= lcec.0.IFC2411Sensor.ifc2411-counter net ifc2411-timestamp <= lcec.0.IFC2411Sensor.ifc2411-timestamp net ifc2411-frequency <= lcec.0.IFC2411Sensor.ifc2411-frequency

I have the feeling that I am overseeing something trivial and would be thankful for any kind of help!

Cheers,

Please Log in to join the conversation.

More
1 year 8 months ago #322058 by rodw
I suspect some SDOs need to be set. Not sure if I am reading the right manual but on P 104 it says
In object 0x1C13, it is selected which PDOs are to be transferred. The PDO mapping objects are selected.

Please Log in to join the conversation.

More
1 year 8 months ago #322066 by mc_cubus
ok I tried setting the SDOs as specified in the manual, i.e.:
Code:
<!-- Example initCmds to map 0x1A00 to SM3 (0x1C13) -->                         <!-- 1) Clear existing SM3 assignments -->                         <InitCmd>                           <Transition>PS</Transition>                           <Comment>clear sm pdos (0x1C13)</Comment>                           <Timeout>0</Timeout>                           <Ccs>1</Ccs> <!-- CoE command -->                           <Index>0x1C13</Index>                           <SubIndex>0</SubIndex>                           <Data>00</Data>  <!-- zero => no assigned PDOs -->                         </InitCmd>                         <!-- 2) Add 1A00 as the first PDO to SM3 -->                         <InitCmd>                           <Transition>PS</Transition>                           <Comment>add pdo 0x1A00 to sm3</Comment>                           <Timeout>0</Timeout>                           <Ccs>1</Ccs>                           <Index>0x1C13</Index>                           <SubIndex>1</SubIndex>                           <Data>1a00</Data>  <!-- This is the hex index of the PDO (0x1A00) -->                         </InitCmd>                         <!-- 3) Set the new count of assigned PDOs to 1 -->                         <InitCmd>                           <Transition>PS</Transition>                           <Comment>download pdo 0x1C13:00 index => 1</Comment>                           <Timeout>0</Timeout>                           <Ccs>1</Ccs>                           <Index>0x1C13</Index>                           <SubIndex>0</SubIndex>                           <Data>01</Data>  <!-- 1 assigned PDO in SM3 -->                         </InitCmd>

Now, when running linuxcnc I get:
Code:
Waiting for component 'lcec' to become ready..........................Failed to execute SDO download: Input/output error LCEC: slave 0.IFC2411Sensor: Failed to execute SDO download (0x1c13:0x00, size 1, byte0=0, error -5, abort_code 06010002) LCEC: failed to configure slave 0.IFC2411Sensor sdo 1c13:00 Failed to execute SDO download: Input/output error LCEC: slave 0.IFC2411Sensor: Failed to execute SDO download (0x1c13:0x01, size 2, byte0=26, error -5, abort_code 00000000) LCEC: failed to configure slave 0.IFC2411Sensor sdo 1c13:01 .Failed to execute SDO download: Input/output error LCEC: slave 0.IFC2411Sensor: Failed to execute SDO download (0x1c13:0x00, size 1, byte0=1, error -5, abort_code 00000000) LCEC: failed to configure slave 0.IFC2411Sensor sdo 1c13:00 LCEC: slave 0.IFC2411Sensor: Failed to execute SDO download (0x1c13:0x00, size 1, byte0=0, error -5, abort_code 06010002) LCEC: failed to configure slave 0.IFC2411Sensor sdo 1c13:00 LCEC: slave 0.IFC2411Sensor: Failed to execute SDO download (0x1c13:0x01, size 2, byte0=26, error -5, abort_code 00000000) LCEC: failed to configure slave 0.IFC2411Sensor sdo 1c13:01 LCEC: slave 0.IFC2411Sensor: Failed to execute SDO download (0x1c13:0x00, size 1, byte0=1, error -5, abort_code 00000000) LCEC: failed to configure slave 0.IFC2411Sensor sdo 1c13:00

I suspect that the Sensor comes up with a default (locked) PDO assignment, since ethercat pdos -p 4 says:
Code:
ethercat pdos -p 4 SM0: PhysAddr 0x1000, DefaultSize 1024, ControlRegister 0x26, Enable 1 SM1: PhysAddr 0x1400, DefaultSize 1024, ControlRegister 0x22, Enable 1 SM2: PhysAddr 0x1800, DefaultSize    0, ControlRegister 0x64, Enable 1 SM3: PhysAddr 0x1818, DefaultSize   24, ControlRegister 0x20, Enable 1   TxPDO 0x1a00 ""     PDO entry 0x6000:01, 32 bit, ""   TxPDO 0x1a30 ""     PDO entry 0x6010:01, 32 bit, ""   TxPDO 0x1a80 ""     PDO entry 0x6030:01, 32 bit, ""   TxPDO 0x1ae0 ""     PDO entry 0x7000:01, 32 bit, ""   TxPDO 0x1ae8 ""     PDO entry 0x7001:01, 32 bit, ""   TxPDO 0x1af0 ""     PDO entry 0x7002:01, 32 bit, ""

And also with $ ethercat upload -p 4 0x1C13 0x00 --type uint8 one can see which PDOs are assigned to the 0x1C13 object and all are already assigned to it.

I am trying to figure out if the problem lies on the Sensor side or I did something wrong with LinuxCNC configuration.

Please Log in to join the conversation.

More
1 year 8 months ago #322678 by mc_cubus
Ok, apparently I just needed to restart the Sensor couple of times in a row and now I started to see the data. The topic may be closed.

Cheers,

Please Log in to join the conversation.

Time to create page: 0.586 seconds
Powered by Kunena Forum