Is latency an issue when using a Mesa card?

More
28 Jun 2012 22:22 #21442 by spangledboy
Hi

This is my first post here - I'm just starting out with LinuxCNC.

I'm currently getting my computer hardware together for an upgrade to my old Supermax mill which has Anilamn Crusader II controls. I'm lucky in that I can choose from a huge number of old PCs at work (mostly Dell & HP) and I've run the latency test on a few. With no special configuration their latency figures are ok, but not amazing, even with relatively new, higher spec machines, so I was a little disappointed.

However, it just dawned on me that the latency may not be a big problem for me as I'll be using a Mesa 5i25 card along with 7i76 or 7i77. Am I right in saying that the latency is only really an issue when using the standard parallel port and software generated stepping, while the Mesa does this in hardware semi-independently of the motherboard?

I've read plenty in the FAQs about latency, it's causes and cures, but there's not much mention of what it exactly affects and whether it's really going to affect me with my add-in card and interfaces.

Apologies if this has been discussed elsewhere already, but I'm sure someone will be able to clear up this question pretty quickly for me.

Thanks

Ben

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

More
28 Jun 2012 23:44 #21448 by BigJohnT
Software step generation needs low latency, hardware step generation does not. If your getting <50,000 jitter you should be ok with a 5i25 combo. The 5i25 configuration only uses the "servo thread" which is pretty slow and software step generation needs a "base thread" that is much faster.

What kind of numbers are you getting for jitter?

John

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

More
28 Jun 2012 23:54 #21450 by PCW
A hardware stepgenerator is a lot less sensitive to latency
than software step generation where a high latency may stall a
step motor and also limits the maximum step rate

Servo and hardware step generator based systems are usually fine
with 50 usec range latencies.

Its possible to make hardware step generation resistant to 1 mS range latencies with some small
changes in the stepgens feedback loop (use the actual thread actuation time for its calculations rather than the nominal value)

The hardware step generator has another advantage in that it generates smoother
pulse streams at high speeds, that is a software stepgen (say at a 30 KHz base thread)
would have 33.3 usec jitter in its pulse stream meaning for example at a 10 KHz step rate
the jitter is 50%. For comparison the 5I25s 33.33 MHZ rate generator jitter is 30 ns so
about. 0.05 %

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

More
29 Jun 2012 15:08 #21456 by spangledboy
On the machines that I've tested, the jitter seems to mostly lie between 14,000ns and 50,000ns. That's with single core P4's, P4's with HT and Core 2 Duo processors with both cores enabled.

I've not tried any of the workarounds to prevent Linux using one of the cores or whatever - just straight out of the box Ubuntu/LinuxCNC 2.5 running from a USB key in "demo mode".

Does it make much difference if I force Linux to just use one of the cores on a dual core machine - presumably allowing the CNC software to run on the other core?

In any case, it's reassuring to hear that the latency is not such an issue with the Mesa connection hardware.

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

More
29 Jun 2012 16:21 - 29 Jun 2012 17:06 #21457 by PCW
Latency in not much of an issue for any hardware stepgenerator (Pico systems USC should be the same as Mesa hardware in this respect)

Using one core for LinuxCNC (the isolcpus grub option) does help on Atom MBs but I dont know if its been tried with Core 2 duo CPUs.
Last edit: 29 Jun 2012 17:06 by PCW. Reason: sp

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

More
29 Jun 2012 16:22 #21458 by BigJohnT
I would turn of HT at the least and check your latency then isolate the cpu and see if it improves any. If your running pretty low numbers then get a spike I would look at the SMI issue. Make sure you run the latency test for an extended period of time to spot any SMI spikes.

John

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

More
29 Jun 2012 19:22 #21462 by spangledboy
Ok, i've just done a little bit of work - the PC that I decided to take was a little over-specced, but I decided to get the newest/best pc from the pile that I could find:

Dell Optiplex 755 Small form factor
8GB RAM (yes, I know we're running a 32bit OS here, but I may do something else with the PC in future)
2.4GHz Core 2 Duo Processor (both cores enabled)
ATI Radeon X300SE PCI-X graphics card

When I ran the latency test with the default configuration I had jitter of about 49,000ns for the 1ms thread and 35,000ns for the 25us thread.

I applied the isolcpus changes as described here: wiki.linuxcnc.org/cgi-bin/wiki.pl?The_Is..._Parameter_And_GRUB2 and the jitter is now 42,700 for the 1ms thread and 16,200 for the 25us thread.

Definitely an improvement! I can see the difference in the CPU graphs on System Monitor - one CPU is doing all the work for the other stuff I have running and the other is hardly doing anything (presumably only the Latency Test). More importantly, the jitter hasn't changed since I started running the test, whereas before it would start low, then jump up to the max figure as time went by.

I'll leave the test running to see if I have any spikes due to SMI and update this thread later.

Ben

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

Time to create page: 0.071 seconds
Powered by Kunena Forum