Ethercat HAL driver

More
12 years 9 months ago #42313 by roschi
Replied by roschi on topic Ethercat HAL driver

Coyote wrote: I would go with ethercat. definitely. Many brands have their proipetary protocol like Fanuc, Mitsubishi, Siemens aka digital servo; high speed, synchronism. If you have the possibility, at least please try only and post your results....


See some first results on a small milling machine
Video on YouTube

Best Regards Andreas
More
12 years 9 months ago #42314 by nursum
Replied by nursum on topic Ethercat HAL driver
Hi Andreas,

very nice! I guess it is a huge amount of time necessary to learn the ethercat driver and to implement ther servo controller... standard I/O's are more or less easy but the controller protocoll...
I'am planning to implement the SERVOSTAR controllers which are similar to the Beckhoff AX2000 serie in my CNC center which is actually driven by old Siemens DC controller/motors (each axis has 2 KW).

regards from Germany
Ingo
More
12 years 8 months ago #43407 by automata
Replied by automata on topic Ethercat HAL driver
Hi Andreas,

That is really impressive.

How did you get the absolute encoders working with linuxcnc? do you have a sample HAL file that you can share?
Also, you mentioned on the youtube video comments that you needed to make certain changes to the linuxcnc source to get absolute encoder homing working. Can you share your method and and maybe source code?

Thanks,

amit
More
12 years 8 months ago - 12 years 8 months ago #43480 by roschi
Replied by roschi on topic Ethercat HAL driver
Hi Amit,

The Homing is done like this way: Linuxcnc starts the homing sequence on each drive via bus and waits for "home switch" which is in fact a bit which is set by the drive over the bus. So I had to patch the homing-state-machine in the source code of LinuxCNC just a little bit and connect HAL-Pins e.g. for home switch to bits from drive status words. The real switches are directly connected to the drives. During homeing LinuxCNC can only do e-stop nothing else. Motion/Path planing is done by the drives themselves.
The encoders in the motors are absolute but single turn so you need to do the homing sequence.
Find the source code here github.com/aschiffler/linuxcnc
Find the config file here hal file
Last edit: 12 years 8 months ago by roschi. Reason: update
More
12 years 8 months ago #43560 by lpons
Replied by lpons on topic Ethercat HAL driver
Hi Everybody,

I have some problem getting LinuxCNC + EtherCAT HAL driver properly compiled. I want also add that I'm almost new to the Linux world so the reason it won't compile is probably caused by a my mistake or something I'm not really into. So be prepared for the tons of silly questions I'll post here.

Back to my error. First of all the EtherCAT master is working: I can load the kernel module, unload it and also use the ethercat utility attached to the device file. But when I try to compile LinuxCNC I get an error such as:

In file included from adlist.c:34:
zmalloc.h:50:31: error: jemalloc/jemalloc.h: No such file or directory
zmalloc.h:55:2: error: #error "New version of jemalloc required"
make[2]: ***[adlist.o] Error 1
make[2]: Leaving directory `/home/jkirkley/gitlocal/ncs/linuxcnc/ethercatBranch/src/redis/redis/src`

I think the problem is or in the makefile the path of jemalloc is not properly set or the version is out of date. But honestly I don't know how to fix it. I try to recompile the jemalloc library but there's no a makefile which works.

If you need more information I'll happy to give what you need.


Thank you so much

LP
More
12 years 8 months ago #43593 by lpons
Replied by lpons on topic Ethercat HAL driver

lpons wrote: Hi Everybody,

I have some problem getting LinuxCNC + EtherCAT HAL driver properly compiled. I want also add that I'm almost new to the Linux world so the reason it won't compile is probably caused by a my mistake or something I'm not really into. So be prepared for the tons of silly questions I'll post here.

Back to my error. First of all the EtherCAT master is working: I can load the kernel module, unload it and also use the ethercat utility attached to the device file. But when I try to compile LinuxCNC I get an error such as:

In file included from adlist.c:34:
zmalloc.h:50:31: error: jemalloc/jemalloc.h: No such file or directory
zmalloc.h:55:2: error: #error "New version of jemalloc required"
make[2]: ***[adlist.o] Error 1
make[2]: Leaving directory `/home/jkirkley/gitlocal/ncs/linuxcnc/ethercatBranch/src/redis/redis/src`

I think the problem is or in the makefile the path of jemalloc is not properly set or the version is out of date. But honestly I don't know how to fix it. I try to recompile the jemalloc library but there's no a makefile which works.

If you need more information I'll happy to give what you need.


Thank you so much

LP


I solved the above problem. I was missing some REDIS file (I don't really know why since I'm working on a previous working LinuxCNC machine, but still...). Now I can compile all the LinuxCNC package and finish the install process running also the "sudo make setuid" command after the "make".

But I have another problem. I want to load the EtherCAT HAL driver module but I get the following error:

jkirkley@linuxCNC:~/gitlocal/ncs/linuxCNC/ethercatBranch$ sudo ./scripts/halrun -I -f ../demo/ledDemo.hal
insmod: error inserting '/home/jkirkley/gitlocal/ncs/linuxCNC/ethercatBranch/rtlib/lcec.ko': -1 Unknown symbol in module
../demo/ledDemo.hal:5: exit value: 1
../demo/ledDemo.hal:5: insmod failed, returned -1
See the output of 'dmesg' for more information.

and when I go to see the dmesg buffer I get:

[84661.062574] I-pipe: Domain RTAI registered.
[84661.062580] RTAI[hal]: <3.8.1> mounted over IPIPE-NOTHREADS 2.6-03.
[84661.062583] RTAI[hal]: compiled with gcc version 4.4.3 (Ubuntu 4.4.3-4ubuntu5) .
[84661.062615] RTAI[hal]: mounted (IPIPE-NOTHREADS, IMMEDIATE (INTERNAL IRQs DISPATCHED), ISOL_CPUS_MASK: 0).
[84661.062617] PIPELINE layers:
[84661.062620] fd098e20 9ac15d93 RTAI 200
[84661.062623] c085cb20 0 Linux 100
[84661.082274] RTAI[malloc]: global heap size = 2097152 bytes, <BSD>.
[84661.082489] RTAI[sched]: IMMEDIATE, MP, USER/KERNEL SPACE: <with RTAI OWN KTASKs>, kstacks pool size = 524288 bytes.
[84661.082495] RTAI[sched]: hard timer type/freq = APIC/12468620(Hz); default timing: periodic; linear timed lists.
[84661.082499] RTAI[sched]: Linux timer freq = 250 (Hz), TimeBase freq = 1994960000 hz.
[84661.082501] RTAI[sched]: timer setup = 999 ns, resched latency = 2944 ns.
[84661.082570] RTAI[usi]: enabled.
[84661.120848] RTAI[math]: loaded.
[84661.162673] lcec: Unknown symbol ecrt_sdo_request_timeout
[84661.162769] lcec: Unknown symbol ecrt_request_master
[84661.162935] lcec: Unknown symbol ecrt_release_master
[84661.163029] lcec: Unknown symbol ecrt_master_activate
[84661.163203] lcec: Unknown symbol ecrt_sdo_request_read
[84661.163513] lcec: Unknown symbol ecrt_domain_size
[84661.163607] lcec: Unknown symbol ecrt_master_deactivate
[84661.163705] lcec: Unknown symbol ecrt_slave_config_create_sdo_request
[84661.164017] lcec: Unknown symbol ecrt_master_sync_reference_clock
[84661.164111] lcec: Unknown symbol ecrt_slave_config_pdos
[84661.164206] lcec: Unknown symbol ecrt_domain_data
[84661.164300] lcec: Unknown symbol ecrt_sdo_request_data
[84661.164394] lcec: Unknown symbol ecrt_slave_config_dc
[84661.164488] lcec: Unknown symbol ecrt_master_slave_config
[84661.164685] lcec: Unknown symbol ecrt_slave_config_state
[84661.164779] lcec: Unknown symbol ecrt_master_state
[84661.164950] lcec: Unknown symbol ecrt_master_callbacks
[84661.165044] lcec: Unknown symbol ecrt_domain_process
[84661.165211] lcec: Unknown symbol ecrt_master_application_time
[84661.165304] lcec: Unknown symbol ecrt_domain_reg_pdo_entry_list
[84661.165399] lcec: Unknown symbol ecrt_slave_config_watchdog
[84661.165638] lcec: Unknown symbol ecrt_slave_config_complete_sdo
[84661.165732] lcec: Unknown symbol ecrt_master_sync_slave_clocks
[84661.166015] lcec: Unknown symbol ecrt_domain_queue
[84661.166111] lcec: Unknown symbol ecrt_sdo_request_state
[84661.166205] lcec: Unknown symbol ecrt_master_send
[84661.166375] lcec: Unknown symbol ecrt_slave_config_sdo
[84661.166473] lcec: Unknown symbol ecrt_master_create_domain
[84661.166724] lcec: Unknown symbol ecrt_master_receive
[84725.526583] RTAI[math]: unloaded.
[84725.555601] SCHED releases registered named ALIEN RTGLBH
[84725.584293] RTAI[malloc]: unloaded.
[84725.684062] RTAI[sched]: unloaded (forced hard/soft/hard transitions: traps 0, syscalls 0).
[84725.686567] I-pipe: Domain RTAI unregistered.
[84725.686603] RTAI[hal]: unmounted.

It looks like some header file is missing or something similar. Again I'm not an expert so I can't say exactly. Some has an idea of the origin of the problem?

Thank you so much

LP
Time to create page: 0.329 seconds
Powered by Kunena Forum