Hi,
I'm trying to get a module working that is not already supported and I hope someone can help me. I followed the instructions on the first page of this thread as best I could.
First I was trying to get an EL3068 8 port analog card working and it was successful. I'm using it to read some potentiometers.
Now I'm trying to get an EL5102 module working and I thought this would be the easier one since the EL5101 is already supported. After following the process linuxcnc doesn't complain about it being in my hal file but the module doesn't leave preop stage.
I copied the EL5101.h and EL5101.c files to lcec_El5102.h and .c
modified them to substitute 5101 to 5102 and changed the ProductCode field (from ethercat xml -p7)
I didn't try adding the second channel in the .c file. I looked but how to do it wasn't obvious.
did make clean and then make
cp lcec.so ../../linuxcnc-dev/rtlib/
sudo cp lcec_conf /usr/bin/
cp lcec_conf ../../linuxcnc/configs/wedm/
ethercat slaves gives: (with linuxcnc started)
0 0:0 OP + EK1100 EtherCAT-Koppler (2A E-Bus)
1 0:1 OP + EL1809 16K. Dig. Eingang 24V, 3ms
2 0:2 OP + EL2008 8K. Dig. Ausgang 24V, 0.5A
3 0:3 OP + EL3068 8K. Ana. Eingang 0-10V
4 0:4 OP + EK1100 EtherCAT-Koppler (2A E-Bus)
5 0:5 OP + EL1008 8K. Dig. Eingang 24V, 3ms
6 0:6 OP + EL2008 8K. Dig. Ausgang 24V, 0.5A
7 0:7 PREOP + EL5102 2Ch. Inc. Encoder 5V (RS422,TTL)
8 0:8 OP + EL7342 2K. DC-Motor-Endstufe (50V, 3.5A)
9 0:9 OP + DVS_ETHCAT_v1.004
10 0:10 OP + DVS_ETHCAT_v1.004
if I set ethercat debug 1 and look at dmesg I see it checking the time offset when starting up but later it just skips over it when going through each device.
[...]
[186186.355310] EtherCAT DEBUG 0-4: Checking system time offset.
[186186.375331] EtherCAT DEBUG 0-4: DC 64 bit system time offset calculation: system_time=761845177497583898 (corrected with 20000000), app_time=761845177496618367, diff=-965531
[186186.375339] EtherCAT DEBUG 0-4: Not touching time offset.
[186186.395306] EtherCAT DEBUG 0-7: Checking system time offset.
[186186.415328] EtherCAT DEBUG 0-7: DC 64 bit system time offset calculation: system_time=761845177537569111 (corrected with 20000000), app_time=761845177536577318, diff=-991793
[186186.415336] EtherCAT DEBUG 0-7: Not touching time offset.
[186186.435301] EtherCAT DEBUG 0-8: Checking system time offset.
[186186.455318] EtherCAT DEBUG 0-8: DC 64 bit system time offset calculation: system_time=761845177577586331 (corrected with 20000000), app_time=761845177576580029, diff=-1006302
[186186.455327] EtherCAT DEBUG 0-8: Setting time offset to 761658983053803698 (was 761658983054810000)
[...]
[186186.860091] EtherCAT DEBUG 0-6: Now in SAFEOP.
[186186.862084] EtherCAT DEBUG 0-6: Now in OP. Finished configuration.
[186186.895348] EtherCAT DEBUG 0-8: Changing state from PREOP to OP.
[186186.895356] EtherCAT DEBUG 0-8: Configuring...
[186186.898094] EtherCAT DEBUG 0-8: Now in INIT.
ethercat slaves -v gives:
=== Master 0, Slave 7 ===
Device: Main
State: PREOP
Flag: +
Identity:
Vendor Id: 0x00000002
Product code: 0x13ee3052
Revision number: 0x00100000
Serial number: 0x00000000
DL information:
FMMU bit operation: no
Distributed clocks: yes, 64 bit
DC system time transmission delay: 1880 ns
Port Type Link Loop Signal NextSlave RxTime [ns] Diff [ns] NextDc [ns]
0 EBUS up open yes 6 3045771182 0 145
1 EBUS up open yes 8 3045771492 310 155
2 N/A down closed no - - - -
3 N/A down closed no - - - -
Mailboxes:
Bootstrap RX: 0x1000/244, TX: 0x10f4/244
Standard RX: 0x1000/128, TX: 0x1100/128
Supported protocols: CoE, FoE
General:
Group: Measuring
Image name:
Order number: EL5102
Device name: EL5102 2Ch. Inc. Encoder 5V (RS422,TTL)
CoE details:
Enable SDO: yes
Enable SDO Info: yes
Enable PDO Assign: yes
Enable PDO Configuration: no
Enable Upload at startup: no
Enable SDO complete access: yes
Flags:
Enable SafeOp: no
Enable notLRW: no
Current consumption: 210 mA
uname -a
Linux Charmilles 4.19.71-rt24-v7l+ #1 SMP PREEMPT RT Fri Jan 1 21:15:16 GMT 2021 armv7l GNU/Linux
LINUXCNC - 2.8.4
This is a raspberry PI and built following instructions from MetalMusings
forum.linuxcnc.org/ethercat/42048-notes-...at-on-raspberry-pi-4
I'm sure I did a bunch of other stuff after following his instructions but I didn't document exactly what I was doing and don't quite remember. However, apart from this card it is mostly working. I/O is working and my ethercat drives are moving are moving the servo motors. I have a separate issue related to a belt reduction but that should probably be in another thread.