Temporary change of units?

  • dannym
  • Topic Author
  • Offline
  • Elite Member
  • Elite Member
More
5 years 7 months ago - 5 years 7 months ago #202024 by dannym
Temporary change of units? was created by dannym
I run a CNC I built for our local community shop, with a wide user base. As such, I need to keep operations really simple and avoid complex special cases. No ATC, just manually changing bits and either eyeballing the Z=0 or using a wireless tool setter.

Recently someone noted the tool setting probe wasn't probing. I found it technically was- prob being, the probing subroutine's .ngc file is in inches, the user's code had put it in mm with G21. OK, fine, add G20 to the top of the machine's subroutine file.

But, what if a user with a metric file breaks the bit mid-job, installs a new one, uses the tool height setter for the replacement, manually restarts the spindle, and does the standard Run From Here? Well, that seems like the file would then be misinterpreted in inch units unless you MDI in a G21. Which I can't explain to a wide pool of users, 95% of whom never touch the MDI window and don't understand G-code commands. I can't just add G21 to the bottom of the .ngc probing sub, because that would then misinterpret the inch files as mm and break most jobs.


This does bring some other questions to mind. The .ngc probe subroutine also cancels feedrate overrides. Is there a general purpose solution for saving and restoring modal states that I don't know about?
Last edit: 5 years 7 months ago by dannym.

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

More
5 years 7 months ago #202030 by cmorley

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

More
5 years 7 months ago #202049 by andypugh
Replied by andypugh on topic Temporary change of units?

dannym wrote: Which I can't explain to a wide pool of users, 95% of whom never touch the MDI window and don't understand G-code commands.


Those users don't deserve to use LinuxCNC :-)

Joking aside, that is a fairly difficult problem to address. The long-term solution is the the US to move to international units.

I think that Chris has part of the answer, the probing routine needs to return the state to what it was before the probe.

If restoring all modal state is too much, you can read, store and revert G20/G21 by inspecting

#<_metric> - Return 1 if G21 is on, else 0.
#<_imperial> - Return 1 if G20 is on, else 0.

linuxcnc.org/docs/2.8/html/gcode/overview.html#gcode:parameters

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

Time to create page: 0.221 seconds
Powered by Kunena Forum