Beckhoff ethercat 64 with bit linuxcnc, How to install.

More
29 Nov 2022 23:48 - 29 Nov 2022 23:49 #258053 by db1981
documentation is an problem....

I would not recommend do create your startup cmds manually.
the file from lcec examples is not complete. This is for an async motor as dummy on the b chanel. If you would have an servo, the whole parameter set would change and there are many parameters to add, that are not in the file yet..

The normal way to get ax5x running would be :

-create an working config in Twincat 2/3 , -> velocity control -> setup the right pdo
configuration, this has to match the mapping in the lcec driver.
-tune the current/velocity controller with twincat
-export the startup list xml
-copy the whole <ETHERCATMAILBOX> part in your initcmd xml

lcec pdo configuration for one AX5XXX Channel:
out:
lcec_syncs_add_pdo_entry(&hal_data->syncs, 0x0086, 0x01, 16); // control-word
lcec_syncs_add_pdo_entry(&hal_data->syncs, 0x0018, 0x01, 32); // velo-command 
in:
lcec_syncs_add_pdo_entry(&hal_data->syncs, 0x0087, 0x01, 16); // status word
lcec_syncs_add_pdo_entry(&hal_data->syncs, 0x0033, 0x01, 32); // position feedback
lcec_syncs_add_pdo_entry(&hal_data->syncs, 0x0054, 0x01, 16); // torque feedback
Last edit: 29 Nov 2022 23:49 by db1981.

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

More
30 Nov 2022 22:55 #258167 by boyzo
I did follow your steps and I am stuck with:
alcmd: loadusr -W /home/bojan/dev/linuxcnc-ethercat/src/lcec_conf ethercat-conf.xml
lcec_conf: ERROR: Invalid data
lcec_conf: ERROR: Parse error at line 2: parsing aborted
lcec_conf: ERROR: Parse error at line 7: parsing aborted
<stdin>:3: waitpid failed /home/bojan/dev/linuxcnc-ethercat/src/lcec_conf lcec_conf
<stdin>:3: /home/bojan/dev/linuxcnc-ethercat/src/lcec_conf exited without becoming ready

I can not find anything wrong in my xml files
Attachments:

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

More
30 Nov 2022 23:41 #258170 by boyzo
I find the reason for ERROR invalid data. My AX5203.xml was all in 1 line. I have to split it. You don't see it if you display the file in browser, you see it when you try to edit file.

Now I get the following:
halcmd: loadrt lcec
Note: Using POSIX realtime
Failed to read IDN: Invalid argument
LCEC: slave 0.3: Failed to execute IDN read (drive 0 idn S-0-79, error -22, error_code 00000000)
lcec: rtapi_app_main: Invalid argument (-22)
<stdin>:6: waitpid failed /usr/bin/rtapi_app lcec
<stdin>:6: /usr/bin/rtapi_app exited without becoming ready
<stdin>:6: insmod for lcec failed, returned -1

Please suggest.

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

More
01 Dec 2022 02:00 #258178 by db1981
check dmesg for errors, if there is no detailed information, set ethercat debug level to 1 and check again.

with an quick view at the initcmds, i am missing the pdo configuration -> there have to be a few <![CDATA[Telegram type]]> initcmds.

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

More
01 Dec 2022 19:05 #258247 by boyzo
It looks like I get some progress. My lcec is started:
halcmd: addf lcec.read-all test
halcmd: addf lcec.write-all test
halcmd: start
halcmd: setp lcec.0.EL2809.dout-0 1
halcmd: show pin
Component Pins:
. .
   67  bit   OUT          TRUE  lcec.0.EL1809.din-1
   67  bit   OUT         FALSE  lcec.0.EL1809.din-1-not
.
.
   67  bit   IN           TRUE  lcec.0.EL2809.dout-0
.
.
   67  bit   IN          FALSE  lcec.0.3.ch0.srv-enable
   67  bit   OUT         FALSE  lcec.0.3.ch0.srv-enabled
   67  bit   OUT          TRUE  lcec.0.3.ch0.srv-fault
   67  bit   IN          FALSE  lcec.0.3.ch0.srv-halt

I attach my initcmds .xml file.

Next I need to create hal. What would be the best way I should take?


 
Attachments:

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

More
01 Dec 2022 19:15 #258250 by db1981
does the servo drive reachs ethercat op state ? I am missing the dc config line in your ethercat_xml . I noticed the fault bit is set , could be result of clock error .

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

More
01 Dec 2022 19:26 #258252 by db1981
for hal starting ....

these are pins of one of my machines. The servodrive is named AX_X_C .

hardware io :
# X axis Encoder
net x-pos-fb <= lcec.0.AX_X_C.ch1.enc-pos
setp lcec.0.AX_X_C.ch1.srv-scale-fb2 [AXIS_0]ENC_SCALE #Incremente /pro 1 Einheit
# X AMP
setp lcec.0.AX_X_C.ch1.srv-scale [AXIS_0]SCALE #kehrwert Weg/pro 1 Motorumdrehung
net x-enable => lcec.0.AX_X_C.ch1.srv-enable
net x-vel-cmd => lcec.0.AX_X_C.ch1.srv-velo-cmd
net servo-x-fault <= lcec.0.AX_X_C.ch1.srv-fault

joint connections:


###########################################################
# X axis
###########################################################

# position controler
setp x-pid.Pgain [AXIS_0]P
setp x-pid.Igain [AXIS_0]I
setp x-pid.Dgain [AXIS_0]D
setp x-pid.FF0 [AXIS_0]FF0
setp x-pid.FF1 [AXIS_0]FF1
setp x-pid.FF2 [AXIS_0]FF2
setp x-pid.bias [AXIS_0]BIAS
setp x-pid.deadband [AXIS_0]DEADBAND
setp x-pid.maxoutput [AXIS_0]MAX_OUTPUT

#####
net x-enable => x-pid.enable
net x-pos-cmd => x-pid.command
net x-pos-fb => x-pid.feedback
net x-vel-cmd <= x-pid.output

# axis interface
net x-home => axis.0.home-sw-in
net x-enable <= axis.0.amp-enable-out
net x-amp-fault => axis.0.amp-fault-in
net x-pos-cmd <= axis.0.motor-pos-cmd #
net x-pos-fb => axis.0.motor-pos-fb   #
net x-pos-joint <= axis.0.joint-pos-fb
net x-homed <= axis.0.homed
net x-homing <= axis.0.homing
net x-pos-lim-in => axis.0.pos-lim-sw-in
net x-neg-lim-in => axis.0.neg-lim-sw-in

(this is an 2.7 machine... you have to translate to the joint pins.)

to more i have no access at the moment, i am out of office for many days..

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

More
01 Dec 2022 21:54 #258264 by boyzo

does the servo drive reachs ethercat op state ? I am missing the dc config line in your ethercat_xml . I noticed the fault bit is set , could be result of clock error .
 

No, only preop. But I do not have motors connected, only 24V to drive.
  67  bit   OUT         FALSE  lcec.0.3.slave-state-op
  67  bit   OUT          TRUE  lcec.0.3.slave-state-preop


If I put DC section I get the following:
halcmd: loadusr -W /home/bojan/dev/linuxcnc-ethercat/src/lcec_conf ethercat-conf.xml
lcec_conf: ERROR: unexpected node DC found
lcec_conf: ERROR: Parse error at line 986: parsing aborted
lcec_conf: ERROR: Parse error at line 7: parsing aborted

Maybe I put it in the wrong place?

 

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

More
02 Dec 2022 23:03 #258386 by boyzo
dmesg with debug level 1

[173184.504599] EtherCAT 0: Using slave 0 as DC reference clock.
[173239.482967] EtherCAT: Requesting master 0...
[173239.482974] EtherCAT: Successfully requested master 0.
[173239.674945] EtherCAT 0: Domain0: Logical address 0x00000000, 32 byte, expected working counter 6.
[173239.674951] EtherCAT 0:   Datagram domain0-0-main: Logical offset 0x00000000, 32 byte, type LRW at 00000000bab88993.
[173239.674988] EtherCAT 0: Master thread exited.
[173239.674991] EtherCAT 0: Starting EtherCAT-OP thread.
[173239.675081] EtherCAT WARNING 0: 1 datagram UNMATCHED!
[173402.585998] EtherCAT 0: Domain 0: Working counter changed to 1/6.
[173403.149017] EtherCAT WARNING 0-3: Slave does not support changing the PDO mapping!
[173403.149031] EtherCAT WARNING 0-3: Currently mapped PDO entries: 0x0086:00/16 0x002F:00/32. Entries to map: 0x0086:01/16 0x001
8:01/32
[173403.149045] EtherCAT WARNING 0-3: Slave does not support changing the PDO mapping!
[173403.149046] EtherCAT WARNING 0-3: Currently mapped PDO entries: 0x0086:00/16 0x002F:00/32. Entries to map: 0x0086:02/16 0x001
8:02/32
[173403.149063] EtherCAT WARNING 0-3: Slave does not support changing the PDO mapping!
[173403.149064] EtherCAT WARNING 0-3: Currently mapped PDO entries: 0x0087:00/16 0x0033:00/32 0x00BD:00/32. Entries to map: 0x008
7:01/16 0x0033:01/32 0x0054:01/16
[173403.149077] EtherCAT WARNING 0-3: Slave does not support changing the PDO mapping!
[173403.149078] EtherCAT WARNING 0-3: Currently mapped PDO entries: 0x0087:00/16 0x0033:00/32 0x00BD:00/32. Entries to map: 0x008
7:02/16 0x0033:02/32 0x0054:02/16
[173403.586998] EtherCAT 0: Domain 0: Working counter changed to 3/6.
[173406.070997] EtherCAT ERROR 0-3: Failed to set SAFEOP state, slave refused state change (PREOP + ERROR).
[173406.072996] EtherCAT ERROR 0-3: AL status message 0x0045: "MBX_SOE".
[173406.074998] EtherCAT 0-3: Acknowledged state PREOP.
[173406.082658] EtherCAT 0: Slave states on main device: PREOP, OP.
[173753.578796] EtherCAT 0: Master thread exited.
[173753.578881] EtherCAT 0: Starting EtherCAT-IDLE thread.

 

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

More
10 Dec 2022 12:58 #259092 by akg1904
Hi,
I installed Ethercat and I'm able to detect my slaves.
now I am facing two challenges which require some help:
1. How to communicate and read data in Terminal
2. How to map ethercat I/O module to the LINUXCNC

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

Time to create page: 0.178 seconds
Powered by Kunena Forum