(Need Help) Linux CNC + EtherCat + RPi 4 Setup

More
24 Jan 2022 12:37 - 24 Jan 2022 12:50 #232954 by Dj Junior
Hi everyone
I hope not to have the wrong section, this is my first post from Italy. I am installing linuxcnc on rpi with ethercat following the instructions of
Bouni whom I thank in advance for the work done
gist.github.com/Bouni/8b4532d0bdf012bd83c65d3eb62f8aa2
and MetalMusings


I followed the instructions step by step but arrived at the last stage:
halcmd setp lcec.0.<module-no>.dout-<output-no> <state>
halcmd setp lcec.0.3.dout-3 1 (knowing my el2008 device is the third slave)
I get the following error: <commandline>: 0: parameter or pin 'lcec.0.3.dout-3' not found

In addition, starting linuxcnc I get the following error:
HAL: ERROR: thread 'servo-thread' not found

I've searched for a file or function with the name servo-thread but can't find anything

I'm probably missing something.

Can anyone help me?

pi@linuxcnc:~ $ ethercat slaves
0 0:0 PREOP + EK1100 EtherCAT-Koppler (2A E-Bus)
1 0:1 PREOP + EL1018 8Ch. Dig. Input 24V, 10�s
2 0:2 PREOP + EL1104 4K. Dig. Eingang 24V, 3ms, Sensorversorgung
3 0:3 PREOP + EL2008 8K. Dig. Ausgang 24V, 0.5A
4 0:4 PREOP + TQ870(COE)
5 0:5 PREOP + TQ870(COE)




Thanks in advance.

Ps: Thanks to everyone who wrote source code to make our life easier
Attachments:
Last edit: 24 Jan 2022 12:50 by Dj Junior.

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

More
24 Jan 2022 13:34 #232957 by tommylight
Edit the .INI file, there should be and entry for
servo-period
in the emcmot section, something like this:
[EMCMOT]
EMCMOT = motmod
SERVO_PERIOD = 1000000

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

More
24 Jan 2022 13:43 #232960 by arvidb

Hi everyone
halcmd setp lcec.0.3.dout-3 1 (knowing my el2008 device is the third slave)
I get the following error: <commandline>: 0: parameter or pin 'lcec.0.3.dout-3' not found

If your device is the third slave it will have number 2, since slave numbers start at 0.

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

More
24 Jan 2022 14:24 #232964 by Dj Junior
Thanks for your quick reply
I entered SERVO_PERIOD = 1000000 in the axis.ini file but I get the same error

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

More
24 Jan 2022 14:27 #232965 by Dj Junior
Sorry I made a mistake. It is in the fourth position

pi@linuxcnc:~/linuxcnc/configs/sim.axis $ ethercat slave
0 0:0 PREOP + EK1100 EtherCAT-Koppler (2A E-Bus)
1 0:1 PREOP + EL1018 8Ch. Dig. Input 24V, 10�s
2 0:2 PREOP + EL1104 4K. Dig. Eingang 24V, 3ms, Sensorversorgung
3 0:3 PREOP + EL2008 8K. Dig. Ausgang 24V, 0.5A
4 0:4 PREOP + TQ870(COE)
5 0:5 PREOP + TQ870(COE)

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

More
24 Jan 2022 14:31 #232967 by tommylight

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

More
24 Jan 2022 14:36 - 24 Jan 2022 14:37 #232968 by Dj Junior
This error thread 'servo-thread' not found

pi@linuxcnc:~/linuxcnc/configs/sim.axis $ linuxcnc axis.ini
LINUXCNC - 2.8.2
Machine configuration directory is '/home/pi/linuxcnc/configs/sim.axis'
Machine configuration file is 'axis.ini'
Starting LinuxCNC...
application-specific initialization failed: no display name and no $DISPLAY environment variable
Error in startup script: invalid command name "."
while executing
". configure -borderwidth 0 -highlightthickness 0"
(file "/usr/lib/tcltk/linuxcnc/bin/popimage" line 35)
Found file(REL): ./ethercat.hal
Note: Using POSIX realtime
HAL: ERROR: thread 'servo-thread' not found
./ethercat.hal:3: addf failed
Shutting down and cleaning up LinuxCNC...
Note: Using POSIX realtime
LinuxCNC terminated with an error. You can find more information in the log:
/home/pi/linuxcnc_debug.txt
and
/home/pi/linuxcnc_print.txt
as well as in the output of the shell command 'dmesg' and in the terminal
Last edit: 24 Jan 2022 14:37 by Dj Junior.

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

More
24 Jan 2022 17:15 #232984 by tommylight
Well that should have gotten rid of that error, so do check again if it is added to the correct section, otherwise i can not think of anything causing that error.
Can you upload the ini file here ?

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

More
24 Jan 2022 17:57 - 24 Jan 2022 18:01 #232989 by Dj Junior
Here are the configuration files

I noticed that the SERVO_PERIOD variable was already present so one was removed
Attachments:
Last edit: 24 Jan 2022 18:01 by Dj Junior.

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

More
24 Jan 2022 18:41 - 24 Jan 2022 18:43 #232995 by Hakan
Hi Dj, I made that video.
I would think you should add the HALFILE line as the last line in this section
[HAL]
HALFILE = ethercat.hal
# The run script first uses halcmd to execute any HALFILE
# files, and then to execute any individual HALCMD commands.
#

# list of hal config files to run through halcmd
# files are executed in the order in which they appear
HALFILE = core_sim.hal
HALFILE = sim_spindle_encoder.hal
HALFILE = axis_manualtoolchange.hal
HALFILE = simulated_home.hal
HALFILE = check_xyz_constraints.hal

Put it after the "HALFILE = check_xyz_constraints.hal" line.


Then there is something with the gui, are you running this without a display? Not sure how that works.

Also, with that specific ethercat-conf.xml you will not see the individual devices, just that ethercat is up and running. To get the devices in there is another ethercat-conf.xml; it is in a forum-posts further in that thread. As others already have pointed out, the devices in ethercat-conf.xml must be ordered the same way as you see in your listing.[/code]
Last edit: 24 Jan 2022 18:43 by Hakan.

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

Time to create page: 0.222 seconds
Powered by Kunena Forum