Ethercat HAL driver

More
22 May 2014 17:15 #47192 by willrat
Replied by willrat on topic Ethercat HAL driver
I had that error using some EL1008 off ebay. The units were dead

You can check with
user@emc-test:~$ ethercat slaves
0      0:0  INIT  +  EK1100 EtherCAT-Koppler (2A E-Bus)
1  65535:0  INIT  +  0xffffffff:0xffffffff

The final line shows the dead unit.

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

More
22 May 2014 17:19 - 22 May 2014 17:21 #47193 by narogon
Replied by narogon on topic Ethercat HAL driver
I'm having the error independently if there are connected or not. In any case I have not any problem when i make ethercat slaves
0  0:0  PREOP  +  EK1100 EtherCAT-Koppler (2A E-Bus)
1  0:1  PREOP  +  EL1014 4K. Dig. Eingang 24V, 10�s
Last edit: 22 May 2014 17:21 by narogon.

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

More
22 May 2014 17:23 #47194 by narogon
Replied by narogon on topic Ethercat HAL driver
Could you post your xml file to check if there is something different from mine?

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

More
22 May 2014 17:31 - 22 May 2014 17:32 #47195 by willrat
Replied by willrat on topic Ethercat HAL driver
We used that same module on a working machine for a customer;
The config was like this;
<master idx="0" appTimePeriod="1000000" refClockSyncCycles="1">
  <slave idx="0" type="EK1100"/>
  
  <!-- modded the source to use the 12 bit module -->  
  <slave idx="1" type="EL3062"/>
  <slave idx="2" type="EL4032"/>
  
  <slave idx="3" type="EL1018"/>
  <slave idx="4" type="EL1018"/>
  
  <slave idx="5" type="EL2008"/>
   
  <slave idx="6" type="EL2024"/>
  
</master>

We added the EL3062 into the source if anyone is interested. Can probably be implemented with the generic driver anyway(?)
Last edit: 22 May 2014 17:32 by willrat.

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

More
22 May 2014 17:47 #47196 by narogon
Replied by narogon on topic Ethercat HAL driver
I've solved it using the generic type, but i would appreciated if anyone could discover why doesn't work using ELxxxx :S
<master idx="0" appTimePeriod="1000000" refClockSyncCycles="10">
	<slave idx="0" type="EK1100" />
	<slave idx="1" type="generic" vid="00000002" pid="03F63052" configPdos="true">
		
		<syncManager idx="0" dir="in">
			<pdo idx="1A00">
				<pdoEntry idx="3101" subIdx="01" bitLen="1" halPin="entrada1" halType="bit"/>
			</pdo>
			<pdo idx="1A01">
				<pdoEntry idx="3101" subIdx="02" bitLen="1" halPin="entrada2" halType="bit"/>
			</pdo>
			<pdo idx="1A02">
				<pdoEntry idx="3101" subIdx="03" bitLen="1" halPin="entrada3" halType="bit"/>
			</pdo>
			<pdo idx="1A03">
				<pdoEntry idx="3101" subIdx="04" bitLen="1" halPin="entrada4" halType="bit"/>
			</pdo>
		</syncManager>
	</slave>
</master>

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

More
26 Jun 2014 22:07 #48258 by javiergr
Replied by javiergr on topic Ethercat HAL driver
Hello, I am transform the EL2004 files to EP2338 box for compiling it but no posible, how I must configure this 2 files for get lcec_ep2338.o and use me box for pulse-direction control?

Best regards

lcec_el2xxx.h

//
// Copyright (C) 2011 Sascha Ittner <This email address is being protected from spambots. You need JavaScript enabled to view it.>
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
//

#include "lcec.h"
#include "lcec_el2xxx.h"

typedef struct {
hal_bit_t *out;
hal_bit_t invert;
unsigned int pdo_os;
unsigned int pdo_bp;
} lcec_el2xxx_pin_t;

void lcec_el2xxx_write(struct lcec_slave *slave, long period);

int lcec_el2xxx_init(int comp_id, struct lcec_slave *slave, ec_pdo_entry_reg_t *pdo_entry_regs) {
lcec_master_t *master = slave->master;
lcec_el2xxx_pin_t *hal_data;
lcec_el2xxx_pin_t *pin;
int i;
int err;

// initialize callbacks
slave->proc_write = lcec_el2xxx_write;

// alloc hal memory
if ((hal_data = hal_malloc(sizeof(lcec_el2xxx_pin_t) * slave->pdo_entry_count)) == NULL) {
rtapi_print_msg(RTAPI_MSG_ERR, LCEC_MSG_PFX "hal_malloc() for slave %s.%s failed\n", master->name, slave->name);
return -EIO;
}
memset(hal_data, 0, sizeof(lcec_el2xxx_pin_t) * slave->pdo_entry_count);
slave->hal_data = hal_data;

// initialize pins
for (i=0, pin=hal_data; i<slave->pdo_entry_count; i++, pin++) {
// initialize POD entry
LCEC_PDO_INIT(pdo_entry_regs, slave->index, slave->vid, slave->pid, 0x7000 + (i << 4), 0x01, &pin->pdo_os, &pin->pdo_bp);

// export pins
if ((err = hal_pin_bit_newf(HAL_IN, &(pin->out), comp_id, "%s.%s.%s.dout-%d", LCEC_MODULE_NAME, master->name, slave->name, i)) != 0) {
rtapi_print_msg(RTAPI_MSG_ERR, LCEC_MSG_PFX "exporting pin %s.%s.%s.dout-%02d failed\n", LCEC_MODULE_NAME, master->name, slave->name, i);
return err;
}
if ((err = hal_param_bit_newf(HAL_RW, &(pin->invert), comp_id, "%s.%s.%s.dout-%d-invert", LCEC_MODULE_NAME, master->name, slave->name, i)) != 0) {
rtapi_print_msg(RTAPI_MSG_ERR, LCEC_MSG_PFX "exporting pin %s.%s.%s.dout-%02d-invert failed\n", LCEC_MODULE_NAME, master->name, slave->name, i);
return err;
}

// initialize pins
*(pin->out) = 0;
pin->invert = 0;
}

return 0;
}

void lcec_el2xxx_write(struct lcec_slave *slave, long period) {
lcec_master_t *master = slave->master;
lcec_el2xxx_pin_t *hal_data = (lcec_el2xxx_pin_t *) slave->hal_data;
uint8_t *pd = master->process_data;
lcec_el2xxx_pin_t *pin;
int i, s;

// set outputs
for (i=0, pin=hal_data; i<slave->pdo_entry_count; i++, pin++) {
s = *(pin->out);
if (pin->invert) {
s = !s;
}
EC_WRITE_BIT(&pd[pin->pdo_os], pin->pdo_bp, s);
}
}



lcec_el2xxx.h


//
// Copyright (C) 2011 Sascha Ittner <This email address is being protected from spambots. You need JavaScript enabled to view it.>
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
//
#ifndef _LCEC_EL2XXX_H_
#define _LCEC_EL2XXX_H_

#include "lcec.h"

#define LCEC_EL2xxx_VID LCEC_BECKHOFF_VID

#define LCEC_EL2002_PID 0x07D23052
#define LCEC_EL2004_PID 0x07D43052
#define LCEC_EL2008_PID 0x07D83052
#define LCEC_EL2022_PID 0x07E63052
#define LCEC_EL2024_PID 0x07E83052
#define LCEC_EL2032_PID 0x07F03052
#define LCEC_EL2034_PID 0x07F23052
#define LCEC_EL2042_PID 0x07FA3052
#define LCEC_EL2084_PID 0x08243052
#define LCEC_EL2088_PID 0x08283052
#define LCEC_EL2124_PID 0x084C3052
#define LCEC_EL2808_PID 0x0AF83052
#define LCEC_EL2809_PID 0x0AF93052

#define LCEC_EL2002_PDOS 2
#define LCEC_EL2004_PDOS 4
#define LCEC_EL2008_PDOS 8
#define LCEC_EL2022_PDOS 2
#define LCEC_EL2024_PDOS 4
#define LCEC_EL2032_PDOS 2
#define LCEC_EL2034_PDOS 4
#define LCEC_EL2042_PDOS 2
#define LCEC_EL2084_PDOS 4
#define LCEC_EL2088_PDOS 8
#define LCEC_EL2124_PDOS 4
#define LCEC_EL2808_PDOS 8
#define LCEC_EL2809_PDOS 16

int lcec_el2xxx_init(int comp_id, struct lcec_slave *slave, ec_pdo_entry_reg_t *pdo_entry_regs);

#endif
The following user(s) said Thank You: Nico2017

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

More
26 Jun 2014 23:02 #48260 by narogon
Replied by narogon on topic Ethercat HAL driver
Why don't you use the generic one?

You describe your EP2338 in the xml file and type=generic.

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

More
11 Jul 2014 18:52 #48649 by lincnc
Replied by lincnc on topic Ethercat HAL driver
Hi everybody,

I would like to ask for help running LinuxCNC with Sascha's EtherCAT HAL driver using AX5xxx servo drives from Beckhoff.

Here is Beckhoff's xml drive description file:

File Attachment:

File Name: BeckhoffAX5xxx.xml
File Size:799 KB


My drive is AX5201-0000-0200, but that model is missing in the xml file, so I use the info for AX5201-0000-0203, assuming it's approximately the same.

Here is my configuration file:

File Attachment:

File Name: ethercat_config_n.xml
File Size:1 KB


I must mention that there isn't any watchdog information in Beckhoff's xml file so I used some logical values.

The problem is that whenever I plug the ethernet cable in the drive's ethercat input, the drive display indicates that there is an error named "F581".
Here is the official Beckhoff's description about this error.

I can properly start the drive in TwinCAT and I can see the "Startup" IDN values that TwinCAT is writing to the drive, so I write the same IDN values to the drive with "ethercat soe_write" command, but still no success. The drive display continue to blink and indicate the "F581" error.

Do you have any ideas?
Any help would be appreciated.
Thank you.
Attachments:

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

More
12 Jul 2014 23:35 - 12 Jul 2014 23:42 #48694 by roschi
Replied by roschi on topic Ethercat HAL driver
Hi

first of all your xml-config-file for the HAL driver is wrong for the dcconf.

You have:
<dcConf assignActivate="730" sync0Cycle="250000" sync0Shift="50000"/>
You should have:
<dcConf assignActivate="730" sync0Cycle="*1" sync0Shift="50000"/>

Next Test should go like this:
1. Unplug cable
2. start or restart ethercat master
3. reboot drive
4. plug cable
--> no error should appear -->5.
--> if an error appears than it is no Linuxcnc/HAL-Driver issue.
5. test for the drive with "ethercat slaves" (soe_write won't work as far as i know forthat drives)
--> check for product ID and compare/search in original xml file --> check parameters
6. start lcnc

Hope that will solve your problem.

Regards
Andreas
Last edit: 12 Jul 2014 23:42 by roschi.
The following user(s) said Thank You: Nico2017

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

More
13 Jul 2014 19:51 #48726 by Coyote
Replied by Coyote on topic Ethercat HAL driver
Beckhoff AX5xxx uses Sercos over Ethercat (SOE), while drivers of Sacha work for CanOpen over Ethercat (COE). Beckhoff anounced that new drives will use COE and SOE will be deprecated. If you succed, you will be the first one to connect linuxcnc with AX5xxx, please post your solution when it will be available, I am interested to use AX5xxxx.

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

Time to create page: 0.155 seconds
Powered by Kunena Forum