LinuxCNC Freezing

More
31 Dec 2018 18:45 #123230 by BigBird
LinuxCNC Freezing was created by BigBird
I am having a problem with LinuxCNC freezing when commanding a motor to move. I first noticed it when I had the PC connected to a "linear motion test bench" which consists of a servo motor with an encoder, limit switches, a lead screw and an independent linear encoder (used to verify movement). When LinuxCNC freezes, the system is completely locked up and unresponsive. In addition, it leaves the motor running and it ignores the limit switches. The PC has to be reset or the power needs to be cycled.

I have done a number of experiments and found that the problem occurs even without the motor attached and all the motor power equipment powered off. The problem seems to be within LinuxCNC and/or the Mesa 5i24. A logic analyzer shows that, when LinuxCNC is not frozen, the signals coming from the 5i24 look good.

I have the Mesa 5i24-16 loaded with the 5i24_16_svst8_4.bit and configured via Pccnf to support 1 servo motor/encoder and 2 stepper motors. I have modified the .hal file so that the commanded position value is assigned to the servo motor encoder feedback to ensure that a following error doesn't occur.

LinuxCNC is started with the axis user interface and then a job, such as 3D_Chips is loaded. If the program is not run, then LinuxCNC is stable. If the G Code program is run, LinuxCNC will freeze, but when it does freeze it's at random times. Occasionally it makes it all the way through the job, but most of the time it freezes shortly after starting.

Instead of running a G Code program, I have tried jogging the motors to see if a servo/encoder or a stepper is the problem. LinuxCNC will freeze if either type is jogged.

I've attached files describing the PC I'm using and the .hal and .ini files. A summary: Ryzen 3 2200G in a MSI B350 Tomahawk motherboard with the latest BIOS installed. 4GB of RAM and an SSD drive.

Any help would be greatly appreciated. Thanks!!

File Attachment:

File Name: my_LinuxCN...2-31.hal
File Size:10 KB

File Attachment:

File Name: my_LinuxCN...2-31.ini
File Size:3 KB

File Attachment:

File Name: lspci_outp...2-31.txt
File Size:2 KB

File Attachment:

File Name: uname_outp...2-31.txt
File Size:0 KB

File Attachment:

File Name: lsblk_outp...2-31.txt
File Size:0 KB

File Attachment:

File Name: lscpu_outp...2-31.txt
File Size:1 KB

File Attachment:

File Name: lshw_outpu...2-31.txt
File Size:20 KB
Attachments:

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

More
31 Dec 2018 19:28 #123231 by PCW
Replied by PCW on topic LinuxCNC Freezing
No idea whats going on with the crashing but it does sound like hal is still running.
(if access to the 5i24 card is stopped, the watchdog will bite and this should disable any drives if the external drive enable circuitry is correct)

My first step at debugging the crashing would be to try a different PC (just move the hard drive, no need to re-install)

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

More
01 Jan 2019 19:17 #123281 by BigBird
Replied by BigBird on topic LinuxCNC Freezing
Peter,
Thanks for your advice. I am using the LiveCD version of LinuxCNC on another PC. This one has an Intel processor and after a few hours of testing, it appears to be stable. The 5i24 also appears to be working correctly.

It seems LinuxCNC and the MSI/AMD system I have are not compatible.

Doug

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

More
01 Jan 2019 20:02 #123286 by PCW
Replied by PCW on topic LinuxCNC Freezing
Its probably not a LinuxCNC issue but rather a Linux kernel version problem of some kind. Ryzen is pretty new and you might need a current kernel to fully support it.

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

More
02 Jan 2019 16:21 #123340 by BigBird
Replied by BigBird on topic LinuxCNC Freezing
Peter,
I've done some research and have found that you are correct.

There are many reports of problems running Linux on Ryzen processors. For example, using the search terms "ryzen 3 2200G C6" will produce a number of discussions about a power management problem (C6) on the Ryzen processors. There is some discussion about a similar problem encountered on a Ryzen 1700x here: bugzilla.kernel.org/show_bug.cgi?id=196683.

I have been trying to load Ubuntu 18.04.1LTS just to see if I could do it. However, the install hangs.

The last thing I want is for LinuxCNC to hang in the middle of a job and then run mill table past the limit switches. Looks like the Ryzen 3 2200G/MSI B350 MB will not work for me.

Thanks for your help!!

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

More
02 Jan 2019 17:48 - 02 Jan 2019 18:21 #123343 by PCW
Replied by PCW on topic LinuxCNC Freezing
If you wanted to spend (and maybe waste) a bit more time you could try the latest Preempt-RT kernel = 4.19.10-rt8. It should compile pretty quickly on the Ryzen...

Something like this should be close:
cd ~
sudo apt-get update
sudo apt-get install build-essential bin86 libssl-dev bc libelf-dev bison flex libqt4-dev libncurses5-dev pkg-config
mkdir rtlinux
cd rtlinux

wget www.kernel.org/pub/linux/kernel/v4.x/linux-4.19.10.tar.xz
wget www.kernel.org/pub/linux/kernel/projects...4.19.10-rt8.patch.gz
tar -xpf linux-4.19.10.tar.xz
gunzip patch-4.19.10-rt8.patch.gz
cp patch-4.19.10-rt8.patch linux-4.19.10
cd linux-4.19.10
cat patch-4.19.10-rt8.patch | patch -p1
make xconfig
make -j8
sudo make modules_install
sudo make install

You need to select "Fully Preemptable Kernel(RT)" in the xconfig step
This is either in the "Processor types and features" section or "General setup" section
Last edit: 02 Jan 2019 18:21 by PCW.

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

More
02 Jan 2019 21:30 #123359 by BigBird
Replied by BigBird on topic LinuxCNC Freezing
Got stuck at "make -j8". "You are building kernel with non-reptoline compiler, please update your compiler.."

Any idea how to fix this?

Thanks!

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

More
02 Jan 2019 23:13 - 02 Jan 2019 23:30 #123374 by Grotius
Replied by Grotius on topic LinuxCNC Freezing
"make -j8", means you are compiling linuxcnc with 8 core processor.
Try for sure : "make -j2" for example.

A compiler (software tool) issue is not a hardware issue (Ryzen processor for example)

This fault issue, will bring me to the point to write this in my terminal :

" sudo apt-get update "
or
" sudo apt-get dist-update "
or
" sudo apt-get install windows 15.0 " :woohoo:

Compiler updates, are unknown linux messages to me. But it is a linuxcnc text output. I think we can find that text
back in the source code at github. If you search "You are building kernel with non-reptoline compiler"
It will output some source location's. Here you can find more info how this is acchieved.

Good luck !

Switching kernel compilation to GCC 7 should get us there. At the moment we use gcc 6.4.0.
source : github.com/NixOS/nixpkgs/issues/34383
Last edit: 02 Jan 2019 23:30 by Grotius.
The following user(s) said Thank You: BigBird

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

More
23 Jan 2019 09:08 #124649 by inscrutableturtle
Replied by inscrutableturtle on topic LinuxCNC Freezing
So have anyone had any luck with Ryzens or the new Athlon?

I want to run some CAD\CAM system on the same PC that will be controlling the router. The workshop only does 2d routing at the moment and my favourite 2d CAD seems to work nicely with Wine, but later I might want to install a virtual machine with windows and a more powerful CAD for 3d, so I want to build the PC with a somewhat powerful processor.

How likely am I to have problems even with the latest kernel if I go for a 2200G\200GE?

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

More
30 Jan 2019 19:47 #125322 by Liqdfire
Replied by Liqdfire on topic LinuxCNC Freezing
I just finished building a new machine with an AMD A8-9600, and GIGABYTE GA-A320M-S2H, and with latency of 24,000 on a Servo Thread 1ms.

I used John's Mint Linux 19 gnipsel.com/linuxcnc/uspace/index.html

If you want to use Ryzen you are going to have to use a newer kernel that what comes on the LiveCD. The LiveCD I believe is using a 3.x kernel, and there were a ton of fixes in 4.10 that geared at getting Ryzen and Threadripper running properly in linux.

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

Time to create page: 0.091 seconds
Powered by Kunena Forum