Temporary change of units?
- dannym
- Offline
- Elite Member
Less
More
- Posts: 212
- Thank you received: 1
12 Mar 2021 22:48 - 12 Mar 2021 22:51 #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?
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: 12 Mar 2021 22:51 by dannym.
Please Log in or Create an account to join the conversation.
- cmorley
- Offline
- Moderator
Less
More
- Posts: 7778
- Thank you received: 2075
12 Mar 2021 23:10 #202030
by cmorley
Replied by cmorley on topic Temporary change of units?
Please Log in or Create an account to join the conversation.
- andypugh
- Offline
- Moderator
Less
More
- Posts: 23178
- Thank you received: 4860
13 Mar 2021 01:21 #202049
by andypugh
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
Replied by andypugh on topic Temporary change of units?
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.058 seconds