Ethercat HAL driver

More
13 years 2 weeks ago #39994 by nursum
Replied by nursum on topic Ethercat HAL driver
Hello Oscar,

I plan to fit my milling machine with Ethercat controlled drives (actually +/- 10V). All hardware is still here but the time is the problem!
Do you have scills about the mapping of the SDO and PDO objects with Ethercat and here especialy with the drives? You have to go very deep in the CAN over Ethercat protocol.....

Ingo (Germany)
More
13 years 2 weeks ago #40025 by sascha
Replied by sascha on topic Ethercat HAL driver
Hi Oscar,

it supports DC for any device that supports DCs. Please find here an example for a machine with stoeber servo inverters:
Code:
<masters> <master idx="0" appTimePeriod="1000000" refClockSyncCycles="1000"> <slave idx="0" type="EK1100"/> <slave idx="1" type="EL1008"/> <slave idx="2" type="EL1008"/> <slave idx="3" type="EL1008"/> <slave idx="4" type="EL2008"/> <slave idx="5" type="EL5101"/> <slave idx="6" type="EL9510"/> <slave idx="7" type="EL3162"/> <slave idx="8" type="EK1100"/> <slave idx="9" type="EL1008"/> <slave idx="10" type="EL1008"/> <slave idx="11" type="EL1008"/> <slave idx="12" type="EL1008"/> <slave idx="13" type="EL1008"/> <slave idx="14" type="EL2008"/> <slave idx="15" type="EL5152"/> <slave idx="16" type="EL2008"/> <slave idx="17" type="EL2008"/> <slave idx="18" type="StMDS5k"> <dcConf assignActivate="300" sync0Cycle="*1" sync0Shift="-25000"/> <watchdog divider="2498" intervals="5000"/> </slave> <slave idx="19" type="StMDS5k"> <dcConf assignActivate="300" sync0Cycle="*1" sync0Shift="-25000"/> <watchdog divider="2498" intervals="5000"/> </slave> <slave idx="20" type="StMDS5k"> <dcConf assignActivate="300" sync0Cycle="*1" sync0Shift="-25000"/> <watchdog divider="2498" intervals="5000"/> </slave> <slave idx="21" type="StMDS5k"> <dcConf assignActivate="300" sync0Cycle="*1" sync0Shift="-25000"/> <watchdog divider="2498" intervals="5000"/> </slave> <slave idx="22" type="StMDS5k"> <dcConf assignActivate="300" sync0Cycle="*1" sync0Shift="-25000"/> <watchdog divider="2498" intervals="5000"/> </slave> <slave idx="23" type="StMDS5k"> <dcConf assignActivate="300" sync0Cycle="*1" sync0Shift="-25000"/> <watchdog divider="2498" intervals="5000"/> </slave> </master> </masters>

First you need too tell the master to sync its clock to the slaves:
Code:
<master idx="0" appTimePeriod="1000000" refClockSyncCycles="1000">
where appTimePeriod has to match the servo period (in ns) and refClockSyncCycles tells how many servo periods to skip between the actual syncs (This sould not be too low to smooth the jitter).

Then you can configure the sync for each device:
Code:
<dcConf assignActivate="300" sync0Cycle="*1" sync0Shift="-25000"/>
assignActivate is the hex code from the device's device description xml, sync0Cycle "*1" means to sync on every cycle and sync0Shift is the sync offset (in ns) to reduce the impact of jitter.

What kind of inverter do you plan to use? You can use the generic driver to interface that device (please see one of my earlier posts for an example), but real fun will appear if you build an native driver module for a particular inverter that do all the dirty work like scaling, reading SDOs on initialization and exporting pins with the domain specific data types. The lcec_stmds5k.c or lcec_el7342.c might be good starting points for that (stmds5k is the stoeber inverter and el7342 a dc motor driver with encoder fedback).

Regards
Sascha
The following user(s) said Thank You: Nico2017
More
13 years 1 week ago - 13 years 1 week ago #40100 by roschi
Replied by roschi on topic Ethercat HAL driver
Hello Oscar,

I used the "generic" EtherCat driver from Sascha Ittner for Bosch Rexroth Indradrives.
I've added a parameter to the XML file in the generic slave entry which does a simple scaling (meens also adjusting some code from Sascha Ittner). Nothing else was changed in the generic driver. All other settings can be made directly in the drive.

See Post

or
video from setup on youtube
Last edit: 13 years 1 week ago by roschi.
The following user(s) said Thank You: Nico2017
More
13 years 1 week ago #40121 by Coyote
Replied by Coyote on topic Ethercat HAL driver
Good work from Sascha is yet giving results.
I would ask some few things:
1. Sascha did a driver that has also a generic that you can modify and save for use with new hardware. This is comlicated for somebody that has no experience in doing that (like me). Is it possible that someday, somebody will write a parser from configuration XML files to EMC2? On Beckhoff site you can dowload the entire product line with XML conf files, except AX5xxx servos. It wouldn't be simpler to copy directory (or xml files from other hw makers) to emc2 directory and simply selecting them - I know that isn't easy and what we do have now is quite good, but...

2. I downloaded servo AX5xxx conf files in XML format, all I have seen is that servo drives series 5000 from Beckhoff use Sercos over Ethercat (SoE), will be possible in future to implemet also SoE devices?

3. Is it possible to have a quick tutorial how to make a driver from Sascha's generic one, if you get an XML file with PDOs ?


Anyway thank you for the contribution (Sascha, Etherlab) you already did, it changed emc2 from hobby to professional.
More
13 years 1 week ago #40122 by andypugh
Replied by andypugh on topic Ethercat HAL driver

Coyote wrote: 1. Sascha did a driver that has also a generic that you can modify and save for use with new hardware. This is comlicated for somebody that has no experience in doing that (like me). Is it possible that someday, somebody will write a parser from configuration XML files to EMC2?


We aren't allowed to use the four characters "EMC2" any more, we have had to rebrand everything as "LinuxCNC".

Anyway, as far as I can see, the config files for the LinuxCNC Ethercat driver are XML files. It may be that the ones you can download will just work.
More
13 years 1 week ago #40141 by roschi
Replied by roschi on topic Ethercat HAL driver

Coyote wrote: 1. Sascha did a driver that has also a generic that you can modify and save for use with new hardware. This is comlicated for somebody that has no experience in doing that (like me). Is it possible that someday, somebody will write a parser from configuration XML files to EMC2? On Beckhoff site you can dowload the entire product line with XML conf files, except AX5xxx servos. It wouldn't be simpler to copy directory (or xml files from other hw makers) to emc2 directory and simply selecting them - I know that isn't easy and what we do have now is quite good, but...
.

I think we are not that far away from that. See the tutorial.

Coyote wrote: 2. I downloaded servo AX5xxx conf files in XML format, all I have seen is that servo drives series 5000 from Beckhoff use Sercos over Ethercat (SoE), will be possible in future to implemet also SoE devices?


The configuration of drives with SoE is not (yet) possible with the HAL-Driver for EtherCAT. Therefore you have to build a state machine within the init phase of the HAL-driver itself. That’s because some of the IDN’s can only be written in Bus-INIT Phase and some should be written to the drive in the Bus-PreOP Phase. (The tool EtherCAT Configurator from Beckhoff, free download does this). Because you have to do this only once, from my point of view there is no great need to implement in the HAL-Driver SoE support in a general way for different Bus-Phases. It is 'nice to have'.

Coyote wrote: 3. Is it possible to have a quick tutorial how to make a driver from Sascha's generic one, if you get an XML file with PDOs ?


I have written a little tutorial that work for the IndraDrive Cs from Bosch Rexroth. If you plan to do the scaling in the HAL-Setup you can use the generic driver as it is without programming. (Just position command, position feedback and enable inverter) I think it should work also for Beckhoff, AMK, LTI drives because the Content of the XML files from manufacturer is standarized

Tutorial on Google Docs
Please feel free to comment directly in the document or correct my english.

Best Regards Andreas
The following user(s) said Thank You: Nico2017
Time to create page: 0.349 seconds
Powered by Kunena Forum