Ethercat HAL driver

More
29 Oct 2013 21:25 #40390 by Oscmol
Replied by Oscmol on topic Ethercat HAL driver

Do you have any feeling if the precision on the machine will get any better with this kind of system instead of using a MESA card and pulse trains.


Both systems should work equally well. The precision is likely to be unaffected by the information transport.

Analogue voltage control still has quite a lot going for it. (and I quite like analogue feedback too, ie Resolvers)


Ok thats good to hear.
I already have 5 drives for my machine.
SIgma 5 with Analogue / Puls connection and i just had an idea to put on Ethercat option boards on these units so i don't need the Mesa cards but maybe that is the easiest way to go anyway.

My machine is an Deckle FP4A that i am retro fitting with new control system.
On my machine i have glasscales today, how is the best way to do this conversion?
To take analogue output from MESA card to the drives and put them in velocity mode and then take the feedback from the glasscales to the MESA card?
I have bought 3 Heidenhain conversion boxes for the glasscales so i can get TTL outsignals.

Best regards
Oscar

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

More
29 Oct 2013 22:38 #40391 by roschi
Replied by roschi on topic Ethercat HAL driver

Were can i find your tutorial?
Are you using your system on an mill or some other cnc machine?
Is your system using the distributed clocks so all drives are in sync?

Tutorial: link
Right now I've finished the setup for drives and CNC; I'm working on a retrofit on a small home-scale milling machine (3 axis); Currently I'm waiting for ball screw spindles to replace the old non ball screw ones.
The Setup with the IndraDrives, LinuxCNC and EtherCAT uses DC-clocks and the application time is synced among the slaves.

Do you have any feeling if the precision on the machine will get any better with this kind of system instead of using a MESA card and pulse trains.


As Andy writes in my opinion there is no difference if you transmit your commanded vlaue for the position via bus or pulse train.

My machine is an Deckle FP4A that i am retro fitting with new control system.
On my machine i have glasscales today, how is the best way to do this conversion?
To take analogue output from MESA card to the drives and put them in velocity mode and then take the feedback from the glasscales to the MESA card?
I have bought 3 Heidenhain conversion boxes for the glasscales so i can get TTL outsignals.


I have no experences with the use of the "MESA card" and LinuxCNC (what does this do?, read encoder, write pulse trains?)
But you have to think about the following (case ball screw spindles):
- Every Servo Drive has in most cases 3 control loops (current,speed,position)
- simple setups for machine tool axis use the position feedback from the rotation motor shaft (means: inaccurancy from errors of spindle, backclash, dynamic compliance)
- more advanced position control use the position feedback from linear measurment devices fixed to the axis (e.g. glassscales) and speed feedback from rotating shafts (classical:tachometer e.g. FP4); In such a setup you have to consider some kind of notch filters for the commanded speed value to get over possible resonant vibrations and so on; This is state of the art in the drives to use speed feedback from rotating shaft and position feedback of linear scales.
- most modern position control use both: position feedback of rotating shaft and linear movement (Siemens, Rexroth, state control instead of PID)

If you thinking about closeing the position control loop 'over' the LinuxCNC/MESA card with linear feedback/pulse train and the speed control loop on the drive as it is this will work.
But my guess is that this is not optimal. Because you have two systems with discrete time signal handling. Reading mesacard counters, calculate new speed command, write to pulse train output on the LinuxCNC side and signal processing on the side of the drive (this will result in dead times with 1 or 2 delays --> limits control bandwith of the position loop, assuming the drive is digital and not analog controled approx. 4-8kHz speed control loop)
I think its better that the drive does all the control loops because a 'shorter' control loop is better for machine tool axis with no dynamic coupling in the mechanics.

Also there could be a problem with the frequency-scaling devices for the glassscale (analog to TTL); If you use scaling 1 this coudl result in low resolution for the axis; If you use scaling/interpolation e.g. 64 the resulting TTL-Freqency at max speed is to high for the counters on the MEAS CARD

To conclude:
My experencies and opinions are based on 'high class' cnc machines and could be completly over engineered for the use in many over cases.

Best regards
Andreas

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

More
29 Oct 2013 23:11 #40392 by PCW
Replied by PCW on topic Ethercat HAL driver
Its well to remember that there is very little to be gained with higher
than 4 KHZ or so _position_ loops on normal machine tools.

LinuxCNC is able to manage 4 KHZ position loops easily with the right PC hardware.

Note that Fanuc only recently changed to a 4 KHZ position loop on their latest high performance
drives (32 KHZ current loop, 16 KHz velocity loop, 4 KHz position loop 16M count/turn encoders)

There is no issue counting multi MHz quadrature signals with Mesa Quadrature encoders so there should be no issue with the interpolators.

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

More
29 Oct 2013 23:14 #40393 by Coyote
Replied by Coyote on topic Ethercat HAL driver
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.

Additional encoder systems serve for high precision machine, the best way is to hook them on servo drive. The feedback of velocity loop remains the motor encoder, while you can use a second encoder for position loop. If you don't have the possibility to add a second encoder system on servo drive, then you could use linuxcnc to do the position loop (P-regulator) and drives do only velocity loop.

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

More
03 Jan 2014 17:44 #42313 by roschi
Replied by roschi on topic Ethercat HAL driver

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

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

More
03 Jan 2014 18:32 #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

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

More
02 Feb 2014 03:23 #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

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

More
03 Feb 2014 15:03 - 04 Feb 2014 02:35 #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: 04 Feb 2014 02:35 by roschi. Reason: update

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

More
05 Feb 2014 07:22 #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

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

More
06 Feb 2014 06:45 #43593 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


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

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

Time to create page: 0.478 seconds
Powered by Kunena Forum