× Forum Header

another question about Max Jitter, Latency Test

More
29 Aug 2013 12:34 - 29 Aug 2013 12:41 #38202 by nquantum
I've read about latency test :
www.linuxcnc.org/docs/html/install/Latency_Test.html
www.linuxcnc.org/docs/devel/html/motion/...l#cha:Stepper-Tuning
wiki.linuxcnc.org/cgi-bin/wiki.pl?Latency-Test
And also "Getting Started Guide" PDF

Question #1
So far I'm not clear about 'Servo Thread' and 'Base Thread' what is difference? I don't find in documents mention what both of them for. Or definition.

"If your Max Jitter number is less than about 15-20 microseconds (15000-20000 nanoseconds), the computer should give very nice results with software stepping. If the max latency..."

Which number u r refer to? Servo Thread? Or Base Thread?
What I guess is: if my machine drive by servo. So I choose Servo Thread. But if my machine drive by step-motor then I must use Base Thread. Am I right?

What if my machine is drive step-motor. And my Servo Thread is 7984 , Base Thread is 5611. Still I will use number of 5611 (also plus hold time requirement of ster-motor later) am I right? Nothing to worry about Servo Thread 7984 correct?

Question #2
For latency test.

"Let the test run for at least 15 minutes (it has been suggested that the longer the better let it run for a day or overnight for instance) while you run glxgears or a similar application to stress the cpu....."

I do by after my pc boot to linuxcnc for a while 1 or 2 min. I run latency test alone. Nothing else. Just before I sleep. Then wake up I check the number. (~8hours) I also try this 10 time. I guess this is not so good right? I plan to test again but to open glxgears full screen and Firefox in background. Is that okay? Enough? Better?
And I should use the maximum number i've got. NOT the average one. Am I right?

This is number I run latency test alone.
1. Servo Thread 7069 ,Base Thread 10868
2. Servo Thread 8826 ,Base Thread 5541
3. Servo Thread 8826 ,Base Thread 6456
4. Servo Thread 7332 ,Base Thread 11597
5. Servo Thread 7916 ,Base Thread 6658
6. Servo Thread 7984 ,Base Thread 5611
7. Servo Thread 8550 ,Base Thread 5586
8. Servo Thread 7800 ,Base Thread 5632
9. Servo Thread 12151 ,Base Thread 11434
10.Servo Thread 8045 ,Base Thread 5908

Question #3
My system is Gigabyte E350N + 4gb ram.
I use screen dell 1600x1200 60Hz , 20.1"
I plan to buy new display. Coz my display just die yesterday. It hard to find 20" or 19" quality monitor.
If I change to 23" or 24" 1920x1080 HD still I can get good result in latency? From E350N. Any comment?

Thank u so much!





Attachments:
Last edit: 29 Aug 2013 12:41 by nquantum.

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

More
29 Aug 2013 15:33 - 29 Aug 2013 18:20 #38210 by ArcEye
Hi

1)
To put it very simply, the base thread is the faster thread used for time-critical operations, such as generating software pulses to move steppers
The servo thread is the slower thread used by components not requiring the same speed and polling rate

So the base thread max_jitter is the figure to use

Hopefully my FAQs will help fill the gaps
www.linuxcnc.org/index.php/english/forum...-the-latency-problem
www.linuxcnc.org/index.php/english/forum...me-latency-solutions

2)
The test needs to be realistic for what the machine will experience when running
The openGL Axis uses makes demands on the video system, so that must be tested, by glxgears, opening windows, moving them forcing re-draws, tabbing between them etc
Firefox is bloatware these days and has a high impact, so opening may well produce a non repeated spike on loading but if opening further tabs, going to URLs etc has no further effect, I would not worry too much about that

The graphic latency-test does not show an average, it shows the peak, this is the figure you need ( a worst case scenario)

The FAQs detail how to run the realtime testsuite latency test which gives a much better picture of what causes the spikes

3)
If you go to higher resolutions, this could impact on latency, especially if you are using the on-board video chip or a low power video card.
The higher the resolution, the larger the memory needed for each frame buffer to hold the pixels for each screen write and the longer each write will take

regards
Last edit: 29 Aug 2013 18:20 by ArcEye.

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

More
31 Aug 2013 03:15 - 31 Aug 2013 03:24 #38265 by nquantum
1)
Wow! That is clear!
Base thread is faster thread. I've got picture. Especially when I closer look Base thread (25us) compare to Servo thread (1ms) , 25us is much less than 1ms 40 time!
So I can see image of Pulse with more frequency with Base thread 25us. So that Max Jitter effect of faster thread , the Base thread.
Also

If you know you can only get xxx pulses per second, which will limit your top velocity to yyy, you can live with that and work within the limits of the hardware.
If however you think you can get XXX+ pulses but occasionally you only get xx- and this causes missed steps and following errors, wrecking a work piece, .......... well you get the picture.


2)
Super clear!
So far I use this computer ,at least in LinuxCnC only for cnc job, nothing else. So I guess glxgears test for video system. Opening windows , moving windows to re-draw. Firefox with some video on it , opening and closing. Copy some dvd files. And run it for 1 night. Then see the worst case number. Should be enough.

3)
Thank! Now I consider either Dell P1913S (1280 x 1024) or Dell P2213 (1680 x 1050)

Question more :
1.1 "The servo thread is the slower thread used by components...."
I don't see the benefit of this yet. The Servo thread. What is it for? Maybe I don't understand your word "..used by components.." mean. Why not just only show Base thread alone? Is something to do with "servo" name?

1.2 When I missed steps will Linuxcnc show me error? Let me know something happened? Coz I've try notebook T43 before and sometime it show error on screen. But still in screen keep runing their job. So I guess that is mean missing step , jitter problem. Unfortunately I forget to capture the screen.

1.3 What exactly clue tell me that I set latency too low? Error on screen while doing job? Screen drawing not smooth?:

If you set your base thread period too low, you can see the extreme symptoms of this, the thread will poll so quickly that Axis, which is userspace, will not be able to load and render graphics etc. in the time between polls.

Last edit: 31 Aug 2013 03:24 by nquantum.

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

More
31 Aug 2013 04:18 #38267 by BigJohnT
The servo thread can handle floating point math and the base thread can not. So many or the HAL components use math and have to be in the servo thread. I have no clue as to why it is called that.

JT
The following user(s) said Thank You: nquantum

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

More
31 Aug 2013 10:15 #38282 by andypugh

The servo thread can handle floating point math and the base thread can not. So many or the HAL components use math and have to be in the servo thread. I have no clue as to why it is called that.


The "servo" thread is where all the real-time motion calculation is done. This is also the thread where most of the HAL components run too, except in unusual cases. Calling it the "Servo" thread in a stepper system does seem a little odd.
Base-thread functions (like stepgen.NN.make-pulses are tiny, fast, all-integer bits of code that try do do the bare minimum of computation, set the IO bits and exit ASAP to hand the CPU back to the other stuff (like Youtube)

The base thread can (and does) interrupt the servo thread.

If you move step generation and encoder counting (etc) to external hardware you don't need a base thread. Though you can still have one if you want. You can even run software stepgen into a Mesa card as GPIO if you want to. (In fact my hand jog wheel on my mill is handled by a servo-thread instance of the software encoder counter. I had no spare hardware counters, and 1kHz count rate and the odd dropped step is of no consequence on a hand control.
The following user(s) said Thank You: nquantum

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

More
31 Aug 2013 17:33 #38298 by ArcEye

1.2 When I missed steps will Linuxcnc show me error? Let me know something happened? Coz I've try notebook T43 before and sometime it show error on screen. But still in screen keep runing their job. So I guess that is mean missing step , jitter problem. Unfortunately I forget to capture the screen.


You will only get a realtime error to screen once, irrespective of how many times it occurs
This often happens immediately upon starting for the reasons previously outlined

1.3 What exactly clue tell me that I set latency too low? Error on screen while doing job? Screen drawing not smooth?:


That was just a hypothetical example to show that realtime priority is at the expense of userspace.
Unless you deliberately set you BASE_PERIOD= in you ini file to a very low number, it is not going to occur

Read the wiki for calculations for setting base period or just allow stepconf to set a conservative value for you

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

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

More
01 Sep 2013 12:28 - 01 Sep 2013 12:29 #38350 by nquantum
Thank you. I understand a bit more in servo threat. Unless I read more and try use myself I'll clearly about what u all try to tell. I only try software step-gen for step-motor. So later I'll more try.

I'll read again how to calculate base thread. It is so good that Linuxcnc can show 'real time error’ and 'how many time it occurs'. So that I can know this maybe I set base threat too low. System can't gen this fast without jitter problem.

Thank u all. I'm clear now
Last edit: 01 Sep 2013 12:29 by nquantum.

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

Time to create page: 0.270 seconds
Powered by Kunena Forum