Beckhoff ethercat 64 with bit linuxcnc, How to install.

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

More
3 years 10 months ago #259143 by rodw
What IO module?
If its not beckhof, you need to make a custom xml file.
With just the io module connected type
ethercat slaves -v
ethercat pdos

You will have all the info to build a xml file similar to  slave1 here
github.com/rodw-au/linuxcnc-cia402/blob/...ercat-conf-diewu.xml

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

More
3 years 10 months ago #259249 by akg1904
So I am trying to get a Weidmuller UR20-FBC-EC IO module integrated.

I tried my best to make the xml file.
I had a few doubts though...

On line 6 what are these responsible for:
appTimePeriod="1000000"
refClockSyncCycles="1"

On line 7 what are these responsible for:
type="generic"
configPdos="false"

On line 8 what are these responsible for:
assignActivate="300"
sync0Cycle="*1"
sync0Shift="0"

I have also attached the xml file with this post.
At the end of the file there are 3 commented out sections that have the response to:

ethercat slaves -v
ethercat pdos
ethercat sdos

Not sure if that is any help or not but just thought maybe the extra information may be useful. Please ignore it if it's useless.

File Attachment:

File Name: wm-io.xml
File Size:47 KB


Now I do have another question. After this custom xml file is generated, how do I go about integrating it with linuxcnc?

Thanks again for you help :)

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

Time to create page: 0.151 seconds
Powered by Kunena Forum