- Posts: 6
- Thank you received: 0
Reducing Jitter
9 years 3 weeks ago #100055
by Escain
Reducing Jitter was created by Escain
Hello 
I am currently trying to get LinuxCNC working on a Raspberry Pi. It's about a few weeks that I am trying, so I guess is the moment to ask, but my expertise is still limited: forgive me if I ask some newbie stuff.
So, what is the current status:
First, I installed a fresh Raspian Linux on the machine.
Second, I Cross-compiled an RT kernel following the page here . After that, using `uname` print the correct new kernel with PREEMPT in it.
I did some tests with "cyclictest" and results, even if not very good, are still bellow 150us maximum and average 20us
I configured the kernel to start with following options:
After, I cloned LinuxCNC and following this guide
What with LinuxCNC?
Running the test: "latency-histogram" I get terrible results with maximum jitter over 700-1400us
It seem to me that there is no preemption usage, but I am unable to check it.
Also, trying to add CPU affinity to the two latency-histogram threads does not seem to help.
Conclusion and question
I fully understand that the RaspberryPi cheap computer will not provides 5us jitter control, but at the moment it seem the CPU is able of more than what I got.
My question/s are:
How to ensure LinuxCNC is using Preemptive kernel features?
If using Preemptive, why is the jitter so high?
Any hint of how to improve and bound this jitter?
Notes:
LinuxCNC version used: 2.8.0~pre1, from today repository status.
I am currently trying to get LinuxCNC working on a Raspberry Pi. It's about a few weeks that I am trying, so I guess is the moment to ask, but my expertise is still limited: forgive me if I ask some newbie stuff.
So, what is the current status:
First, I installed a fresh Raspian Linux on the machine.
Second, I Cross-compiled an RT kernel following the page here . After that, using `uname` print the correct new kernel with PREEMPT in it.
Code:
Linux raspberrypi 4.9.50-rt37-v7+ #2 SMP PREEMPT RT Wed Sep 20 21:44:16 CEST 2017 armv7l GNU/Linux
I configured the kernel to start with following options:
Code:
sdhci_bcm2708.enable_llm=0 dwc_otg.fiq_fsm_enable=0 dwc_otg.fiq_enable=0 dwc_otg.nak_holdoff=0 isolcpus=0,1
After, I cloned LinuxCNC and following this guide
Code:
git clone git://github.com/linuxcnc/linuxcnc.git linuxcnc-dev
sudo apt-get install dpkg-dev
cd linuxcnc-dev/debian
./configure uspace
cd ..
dpkg-checkbuilddeps
apt-get install <all list>
apt-get install bwidget
apt-get install libtk-img
apt-get install tclx
cd src
./configure --with-realtime=uspace | tee ../configure.log
make | tee ../make.log
sudo make setuid | tee ../makesetuid.log
source ../scripts/rip-environment
runtiests
What with LinuxCNC?
Running the test: "latency-histogram" I get terrible results with maximum jitter over 700-1400us
It seem to me that there is no preemption usage, but I am unable to check it.
Also, trying to add CPU affinity to the two latency-histogram threads does not seem to help.
Conclusion and question
I fully understand that the RaspberryPi cheap computer will not provides 5us jitter control, but at the moment it seem the CPU is able of more than what I got.
My question/s are:
How to ensure LinuxCNC is using Preemptive kernel features?
If using Preemptive, why is the jitter so high?
Any hint of how to improve and bound this jitter?
Notes:
LinuxCNC version used: 2.8.0~pre1, from today repository status.
Please Log in to join the conversation.
9 years 2 weeks ago #100174
by andypugh
Replied by andypugh on topic Reducing Jitter
Does "halrun" then "exit" say "Note: using POSIX realtime" ?
Please Log in to join the conversation.
9 years 2 weeks ago #100175
by andypugh
Replied by andypugh on topic Reducing Jitter
I think that there are kernel compilation options that need to be set to allow preempt-rt to work properly too.
wiki.linuxfoundation.org/realtime/docume...ions/preemptrt_setup
wiki.linuxfoundation.org/realtime/docume...ions/preemptrt_setup
Please Log in to join the conversation.
9 years 2 weeks ago #100219
by Escain
Replied by Escain on topic Reducing Jitter
Thanks andipugh for your answer, I appreciate it!
I obviously set the CONFIG_PREEMPT_RT_FULL, but I did not had a look to the debug options nor other possibly related configurations. I will have a look deeper.
Halrun return the following line:
Note: Using POSIX realtime
I obviously set the CONFIG_PREEMPT_RT_FULL, but I did not had a look to the debug options nor other possibly related configurations. I will have a look deeper.
Halrun return the following line:
Note: Using POSIX realtime
Please Log in to join the conversation.
9 years 2 weeks ago #100244
by andypugh
OK, that means that it is using preempt-rt.
Off the Stretch preempt-rt ISO, with no tweaks, my PC is managing about 10uS latency, so you seem to be a bit unlucky.
Replied by andypugh on topic Reducing Jitter
Escain wrote: Note: Using POSIX realtime
OK, that means that it is using preempt-rt.
Off the Stretch preempt-rt ISO, with no tweaks, my PC is managing about 10uS latency, so you seem to be a bit unlucky.
Please Log in to join the conversation.
- tommylight
-
- Offline
- Administrator
-
Less
More
- Posts: 22010
- Thank you received: 3
9 years 1 week ago #100676
by tommylight
Replied by tommylight on topic Reducing Jitter
I am using a version of machinekit on RPI3 ( 2 of them ), had to update and switch to software GL so it is more usable, there is nothing i could do to lower latency but i did not try much as it works nicely with the PiDiCNC controlers.
Please Log in to join the conversation.
Time to create page: 0.088 seconds
