#linuxcnc-devel Logs
Sep 15 2021
#linuxcnc-devel Calendar
06:17 PM fdarling: (continuing my questions that I was posting in the #linuxcnc channel)
06:24 PM fdarling: is this the "main loop" for the 1kHz servo thread on a uspace (PREEMPT_RT) LinuxCNC setup?: https://github.com/LinuxCNC/linuxcnc/blob/7447445b2f8f7f672c1eb324e196f026d6a8337f/src/hal/hal_lib.c#L2825
06:24 PM fdarling: this function seems to use the RTAI API call rt_task_wait_period(): https://github.com/LinuxCNC/linuxcnc/blob/2e75b091a23e3312b9e57a88941714701f3709b8/src/rtapi/rtai_rtapi.c#L830
06:24 PM fdarling: where is the version for PREEMPT_RT where it's not actually using RTAI?
06:51 PM fdarling: I am trying to familiarize myself with LinuxCNC's "main loop" where consistent timing is happening, and how jitter is calculated. I am trying to write my own realtime application using PREEMPT_RT, but my jitter is a lot worse than LinuxCNC's (I am running my program on the same computer)
06:53 PM CaptHindsight[m]: might also be due to your kernel config
06:53 PM fdarling: I doubt it, because I'm running LinuxCNC and my application on the exact same hardware, no rebooting, nothing.
06:53 PM fdarling: I get ~9000 ns jitter with LinuxCNC, but more like 50000 with my program
06:55 PM fdarling: is anyone here familiar with the realtime thread main loop code that's active when compiled for uspace/PREEMPT_RT?
06:57 PM fdarling: I can see the jitter calculating HAL component: https://github.com/LinuxCNC/linuxcnc/blob/2e75b091a23e3312b9e57a88941714701f3709b8/src/hal/components/timedelta.comp#L31
06:57 PM fdarling: however, I am more interested in the clock_nanosleep() or whatever is responsible for the timing
06:58 PM fdarling: I assume this is the code spawning the realtime thread: https://github.com/LinuxCNC/linuxcnc/blob/827de56d20c5fd3dc0c5a30f1a7e0d8151d59f93/src/rtapi/uspace_rtapi_app.cc#L995
07:00 PM fdarling: though I can't find where task_start() is actually called in the code (searching via GitHub anyways)
07:00 PM fdarling: this makes me think that it's probably called by an external library, since it's a member function to a C++ object
07:39 PM Eric_ is now known as unterhausen
11:29 PM fdarling: pcw_home: you wouldn't happen to know where LinuxCNC's realtime loop is, would you? :-)