Mesa 5i25/6i25 my own component: how to begin?

More
04 Nov 2015 00:15 - 04 Nov 2015 00:15 #64709 by sirop

Ah, Xenomai? I assume then that you are using Machinekit? You might have to ask the Machinekit chaps for help with this particular wierdness, the interaction between the realtime and userspace modules may be different there.

In that case, forget what I said about the kernel log too, that only applies to LinuxCNC.


Well, I asked right now in their google group about the difference between LinuxCNC and Machinekit regarding the interaction between the realtime and userspace modules.
Wonder what answer I'll get...

But at least in this case the problem with a 100uS thread may have a simpler solution.

I connect to my Intel NUC where MachienKit is installed over ssh connection which runs over WiFi.
So I thought, maybe, it is not the whole OS that "freezes" but just that only ssh terminal.
Then I started screen within my ssh session following this advice superuser.com/a/444215 .

The 100uS thread is now running and printed out already more than 6000000 lines as compared to only about 700000 lines without screen.
Last edit: 04 Nov 2015 00:15 by sirop.

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

More
04 Nov 2015 00:24 #64712 by ArcEye
I think your threads are simply too fast.

A Xenomai kernel is normally only used with a servo-thread and step generation hardware. It makes no sense to have a sampler running faster than the operating thread speed
and even on a software stepper rtai kernel with a base thread, you would normally run it on the servo-thread, which is typically 10x slower.

sampler has a full bit pin which tells you when the FIFO is full and an overruns pin which tells you how many times this has happened.
These can be used to tune the depth of the buffer and tell you if you are just collecting too many of them (thread too fast)

The realtime part of sampler outputs to a buffer and the userspace part reads the buffer and outputs as required, normally a file.

If you look at src/hal/components/sampler_usr.c you will see this at the top of the reading loop
while ( samples != 0 ) {
	while ( atomic_load_explicit(&fifo->in, memory_order_acquire) == fifo->out ) {
            /* fifo empty, sleep for 10mS */
	    delay.tv_sec = 0;
	    delay.tv_nsec = 10000000;
	    nanosleep(&delay,NULL);
	}

This may give a clue as to the expected operating speed, that it will pause for 10 polls of the 'average' servo-thread if the FIFO is empty.

It is certainly not expecting 100,000 samples to be added to that FIFO in that 10ms B)

regards
The following user(s) said Thank You: sirop

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

Time to create page: 0.124 seconds
Powered by Kunena Forum