The Road to CNC (part 3: computer configuration)

Despite picking up a decent computer, compared to LinuxCNC’s minimum system requirements, I was still getting some awful results when running the latency test. At about over 100K for both servo thread and base thread max jitter values, I started to worry that the entire pc would be unusable for cnc work.

Luckily, with some light reading, I found a few settings to tweak that could improve these results. In short, here’s the list of changes I made

  • Disable all power-saving settings in the BIOS
  • Disable Hyperthreading in the BIOS
  • Enable all (4) cores in the BIOS
    • make sure the lscpu command returns the expected value.
  • add the isolcpus=1,2,3 option in the grub bootloader settings with a modified version of Kent Reed’s 07_rtai script
  • redirect all interrupt requests (IRQs) to one processor by means of spainmann’s script

With these tweaks, servo thread jitter is below 64K nanoseconds and base thread jitter is below 10K nanoseconds–woot, it’s usable for LinuxCNC!

There are some other settings worth investigating later, documented on IBM’s webpage on reducing jitter for real-time linux operating systems. I haven’t played around with them much yet because my system performance is far better (and now good enough) than before the initial listed tweaks.

Leave a Reply

Your email address will not be published. Required fields are marked *