Check if program fits on work area before starting it

  • emcPT
  • emcPT's Avatar Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
More
19 Dec 2018 17:27 #122603 by emcPT
Hello

In a lathe, where several tools are used, I would like to check if the part that I will make fits the working area. I would like to do this in the Gcode, at its start so that a conditional jump is made, and it would be similar to:

IF (G54.Z - Z.LIMIT > PARTSIZE) then OK

I have the PARTSIZE, and I think I can get the current work plane G54 Z value from the 5223 system variable.
However I do not see how can I access Z limit (that is defined on the INI file).
Would this be possible to achieve?

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

More
20 Dec 2018 00:52 - 20 Dec 2018 02:01 #122625 by MaHa
To access ini file parameter, set

[RS274NGC]
FEATURES = 4

and use this in your gcode:

#<_ini[AXIS_2]MIN_LIMIT>

or for absolute value

ABS[#<_ini[AXIS_2]MIN_LIMIT>]
Last edit: 20 Dec 2018 02:01 by MaHa.
The following user(s) said Thank You: emcPT

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

  • emcPT
  • emcPT's Avatar Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
More
20 Dec 2018 19:25 #122647 by emcPT
That is valuable information. Thank you.
Although I did not tested, this looks promising.
Are the FEATURES documented? I only seen information on the forum.

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

More
20 Dec 2018 22:54 #122662 by MaHa
The well hidden information is there

linuxcnc.org/docs/2.7/html/remap/remap.h...i_file_configuration

If you want to abort the program when the partsize doesn`t fit, just

IF (G54.Z - Z.LIMIT LT PARTSIZE)
(MSG, Oversize Program abort)
M2
ENDIF

Maybe Z-offset of your active tool is needed also for the calculation

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

Time to create page: 0.052 seconds
Powered by Kunena Forum