pax_global_header 0000666 0000000 0000000 00000000064 14324265440 0014516 g ustar 00root root 0000000 0000000 52 comment=5718f0bbf7bce5bbac9196f411027800fb8d6149
linuxcnc-retrofit-5718f0bbf7bce5bbac9196f411027800fb8d6149/ 0000775 0000000 0000000 00000000000 14324265440 0022177 5 ustar 00root root 0000000 0000000 linuxcnc-retrofit-5718f0bbf7bce5bbac9196f411027800fb8d6149/.gitignore 0000664 0000000 0000000 00000000245 14324265440 0024170 0 ustar 00root root 0000000 0000000 gmoccapy_preferences
linuxcnc.var
linuxcnc.var.bak
old/*
*.pref
tool.tbl
*.pyc
postion.txt
savestate.*
savestatemacro.*
*.expanded
*.halscope
*.o
mb2halv2/mb2halv2
linuxcnc-retrofit-5718f0bbf7bce5bbac9196f411027800fb8d6149/LatheMacro.svg 0000664 0000000 0000000 00000424431 14324265440 0024747 0 ustar 00root root 0000000 0000000
linuxcnc-retrofit-5718f0bbf7bce5bbac9196f411027800fb8d6149/atv_vfd.hal 0000664 0000000 0000000 00000001676 14324265440 0024330 0 ustar 00root root 0000000 0000000 loadrt mult2 names=ATV_coef
addf ATV_coef servo-thread
# ---magic constant to uncompensate slip---
net spindle-vel-cmd-rpm ATV_coef.in0
setp ATV_coef.in1 0.97
# ---setup spindle control signals---
net spindle-vel-cmd-rps spindle.0.speed-out-rps
net spindle-vel-cmd-rps-abs spindle.0.speed-out-rps-abs
net spindle-vel-cmd-rpm spindle.0.speed-out
net spindle-vel-cmd-rpm-abs spindle.0.speed-out-abs
net spindle-enable spindle.0.on
net spindle-cw spindle.0.forward
net spindle-ccw spindle.0.reverse
net spindle-brake spindle.0.brake
net spindle-revs spindle.0.revs
net spindle-at-speed spindle.0.at-speed
net spindle-vel-fb-rps spindle.0.speed-in
net spindle-index-enable spindle.0.index-enable
net state-op atv_vfd.enable
net MachineIsOn atv_vfd.machine-on
net ATV_correct_speed ATV_coef.out atv_vfd.speed-command
net spindle-enable atv_vfd.spindle-on
net Estop atv_vfd.is-estop
linuxcnc-retrofit-5718f0bbf7bce5bbac9196f411027800fb8d6149/classicladder.hal 0000664 0000000 0000000 00000011724 14324265440 0025467 0 ustar 00root root 0000000 0000000 loadrt classicladder_rt numPhysInputs=80 numPhysOutputs=80 numSymbols=300 numTimersIec=40
addf classicladder.0.refresh servo-thread
loadusr classicladder maurice.clp
#==============================================================
#ClassicLadder Inputs
#==============================================================
#Drive Logic -> 00>19
net X-stat-home classicladder.0.in-00
net X-stat-pos classicladder.0.in-01
net X-homingok classicladder.0.in-02
net X-athome classicladder.0.in-03
net Z-stat-home classicladder.0.in-04
net Z-stat-pos classicladder.0.in-05
net Z-homingok classicladder.0.in-06
net Z-athome classicladder.0.in-07
net Home-All classicladder.0.in-08
net Home-X classicladder.0.in-09
net Home-Z classicladder.0.in-10
#Power On Logic
net MachineReadyFin classicladder.0.in-17
net MachineIsOn classicladder.0.in-18
net ModeManual classicladder.0.in-19
#Tool Change Logic -> 20-35
net TurretLS9 classicladder.0.in-20
net TurretLS10 classicladder.0.in-21
net TurretLS11 classicladder.0.in-22
net TurretLS12 classicladder.0.in-23
net TurretLS13 classicladder.0.in-24
net TurretIndex classicladder.0.in-25
net ToolChangeRequest classicladder.0.in-26
net ToolPrepPocket classicladder.0.s32in-00
net ToolChange classicladder.0.in-27
#Panel Logic -> 30-49
net ToolChangeBtn classicladder.0.in-30
net CycleStartBtn classicladder.0.in-31
net XJogPlus classicladder.0.in-32
net ZJogPlus classicladder.0.in-33
net FeedHoldBtn classicladder.0.in-34
net ModeSelect1 classicladder.0.in-35
net ModeSelect2 classicladder.0.in-36
net ModeSelect3 classicladder.0.in-37
net ModeSelect4 classicladder.0.in-38
net CoolantBtnOn classicladder.0.in-39
net CoolantBtnOff classicladder.0.in-40
#net FeedOv3 classicladder.0.in-41
#net FeedOv4 classicladder.0.in-42
net RapidOv1 classicladder.0.in-43
net RapidOv2 classicladder.0.in-44
net BlockDeleteBtn classicladder.0.in-45
net OptStopBtn classicladder.0.in-46
net SingleBlockBtn classicladder.0.in-47
net PowerOnSw classicladder.0.in-48
net STBEstop classicladder.0.in-49
# Chuck & Interlock Logic -> 50-59
net ChuckOpenBtn classicladder.0.in-50
net ChuckCloseBtn classicladder.0.in-51
net ChuckInsideClamp classicladder.0.in-52
net PressureSwitch classicladder.0.in-53
net ChuckOpenLimit classicladder.0.in-54
net ChuckCloseLimit classicladder.0.in-55
net DoorSwitchs classicladder.0.in-56
net SpindleSpeedFB classicladder.0.floatin-01
#Error Handling -> 60-69
net MachineErrorIn classicladder.0.in-60
#Program Handling -> 70-79
net ProgramIsRunning classicladder.0.in-70
net ProgramIsIdle classicladder.0.in-71
net ProgramIsPaused classicladder.0.in-72
#==============================================================
#ClassicLadder Inputs
#==============================================================
#==============================================================
#ClassicLadder Outputs
#==============================================================
#Drive Logic -> 00>19
net X-homed classicladder.0.out-00
net Z-homed classicladder.0.out-01
net X-inhibit classicladder.0.out-02
net Y-Homed classicladder.0.out-03
net X-ctrl-home classicladder.0.out-04
net X-ctrl-pos classicladder.0.out-05
net Z-ctrl-home classicladder.0.out-06
net Z-ctrl-pos classicladder.0.out-07
net X-homestart classicladder.0.out-08
net Z-homestart classicladder.0.out-09
#Power On Logic
net MachineOn classicladder.0.out-16
net ServoFaultReset classicladder.0.out-17
net AuxiliariesPower classicladder.0.out-18
net ServoPower classicladder.0.out-19
#Tool Change Logic -> 20-29
net TurretUnclamp classicladder.0.out-20
net TurretClamp classicladder.0.out-21
net TurretReverse classicladder.0.out-22
net TurretSpin classicladder.0.out-23
net ToolChangeRuning classicladder.0.out-24
net ToolChangeOk classicladder.0.out-25
net ToolChangeFailed classicladder.0.out-26
net ManualTC classicladder.0.out-27
net ToolChangeLed classicladder.0.out-28
#Panel Logic -> 30 -
net ModeAuto classicladder.0.out-41
net ModeMDI classicladder.0.out-42
net ModeMan classicladder.0.out-43
net ModeJ classicladder.0.out-44
net RapidJog classicladder.0.out-45
net ModeX10 classicladder.0.out-47
net ModeX1 classicladder.0.out-46
net CoolantOn classicladder.0.out-48
net CoolantOff classicladder.0.out-49
#Chuck Logic -> 50 -
net ChuckCloseRelay classicladder.0.out-50
net ChuckOpenRelay classicladder.0.out-51
net SpindleInhibit classicladder.0.out-52
net ChuckClampLed classicladder.0.out-53
# Error Handling -> 60-69
net HydraulicError classicladder.0.out-60
net AuxiliariesError classicladder.0.out-61
net ChuckError classicladder.0.out-62
net MachineErrorLamp classicladder.0.out-64
net ProgrammInhibit classicladder.0.out-66
net EstopCL classicladder.0.out-67
net FeedHoldCL classicladder.0.out-68
net MachineOff classicladder.0.out-69
#Program Handling -> 70-79
net ProgramEnd classicladder.0.out-70
net CycleStart classicladder.0.out-71
net ProgramResume classicladder.0.out-72
net ProgramStep classicladder.0.out-73
net ProgramPause classicladder.0.out-74
linuxcnc-retrofit-5718f0bbf7bce5bbac9196f411027800fb8d6149/gmoccapy_postgui.hal 0000775 0000000 0000000 00000004412 14324265440 0026245 0 ustar 00root root 0000000 0000000 net X-homed => halui.joint.0.home
net Z-homed => halui.joint.2.home
net Y-Homed => halui.joint.1.home
net Home-All <= gmoccapy.joint.all.home
net Home-X <= gmoccapy.joint.0.home
net Home-Z <= gmoccapy.joint.2.home
net ToolChangeFailed halui.program.stop
net SpindleNormal halui.spindle.0.forward
net SpindleOff halui.spindle.0.stop
net SpindleReverse halui.spindle.0.reverse
net CoolantOn halui.flood.on
net CoolantOff halui.flood.off
net CoolantPump halui.flood.is-on
net CycleStartBtn halui.program.run
net FeedHoldBtn halui.program.pause
net XSelect halui.axis.x.select
net ZSelect halui.axis.z.select
net XJogPlus gmoccapy.jog.axis.jog-x-plus
net XJogMinus gmoccapy.jog.axis.jog-x-minus
net ZJogPlus gmoccapy.jog.axis.jog-z-plus
net ZJogMinus gmoccapy.jog.axis.jog-z-minus
net XZeroed halui.joint.0.is-homed
net ZZeroed halui.joint.2.is-homed
net MachineIsOn halui.machine.is-on
net MachineOn halui.machine.on
#net ModeManual halui.mode.is−manual
#net ToolChangeRequest iocontrol.0.tool-change
#net ToolPrepPrepPocket iocontrol.0.tool-prep-pocket
#net ToolChangeOk iocontrol.0.tool-changed
net ModeAuto halui.mode.auto
net ModeMDI halui.mode.mdi
net ModeMan halui.mode.manual
net ManualTC halui.mdi-command-00
#net ManualTC2 => halui.mdi−command−02
#net ManualTC3 => halui.mdi−command−03
#net ManualTC4 => halui.mdi−command−04
#net ManualTC5 => halui.mdi−command−05
#net ManualTC6 => halui.mdi−command−06
#net ManualTC7 => halui.mdi−command−07
#net ManualTC8 => halui.mdi−command−08
setp gmoccapy.feed.feed-override.analog-enable true
net FeedOverride gmoccapy.feed.feed-override.direct-value
setp gmoccapy.jog.jog-velocity.analog-enable true
net FeedOverride gmoccapy.jog.jog-velocity.direct-value
setp gmoccapy.rapid.rapid-override.analog-enable true
net RapidOverride gmoccapy.rapid.rapid-override.direct-value
setp gmoccapy.spindle.spindle-override.analog-enable true
net SpindleOverride gmoccapy.spindle.spindle-override.direct-value
net spindle-vel-fb-rpm-abs gmoccapy.spindle_feedback_bar
net spindle-at-speed gmoccapy.spindle_at_speed_led
net PanelKey gmoccapy.unlock-settings
net RapidJog gmoccapy.jog.turtle-jog
#net CycleStartBtn gladevcp.cycle-start
linuxcnc-retrofit-5718f0bbf7bce5bbac9196f411027800fb8d6149/lathehandler.py 0000775 0000000 0000000 00000022454 14324265440 0025216 0 ustar 00root root 0000000 0000000 #!/usr/bin/env python
# vim: sts=4 sw=4 et
# This is a component of EMC
# savestate.py copyright 2013 Andy Pugh
# based on code from
# probe.py Copyright 2010 Michael Haberler
#
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA''''''
import os,sys
from gladevcp.persistence import IniFile,widget_defaults,set_debug,select_widgets
import hal
import hal_glib
import gtk
import glib
import linuxcnc
import rsvg
import cairo
import signal
import pango
debug = 0
class HandlerClass:
active = False
tab_num = 0
firstpress = 0
def on_expose(self,nb,data=None):
tab_num = nb.get_current_page()
tab = nb.get_nth_page(tab_num)
cr = tab.window.cairo_create()
cr.set_operator(cairo.OPERATOR_OVER)
x, y, w, h = tab.allocation
sx, sy, sw, sh = self.svg.get_dimension_data()
cr.translate(0, y)
cr.scale(1.0 *w / sw, 1.0*h/sh)
self.svg.render_cairo(cr = cr, id = '#layer%i' % tab_num)
# This catches our messages from another program
def event(self,w,event):
print event.message_type,event.data
if event.message_type == 'Gladevcp':
if event.data[:7] == 'Visible':
self.active = True
else:
self.active = False
# We connect to client-events from the new toplevel widget
def on_map_event(self, widget, data=None):
top = widget.get_toplevel()
print "map event"
top.connect('client-event', self.event)
def on_destroy(self,obj,data=None):
self.ini.save_state(self)
def on_restore_defaults(self,button,data=None):
'''
example callback for 'Reset to defaults' button
currently unused
'''
self.ini.create_default_ini()
self.ini.restore_state(self)
def __init__(self, halcomp,builder,useropts):
self.halcomp = halcomp
self.builder = builder
self.ini_filename = 'savestatemacro.sav'
self.defaults = { IniFile.vars: dict(),
IniFile.widgets : widget_defaults(select_widgets(self.builder.get_objects(), hal_only=False,output_only = True))
}
self.ini = IniFile(self.ini_filename,self.defaults,self.builder)
self.ini.restore_state(self)
# A pin to use a physical switch to start the cycle
self.cycle_start = hal_glib.GPin(halcomp.newpin('cycle-start', hal.HAL_BIT, hal.HAL_IN))
self.cycle_start.connect('value-changed', self.cycle_pin)
# This catches the signal from Touchy to say that the tab is exposed
t = self.builder.get_object('eventbox1')
t.connect('map-event',self.on_map_event)
t.add_events(gtk.gdk.STRUCTURE_MASK)
self.cmd = linuxcnc.command()
# This conects the expose event to re-draw and scale the SVG frames
t = self.builder.get_object('tabs1')
t.connect_after("expose_event", self.on_expose)
t.connect("destroy", gtk.main_quit)
t.add_events(gtk.gdk.STRUCTURE_MASK)
self.svg = rsvg.Handle(file='LatheMacro.svg', )
def show_keyb(self, obj, data=None):
self.active_ctrl = obj
self.keyb = self.builder.get_object('keyboard')
self.entry = self.builder.get_object('entry1')
self.entry.modify_font(pango.FontDescription("courier 42"))
#set text to previous value
self.entry.set_text(self.active_ctrl.get_text())
self.entry.select_region(0,-1)
#clear text
#self.entry.set_text("")
self.firstpress = 1
resp = self.keyb.run()
#Add for prevent but if closing the windows without click cancel
self.keyb.hide()
def keyb_prev_click(self, obj, data=None):
pos = self.entry.get_position()
self.entry.set_text(self.active_ctrl.get_text())
self.entry.set_position(pos)
def keyb_number_click(self, obj, data=None):
dataval = obj.get_label()
entryval = self.entry.get_text()
#do some sanity checking
if '.' in dataval:
if self.firstpress == 0:
tarr = entryval.split('/')
pos = self.entry.get_position()
if len(tarr[0]) >= pos:
#cursor is in the numerator
if '.' in tarr[0]:
return
elif len(tarr) > 1:
if '.' in tarr[1]:
return
if '/' in dataval and '/' in entryval:
return #only one divisor
self.firstpress = 0
#otherwise send the value to the entry box
event = gtk.gdk.Event(gtk.gdk.KEY_PRESS)
data = obj.get_label()
virtkey = int(gtk.gdk.unicode_to_keyval(ord(data[0])))
event.keyval = virtkey
self.entry.emit('key_press_event', event)
def process_entry(self):
self.firstpress = 0
data = self.entry.get_text()
darr = data.split('/')
if len(darr) == 1:
#is a single number
return darr[0]
else:
if float(darr[1]) == 0:
return darr[0] #not really correct for divide by 0 but this should be fine
else:
value = float(darr[0]) / float(darr[1])
return "%.5f" % value
def keyb_pm_click(self, obj, data=None):
data = self.process_entry()
if data[0] == '-':
data = data[1:]
else:
data = '-' + data
self.entry.set_text(data)
self.entry.set_position(-1)
def keyb_convert_click(self, obj, data=None):
v = float(self.process_entry())
op = obj.get_label()
if op == 'in->mm':
v = v * 25.4
elif op == 'mm->in':
v = v / 25.4
elif op == 'tpi->pitch':
v = 25.4 / v
elif op == 'pitch->tpi':
v = 25.4 / v
self.entry.set_text('%6.4f'%v)
self.entry.set_position(-1)
def keyb_del_click(self, obj, data=None):
data = self.entry.get_text()
pos = self.entry.get_position()
data = data[:(pos-1)] + data[pos:]
self.entry.set_text(data)
self.entry.set_position(pos-1)
def keyb_clear_click(self, obj, data=None):
self.entry.set_text("0")
self.entry.select_region(0,-1)
def keyb_cancel_click(self, obj, data=None):
self.keyb.hide()
def keyb_ok_click(self, obj, data=None):
if self.entry.get_text() != '':
self.active_ctrl.set_value(float(self.process_entry()))
self.keyb.hide()
def set_alpha(self, obj, data = None):
cr = obj.window.cairo_create()
cr.set_source_rgba(1.0, 1.0, 1.0, 0.0)
def cycle_pin(self, pin, data = None):
if pin.get() == 0:
return
print 'cycle pin'
if self.active:
nb = self.builder.get_object('tabs1')
print 'current tab', nb.get_current_page()
tab = nb.get_nth_page(nb.get_current_page())
for c in tab.get_children():
if c.name.partition('.')[2] == 'action':
self.cmd.abort()
self.cmd.mode(linuxcnc.MODE_MDI)
self.cmd.wait_complete()
c.emit('clicked')
def gash(self, obj, data = None):
print 'event', data
def spin_handler(self, obj, data=None):
data = obj.get_text()
if data[-3:] == 'tpi':
obj.set_value(25.4/float(data[:-3]))
obj.set_position(-1)
elif data[-2:] == 'in':
obj.set_value(25.4*float(data[:-2]))
obj.set_position(-1)
elif data[-2:] == 'mm':
obj.set_value(float(data[:-2])/25.4)
obj.set_position(-1)
elif data[-5:] == 'pitch':
obj.set_value(25.4/float(data[:-5]))
obj.set_position(-1)
elif data[-2:] in [ '/2', '/4', '/8']:
v = data[:-2].split()
if len(v) == 2:
obj.set_value(float(v[0]) + float(v[1]) / float(data[-1:]))
obj.set_position(-1)
elif len(v) == 1:
obj.set_value(float(v[0]) / float(data[-1:]))
obj.set_position(-1)
elif data[-3:] in [ '/16', '/32', '/64']:
v = data[:-3].split()
if len(v) == 2:
obj.set_value(float(v[0]) + float(v[1]) / float(data[-2:]))
obj.set_position(-1)
elif len(v) == 1:
obj.set_value(float(v[0]) / float(data[-2:]))
obj.set_position(-1)
def get_handlers(halcomp,builder,useropts,dummy=False):
global debug
for cmd in useropts:
exec cmd in globals()
set_debug(debug)
return [HandlerClass(halcomp,builder,useropts)]
linuxcnc-retrofit-5718f0bbf7bce5bbac9196f411027800fb8d6149/lathemacro-bak/ 0000775 0000000 0000000 00000000000 14324265440 0025051 5 ustar 00root root 0000000 0000000 linuxcnc-retrofit-5718f0bbf7bce5bbac9196f411027800fb8d6149/lathemacro-bak/boring.ngc 0000775 0000000 0000000 00000004133 14324265440 0027026 0 ustar 00root root 0000000 0000000 ;boring
O sub
# = #<_ccomp>
# = #<_metric>
# = #<_absolute>
# = #<_feed>
# = #<_coord_system>
# = #<_lathe_diameter_mode>
# = #<_ijk_absolute_mode>
G8 ; Lathe radius Mode
G90 ; Absolute Distance
G91.1 ; but not for arcs
; #1 X coord
; #2 surface speed
; #3 cut size
; #4 feed/rpm
; #5 Z coord
; #6 radius
; #7 angle
; #8 tool number
; #9 coolant
O10 if [#9 EQ 1]
M8
O10 endif
;M6 T#8 G43
O100 if [#8 NE #<_current_tool>]
(MSG, ERROR : Set tool before use macro)
O call [#] [#] [#] [#] [#] [#] [#]
O100 return [-2] ; indicate failure to epilog
O100 endif
#1 = [#1 / 2] ; because of radius mode
#14 = [#<_x>] (startinG X)
#13 = #<_z> (startinG Z)
#20 = [#6 * SIN[#7]]
#21 = [-#6 * COS[#7]]
#22 = [#6 / COS[#7]]
#23 = [#5 + #6 - #20]
#24 = [[#23 - #13] * TAN[#7]]
G96 D2500 S#2 ; Constant Surface Speed Mode
M3 ;Start Spindle
G95 F#4 ; Feed-Per-Rev Mode
G4P1 ; Wait to reach speed
(debuG, TurninG finish dia #1 start dia #14 start lenGth #13 finish lenGth #5)
O101 WHILE [#14 LT [#1 - #3]]
G0 X #14
#14=[#14 + #3]
G1 X #14
G1 Z #23 X[#14 + #24]
o102 IF [#6 GT 0]
G3 Z#5 X[#14 + #24 + #21] I#21 K#20
G1 X[#14 + #24 + #21 - #3]
o102 ELSE
G1 X[#14 + #24 - [#3 * 1.5]]
o102 ENDIF
G0 Z[#13]
O101 ENDWHILE
G0 X#1
G1 Z#23 X[#1 + #24]
O103 IF [#6 GT 0]
G3 Z#5 X[#1 + #24 + #21] I#21 K#20
G1 X[#1 + #24 + #21 - #3]
O103 ELSE
G1 X[#1 + #24 - #3]
O103 ENDIF
G0 Z#13
G0 X#1 ; For touch-off
M5
M9
; restore g20/21, g90/g91, feed
O call [#] [#] [#] [#] [#] [#] [#]
O endsub
M2
%
linuxcnc-retrofit-5718f0bbf7bce5bbac9196f411027800fb8d6149/lathemacro-bak/chamfer.ngc 0000775 0000000 0000000 00000005060 14324265440 0027153 0 ustar 00root root 0000000 0000000 ;chamfer
O sub
# = #<_ccomp>
# = #<_metric>
# = #<_absolute>
# = #<_feed>
# = #<_coord_system>
# = #<_lathe_diameter_mode>
# = #<_ijk_absolute_mode>
G8 ; Lathe radius Mode
G90 ; Absolute Distance
; #1 X coord
; #2 feed/rpm
; #3 0.5 ?
; #4 0 ?
; #5 Z coord
; #6 tool number
; #7 0 ?
; #8 chamfer size
; #9 exterior front
; #10 interior
; #11 exterior rear
; #12 coolant
O10 if [#12 EQ 1]
M8
O10 endif
;M6 T#6 G43
O100 if [#6 NE #<_current_tool>]
(MSG, ERROR : Set tool before use macro)
O call [#] [#] [#] [#] [#] [#] [#]
O100 return [-2] ; indicate failure to epilog
O100 endif
#1 = [#1 / 2] ; because of radius mode
#14 = [#<_x>] (starting X)
#13 = [#<_z>] (starting Z)
G96 D2500 S#2 ; Constant Surface Speed Mode
M3
G95 F0.1 ; Feed-Per-Rev Mode
#20 = 0
O101 if [#9 GT 0.5] ; front outside
o102 while [[#20 + #3] lt #8]
#20 = [#20 + #3]
G0 x[#1 - #20] z#13
G1 z#5
G1 x#1 z[#5 - #20]
G1 x #14
G0 z#13
o102 endwhile
G0 x#14 z#13
G0 x[#1 - #8]
G1 z#5
G1 x#1 z[#5 - #8]
G1 x #14
G0 z#13
O101 elseif [#10 GT 0.5] ; front inside
o103 while [[#20 + #3] lt #8]
#20 = [#20 + #3]
G0 x[#1 + #20] z#13
G1 z#5
G1 x#1 z[#5 - #20]
G1 x #14
G0 z#13
o103 endwhile
G0 x#14 z#13
G0 x[#1 + #8]
G1 z#5
G1 x#1 z[#5 - #8]
G1 x #14
G0 z#13
O101 elseif [#11 GT 0.5] ; back outside
o104 while [[#20 + #3] lt #8]
#20 = [#20 + #3]
G0 x[#1 - #20] z#13
G1 z#5
G1 x#1 z[#5 + #20]
G1 x #14
G0 z#13
o104 endwhile
G0 x#14 z#13
G0 x[#1 - #8]
G1 z#5
G1 x#1 z[#5 + #8]
G1 x #14
G0 z#13
O101 endif
M5
M9
; restore g20/21, g90/g91, feed
O call [#] [#] [#] [#] [#] [#] [#]
O endsub
M2
%
linuxcnc-retrofit-5718f0bbf7bce5bbac9196f411027800fb8d6149/lathemacro-bak/drill.ngc 0000775 0000000 0000000 00000002652 14324265440 0026660 0 ustar 00root root 0000000 0000000 ;drill
O sub
# = #<_ccomp>
# = #<_metric>
# = #<_absolute>
# = #<_feed>
# = #<_coord_system>
# = #<_lathe_diameter_mode>
# = #<_ijk_absolute_mode>
G7 ; diameter mode
G90 ; Absolute Distance
; #1 drill diameter
; #2 ydepth
; #3 speed
; #4 feed/rpm
; #5 tool number
; #6 peck amount
; #7 retract amount
; #8 coolant
O10 if [#8 EQ 1]
M8
O10 endif
#9 = #<_y> (starting Y)
;M6 T#5 G43
O100 if [#5 NE #<_current_tool>]
(MSG, ERROR : Set tool before use macro)
O call [#] [#] [#] [#] [#] [#] [#]
O100 return [-2] ; indicate failure to epilog
O100 endif
#7 = [[1000 * #3] / [3.1415 * #1]] ; metric mode RPM
G97 S#7 ; Constant RPM mode
M3 ;Start Spindle
G95 F#4 ; Feed-Per-Rev Mode
G4 P1 ; Wait to reach speed
(debug, Drilling dia #1 depth #2 asked-speed #3 feed/rpm #4 tool #5 peck dist #6 calculated-rpm #7 start-Y #9)
(MSG, ERROR : TODO must retract the X axis to home position)
; G0 X0 ; TODO must retract the X axis to home position
;G0 Y#9
G98
G83 Y#2 R#9 Q#6
G80
;G0 Y#9
M5
M9
; restore g20/21, g90/g91, feed
O call [#] [#] [#] [#] [#] [#] [#]
O endsub
M2
%
linuxcnc-retrofit-5718f0bbf7bce5bbac9196f411027800fb8d6149/lathemacro-bak/facing.ngc 0000775 0000000 0000000 00000002743 14324265440 0027002 0 ustar 00root root 0000000 0000000 ;Facing
O sub
# = #<_ccomp>
# = #<_metric>
# = #<_absolute>
# = #<_feed>
# = #<_coord_system>
# = #<_lathe_diameter_mode>
# = #<_ijk_absolute_mode>
G7 ; diameter mode
G90 ; Absolute Distance
; #1 X coord
; #2 surface speed
; #3 cut size
; #4 feed/rpm
; #5 Z coord
; #6 angles
; #7 tool number
; #8 coolant
O10 if [#8 EQ 1]
M8
O10 endif
O20 IF [#6 NE 0]
(MSG, Angled facing isn't supported yet)
O20 ENDIF
;M6 T#7 G43
O100 if [#7 NE #<_current_tool>]
(MSG, ERROR : Set tool before use macro)
O call [#] [#] [#] [#] [#] [#] [#]
O100 return [-2] ; indicate failure to epilog
O100 endif
#14 = [#<_x> * 2] (starting X)
#13 = #<_z> (starting Z)
G96 D2500 S#2 ; Constant Surface Speed Mode
M3
G95 F#4 ; Feed-Per-Rev Mode
G4P1 ; Wait to reach speed
O200 WHILE [#13 GT #5 + #3]
#13=[#13-#3]
G1 Z#13
G1 X#1
G0 Z[#13+#3]
G0 X#14
G0 Z#13
O200 ENDWHILE
G1 Z#5
G1 X#1
G0 Z[#13+#3]
G0 X[#14+#3]
G0 Z#5 ; For touch-off
M5
M9
; restore g20/21, g90/g91, feed
O call [#] [#] [#] [#] [#] [#] [#]
O endsub
M2
%
linuxcnc-retrofit-5718f0bbf7bce5bbac9196f411027800fb8d6149/lathemacro-bak/radius.ngc 0000775 0000000 0000000 00000005317 14324265440 0027042 0 ustar 00root root 0000000 0000000 ;radius
O sub
# = #<_ccomp>
# = #<_metric>
# = #<_absolute>
# = #<_feed>
# = #<_coord_system>
# = #<_lathe_diameter_mode>
# = #<_ijk_absolute_mode>
G7 ; diameter mode
G90 ; Absolute Distance
; #1 X coord
; #2 feed/rpm
; #3 0.5 ?
; #4 0 ?
; #5 Z coord
; #6 tool number
; #7 0 ?
; #8 radius size
; #9 exterior front
; #10 interior
; #11 exterior rear
; #12 coolant
O10 if [#12 EQ 1]
M8
O10 endif
;M6 T#6 G43
O100 if [#6 NE #<_current_tool>]
(MSG, ERROR : Set tool before use macro)
O call [#] [#] [#] [#] [#] [#] [#]
O100 return [-2] ; indicate failure to epilog
O100 endif
#1 = [#1 / 2] ; because of radius mode
#14 = [#<_x>] (starting X)
#13 = [#<_z>] (starting Z)
G96 D2500 S#2 ; Constant Surface Speed Mode
M3
G95 F0.1 ; Feed-Per-Rev Mode
G4P1 ; Wait to reach speed
#20 = 0
O101 if [#9 GT 0.5] ; Front outside
o102 while [[#20 + #3] lt #8]
#20 = [#20 + #3]
G0 x[#1 - #20] z#13
G1 z#5
G3 x#1 z[#5 - #20] K[-#20]
G1 x #14
G0 z#13
o102 endwhile
G0 x#14 z#13
G0 x[#1 - #8]
G1 z#5
G3 x#1 z[#5 - #8] K[-#8]
G1 x #14
G0 z#13
O101 elseif [#10 GT 0.5] ; front inside
o103 while [[#20 + #3] lt #8]
#20 = [#20 + #3]
G0 x[#1 + #20] z#13
G1 z#5
G2 x#1 z[#5 - #20] K[-#20]
G1 x #14
G0 z#13
o103 endwhile
G0 x#14 z#13
G0 x[#1 + #8]
G1 z#5
G2 x#1 z[#5 - #8] K[-#8]
G1 x #14
G0 z#13
O101 elseif [#11 GT 0.5] ; back outside
o104 while [[#20 + #3] lt #8]
#20 = [#20 + #3]
G0 x[#1 - #20] z#13
G1 z#5
G2 x#1 z[#5 + #20] K#20
G1 x #14
G0 z#13
o104 endwhile
G0 x#14 z#13
G0 x[#1 - #8]
G1 z#5
G2 x#1 z[#5 + #8] K#8
G1 x #14
G0 z#13
O101 endif
M5
M9
; restore g20/21, g90/g91, feed
O call [#] [#] [#] [#] [#] [#] [#]
O endsub
M2
%
linuxcnc-retrofit-5718f0bbf7bce5bbac9196f411027800fb8d6149/lathemacro-bak/restore.ngc 0000775 0000000 0000000 00000003024 14324265440 0027227 0 ustar 00root root 0000000 0000000 ; restore metric/inch absolute/relative, feed as per paramter values
; call as 'O call [originalmetric] [originalabs] [originalfeed] [originalcomp]
;
;[#] [#] [#] [#] [#] [#] [#]
;
O sub
O100 if [#1 NE #<_metric>]
O200 if [#1]
G21
O200 else
G20
O200 endif
O100 endif
O300 if [#2 NE #<_absolute>]
O400 if [#2]
G90
O400 else
G91
O400 endif
O300 endif
O500 if [#3 NE #<_feed>]
F[#3]
O500 endif
O600 if [#4 NE #<_ccomp>]
O601 if [#4 EQ 400]
G40
O601 endif
O602 if [#4 EQ 411]
G41.1
O602 endif
O603 if [#4 EQ 420]
G42
O603 endif
O604 if [#4 EQ 421]
G42.1
O604 endif
O600 endif
O700 if [#5 NE #<_coord_system>]
O701 if [#5 EQ 540]
G54
O701 endif
O702 if [#5 EQ 550]
G55
O702 endif
O703 if [#5 EQ 560]
G56
O703 endif
O704 if [#5 EQ 570]
G57
O704 endif
O705 if [#5 EQ 580]
G58
O705 endif
O706 if [#5 EQ 590]
G59
O706 endif
O707 if [#5 EQ 591]
G59.1
O707 endif
O708 if [#5 EQ 592]
G59.2
O708 endif
O709 if [#5 EQ 593]
G59.3
O709 endif
O700 endif
O800 if [#6 NE #<_lathe_diameter_mode>]
O801 if [#6]
G7
O801 else
G8
O801 endif
O800 endif
O900 if [#7 NE #<_ijk_absolute_mode>]
O901 if [#7]
G90.1
O901 else
G91.1
O901 endif
O900 endif
O endsub
M2
linuxcnc-retrofit-5718f0bbf7bce5bbac9196f411027800fb8d6149/lathemacro-bak/threading.ngc 0000775 0000000 0000000 00000005277 14324265440 0027525 0 ustar 00root root 0000000 0000000 ;threading
O sub
; #1=thread.x, #2=thread.sf, #3=thread.tool-s, #4=thread.pitch-f, #5=thread.z-f, #6=thread.internal #7=thread.external
# = #<_ccomp>
# = #<_metric>
# = #<_absolute>
# = #<_feed>
# = #<_coord_system>
# = #<_lathe_diameter_mode>
# = #<_ijk_absolute_mode>
G8 ; Lathe radius Mode
G90 ; Absolute Distance
; #1 X coord
; #2 feed/rpm
; #3 tool number
; #4 pitch
; #5 Z coord
; #6 interior
; #7 exterior
; #8 coolant
O10 if [#8 EQ 1]
M8
O10 endif
;M6 T#3 G43
O100 if [#3 NE #<_current_tool>]
(MSG, ERROR : Set tool before use macro)
O call [#] [#] [#] [#] [#] [#] [#]
O100 return [-2] ; indicate failure to epilog
O100 endif
#1 = [#1 / 2.0]
#14 = [#<_x> * 2] (starting X)
#13 = #<_z> (starting Z)
G96 D2500 S#2 ; Constant Surface Speed Mode
M3
G4 P1 ; Wait to reach speed
# = [0.86603 * #4]
# = [# * 0.125]
# = [# * 0.250]
# = [# * 0.625]
;(debug, #40 # # #)
O101 IF [#<_metric>]
# = 0.2
# = 0.1
O101 ELSE
# = 0.007
# = 0.004
O101 ENDIF
G95 F# ; Feed-Per-Rev Mode
;Threading
O102 IF [#6 GT 0.5] ;internal
;cut the minor flat diameter
;(debug, INTERNAL Threading thread dia-#1 start-#13 finish-#5 Pitch-#4 Depth-#3)
G0 Z #13
G0 X [#1 + # - #]
G1 Z #5
G0 X [#1 - #]
G0 Z #13
G96 D600 S#2 ; limit RPM in threading mode
G76 P#4 Z#5 i# j# k# H3 R1.5 Q29.5 E0 L0
G0 X [#1 - 0.5]
O102 ELSE ;external
; cut the major diameter
;(debug, EXTERNAL Threading thread dia-#1 start-#13 finish-#5 Pitch-#4 Depth-#3 MF #)
G0 Z #13
G0 X #1
G1 X [#1 - #]
G1 Z #5
G0 X #1
G0 Z #13
G96 D600 S#2 ; limit RPM in threading mode
G76 P#4 Z#5 i[-#] j# k# H3 R1.5 Q29.5 E0 L0
G0 X [#1 + 0.5]
O102 ENDIF
G0 Z#13
M5
M9
; restore g20/21, g90/g91, feed
O call [#] [#] [#] [#] [#] [#] [#]
O endsub
M2
%
linuxcnc-retrofit-5718f0bbf7bce5bbac9196f411027800fb8d6149/lathemacro-bak/turning.ngc 0000775 0000000 0000000 00000004610 14324265440 0027234 0 ustar 00root root 0000000 0000000 ;Turning
O sub
# = #<_ccomp>
# = #<_metric>
# = #<_absolute>
# = #<_feed>
# = #<_coord_system>
# = #<_lathe_diameter_mode>
# = #<_ijk_absolute_mode>
G8 ; Lathe radius Mode
G90 ; Absolute Distance
G91.1 ; but not for arcs
; #1 X coord
; #2 surface speed
; #3 cut size
; #4 feed/rpm
; #5 Z coord
; #6 radius
; #7 angle
; #8 tool number
; #9 coolant
O10 if [#9 EQ 1]
M8
O10 endif
;M6 T#8 G43
O100 if [#8 NE #<_current_tool>]
(MSG, ERROR : Set tool before use macro)
O call [#] [#] [#] [#] [#] [#] [#]
O100 return [-2] ; indicate failure to epilog
O100 endif
#1 = [#1 / 2] ; because of radius mode
#14 = [#<_x>] (starting X)
#13 = #<_z> (starting Z)
#20 = [#6 * SIN[#7]]
#21 = [#6 * COS[#7]]
#22 = [#6 / COS[#7]]
#23 = [#5 + #6 - #20]
#24 = [[#13 - #23] * TAN[#7]]
G96 D2500 S#2 ; Constant Surface Speed Mode
M3 ;Start Spindle
G95 F#4 ; Feed-Per-Rev Mode
G4P1 ; Wait to reach speed
(debug, Turning finish rad #1 start rad #14 start length #13 finish length #5)
;[${turn.x-f}] [${turn.sf-f}] [${turn.cut-f}] [${turn.feed-f}] [${turn.z-f}] [${turn.rad-f}] [${turn.angle-f}] [${turn.tool-s}]
O101 WHILE [#14 GT [#1 + #3 / 2]]
G0 X #14
#14=[#14-#3 / 2]
G1 X #14
G1 Z #23 X[#14 + #24]
o102 IF [#6 GT 0]
G2 Z#5 X[#14 + #24 + #21] I#21 K#20
G1 X[#14 + #24 + #21 + #3/2]
o102 ELSE
G1 X[#14 + #24 + [#3 * .6]]
o102 ENDIF
o103 IF [#7 LT 0]
G0 X#14
o103 ENDIF
G0 Z[#13]
O101 ENDWHILE
G0 X#1
G1 Z #23 X[#1 + #24]
O104 IF [#6 GT 0]
G2 Z#5 X[#1 + #24 + #21] I#21 K#20
G1 X[#1 + #24 + #21 + #3]
O104 ELSE
G1 X[#1 + #24 + #3]
O104 ENDIF
O105 IF [#7 LT 0]
G0 X#14
O105 ENDIF
G0 Z#13
G0 X#1 ; For touch-off
M5
M9
; restore g20/21, g90/g91, feed
O call [#] [#] [#] [#] [#] [#] [#]
O endsub
M2
%
linuxcnc-retrofit-5718f0bbf7bce5bbac9196f411027800fb8d6149/lathemacro-en-numpad.ui 0000775 0000000 0000000 00001045404 14324265440 0026552 0 ustar 00root root 0000000 0000000
False
GDK_EXPOSURE_MASK | GDK_STRUCTURE_MASK
300
180
True
False
True
True
GDK_EXPOSURE_MASK | GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_MOTION_MASK | GDK_BUTTON1_MOTION_MASK | GDK_BUTTON2_MOTION_MASK | GDK_BUTTON3_MOTION_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK | GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK | GDK_FOCUS_CHANGE_MASK | GDK_STRUCTURE_MASK | GDK_PROPERTY_CHANGE_MASK | GDK_VISIBILITY_NOTIFY_MASK | GDK_PROXIMITY_IN_MASK | GDK_PROXIMITY_OUT_MASK | GDK_SUBSTRUCTURE_MASK | GDK_SCROLL_MASK
True
False
20
12
True
True
False
Coolant
True
True
False
False
False
True
0
2
0
1
True
True
â—
True
False
False
True
True
adj.turn.x
3
9
11
14
16
True
True
â—
True
False
False
True
True
adj.turn.feed
3
2
4
15
17
True
True
â—
True
False
False
True
True
adj.turn.rad
3
3
5
5
7
True
True
â—
True
False
False
True
True
adj.turn.cut
3
5
7
17
19
True
True
â—
True
False
False
True
True
adj.turn.z
3
11
13
10
12
True
True
â—
True
False
False
True
True
adj.turn.ang
4
1
3
10
12
True
True
â—
True
False
False
True
True
adj.turn.tool
11
13
0
2
True
True
â—
True
False
False
True
True
adj.turn.sf
11
13
2
4
True
False
Set Tool
True
True
True
turn.toolchange
True
9
11
0
2
True
False
Speed
True
True
9
11
2
4
True
False
gtk-media-play
True
True
True
turn.go
False
True
True
11
13
18
20
True
False
gtk-media-stop
True
True
True
turn.stop
False
True
2
18
20
True
False
Turning
False
True
False
20
12
True
True
False
Coolant
True
True
False
False
False
True
0
2
0
1
True
True
â—
True
False
False
True
True
adj.bore.z
3
11
13
12
14
True
True
â—
True
False
False
True
True
adj.bore.angle
4
1
3
9
11
True
True
â—
True
False
False
True
True
adj.bore.rad
3
5
7
6
8
True
True
â—
True
False
False
True
True
adj.bore.x
3
9
11
15
17
True
True
â—
True
False
False
True
True
adj.bore.cut
3
6
8
19
21
True
True
â—
True
False
False
True
True
adj.bore.feed
3
2
4
15
17
True
True
â—
True
False
False
True
True
adj.bore.tool
11
13
0
2
True
True
â—
True
False
False
True
True
adj.bore.sf
11
13
2
4
True
False
Speed
True
True
9
11
2
4
True
False
Set Tool
True
True
True
bore.toolchange
True
9
11
0
2
True
False
gtk-media-play
True
True
True
bore.go
False
True
True
11
13
19
21
True
False
gtk-media-stop
True
True
True
bore.stop
False
True
2
19
21
1
True
False
Boring
1
False
True
False
20
12
True
True
False
Coolant
True
True
False
False
False
True
0
2
0
1
True
True
â—
True
False
False
True
True
adj.face.tool
11
13
0
2
True
True
â—
True
False
False
True
True
adj.face.sf
11
13
2
4
True
True
â—
True
False
False
True
True
adj.face.z
3
7
9
18
20
True
True
â—
True
False
False
True
True
adj.face.x
3
8
10
12
14
True
True
â—
True
False
False
True
True
adj.face.feed
4
7
9
15
16
True
True
â—
True
False
False
True
True
adj.face.cut
3
2
4
16
18
True
True
â—
True
False
False
True
True
adj.face.angle
4
3
5
12
13
True
False
Set Tool
True
True
True
face.toolchange
True
9
11
0
2
True
False
Speed
True
True
9
11
2
4
True
False
gtk-media-play
True
True
True
face.go
False
True
True
11
13
18
20
True
False
gtk-media-stop
True
True
True
face.stop
False
True
2
18
20
2
True
False
Facing
2
False
True
False
20
12
True
True
False
Coolant
True
True
False
False
False
True
0
2
0
1
True
True
â—
True
False
False
True
True
adj.radius.x
3
10
12
12
13
True
True
â—
True
False
False
True
True
adj.radius.z
3
9
11
18
20
True
True
â—
True
False
False
True
True
adj.radius.rad
3
5
7
6
8
True
False
Internal
True
True
False
False
True
True
7
9
14
15
True
False
External
True
True
False
False
True
True
radius.fi
5
7
18
19
True
False
Rear
True
True
False
False
True
True
radius.fi
1
3
14
15
True
True
â—
True
False
False
True
True
adj.radius.tool
11
13
0
2
True
True
â—
True
False
False
True
True
adj.radius.sf
11
13
2
4
True
False
Speed
True
True
9
11
2
4
True
False
Set Tool
True
True
True
radius.toolchange
True
9
11
0
2
True
False
gtk-media-play
True
True
True
radius.go
False
True
True
11
13
18
20
True
False
gtk-media-stop
True
True
True
radius.stop
False
True
2
18
20
3
True
False
Radius
3
False
True
False
20
12
True
True
False
Coolant
True
True
False
False
False
True
0
2
0
1
True
True
â—
True
False
False
True
True
adj.chamfer.z
3
9
11
19
21
True
True
â—
True
False
False
True
True
adj.chamfer.size
4
4
6
7
9
True
True
â—
True
False
False
True
True
adj.chamfer.x
3
10
12
11
13
True
False
Rear
True
True
False
False
True
True
1
3
12
13
True
False
External
True
True
False
False
True
True
chamfer.bo
4
6
20
21
True
False
Internal
True
True
False
False
1
True
True
chamfer.bo
8
10
14
15
True
True
â—
True
False
False
True
True
adj.chamfer.tool
11
13
0
2
True
True
â—
True
False
False
True
True
adj.chamfer.sf
11
13
2
4
True
False
Speed
True
True
9
11
2
4
True
False
Set Tool
True
True
True
chamfer.toolchange
True
9
11
0
2
True
False
gtk-media-play
True
True
True
chamfer.go
False
True
True
11
13
18
20
True
False
gtk-media-stop
True
True
True
chamfer.stop
False
True
2
18
20
4
True
False
Chamfer
4
False
True
False
20
12
True
True
False
Coolant
True
True
False
False
False
True
0
2
0
1
True
True
â—
True
False
False
True
True
adj.thread.z
3
10
12
6
8
True
True
â—
True
False
False
True
True
adj.thread.x
3
10
12
13
15
True
True
â—
True
False
False
True
True
adj.thread.pitch
4
1
3
14
16
True
True
â—
True
False
False
True
True
adj.thread.tool
11
13
0
2
True
False
Speed
True
True
9
11
2
4
True
False
Externe
True
True
False
False
True
True
4
6
13
14
True
True
â—
True
False
False
True
True
adj.thread.sf
11
13
2
4
True
False
Set Tool
True
True
True
thread.toolchange
True
9
11
0
2
True
False
Internal
True
True
False
False
True
True
thread.external
6
8
8
9
True
False
gtk-media-play
True
True
True
thread.go
False
True
True
11
13
18
20
True
False
gtk-media-stop
True
True
True
thread.stop
False
True
2
18
20
5
True
False
Threads
5
False
True
False
20
12
True
True
False
Coolant
True
True
False
False
False
True
0
2
0
1
True
False
gtk-media-play
True
True
True
drill.go
False
True
True
11
13
18
20
True
False
gtk-media-stop
True
True
True
drill.stop
False
True
2
18
20
True
True
â—
True
False
False
True
True
adj.drill.tool
11
13
0
2
True
True
â—
True
False
False
True
True
adj.drill.sf
11
13
2
4
True
False
Speed
True
True
9
11
2
4
True
False
Set Tool
True
True
True
drill.toolchange
False
9
11
0
2
True
True
â—
False
False
True
True
adj.drill.ydepth
4
10
12
12
14
True
True
â—
False
False
True
True
adj.drill.diameter
4
8
10
16
18
True
True
â—
True
False
False
True
True
adj.drill.feed
4
4
6
17
19
True
True
â—
False
False
True
True
adj.drill.peck
3
5
7
11
13
True
True
â—
False
False
True
True
adj.drill.retract
3
3
5
10
11
6
True
False
Drilling
6
False
linuxcnc-retrofit-5718f0bbf7bce5bbac9196f411027800fb8d6149/lathemacro.ini 0000775 0000000 0000000 00000012567 14324265440 0025035 0 ustar 00root root 0000000 0000000 # This config file was created 2016-09-30 19:50:17.541521 by the update_ini script
# The original config files may be found in the /home/andypugh/linuxcnc/configs/LatheMacro-3/lathemacro.old directory
# EMC controller parameters for a simulated machine.
# General note: Comments can either be preceded with a # or ; - either is
# acceptable, although # is in keeping with most linux config files.
# General section -------------------------------------------------------------
[EMC]
# Version of this INI file
VERSION = 1.0
# Name of machine, for use with display, etc.
MACHINE = GLADEVCP-LATHE
# Debug level, 0 means no messages. See src/emc/nml_int/emcglb.h for others
#DEBUG = 0x7FFFFFFF
DEBUG = 0
# Sections for display options ------------------------------------------------
[DISPLAY]
# add GladeVCP panel where PyVCP used to live:
EMBED_TAB_NAME=Cycles
EMBED_TAB_COMMAND=halcmd loadusr -Wn gladevcp gladevcp -c gladevcp -u lathehandler.py -x {XID} lathemacro-en-numpad.ui
# Name of display program, e.g., xemc
DISPLAY = touchy
OPEN_FILE = ""
# Cycle time, in seconds, that display will sleep between polls
CYCLE_TIME = 0.100
# Path to help file
HELP_FILE = doc/help.txt
# Initial display setting for position, RELATIVE or MACHINE
POSITION_OFFSET = RELATIVE
# Initial display setting for position, COMMANDED or ACTUAL
POSITION_FEEDBACK = ACTUAL
# Highest value that will be allowed for feed override, 1.0 = 100%
MAX_FEED_OVERRIDE = 1.2
MAX_SPINDLE_OVERRIDE = 1.0
LATHE = 1
MAX_LINEAR_VELOCITY = 120
DEFAULT_LINEAR_VELOCITY = 120
# Prefix to be used
PROGRAM_PREFIX = ~/linuxcnc/nc_files
# Introductory graphic
INTRO_GRAPHIC = linuxcnc.gif
INTRO_TIME = 5
EDITOR = gedit
TOOL_EDITOR = tooledit
INCREMENTS = 10mm, 1mm, 0.1mm, 0.01mm
[FILTER]
PROGRAM_EXTENSION = .png,.gif,.jpg Grayscale Depth Image
PROGRAM_EXTENSION = .py Python Script
png = image-to-gcode
gif = image-to-gcode
jpg = image-to-gcode
py = python
# Task controller section -----------------------------------------------------
[RS274NGC]
# File containing interpreter variables
PARAMETER_FILE = sim.var
RS274NGC_STARTUP_CODE = G7 G21
# gladevcp Demo specific Oword subs live here
SUBROUTINE_PATH = ../../../nc_files/gladevcp_lib:./
FEATURES = 0
# Motion control section ------------------------------------------------------
[EMCMOT]
EMCMOT = motmod
# Timeout for comm to emcmot, in seconds
COMM_TIMEOUT = 1.0
# Interval between tries to emcmot, in seconds
COMM_WAIT = 0.010
# BASE_PERIOD is unused in this configuration but specified in core_sim.hal
BASE_PERIOD = 0
# Servo task period, in nano-seconds
SERVO_PERIOD = 1000000
# Hardware Abstraction Layer section --------------------------------------------------
[TASK]
# Name of task controller program, e.g., milltask
TASK = milltask
# Cycle time, in seconds, that task controller will sleep between polls
CYCLE_TIME = 0.001
# Part program interpreter section --------------------------------------------
[HAL]
# The run script first uses halcmd to execute any HALFILE
# files, and then to execute any individual HALCMD commands.
#
# list of hal config files to run through halcmd
# files are executed in the order in which they appear
HALFILE = lathe.hal
HALFILE = axis_manualtoolchange.hal
HALFILE = simulated_home.hal
HALUI = halui
# Trajectory planner section --------------------------------------------------
[HALUI]
#No Content
[TRAJ]
AXES = 2
COORDINATES = X Z
HOME = 0 0 0
LINEAR_UNITS = mm
ANGULAR_UNITS = degree
CYCLE_TIME = 0.010
DEFAULT_VELOCITY = 120
POSITION_FILE = position.txt
MAX_LINEAR_VELOCITY = 120
NO_FORCE_HOMING = 1
# Axes sections ---------------------------------------------------------------
# First axis
[EMCIO]
# Name of IO controller program, e.g., io
EMCIO = io
# cycle time, in seconds
CYCLE_TIME = 0.100
# tool table file
TOOL_TABLE = tool.tbl
[KINS]
KINEMATICS = trivkins coordinates=XZ
#This is a best-guess at the number of joints, it should be checked
JOINTS = 2
[AXIS_X]
MIN_LIMIT = -1
MAX_LIMIT = 400.0
MAX_VELOCITY = 120
MAX_ACCELERATION = 1000.0
[JOINT_0]
TYPE = LINEAR
HOME = 0.000
MAX_VELOCITY = 120
MAX_ACCELERATION = 1000.0
BACKLASH = 0.000
INPUT_SCALE = 4000
OUTPUT_SCALE = 1.00072
MIN_LIMIT = -1
0
MAX_LIMIT = 400.0
FERROR = 0.050
MIN_FERROR = 0.010
HOME_OFFSET = 0.0
HOME_SEARCH_VEL = 200.0
HOME_LATCH_VEL = 200.0
HOME_USE_INDEX = NO
HOME_IGNORE_LIMITS = NO
HOME_SEQUENCE = 0
[AXIS_Z]
MIN_LIMIT = 0
MAX_LIMIT = 1000
MAX_VELOCITY = 400
MAX_ACCELERATION = 1000.0
[JOINT_1]
TYPE = LINEAR
HOME = 0.000
MAX_VELOCITY = 400
MAX_ACCELERATION = 1000.0
BACKLASH = 0.000
INPUT_SCALE = 4000
OUTPUT_SCALE = 1.000
MIN_LIMIT = 0
MAX_LIMIT = 1000
FERROR = 0.050
MIN_FERROR = 0.010
HOME_OFFSET = 0.0
HOME_SEARCH_VEL = 200.0
HOME_LATCH_VEL = 200.0
HOME_USE_INDEX = NO
HOME_IGNORE_LIMITS = NO
HOME_SEQUENCE = 1
linuxcnc-retrofit-5718f0bbf7bce5bbac9196f411027800fb8d6149/lathemacro.ui 0000775 0000000 0000000 00000735202 14324265440 0024671 0 ustar 00root root 0000000 0000000
-90
90
10
3
0.14999999999999999
10
2
0.029999999999999999
100
10
20
200
45
10
100
10
-20
250
15
10
-2000
2000
1
100
10
250
10
-1000
1000
10
-89
89
10
-1000
1000
10
20
0.10000000000000001
10
20
10
100
10
250
10
-1000
1000
10
100
10
200
10
-1000
1000
10
100
10
250
10
100
10
-1000
1000
10
-1000
1000
10
100
10
250
10
-1000
1000
10
100
10
100
10
-1000
1000
10
100
10
10
100
10
10
-89
89
10
-1000
1000
10
100
10
100
10
-1000
1000
10
100
10
gtk-media-play
O<boring> call [${bore.x-f}] [${bore.sf-f}] [${bore.cut-f}] [${bore.feed-f}] [${bore.z-f}] [${bore.rad-f}] [${bore.angle-f}] [${bore.tool-s}]
Set Tool
M61 Q${bore.tool-s} G43 H${bore.tool-s}
O<chamfer>call [${chamfer.x-f}] [${chamfer.sf-f}] [0.5] [0] [${chamfer.z-f}] [${chamfer.tool-s}] [0] [${chamfer.size-f}] [${chamfer.fo}] [${chamfer.fi}] [${chamfer.bo}]
M61 Q${chamfer.tool-s} G43 H${chamfer.tool-s}
O<facing>call [${face.x-f}] [${face.sf-f}] [${face.cut-f}] [${face.feed-f}] [${face.z-f}] [${face.angle-s}] [${face.tool-s}]
Set Tool
M61 Q${face.tool-s} G43 H${face.tool-s}
O<radius> call [${radius.x-f}] [${radius.sf-f}] [0.5] [0][${radius.z-f}] [${radius.tool-s}] [0] [${radius.rad-f}] [${radius.fo}] [${radius.fi}] [${radius.bo}]
Set Tool
M61 Q${radius.tool-s} G43 H${radius.tool-s}
O<threading>call [${thread.x-f}] [${thread.sf-f}] [${thread.tool-s}] [${thread.pitch-f}] [${thread.z-f}] [${thread.internal}] [${thread.external}]
M61 Q${thread.tool-s} G43 H${thread.tool-s}
O<turning> call [${turn.x-f}] [${turn.sf-f}] [${turn.cut-f}] [${turn.feed-f}] [${turn.z-f}] [${turn.rad-f}] [${turn.angle-f}] [${turn.tool-s}]
Set Tool
M61 Q${turn.tool-s} G43 H${turn.tool-s}
False
5
dialog
True
False
2
True
False
end
OK
100
50
True
True
True
False
False
False
0
Cancel
100
50
True
True
True
False
False
False
1
False
True
end
0
60
True
True
â—
False
False
True
True
False
False
1
True
False
5
4
1
50
50
True
True
True
False
2
50
20
True
True
True
False
1
2
3
50
20
True
True
True
False
2
3
DEL
50
20
True
True
True
False
3
4
4
50
50
True
True
True
False
1
2
5
50
20
True
True
True
False
1
2
1
2
6
50
20
True
True
True
False
2
3
1
2
CLR
50
20
True
True
True
False
3
4
1
2
7
50
50
True
True
True
False
2
3
8
50
20
True
True
True
False
1
2
2
3
9
50
20
True
True
True
False
2
3
2
3
PREV
50
20
True
True
True
False
3
4
2
3
+/-
50
50
True
True
True
False
3
4
0
50
20
True
True
True
False
1
2
3
4
.
50
20
True
True
True
False
2
3
3
4
/
50
20
True
True
True
False
3
4
3
4
in->mm
80
40
True
True
True
False
4
5
4
4
mm->in
80
40
True
True
True
False
1
2
4
5
4
4
pitch->tpi
80
40
True
True
True
False
2
3
4
5
4
4
tpi->pitch
80
40
True
True
True
False
3
4
4
5
4
4
True
True
2
button23
button24
False
GDK_EXPOSURE_MASK | GDK_STRUCTURE_MASK
300
180
True
False
True
True
GDK_EXPOSURE_MASK | GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_MOTION_MASK | GDK_BUTTON1_MOTION_MASK | GDK_BUTTON2_MOTION_MASK | GDK_BUTTON3_MOTION_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK | GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK | GDK_FOCUS_CHANGE_MASK | GDK_STRUCTURE_MASK | GDK_PROPERTY_CHANGE_MASK | GDK_VISIBILITY_NOTIFY_MASK | GDK_PROXIMITY_IN_MASK | GDK_PROXIMITY_OUT_MASK | GDK_SUBSTRUCTURE_MASK | GDK_SCROLL_MASK
True
False
20
12
True
50
20
True
True
â—
True
False
False
True
True
TurnXAdj
3
9
10
16
17
GTK_EXPAND | GTK_SHRINK | GTK_FILL
GTK_EXPAND | GTK_SHRINK | GTK_FILL
52
20
True
True
â—
True
False
False
True
True
TurnFeedAdj
3
5
6
15
16
GTK_EXPAND | GTK_SHRINK | GTK_FILL
GTK_EXPAND | GTK_SHRINK | GTK_FILL
51
20
True
True
â—
True
False
False
True
True
TurnRadAdj
3
7
8
4
5
GTK_EXPAND | GTK_SHRINK | GTK_FILL
GTK_EXPAND | GTK_SHRINK | GTK_FILL
50
20
True
True
â—
True
False
False
True
True
TurnCutAdj
3
7
8
18
19
GTK_EXPAND | GTK_SHRINK | GTK_FILL
GTK_EXPAND | GTK_SHRINK | GTK_FILL
49
20
True
True
â—
True
False
False
True
True
TurnZAdj
3
1
2
13
14
GTK_EXPAND | GTK_SHRINK | GTK_FILL
GTK_EXPAND | GTK_SHRINK | GTK_FILL
50
20
True
True
â—
True
False
False
True
True
TurnAngAdj
4
4
5
11
12
GTK_EXPAND | GTK_SHRINK | GTK_FILL
GTK_EXPAND | GTK_SHRINK | GTK_FILL
True
False
50
20
True
True
â—
True
False
False
True
True
TurnToolAdj
11
12
GTK_EXPAND | GTK_SHRINK | GTK_FILL
GTK_EXPAND | GTK_SHRINK | GTK_FILL
50
20
True
True
â—
True
False
False
True
True
TurnSFAdj
11
12
1
2
GTK_EXPAND | GTK_SHRINK | GTK_FILL
GTK_EXPAND | GTK_SHRINK | GTK_FILL
True
False
Set Tool
50
20
True
True
True
turn.toolchange
True
10
11
True
False
True
True
0.89999997615814209
Speed
t
10
11
1
2
GTK_EXPAND | GTK_SHRINK | GTK_FILL
GTK_EXPAND | GTK_SHRINK | GTK_FILL
50
20
True
True
True
turn.go
False
True
True
False
media-playback-start
10
12
18
20
True
False
Turning
False
True
False
20
12
True
50
20
True
True
True
bore.go
False
True
True
False
media-playback-start
10
12
18
20
GTK_EXPAND | GTK_SHRINK | GTK_FILL
GTK_EXPAND | GTK_SHRINK | GTK_FILL
50
20
True
True
â—
True
False
False
True
True
adjustment5
3
10
11
GTK_EXPAND | GTK_SHRINK | GTK_FILL
GTK_EXPAND | GTK_SHRINK | GTK_FILL
51
20
True
True
â—
True
False
False
True
True
adjustment4
4
4
5
10
11
GTK_EXPAND | GTK_SHRINK | GTK_FILL
GTK_EXPAND | GTK_SHRINK | GTK_FILL
51
20
True
True
â—
True
False
False
True
True
adjustment3
3
6
7
9
10
GTK_EXPAND | GTK_SHRINK | GTK_FILL
GTK_EXPAND | GTK_SHRINK | GTK_FILL
51
20
True
True
â—
True
False
False
True
True
adjustment8
3
9
10
16
17
GTK_EXPAND | GTK_SHRINK | GTK_FILL
GTK_EXPAND | GTK_SHRINK | GTK_FILL
51
20
True
True
â—
True
False
False
True
True
adjustment7
3
7
8
19
20
GTK_EXPAND | GTK_SHRINK | GTK_FILL
GTK_EXPAND | GTK_SHRINK | GTK_FILL
52
20
True
True
â—
True
False
False
True
True
TurnFeedAdj
3
5
6
17
18
GTK_EXPAND | GTK_SHRINK | GTK_FILL
GTK_EXPAND | GTK_SHRINK | GTK_FILL
True
False
50
20
True
True
â—
True
False
False
True
True
adjustment1
11
12
GTK_EXPAND | GTK_SHRINK | GTK_FILL
GTK_EXPAND | GTK_SHRINK | GTK_FILL
50
20
True
True
â—
True
False
False
True
True
adjustment2
11
12
1
2
GTK_EXPAND | GTK_SHRINK | GTK_FILL
GTK_EXPAND | GTK_SHRINK | GTK_FILL
True
False
True
False
1
Speed
10
11
1
2
GTK_EXPAND | GTK_SHRINK | GTK_FILL
GTK_EXPAND | GTK_SHRINK | GTK_FILL
True
False
Set Tool
50
20
True
True
True
bore.toolchange
True
10
11
1
True
False
Boring
1
False
True
False
20
12
True
50
20
True
True
True
face.go
True
False
media-playback-start
10
12
18
20
GTK_EXPAND | GTK_SHRINK | GTK_FILL
GTK_EXPAND | GTK_SHRINK | GTK_FILL
50
20
True
True
â—
True
False
False
True
True
adjustment9
11
12
GTK_EXPAND | GTK_SHRINK | GTK_FILL
GTK_EXPAND | GTK_SHRINK | GTK_FILL
50
20
True
True
â—
True
False
False
True
True
adjustment10
11
12
1
2
GTK_EXPAND | GTK_SHRINK | GTK_FILL
GTK_EXPAND | GTK_SHRINK | GTK_FILL
51
20
True
True
â—
True
False
False
True
True
adjustment11
3
1
2
10
11
GTK_EXPAND | GTK_SHRINK | GTK_FILL
GTK_EXPAND | GTK_SHRINK | GTK_FILL
50
20
True
True
â—
True
False
False
True
True
adjustment13
3
9
10
15
16
GTK_EXPAND | GTK_SHRINK | GTK_FILL
GTK_EXPAND | GTK_SHRINK | GTK_FILL
51
20
True
True
â—
True
False
False
True
True
adjustment14
4
7
8
17
18
GTK_EXPAND | GTK_SHRINK | GTK_FILL
GTK_EXPAND | GTK_SHRINK | GTK_FILL
51
20
True
True
â—
True
False
False
True
True
adjustment15
3
6
7
18
19
GTK_EXPAND | GTK_SHRINK | GTK_FILL
GTK_EXPAND | GTK_SHRINK | GTK_FILL
50
20
True
True
â—
True
False
False
True
True
adjustment12
4
7
8
13
14
GTK_EXPAND | GTK_SHRINK | GTK_FILL
GTK_EXPAND | GTK_SHRINK | GTK_FILL
True
False
Set Tool
50
20
True
True
True
face.toolchange
True
10
11
GTK_EXPAND | GTK_SHRINK | GTK_FILL
GTK_EXPAND | GTK_SHRINK | GTK_FILL
True
False
True
False
1
Speed
10
11
1
2
GTK_EXPAND | GTK_SHRINK | GTK_FILL
GTK_EXPAND | GTK_SHRINK | GTK_FILL
2
True
False
Facing
2
False
True
False
20
12
True
50
20
True
True
True
radius.go
True
False
media-playback-start
10
12
18
20
GTK_EXPAND | GTK_SHRINK | GTK_FILL
GTK_EXPAND | GTK_SHRINK | GTK_FILL
51
20
True
True
â—
True
False
False
True
True
adjustment20
3
8
9
16
17
GTK_EXPAND | GTK_SHRINK | GTK_FILL
GTK_EXPAND | GTK_SHRINK | GTK_FILL
48
20
True
True
â—
True
False
False
True
True
adjustment24
3
1
2
8
9
GTK_EXPAND | GTK_SHRINK | GTK_FILL
GTK_EXPAND | GTK_SHRINK | GTK_FILL
50
20
True
True
â—
True
False
False
True
True
adjustment19
3
7
8
8
9
GTK_EXPAND | GTK_SHRINK | GTK_FILL
GTK_EXPAND | GTK_SHRINK | GTK_FILL
True
False
50
20
True
True
False
False
True
True
7
8
14
15
GTK_EXPAND | GTK_SHRINK | GTK_FILL
GTK_EXPAND | GTK_SHRINK | GTK_FILL
True
False
50
20
True
True
False
False
True
True
radius.fi
5
6
16
17
GTK_EXPAND | GTK_SHRINK | GTK_FILL
GTK_EXPAND | GTK_SHRINK | GTK_FILL
True
False
50
20
True
True
False
False
True
True
radius.fi
2
3
10
11
GTK_EXPAND | GTK_SHRINK | GTK_FILL
GTK_EXPAND | GTK_SHRINK | GTK_FILL
50
20
True
True
â—
True
False
False
True
True
adjustment16
11
12
GTK_EXPAND | GTK_SHRINK | GTK_FILL
GTK_EXPAND | GTK_SHRINK | GTK_FILL
50
20
True
True
â—
True
False
False
True
True
adjustment17
11
12
1
2
GTK_EXPAND | GTK_SHRINK | GTK_FILL
GTK_EXPAND | GTK_SHRINK | GTK_FILL
True
False
True
False
1
Speed
10
11
1
2
GTK_EXPAND | GTK_SHRINK | GTK_FILL
GTK_EXPAND | GTK_SHRINK | GTK_FILL
True
False
Set Tool
50
20
True
True
True
radius.toolchange
True
10
11
GTK_EXPAND | GTK_SHRINK | GTK_FILL
GTK_EXPAND | GTK_SHRINK | GTK_FILL
3
True
False
Radius
3
False
True
False
20
12
True
50
20
True
True
True
chamfer.go
False
True
True
False
media-playback-start
10
12
18
20
GTK_EXPAND | GTK_SHRINK | GTK_FILL
GTK_EXPAND | GTK_SHRINK | GTK_FILL
48
20
True
True
â—
True
False
False
True
True
adjustment24
3
1
2
7
8
GTK_EXPAND | GTK_SHRINK | GTK_FILL
GTK_EXPAND | GTK_SHRINK | GTK_FILL
51
20
True
True
â—
True
False
False
True
True
adjustment23
4
7
8
9
10
GTK_EXPAND | GTK_SHRINK | GTK_FILL
GTK_EXPAND | GTK_SHRINK | GTK_FILL
50
20
True
True
â—
True
False
False
True
True
adjustment25
3
9
10
15
16
GTK_EXPAND | GTK_SHRINK | GTK_FILL
GTK_EXPAND | GTK_SHRINK | GTK_FILL
True
False
50
20
True
True
False
False
True
True
2
3
10
11
True
False
50
20
True
True
False
False
True
True
chamfer.bo
6
7
17
18
True
False
50
16
True
True
False
False
1
True
True
chamfer.bo
7
8
14
15
50
20
True
True
â—
True
False
False
True
True
adjustment21
11
12
GTK_EXPAND | GTK_SHRINK | GTK_FILL
GTK_EXPAND | GTK_SHRINK | GTK_FILL
50
20
True
True
â—
True
False
False
True
True
adjustment22
11
12
1
2
GTK_EXPAND | GTK_SHRINK | GTK_FILL
GTK_EXPAND | GTK_SHRINK | GTK_FILL
True
False
True
False
1
Speed
10
11
1
2
GTK_EXPAND | GTK_SHRINK | GTK_FILL
GTK_EXPAND | GTK_SHRINK | GTK_FILL
True
False
Set Tool
50
12
True
True
True
chamfer.toolchange
False
True
10
11
GTK_EXPAND | GTK_SHRINK | GTK_FILL
GTK_EXPAND | GTK_SHRINK | GTK_FILL
4
True
False
Chamfer
4
False
True
False
20
12
True
50
20
True
True
True
thread.go
False
True
True
False
media-playback-start
10
12
18
20
GTK_EXPAND | GTK_SHRINK | GTK_FILL
GTK_EXPAND | GTK_SHRINK | GTK_FILL
51
20
True
True
â—
True
False
False
True
True
adjustment30
3
1
2
8
9
GTK_EXPAND | GTK_SHRINK | GTK_FILL
GTK_EXPAND | GTK_SHRINK | GTK_FILL
50
20
True
True
â—
True
False
False
True
True
adjustment28
3
8
9
15
16
GTK_EXPAND | GTK_SHRINK | GTK_FILL
GTK_EXPAND | GTK_SHRINK | GTK_FILL
50
20
True
True
â—
True
False
False
True
True
adjustment29
4
3
4
15
16
GTK_EXPAND | GTK_SHRINK | GTK_FILL
GTK_EXPAND | GTK_SHRINK | GTK_FILL
True
False
50
20
True
True
â—
True
False
False
True
True
TurnToolAdj
11
12
True
False
True
False
1
Speed
10
11
1
2
True
False
external
True
True
False
False
True
True
5
6
14
15
GTK_EXPAND | GTK_SHRINK | GTK_FILL
GTK_EXPAND | GTK_SHRINK | GTK_FILL
50
20
True
True
â—
True
False
False
True
True
TurnSFAdj
11
12
1
2
GTK_EXPAND | GTK_SHRINK | GTK_FILL
GTK_EXPAND | GTK_SHRINK | GTK_FILL
True
False
Set Tool
50
20
True
True
True
thread.toolchange
False
True
10
11
True
False
internal
True
True
False
False
True
True
thread.external
7
8
9
10
5
True
False
Threads
5
False
linuxcnc-retrofit-5718f0bbf7bce5bbac9196f411027800fb8d6149/lathemacro_postgui.hal 0000664 0000000 0000000 00000000365 14324265440 0026562 0 ustar 00root root 0000000 0000000 ## For use clear axis notification You also need to add this or for general use add a POSTGUI_HALFILE file or add this is your postgui.hal
net clear-axis-message <= motion.digital-out-00
net clear-axis-message => axisui.notifications-clear-info
linuxcnc-retrofit-5718f0bbf7bce5bbac9196f411027800fb8d6149/lathemacros/ 0000775 0000000 0000000 00000000000 14324265440 0024501 5 ustar 00root root 0000000 0000000 linuxcnc-retrofit-5718f0bbf7bce5bbac9196f411027800fb8d6149/lathemacros/backup_restore.ngc 0000664 0000000 0000000 00000010463 14324265440 0030206 0 ustar 00root root 0000000 0000000 ; backup_restore metric/inch absolute/relative, feed as per paramter values
; call as o call ; backup_restore g20/21, g90/g91, feedrate cuter-comp and other using now global _backup_var
;
o sub
;
;RS274NGC_STARTUP_CODE = G7 G18 G21 G40 G49 G54 G64 P0.001 G80 G90 G90.1 G92.1 G94 G97 G99 M5 M9 M53
;for a complete restore according to what is configured in my ini
G64P0.001 G97 G99 M5 M9
o1 if [EXISTS [#<_backup_metric>]]
(DEBUG,RESTORE MODAL STATUS USING _BACKUP_VAR)
o10 if [#<_backup_metric> NE #<_metric>]
o11 if [#<_backup_metric>]
G21
o11 else
G20
o11 endif
o10 endif
o20 if [#<_backup_absolute> NE #<_absolute>]
o21 if [#<_backup_absolute>]
G90
o21 else
G91
o21 endif
o20 endif
o30 if [#<_backup_feed> NE #<_feed>]
F[#<_backup_feed>]
o30 endif
o40 if [#<_backup_ccomp> NE #<_ccomp>]
o41 if [#<_backup_ccomp> EQ 400]
G40
o41 elseif [#<_backup_ccomp> EQ 410]
G41
o41 elseif [#<_backup_ccomp> EQ 411]
G41.1
o41 elseif [#<_backup_ccomp> EQ 420]
G42
o41 elseif [#<_backup_ccomp> EQ 421]
G42.1
o41 endif
o40 endif
o50 if [#<_backup_tool_offset> NE #<_tool_offset>]
o51 if [#<_backup_tool_offset> EQ 490]
G49
o51 elseif [#<_backup_tool_offset> EQ 430]
G43
o51 elseif [#<_backup_tool_offset> EQ 431]
G43.1
o51 elseif [#<_backup_tool_offset> EQ 432]
G43.2
o51 endif
o50 endif
o60 if [#<_backup_coord_system> NE #<_coord_system>]
o61 if [#<_backup_coord_system> EQ 540]
G54
o61 elseif [#<_backup_coord_system> EQ 550]
G55
o61 elseif [#<_backup_coord_system> EQ 560]
G56
o61 elseif [#<_backup_coord_system> EQ 570]
G57
o61 elseif [#<_backup_coord_system> EQ 580]
G58
o61 elseif [#<_backup_coord_system> EQ 590]
G59
o61 elseif [#<_backup_coord_system> EQ 591]
G59.1
o61 elseif [#<_backup_coord_system> EQ 592]
G59.2
o61 elseif [#<_backup_coord_system> EQ 593]
G59.3
o61 endif
o60 endif
o70 if [#<_backup_ijk_abs_mode> NE #<_ijk_absolute_mode>]
o71 if [#<_backup_ijk_abs_mode>]
G90.1
o71 else
G91.1
o71 endif
o70 endif
;o80 if [#<_backup_lathe_mode>}
o81 if [#<_backup_lathe_diam_mode> NE #<_lathe_diameter_mode>]
o82 if [#<_backup_lathe_diam_mode>]
G7 (lathe diameter mode)
o82 else
G8
o82 endif
o81 endif
;o80 endif
o90 if [#<_backup_plane> NE #<_plane>]
o91 if [#<_backup_plane> EQ 170]
G17
o91 elseif [#<_backup_plane> EQ 180]
G18
o91 elseif [#<_backup_plane> EQ 190]
G19
o91 elseif [#<_backup_plane> EQ 171]
G17.1
o91 elseif [#<_backup_plane> EQ 181]
G18.1
o91 else if [#<_backup_plane> EQ 191]
G19.1
o91 endif
o90 endif
o100 if [#<_backup_units_per_min> NE #<_units_per_minute>]
o101 if [#<_backup_units_per_min> EQ 1]
G94
o101 else
G95
o101 endif
o100 endif
o110 if [#<_backup_retract_old_z> NE #<_retract_old_z>]
o111 if [#<_backup_retract_old_z> EQ 1]
G99
o111 else
G98
o111 endif
o110 endif
o1 else
(DEBUG,RESTORE MODAL STATUS USING FIXED VALUE)
; FULL STATRUP LIST FROM CONFIG
;G7 G18 G21 G40 G49 G54 G64P0.001 G80 G90 G90.1 G92.1 G94 G97 G99 M5 M9 M53
; o1 if [#<_ini[DISPLAY]LATHE> EQ 1]
; G7 (lathe diameter mode)
; o1 endif
G21 (metric)
G40 (cutter compensation off)
G54 (origin offsets are set to the default)
G64 P0.001 (Path Blending)
G80 (cancel canned cycle)
G90 (absolute)
G90.1 (Arc Distance mode)
G92.1
G94 (feed mode: units/minute)
G97 (spindle rpm mode)
G99 (canned cycle return mode)
M48 (set feed and speed overrides)
M53 (feed Stop Control)
o1 endif
o endsub
M2
linuxcnc-retrofit-5718f0bbf7bce5bbac9196f411027800fb8d6149/lathemacros/backup_status.ngc 0000664 0000000 0000000 00000001201 14324265440 0030034 0 ustar 00root root 0000000 0000000 o sub
#<_backup_retract_old_z> = #<_retract_old_z>
#<_backup_units_per_min> = #<_units_per_minute>
#<_backup_plane> = #<_plane>
#<_backup_metric> = #<_metric>
#<_backup_absolute> = #<_absolute>
#<_backup_feed> = #<_feed>
#<_backup_ccomp> = #<_ccomp>
#<_backup_tool_offset> = #<_tool_offset>
#<_backup_coord_system> = #<_coord_system>
#<_backup_ijk_abs_mode> = #<_ijk_absolute_mode>
;o10 if [#<_ini[DISPLAY]LATHE> EQ 1]
#<_backup_lathe_diam_mode> = #<_lathe_diameter_mode>
; #<_backup_lathe_mode> = 1
;o10 else
; #<_backup_lathe_mode> = 0
;o10 endif
o endsub
M2
linuxcnc-retrofit-5718f0bbf7bce5bbac9196f411027800fb8d6149/lathemacros/boring.ngc 0000664 0000000 0000000 00000004425 14324265440 0026457 0 ustar 00root root 0000000 0000000 ;boring
o sub
o call
o call
# = #1
# = #2
# = #3
# = #4
# = #5
# = #6
# = #7
# = #8
# = #9
O100 if [# NE #<_current_tool>]
(MSG,ERROR : Set tool before use macro)
O100 return [-2] ; indicate failure to epilog
O100 endif
G8 ; Lathe radius Mode
G18 ; XZ Plane
G21 ; Metric Units
G90 ; Absolute Distance
G91.1 ; but not for arcs
# = [# / 2] ; because of radius mode
# = [#<_x>] (startinG X)
# = #<_z> (startinG Z)
#20 = [# * SIN[#]]
#21 = [-# * COS[#]]
#22 = [# / COS[#]]
#23 = [# + # - #20]
#24 = [[#23 - #] * TAN[#]]
G96 D2500 S# ; Constant Surface Speed Mode
M3 ; Start Spindle
G95 F# ; Feed-Per-Rev Mode
G4P1 ; Wait to reach speed
O110 if [#]
M8
O110 endif
(DEBUG,Turning finish dia-# start rad-# start length-# finish length-#)
O200 while [# LT [# - #]]
G0 X #
#