pax_global_header 0000666 0000000 0000000 00000000064 13763762337 0014533 g ustar 00root root 0000000 0000000 52 comment=26059bbf9ce207548bba08662c503570ddf5fe27
linuxcnc-retrofit-26059bbf9ce207548bba08662c503570ddf5fe27/ 0000775 0000000 0000000 00000000000 13763762337 0022137 5 ustar 00root root 0000000 0000000 linuxcnc-retrofit-26059bbf9ce207548bba08662c503570ddf5fe27/.gitignore 0000664 0000000 0000000 00000000170 13763762337 0024125 0 ustar 00root root 0000000 0000000 gmoccapy_preferences
linuxcnc.var
linuxcnc.var.bak
old/*
*.pref
tool.tbl
*.pyc
postion.txt
savestate.*
savestatemacro.*
linuxcnc-retrofit-26059bbf9ce207548bba08662c503570ddf5fe27/LatheMacro.svg 0000775 0000000 0000000 00000440243 13763762337 0024711 0 ustar 00root root 0000000 0000000
linuxcnc-retrofit-26059bbf9ce207548bba08662c503570ddf5fe27/gmoccapy_postgui.hal 0000775 0000000 0000000 00000000315 13763762337 0026203 0 ustar 00root root 0000000 0000000 net X-homed => halui.joint.0.home
net Z-homed => halui.joint.2.home
net Home-All <= gmoccapy.joint.all.home
net Home-X <= gmoccapy.joint.0.home
net Home-Z <= gmoccapy.joint.2.home
linuxcnc-retrofit-26059bbf9ce207548bba08662c503570ddf5fe27/lathehandler.py 0000775 0000000 0000000 00000022454 13763762337 0025156 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-26059bbf9ce207548bba08662c503570ddf5fe27/lathemacro-en-numpad.ui 0000775 0000000 0000000 00001045404 13763762337 0026512 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-26059bbf9ce207548bba08662c503570ddf5fe27/lathemacro.ini 0000775 0000000 0000000 00000012567 13763762337 0024775 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-26059bbf9ce207548bba08662c503570ddf5fe27/lathemacro.ui 0000775 0000000 0000000 00000735202 13763762337 0024631 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-26059bbf9ce207548bba08662c503570ddf5fe27/lathemacro/ 0000775 0000000 0000000 00000000000 13763762337 0024256 5 ustar 00root root 0000000 0000000 linuxcnc-retrofit-26059bbf9ce207548bba08662c503570ddf5fe27/lathemacro/boring.ngc 0000775 0000000 0000000 00000004133 13763762337 0026233 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-26059bbf9ce207548bba08662c503570ddf5fe27/lathemacro/chamfer.ngc 0000775 0000000 0000000 00000005060 13763762337 0026360 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-26059bbf9ce207548bba08662c503570ddf5fe27/lathemacro/drill.ngc 0000775 0000000 0000000 00000002652 13763762337 0026065 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-26059bbf9ce207548bba08662c503570ddf5fe27/lathemacro/facing.ngc 0000775 0000000 0000000 00000002743 13763762337 0026207 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-26059bbf9ce207548bba08662c503570ddf5fe27/lathemacro/radius.ngc 0000775 0000000 0000000 00000005317 13763762337 0026247 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-26059bbf9ce207548bba08662c503570ddf5fe27/lathemacro/restore.ngc 0000775 0000000 0000000 00000003024 13763762337 0026434 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-26059bbf9ce207548bba08662c503570ddf5fe27/lathemacro/threading.ngc 0000775 0000000 0000000 00000005277 13763762337 0026732 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-26059bbf9ce207548bba08662c503570ddf5fe27/lathemacro/turning.ngc 0000775 0000000 0000000 00000004610 13763762337 0026441 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-26059bbf9ce207548bba08662c503570ddf5fe27/lcec.hal 0000775 0000000 0000000 00000000434 13763762337 0023537 0 ustar 00root root 0000000 0000000 loadrt trivkins
loadrt [EMCMOT]EMCMOT base_period_nsec=[EMCMOT]BASE_PERIOD servo_period_nsec=[EMCMOT]SERVO_PERIOD num_joints=[KINS]JOINTS
loadusr -W lcec_conf maurice.xml
loadrt lcec
addf lcec.read-all servo-thread
addf lcec.write-all servo-thread
net state-op <= lcec.state-op
linuxcnc-retrofit-26059bbf9ce207548bba08662c503570ddf5fe27/lcec_simu.hal 0000775 0000000 0000000 00000000414 13763762337 0024572 0 ustar 00root root 0000000 0000000 loadrt trivkins
loadrt [EMCMOT]EMCMOT base_period_nsec=[EMCMOT]BASE_PERIOD servo_period_nsec=[EMCMOT]SERVO_PERIOD num_joints=[KINS]JOINTS
loadrt lcec_simu names=lcec.0.0,lcec.0.1
addf lcec.0.0 servo-thread
addf lcec.0.1 servo-thread
setp iocontrol.0.emc-enable-in 1
linuxcnc-retrofit-26059bbf9ce207548bba08662c503570ddf5fe27/lcec_simu/ 0000775 0000000 0000000 00000000000 13763762337 0024102 5 ustar 00root root 0000000 0000000 linuxcnc-retrofit-26059bbf9ce207548bba08662c503570ddf5fe27/lcec_simu/lcec_simu.comp 0000775 0000000 0000000 00000006756 13763762337 0026746 0 ustar 00root root 0000000 0000000 // setp lcec.0.0.drivecontrol-1 1
// setp lcec.0.0.drivecontrol-2 1
// net state-op <= lcec.state-op
// net X-amp => lcec.0.0.drivecontrol-3 => lcec.0.0.drivecontrol-0
// net X-poscmd => lcec.0.0.poscommand
// net X-posfb <= lcec.0.0.pos
// net X-fault <= lcec.0.0.drivestatus-3
// net X-stat-pos <= lcec.0.0.modestatus-3
// net X-stat-home <= lcec.0.0.modestatus-2
// net X-homingok <= lcec.0.0.drivestatus-12
// net X-athome <= lcec.0.0.drivestatus-10
// net X-ctrl-home => lcec.0.0.modecontrol-1 => lcec.0.0.modecontrol-2
// net X-homestart => lcec.0.0.drivecontrol-4
// net X-ctrl-pos => lcec.0.0.modecontrol-3
// net X-PoT <= lcec.0.0.inputs-1
// net X-NoT <= lcec.0.0.inputs-0
component lcec_simu "ESTUN drive simulator";
author "Electrolab";
pin out bit state_op;
pin in bit drivecontrol_0;
pin in bit drivecontrol_1;
pin in bit drivecontrol_2;
pin in bit drivecontrol_3;
pin in bit drivecontrol_4;
pin in float poscommand;
pin out float pos;
pin out bit drivestatus_3;
pin out bit drivestatus_10;
pin out bit drivestatus_12;
pin out bit modestatus_2;
pin out bit modestatus_3;
pin in bit modecontrol_0;
pin in bit modecontrol_1;
pin in bit modecontrol_2;
pin in bit modecontrol_3;
pin in bit modecontrol_4;
pin out bit inputs_0;
pin out bit inputs_1;
pin out float physical_pos = 50;
pin out s32 state;
pin out float home_to;
pin out bit home_dir;
function _;
license "GPL"; // indicates GPL v2 or later
;;
#include
#define HOMING_POS 100
#define LATCH_LENGTH 5
#define HOMING_SPEED_MM_S 10
#define SERVO_PERIOD_MILI 1
int process_homing(hal_float_t *_home_to, hal_float_t *_physical_pos, hal_float_t *_pos)
{
float delta = *_home_to - *_physical_pos;
if (fabs(delta) < 1e-7) return 1; // Arrive at destination
float step = HOMING_SPEED_MM_S * SERVO_PERIOD_MILI / 1000.0;
if (step > fabs(delta)) step = fabs(delta);
if (delta < 0) step = -step;
*_physical_pos += step;
*_pos += step;
return 0;
}
FUNCTION(_) {
state_op = 1;
drivestatus_3 = 0;
inputs_0 = 0;
inputs_1 = 0;
modestatus_2 = modecontrol_2;
modestatus_3 = modecontrol_3;
if (!drivecontrol_4) {
home_to = HOMING_POS;
if (physical_pos < home_to) {
home_to += LATCH_LENGTH;
home_dir = 1;
}
else {
home_to -= LATCH_LENGTH;
home_dir = 0;
}
drivestatus_12 = 0;
state = 0;
}
if (drivecontrol_0 && drivecontrol_1 && drivecontrol_2 && drivecontrol_3) { // Drive enable
if (!modecontrol_2 && modecontrol_3) { // Position mode
physical_pos += poscommand - pos;
pos = poscommand;
}
if (modecontrol_2 && !modecontrol_3 && drivecontrol_4) { // Homing mode
switch (state) {
case 0: // idle
state = 1;
break;
case 1: // home
if (process_homing(&home_to, &physical_pos, &pos)) {
if (home_dir) home_to -= LATCH_LENGTH;
else home_to += LATCH_LENGTH;
state = 2;
}
break;
case 2: // latch
if (process_homing(&home_to, &physical_pos, &pos)) {
pos = 0;
state = 3;
}
break;
case 3: // homed
drivestatus_12 = 1;
break;
}
}
}
} linuxcnc-retrofit-26059bbf9ce207548bba08662c503570ddf5fe27/lcec_simu/lcec_simu.so 0000775 0000000 0000000 00000105070 13763762337 0026416 0 ustar 00root root 0000000 0000000 ELF > à @ ø€ @ 8 @ % $ ¹ ¹ 0 0 0 Ô Ô > N N H x > N N Ð Ð 8 8 8 $ $ Påtd œ4 œ4 œ4 <