LinuxCNC / linuxcnc

LinuxCNC controls CNC machines. It can drive milling machines, lathes, 3d printers, laser cutters, plasma cutters, robot arms, hexapods, and more.
http://linuxcnc.org/
GNU General Public License v2.0
1.8k stars 1.15k forks source link

Program exceeds machine limits and wrong toolpath displayed #176

Open propcoder opened 8 years ago

propcoder commented 8 years ago

LinuxCNC 2.7.7

Steps to reproduce the issue:

  1. Take sim axis_mm example configuration.
  2. Change axis_1 parameters in INI file to:
# Second axis
[AXIS_1]
TYPE = LINEAR
HOME = 1400
MAX_VELOCITY = 1000
MAX_ACCELERATION = 5000
MIN_LIMIT = 141
MAX_LIMIT = 1420
FERROR = 1
MIN_FERROR = 0.5
HOME_OFFSET = 1396
HOME_SEARCH_VEL = 0
HOME_LATCH_VEL = 0
HOME_FINAL_VEL = 70
HOME_USE_INDEX = NO
HOME_IGNORE_LIMITS = NO
HOME_SEQUENCE = 0
  1. Open this .ngc file:
G64 P0.01
G1 F10000 ; Misinterpreted line, X,Y taken as 0?
X0 Y10
X20 Y20
M30
  1. Touch-off axes that the path should fit in machine limits.
  2. Try to run the program.
  3. LinuxCNC complaints: Program exceeds machine limits Program exceeds machine minimum on axis Y While it shouldn't
  4. Choose run anyway. Notice how toolpath and liveplot are displayed.
  5. Check Y bounds and Feed distance in File/Properties. They are wrong.
jepler commented 8 years ago

Your guess about the interpretation of "G1 F10000" is approximately on target; the preview and bounds calculations assume that the start of a program is a number of preparatory G0 moves, which fully establish the starting coordinates; otherwise, some arbitrary value (possibly the origin of the active coordinate system?) is used instead.

Note that in linuxcnc there is no problem programming an F-number even when the active motion mode is G0 or G80, so if you can change your post to say "F10000" instead of "G1 F10000" you may be happier with how the preview and bounds check behave.

Revamping this code so that it does "something smarter" when the program doesn't start with a series of G0 moves that fully establish the starting position is a topic for development, unfortunately not a simple bugfix.