#linuxcnc Logs

May 16 2023

#linuxcnc Calendar

12:53 AM Deejay: moin
04:30 AM Tom_L: morning
04:36 AM Jym: Tom_L Morning
05:01 AM -!- #linuxcnc mode set to +v by ChanServ
05:09 AM -!- #linuxcnc mode set to +v by ChanServ
05:24 AM JT-Cave: looks like Wednesday and Thursday will be really nice weather days here
05:24 AM XXCoder: you guys sent us thunder lol
05:24 AM XXCoder: we had thinderstorm here recently
05:24 AM JT-Cave: gotta change the TPMS in the right rear of the C5 today and re-train the thing
05:25 AM JT-Cave: there's a $250 training tool or you go to Hobby Lobby and buy a magnet lol
05:48 AM JT-Cave: rooster just crowed
06:37 AM -!- #linuxcnc mode set to +v by ChanServ
06:38 AM -!- #linuxcnc mode set to +v by ChanServ
07:18 AM Tom_L: JT-Cave, moral of the story: choose your partners carefully
07:18 AM JT-Cave: aww you spoiled it for me
07:19 AM Tom_L: naw, it's all over the internet too
07:19 AM travis_farmer[m]: ???
07:29 AM JT-Cave: really
07:34 AM * JT-Cave starts his chicken day
09:23 AM Kumar: Hello All,
09:26 AM Kumar: I have a doubt regarding RT patch in linux. I have configured and applied RT patch.  Verified RT patch is installed in my linux kernel using uname -a command
09:27 AM Kumar: While testing RT patch behaviour using deadline scheduler. getting unexpected behaviours ?
09:28 AM Kumar: So, How to test RT patch using deadline scheduler ? Whether it has some improvements in real time behaviours, reduce_latency or not ?
09:28 AM Kumar: Any idea or suggestions on this ?
09:34 AM rmu: Kumar: how did you test, what unexcepted behaviour did you get?
09:37 AM rmu: Kumar: are you talking about this: https://www.kernel.org/doc/html/latest/scheduler/sched-deadline.html ?
09:38 AM Kumar: rmu, I created a C test application using 2 threads with deadline scheduler. Measured Scheduling time is not correct. Compared with Normal kernel also. Both Kernel has same scheduling timings
09:39 AM Kumar: Yes. talking about deadline sheduler
09:40 AM Kumar: My intention is to prove RT is more efficient in terms of  realtime responsiveness and less latency and accurate scheduling time than normal kernel .
09:42 AM rmu: at leat with SCHED_FIFO or SCHED_RR, it definitely is
09:42 AM Kumar: / Online C compiler to run C program online
09:42 AM Kumar: #define _GNU_SOURCE
09:42 AM Kumar: #include <unistd.h>
09:42 AM Kumar: #include <stdio.h>
09:42 AM Kumar: #include <stdlib.h>
09:42 AM Kumar: #include <string.h>
09:42 AM Kumar: #include <time.h>
09:42 AM Kumar: #include <linux/unistd.h>
09:42 AM Kumar: #include <linux/kernel.h>
09:42 AM Kumar: #include <linux/types.h>
09:42 AM Kumar: #include <sys/syscall.h>
09:42 AM Kumar: #include <pthread.h>
09:42 AM Kumar: #include <wiringPi.h>
09:42 AM Kumar: #define gettid() syscall(__NR_gettid)
09:42 AM Kumar: #define SCHED_DEADLINE 6
09:42 AM Kumar: #ifdef __x86_64__
09:42 AM Kumar: #define __NR_sched_setattr 314
09:42 AM Kumar: #define __NR_sched_getattr 315
09:42 AM Kumar: #endif
09:42 AM Kumar: #ifdef __i386__
09:43 AM Kumar:     clock_t goal = msecs * (CLOCKS_PER_SEC / 1000) + clock();
09:43 AM Kumar:     while (goal > clock());
09:43 AM Kumar: }
09:43 AM Kumar: int sched_setattr(pid_t pid,
09:43 AM Kumar:         const struct sched_attr *attr,
09:43 AM Kumar:         unsigned int flags)
09:43 AM Kumar: {
09:43 AM Kumar:     return syscall(__NR_sched_setattr, pid, attr, flags);
09:43 AM Kumar: }
09:43 AM Kumar: int sched_getattr(pid_t pid,
09:43 AM Kumar:         struct sched_attr *attr,
09:43 AM Kumar:         unsigned int size,
09:43 AM Kumar:         unsigned int flags)
09:43 AM Kumar: {
09:43 AM Kumar:     return syscall(__NR_sched_getattr, pid, attr, size, flags);
09:43 AM Kumar: }
09:43 AM Kumar: void *run_deadline1(void *data)
09:43 AM Kumar: {
09:43 AM Kumar:         busy_wait_loop(1);
09:43 AM Kumar:         digitalWrite(8,LOW);
09:43 AM Kumar:         busy_wait_loop(1);
09:43 AM Kumar:     }
09:43 AM Kumar:     return NULL;
09:43 AM Kumar: }
09:43 AM Kumar: void *run_deadline2(void *arg)
09:43 AM Kumar: {
09:43 AM Kumar:     struct sched_attr attr;
09:43 AM Kumar:     int x = 0,*thid;
09:43 AM Kumar:     int ret;
09:43 AM Kumar:     unsigned int flags = 0;
09:43 AM Kumar:     attr.size = sizeof(attr);
09:43 AM Kumar:     attr.sched_flags = 0;
09:43 AM Kumar:     attr.sched_nice = 0;
09:43 AM Kumar:     attr.sched_priority = 0;
09:43 AM Kumar:     /* This creates a 4ms/10ms reservation */
09:43 AM Kumar:     attr.sched_policy = SCHED_DEADLINE;
09:43 AM Kumar:     printf("main thread [%ld]\n", gettid());
09:43 AM Kumar:     wiringPiSetup();
09:43 AM Kumar:     pinMode(8,OUTPUT);
09:43 AM Kumar:     pinMode(9,OUTPUT);
09:43 AM Kumar:     pthread_create(&thread1, NULL, run_deadline1, NULL);
09:43 AM Kumar:     pthread_create(&thread2, NULL, run_deadline2, NULL);
09:43 AM rmu: please don't paste source code into IRC
09:43 AM Kumar:     pthread_join(thread1, NULL);
09:43 AM Kumar:     pthread_join(thread2, NULL);
09:43 AM Kumar:     printf("main dies [%ld]\n", gettid());
09:43 AM Kumar:     return 0;
09:43 AM Kumar: }// Online C compiler to run C program online
09:43 AM Kumar: #define _GNU_SOURCE
09:43 AM Kumar: #include <unistd.h>
09:43 AM Kumar: #include <stdio.h>
09:43 AM Kumar: #include <stdlib.h>
09:43 AM Kumar: #include <string.h>
09:43 AM Kumar: #include <time.h>
09:43 AM Kumar: #include <linux/unistd.h>
09:43 AM rmu: nobody will look at that
09:44 AM Kumar:     __u32 size;
09:44 AM Kumar:     __u32 sched_policy;
09:44 AM Kumar:     __u64 sched_flags;
09:44 AM Kumar:     /* SCHED_NORMAL, SCHED_BATCH */
09:44 AM Kumar:     __s32 sched_nice;
09:44 AM Kumar:     /* SCHED_FIFO, SCHED_RR */
09:44 AM Kumar:     __u32 sched_priority;
09:44 AM Kumar:     /* SCHED_DEADLINE (nsec) */
09:44 AM rmu: and some channel protection will probably kick you
09:44 AM Kumar:     __u64 sched_runtime;
09:44 AM Kumar:     __u64 sched_deadline;
09:44 AM Kumar:     __u64 sched_period;
09:44 AM Kumar: };
09:44 AM Kumar: void busy_wait_loop(unsigned int msecs) {
09:44 AM Kumar:     clock_t goal = msecs * (CLOCKS_PER_SEC / 1000) + clock();
09:44 AM Kumar:     while (goal > clock());
09:44 AM Kumar: }
09:44 AM Kumar: int sched_setattr(pid_t pid,
09:44 AM Kumar:         const struct sched_attr *attr,
09:44 AM rmu: use paste service
09:44 AM travis_farmer[m]: what the heck?!?!?!?!?!?!?!
09:44 AM Kumar:     attr.sched_policy = SCHED_DEADLINE;
09:44 AM Kumar:     attr.sched_runtime =2 * 1000 * 1000;
09:44 AM Kumar:     attr.sched_period = 5 *1000 *1000;
09:44 AM Kumar:     attr.sched_deadline = 5 * 1000 * 1000;
09:44 AM Kumar:     ret = sched_setattr(0, &attr, flags);
09:44 AM Kumar:     if (ret < 0) {
09:44 AM Kumar:         done = 0;
09:44 AM Kumar:         perror("sched_setattr");
09:44 AM Kumar:         exit(-1);
09:44 AM Kumar:     }
09:44 AM Kumar:     while(1)
09:44 AM Kumar:     {
09:44 AM Kumar:         digitalWrite(8,HIGH);
09:44 AM Kumar:         busy_wait_loop(1);
09:44 AM Kumar:         digitalWrite(8,LOW);
09:44 AM Kumar:         busy_wait_loop(1);
09:44 AM Kumar:     }
09:44 AM Kumar:     return NULL;
09:44 AM travis_farmer[m]: Kumar!!! STOP
09:44 AM Kumar:     while(1)
09:44 AM Kumar:     {
09:44 AM Kumar:         digitalWrite(9,HIGH);
09:44 AM Kumar:         busy_wait_loop(2);
09:44 AM Kumar:         digitalWrite(9,LOW);
09:44 AM Kumar:         busy_wait_loop(2);
09:44 AM Kumar:     }
09:44 AM Kumar:     pthread_exit(NULL);
09:44 AM Kumar: }
09:44 AM Kumar: int main (int argc, char **argv)
09:44 AM Kumar: {
09:44 AM Kumar:     pthread_t thread1,thread2;
09:44 AM Kumar:     int thid[NOT];
09:44 AM Kumar:     printf("main thread [%ld]\n", gettid());
09:44 AM Kumar:     wiringPiSetup();
09:44 AM Kumar:     pinMode(8,OUTPUT);
09:44 AM Kumar:     pinMode(9,OUTPUT);
09:44 AM Kumar:     pthread_create(&thread1, NULL, run_deadline1, NULL);
09:44 AM rmu: also it looks like you are on a raspberry pi, all bets are off ;)
09:45 AM Kumar: yes. I am testing using raspberry pi 4
09:45 AM Kumar: I am not understanding what is the problem here ? Can you pls calrify me ?
09:46 AM travis_farmer[m]: don't post code to IRC!!!
09:46 AM rmu: with regards to pasting source code into IRC?
09:46 AM rmu: just DONT DO IT
09:46 AM travis_farmer[m]: use a pastebin service
09:46 AM rmu: what travis says
09:46 AM rmu: please
09:47 AM Kumar: ok Sure. I will not paste code here, Travis and rmu
09:47 AM skunkworks[m]: why not use the linuxcnc realtime hal subsystem for testing?
09:48 AM rmu: also, regarding latency and so on, I would be really surprised if SCHED_DEADLINE gives better results for linuxcnc
09:49 AM rmu: linuxcnc usually has only one or two realtime threads, running on an isolated core that doesn't do anything else (at least that's the recommended setup), and there is no potential for priority inversion or starving a thread
09:50 AM travis_farmer[m]: ...now i forgot what i was working on, when my screen was flooded with notifications ;-)
09:51 AM Kumar: ok. please suggest a best approach to test RT patch to get correct results
09:51 AM rmu: my phone was like "bing bing bing bing bing bing bing...."
09:52 AM Kumar: Really sorry, I am new this IRC. just joined few mins back.
09:52 AM Kumar: I am not aware of this
09:52 AM rmu: Kumar: define what "correct results" shoudl be in your case. i'm not clear what you try to accomplish. you have two threads busy-waiting and toggline a digital io. what behaviour do you see?
09:53 AM * rmu AFK 1h
09:54 AM Kumar: I measured the GPIO high and low timings and calculating scheduling time. ( RT patch modifies kernel to improving scheduling right  ?). I am getting almost same timings in RT patch applied Kernel and Normal Kernel
09:57 AM Kumar: I flashed these kernel in Rapverry PI 4. and tested using above C program.   We can test using raspberry pi right ?
10:00 AM Kumar: skunkworks pls share the procedures to test RT patch using LinuxCNC realtime hal subsystem ?
10:55 AM JT-Shop: it's so fun trying to talk people to my house lol
11:31 AM * JT[m] uploaded an image: (208KiB) < https://libera.ems.host/_matrix/media/v3/download/matrix.org/dnUzEkkgFIMsNxRTuhpEyrAz/20230516_113116.jpg >
11:31 AM JT[m]: Just need one more tire lol
11:32 AM travis_farmer[m]: and here i thought you had a big tricycle ;-)
11:35 AM JT-Shop: had one but got rid of it
11:38 AM roycroft: are you making a swing?
11:38 AM JT-Shop: it will be a big one...
11:47 AM rmu: hmm. seems the gpt rt programmer is gone...
12:01 PM JT-Cave: looks like one rear tire got lost at Olive Branch MS...
12:10 PM roycroft: oh, so someone else is building a swing
12:10 PM travis_farmer[m]: lol
12:16 PM roycroft: so we're not the only country that has elevated a televison personality to head of state:
12:16 PM roycroft: https://www.youtube.com/watch?v=ZQTPdEKGEBs
12:19 PM JT-Shop: nap time
01:29 PM CaptHindsight[m]: Kumar: the devs are not in this channel, you'll likely get more conversation going on the developer mail list or the forums
01:30 PM CaptHindsight[m]: Kumar: https://sourceforge.net/projects/emc/lists/emc-developers
01:30 PM CaptHindsight[m]: Kumar: https://forum.linuxcnc.org/
01:40 PM * skunkworks[m] uploaded an image: (1616KiB) < https://libera.ems.host/_matrix/media/v3/download/jauriarts.org/UoeWnoiqQRFicQuexHlwQMZn/PXL_20230514_195859859.jpg >
01:41 PM JT-Shop: snow storm
01:41 PM CaptHindsight[m]: https://en.wikipedia.org/wiki/Expansion_ratio nitrogen vs other gases
01:46 PM JT-Shop: neon is bad ass
01:47 PM CaptHindsight[m]: JT-Shop: dry air is better than humid for inflating tires
01:48 PM CaptHindsight[m]: if the driver complains about the lack of nitrogen in the tires then get a new driver
01:48 PM JT-Woodshop: better to what degree?
01:48 PM CaptHindsight[m]: common earth temps -20 - 50C :)
01:50 PM CaptHindsight[m]: Is your tire nitrogen really dry enough?
01:51 PM CaptHindsight[m]: I'll happy sell you cans of "azote de qualité supérieure"
01:56 PM JT-Woodshop: "better" has no quantitative value so it's meaningless as a comparison of two things
02:10 PM Unterhaus_ is now known as Unterhausen
02:11 PM Unterhausen: I feel fairly confident that racers started using nitrogen because it's almost free and they couldn't count on compressed air at race tracks to be dry
02:12 PM Unterhausen: then the whole thing moved to tire dealers where they charge you nearly 100% markup on nitrogen. The tank rental costs more than the gas
02:25 PM JT-Shop: high speed racing is a totally different environment for tires than daily driving
02:30 PM roycroft: when you consider that atmospheric air is 78% nitrogen, i'm not sure that pure nitrogen vs. dry atmospheric air makes much of a difference
02:30 PM JT-Shop: agree
02:30 PM roycroft: the moisture in air, especially compressed air, is a real factor
02:31 PM roycroft: but if you can dry the air i see nitrogen as more of a gimmick than a real help
02:31 PM JT-Shop: I have an air drier but if you fill at a station in humid times...
02:32 PM JT-Shop: and for daily driving it matters not one whit
02:32 PM roycroft: so the moral of this story is: don't buy nitrogen for your car
02:32 PM roycroft: buy an air dryer (if you don't already have one)
02:32 PM travis_farmer[m]: or if you are unlucky enough to get a leaky valve-stem...
02:32 PM roycroft: you'll be money ahead soon
02:32 PM roycroft: dry air is also very helpful if you're painting
02:33 PM JT-Shop: and powder coating...
02:33 PM roycroft: yes
02:34 PM roycroft: even for blowing yourself off if you get dusty
02:34 PM roycroft: you don't want to blow the dust off and end up taking a shower
02:34 PM Tom_L: mine came with nitrogen in them but i just use the compressor now
02:35 PM roycroft: yeah, i would not intentionally replace nitrogen with atmospheric air
02:35 PM roycroft: but i'd just use air from the compressor going forward
02:35 PM roycroft: i don't have a good dryer for mine
02:35 PM roycroft: i use filters
02:35 PM roycroft: but one of these days i'll get a nice dryer
02:36 PM roycroft: of course, that's more real estate i have to allocate
02:36 PM roycroft: a dryer with dessicant beads and a sight glass works pretty well for me at the moment
02:36 PM roycroft: when the beads turn pink, a minute in the microwave turns them dark blue again
02:37 PM roycroft: i use those dessicant cannisters on the tools that need really dry air
02:37 PM roycroft: and i have a big water filter coming out of the compressor
02:38 PM roycroft: which catches most of the water
02:39 PM CaptHindsight[m]: https://linuxgizmos.com/99-00-orange-pi-5-plus-sbc-is-now-available-to-order/
02:39 PM CaptHindsight[m]: https://forum.linuxcnc.org/18-computer/48079-can-the-opi5-be-configured-to-run-lcnc?start=140#271463
02:41 PM Unterhausen: I use a special mix in my tires. 78 percent nitrogen and 21 percent oxygen, and also carbon dioxide, neon, and hydrogen
02:41 PM Unterhausen: wish I had someplace to put an air dryer
02:43 PM JT-Shop: which reminds me of the old free energy hydrogen generator scam... had an engine rebuild guy try to sell me one once
02:43 PM CaptHindsight[m]: fill the tires with dessicant to absorb the water :)
02:43 PM JT-Shop: after I explained to him that every time you convert energy from one form to another you lose some to heat usually
02:43 PM travis_farmer[m]: will auto-balance then too
02:44 PM JT-Shop: LOL
02:44 PM JT-Shop: and now I remember the old auto balance scam too
02:44 PM travis_farmer[m]: :-)
02:44 PM roycroft: if you drive to vancouver bc you can add some ozone to your special mix
02:45 PM JT-Shop: "There's a sucker born every minute"
02:45 PM travis_farmer[m]: IIRC, auto-balance is a little exciting in winter
02:45 PM roycroft: yet nature has created a perfect perpetual motion machine
02:46 PM roycroft: it's called a bunny rabbit in heet
02:46 PM roycroft: which is redundant
02:46 PM roycroft: i should say "it's called a bunny rabbit"
02:46 PM JT-Shop: lol you talking about my bunny buddies?
02:46 PM * JT-Shop goes to spoil the hens yet again
02:46 PM CaptHindsight[m]: rabbit season
02:47 PM roycroft: i'm just saying they know what they like and they just go for it
02:50 PM Unterhausen: I was going to put some plants out in the garden to make room for more plants, but it's going to freeze on wednesday night
02:50 PM Unterhausen: there will be no moving of plants
02:52 PM roycroft: we're all done with that freezing stuff until next fall
02:55 PM Unterhausen: historically we are very unlikely to get frost after may 20th. People often plant in April and regret it
02:55 PM Unterhausen: people who have lived here a long time don't plant until memorial day, but since we've been here that's not really necessary
03:48 PM Tom_L: fill with cement and you'll have run flats :)
04:04 PM JT-Shop: rubber cement...
04:05 PM JT-Shop: RR TPMS replaced and all trained
04:07 PM -!- #linuxcnc mode set to +v by ChanServ
07:07 PM skunkworks[m]: Thinking about getting chickens...
07:30 PM roycroft: this guy, olivier gomis, does some interesting wood turning:
07:30 PM roycroft: https://www.youtube.com/@OlivierGomis
07:31 PM roycroft: there's a good chance jt has heard of him, but i thought i'd mention it in case he hasn't
07:31 PM XXCoder: watching latest. insane
07:31 PM roycroft: and, of course, for the benefit of any others of you who might be interested
07:32 PM XXCoder: cracks one look fun as light source
07:32 PM roycroft: oh, i like him even more now
07:32 PM roycroft: he did the obligatory colored pencil turning
07:32 PM roycroft: but WITHOUT resin
07:34 PM XXCoder: in-bore camera lol
07:37 PM XXCoder: big bowl lol
07:39 PM XXCoder: watching color pencils one now
07:42 PM XXCoder: color of his arms lol
07:44 PM XXCoder: definitely interesting resylt
08:35 PM -!- #linuxcnc mode set to +v by ChanServ