winder / Universal-G-Code-Sender

A cross-platform G-Code sender for GRBL, Smoothieware, TinyG and G2core.
http://winder.github.io/ugs_website/
GNU General Public License v3.0
1.9k stars 766 forks source link

UGS Platform on RasPi large GCode file problem #1477

Open phil-barrett opened 3 years ago

phil-barrett commented 3 years ago

Describe the bug Loading a very large GCode file chokes Platform running on RasPi.

To reproduce Steps to reproduce the behavior:

  1. Start UGS Platform (I used build DL'd on 11/18/2020), connected to grbl board (I am using grblHAL but don't think that matters in this case)
  2. Load "concentric circles as arcs fr5000.cnc" (see attached zip file)
  3. Note that the machine has become extremely unresponsive. Mouse cursor movement is delayed by 5-10 second.
  4. Let it run 8 hours and note it is still unresponsive.
  5. Power cycle your Pi

Expected behavior The GCode will load.

Screenshots If applicable, add screenshots to help explain your problem.

Version From the about box.

Product Version: Universal Gcode Platform 20201002
Java: 1.8.0_212; OpenJDK Client VM 25.212-b01
Runtime: OpenJDK Runtime Environment 1.8.0_212-8u212-b01-1+rpi1-b01
System: Linux version 5.4.72-v7+ running on arm; UTF-8; en_US (ugsplatform)
User directory: /home/pi/.ugsplatform/2.0.6/dev
Cache directory: /home/pi/.ugsplatform/2.0.6/dev/var/cache      

Hardware RasPi 3 model B running raspi buster (2020-02-12-rpd-x86-buster.iso image) - Rasberry Pi OS dl'd on 11/18/2020, grblHAL breakout board running grblHAL with COMPATIBILITY_MODE 1 set.

Additional context Running same file on ugs platform on a Win10 PC and connecting to the same grblHAL board has no problems.

Here is the file concentric circles as arcs fr5000.zip

breiler commented 3 years ago

Wow that was an evil test on the little pi. 😄

The arcs will be expanded to lines with a segment length of 0.3mm which would generate about 7.3 million line segments. That is a lot...

We could probably try to parse the extent of the work before loading it as a model to get some estimate on a suitable arc length.

phil-barrett commented 3 years ago

Yeah, diabolical. It tends to choke renderers as well. Definitely not a realistic test, though. UGS seems to handle my other tests. If you guys want to parse far enough to say "won't run" or even just close without fixing, I would not think less of you.