run Linuxcnc on xenomai with EVL(the realtime core)

More
18 Apr 2024 09:46 #298537 by cgy
Hi, I'd like to ask how to run LinuxCNC on a system with Xenomai 4  installed (Debian 12).
I installed LinuxCNC using
sudo apt install linuxcnc-uspace linuxcnc-uspace-dev,
which is how I did it on a Debian 12 system with the preempt-rt patch, and it worked fine there. However, now with Xenomai 4, when I try to run LinuxCNC, it gives me a note: "Note: Using POSIX non-realtime". Does this mean I'm not leveraging Xenomai's real-time performance?
I'm sure my Xenomai installation was successful.
[code]pi@raspberrypi:~ $ dmesg | grep EVL
[    1.079272] IRQ pipeline: high-priority EVL stage added.
[    1.081776] EVL: core started 
[/code]

Since there are few tutorials for Xenomai 4, I'm not sure what the correct steps are. My current guess is that I need to run it in the evl environment, which means I need to run it in root mode (sudo su). However, when I tried that, LinuxCNC gave me an error and didn't allow running in root mode.
So, I'm wondering if there's a way to solve this problem, or if there are any parameter settings that can make LinuxCNC run in the real-time core of Xenomai 4.
How can I run an application using the EVL core?
Thanks a lot!

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

More
18 Apr 2024 10:35 #298541 by tommylight
No double posting.
-
Is there any particular reason to use Xenonai?
Probably compiling it might work, but i never tried it.

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

More
18 Apr 2024 10:44 #298544 by cgy
I'm really sorry for the double posting. The first time I tried to post, my webpage crashed, and I thought the post failed.

I'm using Xenomai for some experimental testing. I've already completed my tests on a preempt-rt system, and now I'm moving on to testing with Xenomai. Unfortunately, I've encountered a lot of difficulties, so I'm hoping to get some advice and help from everyone.

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

More
18 Apr 2024 11:18 #298547 by cornholio
You'll have to build Linuxcnc for Xenomai.

There maybe some notes in the docs, maybe Andy might chime in.

The packages you downloaded are for the RT kernel.

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

More
18 Apr 2024 15:11 - 18 Apr 2024 15:15 #298561 by cgy

cornholio post=298547 userid=35653
You'll have to build Linuxcnc for Xenomai.

There maybe some notes in the docs, maybe Andy might chime in.

The packages you downloaded are for the RT kernel.

I just tried it. I rebuilt LinuxCNC as the documentation said

The most commonly used arguments are:

--with-realtime=uspaceBuild for any realtime platform, or for non-realtime. The resulting LinuxCNC executables will run on both a Linux kernel with Preempt-RT patches (providing realtime machine control) and on a vanilla (un-patched) Linux kernel (providing G-code simulation but no realtime machine control). If development files are installed for Xenomai (typically from package libxenomai-dev) or RTAI (typically from a package with a name starting "rtai-modules"), support for these real-time kernels will also be enabled.

[code], but unfortunately, it didn't work. It still gives me the message: "[b]Note: Using POSIX non-realtime." Is that normal???[/b]
[/code]
Last edit: 18 Apr 2024 15:15 by cgy.

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

More
18 Apr 2024 20:41 #298575 by cornholio
I take it you ran the linuxcnc as a RIP ?

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

More
19 Apr 2024 04:43 #298593 by cgy

I take it you ran the linuxcnc as a RIP ?

sorry,do you mean “Real-time Is Preemptive”?If it is, I'm trying to do it like this.
According to the docs, building LinuxCNC should detect the Xenomai4 EVL real-time core, right? All my EVL tests have passed, so I'm not sure if the current setup is correct.

My current process is to build LinuxCNC according to the documentation and then start LinuxCNC. However, I get a message saying, "Note: Using POSIX non-realtime." Is this process correct? If not, what settings do I need to change to use EVL?

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

More
19 Apr 2024 05:44 #298596 by cornholio
RIP means Run In Place, it's mentioned in the docs.

What method did you use to build Linuxcnc and then run an instance ?

When you built Linuxcnc did you have any xenomai develpoment files &\or libs installed ?
Did you build packagess & install the packages ?
Or did you just build Linuxcnc, run the script to setup the environment variables and run it from the command line ? Running from the menu will just run the prior installed package.

If you don't run the script to setup the environment variables or build and install new packages you will be running the prior version you installed.

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

More
19 Apr 2024 06:03 #298599 by cgy

RIP means Run In Place, it's mentioned in the docs.

What method did you use to build Linuxcnc and then run an instance ?

When you built Linuxcnc did you have any xenomai develpoment files &\or libs installed ?
Did you build packagess & install the packages ?
Or did you just build Linuxcnc, run the script to setup the environment variables and run it from the command line ? Running from the menu will just run the prior installed package.

If you don't run the script to setup the environment variables or build and install new packages you will be running the prior version you installed.


I uninstalled the previous LinuxCNC and rebuilt it following these steps. (By the way, I also installed all the dependencies shown by dpkg-checkbuilddeps.)
$ git clone https://github.com/LinuxCNC/linuxcnc.git linuxcnc-dev
$ cd linuxcnc-dev/src
$ ./autogen.sh
$ ./configure --with-realtime=uspace
$ make
$ sudo make setuid
$ source ../scripts/rip-environment
$ runtests
This runtest has passed the majority of the tests, with only a few showing automatic skips. no errors.
And then I did this to run linuxcnc:
$ source ../scripts/rip-environment
$ linuxcnc

As for Xenomai, I replaced the core, built and installed libevl according to the official website and other forum posts. I also passed the EVL test included with Xenomai, indicating that all Xenomai modules are successfully installed. The only issue is that the latency is slightly high, which should be due to the kernel configuration not being optimized to the fullest. However, this shouldn't have a major impact.
So, I'm currently running the latest build of LinuxCNC.

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

More
19 Apr 2024 08:00 #298607 by cornholio
To be perfectly honest the only application where low latency is crucial is with software step generation.
If using a Mesa card or other external motion control card that only requires a servo thread the latency requirements are a bit looser, and in most instances the RT-PREEMPT kernel is fine.

What I am saying is that chasing down latency gets to a point where it is of no great issue and can be more academic than performance.

In saying that it is interesting to see someone going down a different path and to see the results.

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

Time to create page: 0.161 seconds
Powered by Kunena Forum