Why the tight jitter requirement?

More
18 Aug 2022 20:17 #250034 by martin_mortensen
I'm setting up linuxCNC and the latency test is reporting around 6 mS which according to the manual is too high for it to work.

Can someone explain why that is the case.  The computer is connected by the parallel port to a Xylotex controller that's controlling the CNC.  Wouldn't the computer just download the gcode file and the controller take care of handling the timing sensitive stuff?
 

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

More
18 Aug 2022 20:48 #250035 by Todd Zuercher
That isn't how Linuxcnc works. It isn't sending g-code or bits of g-code files to the machine. It is calculating and generating the individual step pulses (and the space between them) that move the machine. Those can be spaced as little as1 or 2 microseconds apart. And to be able to accurately produce those kinds of timings and have reasonable resolution for timings near by (ie slightly slower) Linuxcnc needs reliable realtime timing a fraction of the smallest step timing that will be used. All this in the name of reliable stepping (no missed steps) and smooth motion.

As far as I know the Xylotex control is only a box that contains a few step motor drivers, it isn't a true motion controler.

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

More
18 Aug 2022 21:33 #250038 by tommylight
If you are using the official ISO, try installing the RTAI kernel as described here:
linuxcnc.org/docs/2.8/html/getting-start...#cha:Installing-RTAI
It is much better for use with parallel port, especially on older computers.

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

More
19 Aug 2022 19:43 #250086 by Bari
RTAI is generally better latency for software stepping on older systems but some are just fine with preempt_rt



But this system gets terrible latency with preempt_rt kernels newer than 5.10. You never know.  :)
Attachments:

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

More
22 Aug 2022 13:22 - 22 Aug 2022 13:24 #250202 by Todd Zuercher
Yes, Preempt-RT seems to require a little more horsepower from the CPU to get good latency than RTAI. An RTAI instal often is better for older and/or slower CPUs. I think the reason may be in the basic architecture of the real-time portions. RTAI is more of a separate layer underneath the kernel, where Preempt-RT is more of a patch on top/in the kernel. Because of that, RTAI's real-time performance is less dependent on the computer's speed. As such the minimum system specs for an RTAI Linuxcnc installation are pretty much the same as the base specs for adequate usability of the operating system.
Last edit: 22 Aug 2022 13:24 by Todd Zuercher.

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

More
25 Aug 2022 22:57 #250472 by martin_mortensen
When I install RTAI LinuxCNC won't run. Any idea how to fix it?

Error report created by /usr/lib/tcltk/linuxcnc/show_errors.tcl:

Print file information:
RUN_IN_PLACE=no
LINUXCNC_DIR=
LINUXCNC_BIN_DIR=/usr/bin
LINUXCNC_TCL_DIR=/usr/lib/tcltk/linuxcnc
LINUXCNC_SCRIPT_DIR=
LINUXCNC_RTLIB_DIR=/usr/realtime-4.19.195-rtai-amd64/modules/linuxcnc
LINUXCNC_CONFIG_DIR=
LINUXCNC_LANG_DIR=/usr/lib/tcltk/linuxcnc/msgs
INIVAR=inivar
HALCMD=halcmd
LINUXCNC_EMCSH=/usr/bin/wish8.6
LINUXCNC - 2.8.2
Machine configuration directory is '/home/martin/linuxcnc/configs/sim.axis'
Machine configuration file is 'axis.ini'
INIFILE=/home/martin/linuxcnc/configs/sim.axis/axis.ini
VERSION=1.1
PARAMETER_FILE=sim.var
TASK=milltask
HALUI=halui
DISPLAY=axis
COORDINATES=X Y Z
KINEMATICS=trivkins
Starting LinuxCNC...
Starting LinuxCNC server program: linuxcncsvr
Loading Real Time OS, RTAPI, and HAL_LIB modules
Realtime system did not load
Shutting down and cleaning up LinuxCNC...
Removing HAL_LIB, RTAPI, and Real Time OS modules
Removing NML shared memory segments

Debug file information:
insmod: ERROR: could not insert module /usr/realtime-4.19.195-rtai-amd64/modules/rtai_hal.ko: File exists
1306
Stopping realtime threads
Unloading hal components
rmmod: ERROR: Module hal_lib is not currently loaded
rmmod: ERROR: Module rtapi is not currently loaded
rmmod: ERROR: Module rtai_math is not currently loaded
rmmod: ERROR: Module rtai_sched is in use
rmmod: ERROR: Module rtai_hal is in use by: rtai_sched

Kernel message information:
[ 52.492756] I-pipe: head domain RTAI registered.
[ 52.492758] RTAI[hal]: mounted. ISOL_CPUS_MASK: 0.
[ 52.492760] SYSINFO - # CPUs: 2, TIMER NAME: 'lapic', TIMER IRQ: 4355, TIMER FREQ: 20781349, CLOCK NAME: 'tsc', CLOCK FREQ: 3158730000, CPU FREQ: 3158730000, LINUX TIMER IRQ: 4355.
[ 52.498812] RTAI[malloc]: global heap size = 2097152 bytes, <BSD>.
[ 52.498829] kstacks pool size = 524288 bytes
[ 52.498830] RTAI[sched]: hard timer type/freq = lapic/20781349(Hz)
[ 52.498830] linear timed lists.
[ 52.498831] RTAI[sched]: Linux timer freq = 250 (Hz), TimeBase freq = 3158730000 hz.
[ 52.498832] RTAI[sched]: timer setup = 48 ns, resched latency = 0 ns.
[ 52.511997] USERMODE CHECK: OK.
[ 52.512019] USERMODE CHECK PROVIDED (ns): KernelLatency -1, UserLatency -1.



Info report created by linuxcnc_info:
The file: /tmp/linuxcnc_info.txt
can be posted to a forum or a web site like:
pastebin.com
in order to provide information about the linuxcnc
system and configuration.

Date: Thu 25 Aug 2022 03:50:05 PM PDT
UTC Date: Thu 25 Aug 2022 10:50:05 PM UTC
this program: /usr/bin/linuxcnc_info
uptime: 15:50:05 up 2 min, 1 user, load average: 0.88, 0.35, 0.13
lsb_release -sa: Debian Debian GNU/Linux 10 (buster) 10 buster
which linuxcnc: /usr/bin/linuxcnc
pwd: /home/martin/linuxcnc/configs/sim.axis
USER: martin
LOGNAME: martin
HOME: /home/martin
EDITOR:
VISUAL:
LANGUAGE:
TERM: dumb
COLORTERM:
DISPLAY: :0.0
DESKTOP: lightdm-xsession
display size: 1280x1024 pixels (338x270 millimeters)
PATH: /usr/bin:/home/martin/linuxcnc/configs/sim.axis/bin:/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games

uname items:
nodename -n: LinuxCNC
kernel-name -s: Linux
kernel-vers -v: #5 SMP PREEMPT Sun Jul 11 19:13:27 BST 2021
machine -m: x86_64
processor -p: unknown
platform -i: unknown
oper system -o: GNU/Linux

/proc items:
cmdline: BOOT_IMAGE=/boot/vmlinuz-4.19.195-rtai-amd64 root=UUID=03a256ba-e2c1-49d3-b584-24634c5e941a ro initrd=/install/initrd.gz quiet
model name: Intel(R) Core(TM)2 Duo CPU E8500 @ 3.16GHz
cores: 2
cpu MHz: 3023.513
parport: 0000-0000 : parport0 0000-0000 : parport0
serial: 0000-0000 : serial 0000-0000 : serial

Versions:
gcc: gcc (Debian 8.3.0-6) 8.3.0
python: Python 2.7.16
git: not_in_PATH
git commit: NA
tcl: 8.6
tk: 8.6
glade: not_in_PATH
glade-gtk2: not_in_PATH

linuxcnc_var all:

LINUXCNCVERSION: 2.8.2
LINUXCNC_AUX_GLADEVCP: /usr/share/linuxcnc/aux_gladevcp
LINUXCNC_AUX_EXAMPLES: /usr/share/linuxcnc/aux_examples
REALTIME: /etc/init.d/realtime
RTS: /usr/realtime-4.19.195-rtai-amd64/bin/rtai-config
HALLIB_DIR: /usr/share/linuxcnc/hallib

dpkg -l '*linuxcnc*':
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-===============-=====================-============-=====================================================================

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

More
25 Aug 2022 23:31 #250473 by Bari
Try rebooting since some modules are hanging.

If preempt_rt was getting you 6mS (6,000,000nS) latency jitter you probably don't have all the speed stepping, power management etc etc turned OFF in BIOS yet. Did you really mean 6mS (sad face) or 6uS (6,000nS) which is great!

Try running the RTAI latency test $ sudo /usr/realtime*/testsuite/run

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

More
26 Aug 2022 00:14 #250480 by tommylight
Pretty sure the RTAI kernel requires a version of LinuxCNC compiled for it, not sure though, it's been a while.

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

More
26 Aug 2022 00:29 #250482 by Bari
True, but I assumed he followed all the steps here linuxcnc.org/docs/2.8/html/getting-start...#cha:Installing-RTAI

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

More
28 Aug 2022 23:53 #250666 by martin_mortensen
yes followed those instructions. Didn't see any errors. tried rebooting and even re-installing but same result.

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

Time to create page: 0.100 seconds
Powered by Kunena Forum