dodalem probe basic
This commit is contained in:
44
configs/probe_basic_lathe/custom_config.yml
Normal file
44
configs/probe_basic_lathe/custom_config.yml
Normal file
@@ -0,0 +1,44 @@
|
||||
# example of a machine specific settings
|
||||
windows:
|
||||
mainwindow:
|
||||
kwargs:
|
||||
confirm_exit: false
|
||||
|
||||
data_plugins:
|
||||
tooltable:
|
||||
provider: qtpyvcp.plugins.tool_table:ToolTable
|
||||
kwargs:
|
||||
columns: {{ ini.DISPLAY.tool_table_columns }}
|
||||
|
||||
offsettable:
|
||||
provider: qtpyvcp.plugins.offset_table:OffsetTable
|
||||
kwargs:
|
||||
columns: {{ ini.DISPLAY.offset_columns }}
|
||||
|
||||
settings:
|
||||
|
||||
# VTK backplot view settings
|
||||
|
||||
backplot.show-grid:
|
||||
default_value: false
|
||||
|
||||
backplot.show-program-bounds:
|
||||
default_value: false
|
||||
|
||||
backplot.show-program-labels:
|
||||
default_value: false
|
||||
|
||||
backplot.show-program-ticks:
|
||||
default_value: false
|
||||
|
||||
backplot.show-machine-bounds:
|
||||
default_value: false
|
||||
|
||||
backplot.show-machine-labels:
|
||||
default_value: false
|
||||
|
||||
backplot.show-machine-ticks:
|
||||
default_value: false
|
||||
|
||||
backplot.perspective-view:
|
||||
default_value: false
|
||||
47
configs/probe_basic_lathe/hallib/core_sim_2.hal
Normal file
47
configs/probe_basic_lathe/hallib/core_sim_2.hal
Normal file
@@ -0,0 +1,47 @@
|
||||
# core HAL config file for simulation
|
||||
|
||||
# first load all the RT modules that will be needed
|
||||
# kinematics
|
||||
loadrt [KINS]KINEMATICS
|
||||
# motion controller, get name and thread periods from ini file
|
||||
loadrt [EMCMOT]EMCMOT base_period_nsec=[EMCMOT]BASE_PERIOD servo_period_nsec=[EMCMOT]SERVO_PERIOD num_joints=[KINS]JOINTS num_spindles=[TRAJ]SPINDLES num_dio=6 num_aio=3
|
||||
# load 6 differentiators (for velocity and accel signals
|
||||
loadrt ddt names=ddt_x,ddt_xv,ddt_z,ddt_zv
|
||||
# load additional blocks
|
||||
loadrt hypot names=vel_xz
|
||||
|
||||
# add motion controller functions to servo thread
|
||||
addf motion-command-handler servo-thread
|
||||
addf motion-controller servo-thread
|
||||
# link the differentiator functions into the code
|
||||
addf ddt_x servo-thread
|
||||
addf ddt_xv servo-thread
|
||||
addf ddt_z servo-thread
|
||||
addf ddt_zv servo-thread
|
||||
addf vel_xz servo-thread
|
||||
|
||||
# create HAL signals for position commands from motion module
|
||||
# loop position commands back to motion module feedback
|
||||
net Xpos joint.0.motor-pos-cmd => joint.0.motor-pos-fb ddt_x.in
|
||||
net Zpos joint.1.motor-pos-cmd => joint.1.motor-pos-fb ddt_z.in
|
||||
|
||||
# send the position commands thru differentiators to
|
||||
# generate velocity and accel signals
|
||||
net Xvel ddt_x.out => ddt_xv.in vel_xz.in0
|
||||
net Xacc <= ddt_xv.out
|
||||
net Zvel ddt_z.out => ddt_zv.in vel_xz.in1
|
||||
net Zacc <= ddt_zv.out
|
||||
|
||||
# Cartesian 2- and 3-axis velocities
|
||||
net XZvel <= vel_xz.out
|
||||
|
||||
# estop loopback
|
||||
net estop-loop iocontrol.0.user-enable-out iocontrol.0.emc-enable-in
|
||||
|
||||
# ---manual tool change signals---
|
||||
net tool-change-request <= iocontrol.0.tool-change
|
||||
net tool-change-confirmed => iocontrol.0.tool-changed
|
||||
net tool-number <= iocontrol.0.tool-prep-number
|
||||
|
||||
# create signals for tool loading loopback
|
||||
net tool-prep-loop iocontrol.0.tool-prepare iocontrol.0.tool-prepared
|
||||
55
configs/probe_basic_lathe/hallib/core_sim_4.hal
Normal file
55
configs/probe_basic_lathe/hallib/core_sim_4.hal
Normal file
@@ -0,0 +1,55 @@
|
||||
# core HAL config file for XYZC lathe simulation
|
||||
|
||||
# Load required RT modules
|
||||
loadrt [KINS]KINEMATICS
|
||||
loadrt [EMCMOT]EMCMOT base_period_nsec=[EMCMOT]BASE_PERIOD servo_period_nsec=[EMCMOT]SERVO_PERIOD num_joints=[KINS]JOINTS num_spindles=[TRAJ]SPINDLES num_dio=6 num_aio=3
|
||||
|
||||
# Load differentiators for each axis
|
||||
loadrt ddt names=ddt_x,ddt_xv,ddt_y,ddt_yv,ddt_z,ddt_zv,ddt_c,ddt_cv
|
||||
# Load hypot blocks for velocity calculations
|
||||
loadrt hypot names=vel_xy,vel_xyz
|
||||
|
||||
# Add functions to servo thread
|
||||
addf motion-command-handler servo-thread
|
||||
addf motion-controller servo-thread
|
||||
addf ddt_x servo-thread
|
||||
addf ddt_xv servo-thread
|
||||
addf ddt_y servo-thread
|
||||
addf ddt_yv servo-thread
|
||||
addf ddt_z servo-thread
|
||||
addf ddt_zv servo-thread
|
||||
addf ddt_c servo-thread
|
||||
addf ddt_cv servo-thread
|
||||
addf vel_xy servo-thread
|
||||
addf vel_xyz servo-thread
|
||||
|
||||
# Position command/feedback loopback for each joint
|
||||
net Xpos joint.0.motor-pos-cmd => joint.0.motor-pos-fb ddt_x.in
|
||||
net Ypos joint.1.motor-pos-cmd => joint.1.motor-pos-fb ddt_y.in
|
||||
net Zpos joint.2.motor-pos-cmd => joint.2.motor-pos-fb ddt_z.in
|
||||
net Cpos joint.3.motor-pos-cmd => joint.3.motor-pos-fb ddt_c.in
|
||||
|
||||
# Velocity and acceleration signals for each axis
|
||||
net Xvel ddt_x.out => ddt_xv.in vel_xy.in0 vel_xyz.in0
|
||||
net Xacc <= ddt_xv.out
|
||||
net Yvel ddt_y.out => ddt_yv.in vel_xy.in1 vel_xyz.in1
|
||||
net Yacc <= ddt_yv.out
|
||||
net Zvel ddt_z.out => ddt_zv.in vel_xyz.in2
|
||||
net Zacc <= ddt_zv.out
|
||||
net Cvel ddt_c.out => ddt_cv.in
|
||||
net Cacc <= ddt_cv.out
|
||||
|
||||
# Cartesian velocities
|
||||
net XYvel <= vel_xy.out
|
||||
net XYZvel <= vel_xyz.out
|
||||
|
||||
# estop loopback
|
||||
net estop-loop iocontrol.0.user-enable-out iocontrol.0.emc-enable-in
|
||||
|
||||
# ---manual tool change signals---
|
||||
net tool-change-request <= iocontrol.0.tool-change
|
||||
net tool-change-confirmed => iocontrol.0.tool-changed
|
||||
net tool-number <= iocontrol.0.tool-prep-number
|
||||
|
||||
# tool loading loopback
|
||||
net tool-prep-loop iocontrol.0.tool-prepare iocontrol.0.tool-prepared
|
||||
55
configs/probe_basic_lathe/hallib/core_xyzclathe_sim.hal
Normal file
55
configs/probe_basic_lathe/hallib/core_xyzclathe_sim.hal
Normal file
@@ -0,0 +1,55 @@
|
||||
# core HAL config file for XYZC lathe simulation
|
||||
|
||||
# Load required RT modules
|
||||
loadrt [KINS]KINEMATICS
|
||||
loadrt [EMCMOT]EMCMOT base_period_nsec=[EMCMOT]BASE_PERIOD servo_period_nsec=[EMCMOT]SERVO_PERIOD num_joints=[KINS]JOINTS num_spindles=[TRAJ]SPINDLES num_dio=6 num_aio=3
|
||||
|
||||
# Load differentiators for each axis
|
||||
loadrt ddt names=ddt_x,ddt_xv,ddt_y,ddt_yv,ddt_z,ddt_zv,ddt_c,ddt_cv
|
||||
# Load hypot blocks for velocity calculations
|
||||
loadrt hypot names=vel_xy,vel_xyz
|
||||
|
||||
# Add functions to servo thread
|
||||
addf motion-command-handler servo-thread
|
||||
addf motion-controller servo-thread
|
||||
addf ddt_x servo-thread
|
||||
addf ddt_xv servo-thread
|
||||
addf ddt_y servo-thread
|
||||
addf ddt_yv servo-thread
|
||||
addf ddt_z servo-thread
|
||||
addf ddt_zv servo-thread
|
||||
addf ddt_c servo-thread
|
||||
addf ddt_cv servo-thread
|
||||
addf vel_xy servo-thread
|
||||
addf vel_xyz servo-thread
|
||||
|
||||
# Position command/feedback loopback for each joint
|
||||
net Xpos joint.0.motor-pos-cmd => joint.0.motor-pos-fb ddt_x.in
|
||||
net Ypos joint.1.motor-pos-cmd => joint.1.motor-pos-fb ddt_y.in
|
||||
net Zpos joint.2.motor-pos-cmd => joint.2.motor-pos-fb ddt_z.in
|
||||
net Cpos joint.3.motor-pos-cmd => joint.3.motor-pos-fb ddt_c.in
|
||||
|
||||
# Velocity and acceleration signals for each axis
|
||||
net Xvel ddt_x.out => ddt_xv.in vel_xy.in0 vel_xyz.in0
|
||||
net Xacc <= ddt_xv.out
|
||||
net Yvel ddt_y.out => ddt_yv.in vel_xy.in1 vel_xyz.in1
|
||||
net Yacc <= ddt_yv.out
|
||||
net Zvel ddt_z.out => ddt_zv.in vel_xyz.in2
|
||||
net Zacc <= ddt_zv.out
|
||||
net Cvel ddt_c.out => ddt_cv.in
|
||||
net Cacc <= ddt_cv.out
|
||||
|
||||
# Cartesian velocities
|
||||
net XYvel <= vel_xy.out
|
||||
net XYZvel <= vel_xyz.out
|
||||
|
||||
# estop loopback
|
||||
net estop-loop iocontrol.0.user-enable-out iocontrol.0.emc-enable-in
|
||||
|
||||
# ---manual tool change signals---
|
||||
net tool-change-request <= iocontrol.0.tool-change
|
||||
net tool-change-confirmed => iocontrol.0.tool-changed
|
||||
net tool-number <= iocontrol.0.tool-prep-number
|
||||
|
||||
# tool loading loopback
|
||||
net tool-prep-loop iocontrol.0.tool-prepare iocontrol.0.tool-prepared
|
||||
@@ -0,0 +1,21 @@
|
||||
loadrt time
|
||||
loadrt not
|
||||
|
||||
addf time.0 servo-thread
|
||||
addf not.0 servo-thread
|
||||
|
||||
# *** Time items required for Probe Basic to run ***
|
||||
net prog-running not.0.in <= halui.program.is-idle
|
||||
net prog-paused halui.program.is-paused => time.0.pause
|
||||
net cycle-timer time.0.start <= not.0.out
|
||||
net cycle-seconds qtpyvcp.timerseconds.in <= time.0.seconds
|
||||
net cycle-minutes qtpyvcp.timerminutes.in <= time.0.minutes
|
||||
net cycle-hours qtpyvcp.timerhours.in <= time.0.hours
|
||||
|
||||
# ---manual tool change signals---
|
||||
net tool-change-request => qtpyvcp_manualtoolchange.change
|
||||
net tool-change-confirmed <= qtpyvcp_manualtoolchange.changed
|
||||
net tool-number => qtpyvcp_manualtoolchange.number
|
||||
|
||||
# *** Set line below for actual spindle readout from your hal file ***
|
||||
net spindle-rpm-filtered.0 scale_to_rpm.0.out => qtpyvcp.spindle-encoder-rpm.in
|
||||
39
configs/probe_basic_lathe/hallib/sim_spindle_encoder.hal
Normal file
39
configs/probe_basic_lathe/hallib/sim_spindle_encoder.hal
Normal file
@@ -0,0 +1,39 @@
|
||||
# simulated spindle encoder (for spindle-synced moves)
|
||||
loadrt sim_spindle names=sim_spindle
|
||||
setp sim_spindle.scale 0.01666667
|
||||
|
||||
loadrt limit2 names=limit_speed
|
||||
loadrt lowpass names=spindle_mass
|
||||
loadrt near names=near_speed
|
||||
|
||||
# this limit doesnt make any sense to me:
|
||||
setp limit_speed.maxv 2000.0 # rpm/second
|
||||
|
||||
# encoder reset control
|
||||
# hook up motion controller's sync output
|
||||
net spindle-index-enable spindle.0.index-enable <=> sim_spindle.index-enable
|
||||
|
||||
# report our revolution count to the motion controller
|
||||
net spindle-pos sim_spindle.position-fb => spindle.0.revs
|
||||
|
||||
# simulate spindle mass
|
||||
setp spindle_mass.gain .07
|
||||
|
||||
# spindle speed control
|
||||
net spindle-speed-cmd spindle.0.speed-out => limit_speed.in
|
||||
net spindle-speed-limited limit_speed.out => sim_spindle.velocity-cmd spindle_mass.in
|
||||
|
||||
# for spindle velocity estimate
|
||||
net spindle-rpm-filtered spindle_mass.out spindle.0.speed-in near_speed.in2
|
||||
|
||||
# at-speed detection
|
||||
setp near_speed.scale 1.1
|
||||
setp near_speed.difference 10
|
||||
|
||||
net spindle-speed-cmd => near_speed.in1
|
||||
net spindle-at-speed near_speed.out spindle.0.at-speed
|
||||
|
||||
addf limit_speed servo-thread
|
||||
addf spindle_mass servo-thread
|
||||
addf near_speed servo-thread
|
||||
addf sim_spindle servo-thread
|
||||
31
configs/probe_basic_lathe/hallib/simulated_home_xyzc.hal
Normal file
31
configs/probe_basic_lathe/hallib/simulated_home_xyzc.hal
Normal file
@@ -0,0 +1,31 @@
|
||||
loadrt comp names=comp_x,comp_y,comp_z,comp_c
|
||||
|
||||
net Xhomeswpos => comp_x.in0
|
||||
net Yhomeswpos => comp_y.in0
|
||||
net Zhomeswpos => comp_z.in0
|
||||
net Chomeswpos => comp_c.in0
|
||||
|
||||
sets Xhomeswpos 1
|
||||
sets Yhomeswpos 2
|
||||
sets Zhomeswpos 3
|
||||
sets Chomeswpos 4
|
||||
|
||||
net Xpos => comp_x.in1
|
||||
net Ypos => comp_y.in1
|
||||
net Zpos => comp_z.in1
|
||||
net Cpos => comp_c.in1
|
||||
|
||||
setp comp_x.hyst .02
|
||||
setp comp_y.hyst .02
|
||||
setp comp_z.hyst .02
|
||||
setp comp_c.hyst .02
|
||||
|
||||
net Xhomesw <= comp_x.out => joint.0.home-sw-in
|
||||
net Yhomesw <= comp_y.out => joint.1.home-sw-in
|
||||
net Zhomesw <= comp_z.out => joint.2.home-sw-in
|
||||
net Chomesw <= comp_c.out => joint.3.home-sw-in
|
||||
|
||||
addf comp_x servo-thread
|
||||
addf comp_y servo-thread
|
||||
addf comp_z servo-thread
|
||||
addf comp_c servo-thread
|
||||
25
configs/probe_basic_lathe/hallib/simulated_home_xz.hal
Normal file
25
configs/probe_basic_lathe/hallib/simulated_home_xz.hal
Normal file
@@ -0,0 +1,25 @@
|
||||
loadrt or2 names=or2_0
|
||||
loadrt comp names=comp_x,comp_z
|
||||
|
||||
net Xhomeswpos => comp_x.in0
|
||||
net Zhomeswpos => comp_z.in0
|
||||
|
||||
sets Xhomeswpos 1
|
||||
sets Zhomeswpos 2
|
||||
|
||||
net Xpos => comp_x.in1
|
||||
net Zpos => comp_z.in1
|
||||
|
||||
setp comp_x.hyst .02
|
||||
setp comp_z.hyst .02
|
||||
|
||||
net Xhomesw <= comp_x.out => joint.0.home-sw-in
|
||||
net Zhomesw <= comp_z.out => joint.1.home-sw-in
|
||||
|
||||
# net Xhomesw => or2_0.in0
|
||||
# net XZhomesw or2_0.out => joint.0.home-sw-in joint.2.home-sw-in
|
||||
|
||||
addf comp_x servo-thread
|
||||
addf comp_z servo-thread
|
||||
|
||||
addf or2_0 servo-thread
|
||||
109
configs/probe_basic_lathe/hallib/simulated_lathe.hal
Normal file
109
configs/probe_basic_lathe/hallib/simulated_lathe.hal
Normal file
@@ -0,0 +1,109 @@
|
||||
# counting the spindle encoder in software
|
||||
loadrt encoder names=encoder_0,encoder_1
|
||||
# simulate the encoder
|
||||
loadrt sim_encoder names=sim_encoder_0,sim_encoder_1
|
||||
loadrt limit2 names=limit_speed
|
||||
|
||||
addf limit_speed servo-thread
|
||||
|
||||
#######################################################
|
||||
# Beginning of threading related stuff
|
||||
#######################################################
|
||||
|
||||
# spindle speed control
|
||||
net spindle.0.cmd spindle.0.speed-out => sim_encoder_0.speed
|
||||
net spindle.1.cmd spindle.1.speed-out => sim_encoder_1.speed
|
||||
|
||||
# simulate spindle mass
|
||||
setp limit_speed.maxv 2000.0 # rpm/second
|
||||
|
||||
# spindle encoder 0
|
||||
# connect encoder signals to encoder counter
|
||||
net spindle-phase-A sim_encoder_0.phase-A => encoder_0.phase-A
|
||||
net spindle-phase-B sim_encoder_0.phase-B => encoder_0.phase-B
|
||||
net spindle-phase-Z sim_encoder_0.phase-Z => encoder_0.phase-Z
|
||||
|
||||
# assume 120 ppr = 480 counts/rev for the spindle
|
||||
setp sim_encoder_0.ppr 120
|
||||
# iocontrol output is in rpm, but sim-encoder speed is rps
|
||||
setp sim_encoder_0.scale 60
|
||||
# scale encoder output to read in revolutions
|
||||
# (that way thread pitches can be straightforward,
|
||||
# a 20 tpi thread would multiply the encoder output
|
||||
# by 1/20, etc)
|
||||
setp encoder_0.position-scale 480
|
||||
|
||||
# encoder reset control
|
||||
# hook up motion controller's sync output
|
||||
net spindle-index-enable spindle.0.index-enable <=> encoder_0.index-enable
|
||||
|
||||
# report our revolution count to the motion controller
|
||||
net spindle.0.pos encoder_0.position => spindle.0.revs
|
||||
|
||||
# spindle encoder 1
|
||||
# connect encoder signals to encoder counter
|
||||
net spindle-phase-A1 sim_encoder_1.phase-A => encoder_1.phase-A
|
||||
net spindle-phase-B1 sim_encoder_1.phase-B => encoder_1.phase-B
|
||||
net spindle-phase-Z1 sim_encoder_1.phase-Z => encoder_1.phase-Z
|
||||
|
||||
# assume 120 ppr = 480 counts/rev for the spindle
|
||||
setp sim_encoder_1.ppr 120
|
||||
# iocontrol output is in rpm, but sim-encoder speed is rps
|
||||
setp sim_encoder_1.scale 60
|
||||
# scale encoder output to read in revolutions
|
||||
# (that way thread pitches can be straightforward,
|
||||
# a 20 tpi thread would multiply the encoder output
|
||||
# by 1/20, etc)
|
||||
setp encoder_1.position-scale 480
|
||||
|
||||
# encoder reset control
|
||||
# hook up motion controller's sync output
|
||||
net spindle-index-enable spindle.1.index-enable <=> encoder_0.index-enable
|
||||
|
||||
# report our revolution count to the motion controller
|
||||
net spindle.1.pos encoder_1.position => spindle.1.revs
|
||||
|
||||
# for spindle velocity estimate
|
||||
loadrt lowpass names=lowpass_velocity.0,lowpass_velocity.1
|
||||
loadrt scale names=scale_to_rpm.0,scale_to_rpm.1
|
||||
net spindle-rps-raw.0 encoder_0.velocity lowpass_velocity.0.in
|
||||
net spindle-rps-filtered.0 lowpass_velocity.0.out scale_to_rpm.0.in spindle.0.speed-in
|
||||
net spindle-rpm-filtered.0 scale_to_rpm.0.out
|
||||
setp scale_to_rpm.0.gain 60
|
||||
setp lowpass_velocity.0.gain .07
|
||||
addf lowpass_velocity.0 servo-thread
|
||||
addf scale_to_rpm.0 servo-thread
|
||||
|
||||
net spindle-rps-raw.1 encoder_1.velocity lowpass_velocity.1.in
|
||||
net spindle-rps-filtered.1 lowpass_velocity.1.out scale_to_rpm.1.in spindle.1.speed-in
|
||||
net spindle-rpm-filtered.1 scale_to_rpm.1.out
|
||||
setp scale_to_rpm.1.gain 60
|
||||
setp lowpass_velocity.1.gain .07
|
||||
addf lowpass_velocity.1 servo-thread
|
||||
addf scale_to_rpm.1 servo-thread
|
||||
|
||||
# for at-speed detection
|
||||
loadrt near names=near_speed.0,near_speed.1
|
||||
addf near_speed.0 servo-thread
|
||||
setp near_speed.0.scale 1.1
|
||||
setp near_speed.0.difference 10
|
||||
net spindle.0.cmd => near_speed.0.in1
|
||||
net spindle-rpm-filtered.0 => near_speed.0.in2
|
||||
net spindle-at-speed.0 near_speed.0.out spindle.0.at-speed
|
||||
net spindle.0-fwd <= spindle.0.forward
|
||||
|
||||
addf near_speed.1 servo-thread
|
||||
setp near_speed.1.scale 1.1
|
||||
setp near_speed.1.difference 10
|
||||
net spindle.1.cmd => near_speed.1.in1
|
||||
net spindle-rpm-filtered.1 => near_speed.1.in2
|
||||
net spindle-at-speed.1 near_speed.1.out spindle.1.at-speed
|
||||
|
||||
net spindle.1-fwd <= spindle.1.forward
|
||||
|
||||
addf encoder.capture-position servo-thread
|
||||
addf sim-encoder.update-speed servo-thread
|
||||
|
||||
addf sim-encoder.make-pulses base-thread
|
||||
addf encoder.update-counters base-thread
|
||||
|
||||
69
configs/probe_basic_lathe/hallib/spindle_sim.hal
Normal file
69
configs/probe_basic_lathe/hallib/spindle_sim.hal
Normal file
@@ -0,0 +1,69 @@
|
||||
# counting the spindle encoder in software
|
||||
loadrt encoder names=encoder_0
|
||||
# simulate the encoder
|
||||
loadrt sim_encoder names=sim_encoder_0
|
||||
loadrt limit2 names=limit_speed
|
||||
|
||||
addf limit_speed servo-thread
|
||||
|
||||
#######################################################
|
||||
# Beginning of threading related stuff
|
||||
#######################################################
|
||||
|
||||
# spindle speed control
|
||||
net spindle-speed-cmd spindle.0.speed-out => limit_speed.in
|
||||
net spindle-speed-limited limit_speed.out => sim_encoder_0.speed
|
||||
|
||||
# simulate spindle mass
|
||||
setp limit_speed.maxv 2000.0 # rpm/second
|
||||
|
||||
# spindle encoder
|
||||
# connect encoder signals to encoder counter
|
||||
net spindle-phase-A sim_encoder_0.phase-A => encoder_0.phase-A
|
||||
net spindle-phase-B sim_encoder_0.phase-B => encoder_0.phase-B
|
||||
net spindle-phase-Z sim_encoder_0.phase-Z => encoder_0.phase-Z
|
||||
|
||||
# assume 120 ppr = 480 counts/rev for the spindle
|
||||
setp sim_encoder_0.ppr 12
|
||||
# iocontrol output is in rpm, but sim-encoder speed is rps
|
||||
setp sim_encoder_0.scale 60
|
||||
# scale encoder output to read in revolutions
|
||||
# (that way thread pitches can be straightforward,
|
||||
# a 20 tpi thread would multiply the encoder output
|
||||
# by 1/20, etc)
|
||||
setp encoder_0.position-scale 48
|
||||
|
||||
# encoder reset control
|
||||
# hook up motion controller's sync output
|
||||
net spindle-index-enable spindle.0.index-enable <=> encoder_0.index-enable
|
||||
|
||||
# report our revolution count to the motion controller
|
||||
net spindle-pos encoder_0.position => spindle.0.revs
|
||||
|
||||
# for spindle velocity estimate
|
||||
loadrt lowpass names=lowpass_velocity
|
||||
loadrt scale names=scale_to_rpm,scale.servo
|
||||
net spindle-rps-raw encoder_0.velocity lowpass_velocity.in
|
||||
net spindle-rps-filtered lowpass_velocity.out scale_to_rpm.in spindle.0.speed-in
|
||||
net spindle-rpm-filtered scale_to_rpm.out
|
||||
setp scale_to_rpm.gain 60
|
||||
setp lowpass_velocity.gain .07
|
||||
addf lowpass_velocity servo-thread
|
||||
addf scale_to_rpm servo-thread
|
||||
|
||||
# for at-speed detection
|
||||
loadrt near names=near_speed
|
||||
addf near_speed servo-thread
|
||||
setp near_speed.scale 1.1
|
||||
setp near_speed.difference 10
|
||||
net spindle-speed-cmd => near_speed.in1
|
||||
net spindle-rpm-filtered => near_speed.in2
|
||||
net spindle-at-speed near_speed.out spindle.0.at-speed
|
||||
|
||||
net spindle-fwd <= spindle.0.forward
|
||||
|
||||
addf encoder.capture-position servo-thread
|
||||
addf sim-encoder.update-speed servo-thread
|
||||
|
||||
addf sim-encoder.make-pulses base-thread
|
||||
addf encoder.update-counters base-thread
|
||||
145
configs/probe_basic_lathe/probe_basic_lathe.ini
Normal file
145
configs/probe_basic_lathe/probe_basic_lathe.ini
Normal file
@@ -0,0 +1,145 @@
|
||||
[EMC]
|
||||
VERSION = 1.1
|
||||
MACHINE = QtPyVCP - probe_basic Sim
|
||||
DEBUG = 0
|
||||
|
||||
[DISPLAY]
|
||||
DISPLAY = probe_basic_lathe
|
||||
BACK_TOOL_LATHE = 1
|
||||
CONFIRM_EXIT = False
|
||||
LOG_FILE = sim.log
|
||||
LOG_LEVEL = DEBUG
|
||||
PREFERENCE_FILE = sim.pref
|
||||
CONFIG_FILE = custom_config.yml
|
||||
CYCLE_TIME = 0.100
|
||||
POSITION_OFFSET = RELATIVE
|
||||
POSITION_FEEDBACK = ACTUAL
|
||||
DEFAULT_LINEAR_VELOCITY = 0.50000
|
||||
MAX_LINEAR_VELOCITY = 3.333334
|
||||
MIN_LINEAR_VELOCITY = 0.016670
|
||||
DEFAULT_ANGULAR_VELOCITY = 12.000000
|
||||
MAX_ANGULAR_VELOCITY = 180.000000
|
||||
MIN_ANGULAR_VELOCITY = 1.666667
|
||||
DEFAULT_SPINDLE_SPEED = 300
|
||||
MAX_SPINDLE_OVERRIDE = 2.000000
|
||||
MIN_SPINDLE_OVERRIDE = 0.500000
|
||||
MAX_FEED_OVERRIDE = 2.000000
|
||||
PROGRAM_PREFIX = ~/linuxcnc/nc_files
|
||||
OPEN_FILE = ~/linuxcnc/nc_files/pb_examples/blank.ngc
|
||||
INTRO_GRAPHIC = pbsplash.png
|
||||
INTRO_TIME = 3
|
||||
INCREMENTS = JOG .10in .01in .001in .0001in
|
||||
# USER_TABS_PATH = user_tabs/
|
||||
USER_BUTTONS_PATH = user_buttons/
|
||||
USER_DROS_PATH = user_dro_display/
|
||||
DRO_DISPLAY = XZ
|
||||
GEOMETRY = XZ
|
||||
OFFSET_COLUMNS = XZ
|
||||
TOOL_TABLE_COLUMNS = TXZIJDQR
|
||||
KEYBOARD_JOG = true
|
||||
KEYBOARD_JOG_SAFETY_OFF = false
|
||||
|
||||
[FILTER]
|
||||
PROGRAM_EXTENSION = .nc,.txt,.tap Other NC files
|
||||
|
||||
[RS274NGC]
|
||||
RS274NGC_STARTUP_CODE = G90 G7 G18 G95 G96 D2000 S200
|
||||
PARAMETER_FILE = sim-lathe.var
|
||||
SUBROUTINE_PATH = subroutines
|
||||
|
||||
[EMCMOT]
|
||||
EMCMOT = motmod
|
||||
COMM_TIMEOUT = 1.0
|
||||
BASE_PERIOD = 100000
|
||||
SERVO_PERIOD = 1000000
|
||||
|
||||
[TASK]
|
||||
TASK = milltask
|
||||
CYCLE_TIME = 0.010
|
||||
|
||||
[HAL]
|
||||
HALFILE = hallib/core_sim_2.hal
|
||||
HALFILE = hallib/simulated_home_xz.hal
|
||||
HALFILE = hallib/simulated_lathe.hal
|
||||
HALUI = halui
|
||||
POSTGUI_HALFILE = hallib/probe_basic_lathe_postgui.hal
|
||||
|
||||
[HALUI]
|
||||
|
||||
[TRAJ]
|
||||
AXES = 2
|
||||
SPINDLES = 2
|
||||
COORDINATES = X Z
|
||||
LINEAR_UNITS = inch
|
||||
ANGULAR_UNITS = degree
|
||||
CYCLE_TIME = 0.010
|
||||
DEFAULT_VELOCITY = 1.0
|
||||
MAX_LINEAR_VELOCITY = 3.333334
|
||||
DEFAULT_ACCELERATION = 20.0
|
||||
MAX_ACCELERATION = 20.0
|
||||
NO_FORCE_HOMING = 0
|
||||
# Axes sections ---------------------------------------------------------------
|
||||
|
||||
# First axis
|
||||
[EMCIO]
|
||||
EMCIO = io
|
||||
CYCLE_TIME = 0.100
|
||||
TOOL_TABLE = lathe.tbl
|
||||
#TOOL_CHANGE_POSITION = 2 0 1
|
||||
#TOOL_CHANGE_WITH_SPINDLE_ON = 1
|
||||
|
||||
[KINS]
|
||||
KINEMATICS = trivkins coordinates=xz
|
||||
JOINTS = 2
|
||||
|
||||
[AXIS_X]
|
||||
MIN_LIMIT = -5.0
|
||||
MAX_LIMIT = 5.0
|
||||
MAX_VELOCITY = 3.333334
|
||||
MAX_ACCELERATION = 20.0
|
||||
|
||||
[JOINT_0]
|
||||
TYPE = LINEAR
|
||||
HOME = 0.000
|
||||
MAX_VELOCITY = 3.333334
|
||||
MAX_ACCELERATION = 20.0
|
||||
BACKLASH = 0.000
|
||||
INPUT_SCALE = 4000
|
||||
OUTPUT_SCALE = 1.000
|
||||
MIN_LIMIT = -5.0
|
||||
MAX_LIMIT = 5.0
|
||||
FERROR = 0.050
|
||||
MIN_FERROR = 0.010
|
||||
HOME_OFFSET = 1.0
|
||||
HOME_SEARCH_VEL = 5.0
|
||||
HOME_LATCH_VEL = 1.0
|
||||
HOME_USE_INDEX = NO
|
||||
HOME_IGNORE_LIMITS = NO
|
||||
HOME_SEQUENCE = 0
|
||||
HOME_IS_SHARED = 1
|
||||
|
||||
[AXIS_Z]
|
||||
MIN_LIMIT = 0
|
||||
MAX_LIMIT = 12.0
|
||||
MAX_VELOCITY = 3.333334
|
||||
MAX_ACCELERATION = 20.0
|
||||
|
||||
[JOINT_1]
|
||||
TYPE = LINEAR
|
||||
HOME = 0.0
|
||||
MAX_VELOCITY = 3.333334
|
||||
MAX_ACCELERATION = 20.0
|
||||
BACKLASH = 0.000
|
||||
INPUT_SCALE = 4000
|
||||
OUTPUT_SCALE = 1.000
|
||||
MIN_LIMIT = 0.0
|
||||
MAX_LIMIT = 12.0
|
||||
FERROR = 0.050
|
||||
MIN_FERROR = 0.010
|
||||
HOME_OFFSET = 1.0
|
||||
HOME_SEARCH_VEL = 5.0
|
||||
HOME_LATCH_VEL = 1.0
|
||||
HOME_USE_INDEX = NO
|
||||
HOME_IGNORE_LIMITS = NO
|
||||
HOME_SEQUENCE = 1
|
||||
HOME_IS_SHARED = 1
|
||||
19
configs/probe_basic_lathe/python/remap.py
Normal file
19
configs/probe_basic_lathe/python/remap.py
Normal file
@@ -0,0 +1,19 @@
|
||||
# This is a component of LinuxCNC
|
||||
# Copyright 2011, 2012, 2013, 2014 Dewey Garrett <dgarrett@panix.com>,
|
||||
# Michael Haberler <git@mah.priv.at>, Norbert Schechner <nieson@web.de>
|
||||
#
|
||||
# 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
|
||||
#
|
||||
from stdglue import *
|
||||
165
configs/probe_basic_lathe/python/stdglue.py
Normal file
165
configs/probe_basic_lathe/python/stdglue.py
Normal file
@@ -0,0 +1,165 @@
|
||||
|
||||
#NOTE:
|
||||
# The legacy names *selected_pocket* and *current_pocket* actually reference
|
||||
# a sequential tooldata index for tool items loaded from a tool
|
||||
# table ([EMCIO]TOOL_TABLE) or via a tooldata database ([EMCIO]DB_PROGRAM)
|
||||
|
||||
# stdglue - canned prolog and epilog functions for the remappable builtin codes (T,M6,M61,S,F)
|
||||
#
|
||||
# we dont use argspec to avoid the generic error message of the argspec prolog and give more
|
||||
# concise ones here
|
||||
|
||||
|
||||
import emccanon
|
||||
|
||||
from linuxcnc import version
|
||||
from interpreter import *
|
||||
from emccanon import MESSAGE
|
||||
|
||||
throw_exceptions = 1
|
||||
|
||||
VERSION = version
|
||||
|
||||
# used so screens can get info.
|
||||
# add this to toplevel to call it:
|
||||
|
||||
# import remap
|
||||
# def __init__(self):
|
||||
# if self.task:
|
||||
# remap.build_hal(self)
|
||||
|
||||
def build_hal(self):
|
||||
import hal
|
||||
try:
|
||||
h=hal.component('remapStat')
|
||||
h.newpin("tool", hal.HAL_S32, hal.HAL_OUT)
|
||||
h.newpin("wear", hal.HAL_S32, hal.HAL_OUT)
|
||||
h.ready()
|
||||
self.hal_tool_comp = h
|
||||
except Exception as e:
|
||||
print(e)
|
||||
|
||||
# REMAP=T prolog=prepare_prolog ngc=prepare epilog=prepare_epilog
|
||||
# exposed parameters: #<tool> #<pocket>
|
||||
|
||||
def prepare_prolog(self,**words):
|
||||
try:
|
||||
cblock = self.blocks[self.remap_level]
|
||||
if not cblock.t_flag:
|
||||
self.set_errormsg("T requires a tool number")
|
||||
return INTERP_ERROR
|
||||
tool = cblock.t_number
|
||||
if tool:
|
||||
(status, pocket) = self.find_tool_pocket(tool)
|
||||
if status != INTERP_OK:
|
||||
self.set_errormsg("T%d: pocket not found" % (tool))
|
||||
return status
|
||||
else:
|
||||
pocket = -1 # this is a T0 - tool unload
|
||||
self.params["tool"] = tool
|
||||
self.params["pocket"] = pocket
|
||||
return INTERP_OK
|
||||
except Exception as e:
|
||||
self.set_errormsg("T%d/prepare_prolog: %s" % (int(words['t']), e))
|
||||
return INTERP_ERROR
|
||||
|
||||
def prepare_epilog(self, **words):
|
||||
try:
|
||||
if not self.value_returned:
|
||||
r = self.blocks[self.remap_level].executing_remap
|
||||
self.set_errormsg("the %s remap procedure %s did not return a value"
|
||||
% (r.name,r.remap_ngc if r.remap_ngc else r.remap_py))
|
||||
return INTERP_ERROR
|
||||
if self.blocks[self.remap_level].builtin_used:
|
||||
#print "---------- T builtin recursion, nothing to do"
|
||||
return INTERP_OK
|
||||
else:
|
||||
if self.return_value > 0:
|
||||
self.selected_tool = int(self.params["tool"])
|
||||
self.selected_pocket = int(self.params["pocket"])
|
||||
emccanon.SELECT_TOOL(self.selected_tool)
|
||||
return INTERP_OK
|
||||
else:
|
||||
self.set_errormsg("T%d: aborted (return code %.1f)" % (int(self.params["tool"]),self.return_value))
|
||||
return INTERP_ERROR
|
||||
except Exception as e:
|
||||
self.set_errormsg("T%d/prepare_epilog: %s" % (tool,e))
|
||||
return INTERP_ERROR
|
||||
|
||||
# REMAP=M6 modalgroup=6 prolog=change_prolog ngc=change epilog=change_epilog
|
||||
# exposed parameters:
|
||||
# #<tool_in_spindle>
|
||||
# #<selected_tool>
|
||||
# #<current_pocket>
|
||||
# #<selected_pocket>
|
||||
|
||||
def change_prolog(self, **words):
|
||||
try:
|
||||
# this is relevant only when using iocontrol-v2.
|
||||
if self.params[5600] > 0.0:
|
||||
if self.params[5601] < 0.0:
|
||||
self.set_errormsg("Toolchanger hard fault %d" % (int(self.params[5601])))
|
||||
return INTERP_ERROR
|
||||
print("change_prolog: Toolchanger soft fault %d" % int(self.params[5601]))
|
||||
|
||||
if self.selected_pocket < 0:
|
||||
self.set_errormsg("M6: no tool prepared")
|
||||
return INTERP_ERROR
|
||||
if self.cutter_comp_side:
|
||||
self.set_errormsg("Cannot change tools with cutter radius compensation on")
|
||||
return INTERP_ERROR
|
||||
self.params["tool_in_spindle"] = self.current_tool
|
||||
self.params["selected_tool"] = self.selected_tool
|
||||
self.params["current_pocket"] = self.current_pocket
|
||||
self.params["selected_pocket"] = self.selected_pocket
|
||||
return INTERP_OK
|
||||
except Exception as e:
|
||||
self.set_errormsg("M6/change_prolog: %s" % (e))
|
||||
return INTERP_ERROR
|
||||
|
||||
def change_epilog(self, **words):
|
||||
try:
|
||||
if not self.value_returned:
|
||||
r = self.blocks[self.remap_level].executing_remap
|
||||
self.set_errormsg("the %s remap procedure %s did not return a value"
|
||||
% (r.name,r.remap_ngc if r.remap_ngc else r.remap_py))
|
||||
yield INTERP_ERROR
|
||||
# this is relevant only when using iocontrol-v2.
|
||||
if self.params[5600] > 0.0:
|
||||
if self.params[5601] < 0.0:
|
||||
self.set_errormsg("Toolchanger hard fault %d" % (int(self.params[5601])))
|
||||
yield INTERP_ERROR
|
||||
print("change_epilog: Toolchanger soft fault %d" % int(self.params[5601]))
|
||||
|
||||
if self.blocks[self.remap_level].builtin_used:
|
||||
#print "---------- M6 builtin recursion, nothing to do"
|
||||
yield INTERP_OK
|
||||
else:
|
||||
if self.return_value > 0.0:
|
||||
|
||||
# commit change
|
||||
|
||||
self.selected_pocket = int(self.params["selected_pocket"])
|
||||
|
||||
if "2.9" in VERSION:
|
||||
emccanon.CHANGE_TOOL(self.selected_pocket)
|
||||
elif "2.10" in VERSION:
|
||||
emccanon.SELECT_TOOL(self.selected_tool)
|
||||
emccanon.CHANGE_TOOL()
|
||||
|
||||
self.current_pocket = self.selected_pocket
|
||||
self.selected_pocket = -1
|
||||
self.selected_tool = -1
|
||||
# cause a sync()
|
||||
self.set_tool_parameters()
|
||||
self.toolchange_flag = True
|
||||
yield INTERP_EXECUTE_FINISH
|
||||
else:
|
||||
# yield to print any messages from the NGC program
|
||||
yield INTERP_EXECUTE_FINISH
|
||||
self.set_errormsg("M6 aborted (return code %.1f)" % (self.return_value))
|
||||
yield INTERP_ERROR
|
||||
except Exception as e:
|
||||
self.set_errormsg("M6/change_epilog: %s" % (e))
|
||||
yield INTERP_ERROR
|
||||
|
||||
19
configs/probe_basic_lathe/python/toplevel.py
Normal file
19
configs/probe_basic_lathe/python/toplevel.py
Normal file
@@ -0,0 +1,19 @@
|
||||
# This is a component of LinuxCNC
|
||||
# Copyright 2011, 2013, 2014 Dewey Garrett <dgarrett@panix.com>,
|
||||
# Michael Haberler <git@mah.priv.at>, Norbert Schechner <nieson@web.de>
|
||||
#
|
||||
# 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 remap
|
||||
172
configs/probe_basic_lathe/subroutines/backup_restore.ngc
Executable file
172
configs/probe_basic_lathe/subroutines/backup_restore.ngc
Executable file
@@ -0,0 +1,172 @@
|
||||
; backup_restore metric/inch absolute/relative, feed as per paramter values
|
||||
; call as o<backup_restore> call ; backup_restore g20/21, g90/g91, feedrate cuter-comp and other using now global _backup_var
|
||||
;
|
||||
o<backup_restore> 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<backup_restore> endsub
|
||||
M2
|
||||
21
configs/probe_basic_lathe/subroutines/backup_status.ngc
Executable file
21
configs/probe_basic_lathe/subroutines/backup_status.ngc
Executable file
@@ -0,0 +1,21 @@
|
||||
o<backup_status> 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<backup_status> endsub
|
||||
M2
|
||||
102
configs/probe_basic_lathe/subroutines/chamfer.ngc
Executable file
102
configs/probe_basic_lathe/subroutines/chamfer.ngc
Executable file
@@ -0,0 +1,102 @@
|
||||
chamfer
|
||||
o<chamfer> sub
|
||||
|
||||
o<backup_status> call
|
||||
|
||||
#<chamfer_x> = #1
|
||||
#<chamfer_ss> = #2
|
||||
#<chamfer_doc> = #3 ;depth of cut
|
||||
#<chamfer_z> = #4
|
||||
#<chamfer_tool> = #5
|
||||
#<chamfer_feed> = #6
|
||||
#<chamfer_exterior_front> = #7 ;will be cut if > 0
|
||||
#<chamfer_interior> = #8 ;will be cut if > 0
|
||||
#<chamfer_exterior_rear> = #9 ;will be cut if > 0
|
||||
#<chamfer_coolant> = #10
|
||||
#<chamfer_maxrpm> = #11
|
||||
|
||||
|
||||
o100 if [#<chamfer_tool> 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
|
||||
|
||||
|
||||
#<chamfer_x> = [#<chamfer_x> / 2] ; because of radius mode
|
||||
#<starting_X> = #<_x> (starting X)
|
||||
#<starting_Z> = #<_z> (starting Z)
|
||||
|
||||
G96 D#<chamfer_maxrpm> S#<chamfer_ss> ; Constant Surface Speed Mode
|
||||
M3 ; Start Spindle
|
||||
G95 F#<chamfer_feed> ; Feed-Per-Rev Mode
|
||||
G4P1 ; Wait to reach speed
|
||||
|
||||
o110 if [#<chamfer_coolant>]
|
||||
M8
|
||||
o110 endif
|
||||
|
||||
#<temp> = 0
|
||||
o200 if [#<chamfer_exterior_front> GT 0] ; front outside
|
||||
o201 while [[#<temp> + #<chamfer_doc> ] lt #<chamfer_exterior_front> ]
|
||||
#<temp> = [#<temp> + #<chamfer_doc> ]
|
||||
G0 x[#<chamfer_x> - #<temp>] z#<starting_Z>
|
||||
G1 z#<chamfer_z>
|
||||
G1 x#<chamfer_x> z[#<chamfer_z> - #<temp>]
|
||||
G1 x#<starting_X>
|
||||
G0 z#<starting_Z>
|
||||
o201 endwhile
|
||||
|
||||
G0 x#<starting_X> z#<starting_Z>
|
||||
G0 x[#<chamfer_x> - #<chamfer_exterior_front> ]
|
||||
G1 z#<chamfer_z>
|
||||
G1 x#<chamfer_x> z[#<chamfer_z> - #<chamfer_exterior_front> ]
|
||||
G1 x#<starting_X>
|
||||
G0 z#<starting_Z>
|
||||
o200 elseif [#<chamfer_interior> GT 0] ; front inside
|
||||
o202 while [[#<temp> + #<chamfer_doc> ] lt #<chamfer_interior> ]
|
||||
#<temp> = [#<temp> + #<chamfer_doc> ]
|
||||
G0 x[#<chamfer_x> + #<temp>] z#<starting_Z>
|
||||
G1 z#<chamfer_z>
|
||||
G1 x#<chamfer_x> z[#<chamfer_z> - #<temp>]
|
||||
G1 x#<starting_X>
|
||||
G0 z#<starting_Z>
|
||||
o202 endwhile
|
||||
|
||||
G0 x#<starting_X> z#<starting_Z>
|
||||
G0 x[#<chamfer_x> + #<chamfer_interior> ]
|
||||
G1 z#<chamfer_z>
|
||||
G1 x#<chamfer_x> z[#<chamfer_z> - #<chamfer_interior> ]
|
||||
G1 x#<starting_X>
|
||||
G0 z#<starting_Z>
|
||||
o200 elseif [#<chamfer_exterior_rear> GT 0] ; back outside
|
||||
o203 while [[#<temp> + #<chamfer_doc> ] lt <chamfer_exterior_rear>]
|
||||
#<temp> = [#<temp> + #<chamfer_doc> ]
|
||||
G0 x[#<chamfer_x> - #<temp>] z#<starting_Z>
|
||||
G1 z#<chamfer_z>
|
||||
G1 x#<chamfer_x> z[#<chamfer_z> + #<temp>]
|
||||
G1 x#<starting_X>
|
||||
G0 z#<starting_Z>
|
||||
o203 endwhile
|
||||
|
||||
G0 x#<starting_X> z#<starting_Z>
|
||||
G0 x[#<chamfer_x> - <chamfer_exterior_rear>]
|
||||
G1 z#<chamfer_z>
|
||||
G1 x#<chamfer_x> z[#<chamfer_z> + <chamfer_exterior_rear> ]
|
||||
G1 x#<starting_X>
|
||||
G0 z#<starting_Z>
|
||||
o200 endif
|
||||
|
||||
M5
|
||||
M9
|
||||
|
||||
o<backup_restore> call ; restore g20/21, g90/g91, feedrate cuter-comp and other using now global _backup_var
|
||||
|
||||
o<chamfer> endsub
|
||||
|
||||
M2
|
||||
%
|
||||
12
configs/probe_basic_lathe/subroutines/clamptool.ngc
Normal file
12
configs/probe_basic_lathe/subroutines/clamptool.ngc
Normal file
@@ -0,0 +1,12 @@
|
||||
o<clamptool> sub
|
||||
|
||||
M65 P2 ; clamp the tool
|
||||
|
||||
M66 P5 L3 Q2 ; check the clamped tool sensor
|
||||
o100 if [#5399 LT 0]
|
||||
(abort, Failed to release tool) ; abort if the sensor does not activate in 2 seconds
|
||||
o100 endif
|
||||
|
||||
o<clamptool> endsub [1]
|
||||
|
||||
M2
|
||||
85
configs/probe_basic_lathe/subroutines/drill.ngc
Executable file
85
configs/probe_basic_lathe/subroutines/drill.ngc
Executable file
@@ -0,0 +1,85 @@
|
||||
;drill
|
||||
o<drill> sub
|
||||
|
||||
o<backup_status> call
|
||||
|
||||
#<drill_diam> = #1
|
||||
#<drill_depth> = #2
|
||||
#<drill_ss> = #3
|
||||
#<drill_feed> = #4
|
||||
#<drill_tool> = #5
|
||||
#<drill_peck> = #6
|
||||
#<drill_coolant> = #8
|
||||
#<drill_x> = #9
|
||||
#<drill_doc> = #10
|
||||
#<angles> = 0
|
||||
#<drill_maxrpm> = #11
|
||||
|
||||
#<starting_z> = #<_z> (starting z)
|
||||
|
||||
o100 if [#<drill_tool> NE #<_current_tool>]
|
||||
(MSG,ERROR : Set tool before use macro)
|
||||
o100 return [-2] ; indicate failure to epilog
|
||||
o100 endif
|
||||
|
||||
G7 ; diameter mode
|
||||
G17 ; XY Plane
|
||||
G21 ; Metric Units
|
||||
G90 ; Absolute Distance
|
||||
G91.1 ; but not for arcs
|
||||
|
||||
#<speed_calc> = [[1000 * #<drill_ss>] / [3.1415 * #<drill_diam>]] ; metric mode RPM
|
||||
|
||||
G97 S#<speed_calc> ; Constant RPM mode
|
||||
M3 ; Start Spindle
|
||||
G95 F#<drill_feed> ; Feed-Per-Rev Mode
|
||||
G4 P1 ; Wait to reach speed
|
||||
|
||||
o110 if [#<drill_coolant>]
|
||||
M8
|
||||
o110 endif
|
||||
|
||||
(DEBUG,Drilling dia-#<drill_diam> depth-#<drill_depth> asked-speed-#<drill_ss> feed/rpm-#<drill_feed> tool-#<tool_number> peck dist-#<drill_peck> full retract calculated-rpm-#<speed_calc> start-z-#<starting_z>)
|
||||
|
||||
G98
|
||||
G0 X0 ; must drill from the centerline. Tool should be zeroed here
|
||||
G83 Z#<drill_depth> R#<starting_z> Q#<drill_peck>
|
||||
G80
|
||||
|
||||
o300 if[#<drill_x> gt #<drill_diam> ]
|
||||
#<new_x> = [#<drill_x> - #<drill_diam>] ; because of drilldiameter and diameter mode
|
||||
|
||||
G96 D#<drill_maxrpm> S#<drill_ss> ; Constant Surface Speed Mode
|
||||
M3 ; Start Spindle
|
||||
G95 F#<drill_feed> ; Feed-Per-Rev Mode
|
||||
G4P1 ; Wait to reach speed
|
||||
G0 X0
|
||||
#<starting_X> = #<_x>
|
||||
(DEBUG,Turning finish dia-#<drill_x> start rad-#<starting_X> start length-#<starting_Z> finish length-#<drill_depth>)
|
||||
|
||||
o400 while [#<starting_X> LT [#<new_x> - #<drill_doc>]]
|
||||
G0 X #<starting_X>
|
||||
#<starting_X>=[#<starting_X> + #<drill_doc>]
|
||||
G1 X #<starting_X>
|
||||
G1 Z #<drill_depth> X #<starting_X>
|
||||
G1 X[#<starting_X> - #<drill_doc>]
|
||||
G0 Z[#<starting_Z>]
|
||||
o400 endwhile
|
||||
|
||||
G0 X#<new_x>
|
||||
G1 Z#<drill_depth> X#<new_x>
|
||||
G1 X[#<new_x> - #<drill_doc>]
|
||||
G0 Z#<starting_Z>
|
||||
G0 X#<new_x> ; For touch-off
|
||||
o300 endif
|
||||
|
||||
M5
|
||||
M9
|
||||
|
||||
o<backup_restore> call ; restore g20/21, g90/g91, feedrate cuter-comp and other using now global _backup_var
|
||||
|
||||
|
||||
o<drill> endsub
|
||||
|
||||
M2
|
||||
%
|
||||
27
configs/probe_basic_lathe/subroutines/extendatc.ngc
Normal file
27
configs/probe_basic_lathe/subroutines/extendatc.ngc
Normal file
@@ -0,0 +1,27 @@
|
||||
o<extendatc> sub
|
||||
|
||||
; #<atc_z_tool_change_height> is the height you spindle needs to be at to clamp/unclamp a tool form the ATC (Set via INI [ATC]Z_TOOL_CHANGE_HEIGHT)
|
||||
; #<atc_z_tool_clearance_height> is the clearance height you spindle needs to be at to safely clear the ATC (Set via INI [ATC]Z_TOOL_CLEARANCE_HEIGHT)
|
||||
|
||||
#<atc_z_tool_change_height> = -3.9000
|
||||
o100 if [EXISTS[#<_ini[atc]z_tool_change_height>]]
|
||||
#<atc_z_tool_change_height> = #<_ini[atc]z_tool_change_height>
|
||||
o100 endif
|
||||
#<atc_z_tool_clearance_height> = [#<_ini[AXIS_Z]MAX_LIMIT>-0.01]
|
||||
o110 if [EXISTS[#<_ini[atc]z_tool_clearance_height>]]
|
||||
#<atc_z_tool_clearance_height> = #<_ini[atc]z_tool_clearance_height>
|
||||
o110 endif
|
||||
|
||||
G0 G53 Z#<atc_z_tool_clearance_height> ; move z to clear height
|
||||
|
||||
M65 P1 ; Turn off carousel home solenoid
|
||||
M64 P0 ; Move Carousel OUT
|
||||
M66 P1 L3 Q5 ; check for carousel out position sensor
|
||||
o120 if [#5399 LT 0]
|
||||
M65 P0 ; switch off atc out solenoid
|
||||
(abort, ATC not in position)
|
||||
o120 endif
|
||||
|
||||
o<extendatc> endsub [1]
|
||||
|
||||
M2
|
||||
68
configs/probe_basic_lathe/subroutines/facing.ngc
Executable file
68
configs/probe_basic_lathe/subroutines/facing.ngc
Executable file
@@ -0,0 +1,68 @@
|
||||
;Facing
|
||||
o<facing> sub
|
||||
|
||||
o<backup_status> call
|
||||
|
||||
#<facing_ss> = #1
|
||||
#<facing_maxrpm> = #2
|
||||
#<facing_feed> = #3
|
||||
#<facing_doc> = #4
|
||||
#<facing_tool> = #5
|
||||
#<facing_coolant> = #6
|
||||
#<facing_angle> = #7
|
||||
#<facing_x> = #8
|
||||
#<facing_z> = #9
|
||||
|
||||
o10 if [#<facing_angle>NE 0]
|
||||
(MSG,Angled facing isn't supported yet)
|
||||
o10 return [-2] ; indicate failure to epilog
|
||||
o10 endif
|
||||
|
||||
o100 if [#<facing_tool> NE #<_current_tool>]
|
||||
(MSG,ERROR : Set tool before use macro)
|
||||
o100 return [-2] ; indicate failure to epilog
|
||||
o100 endif
|
||||
|
||||
G7 ; diameter mode
|
||||
G18 ; XZ Plane
|
||||
G21 ; Metric Units
|
||||
G90 ; Absolute Distance
|
||||
|
||||
#<starting_X> = [#<_x> * 2] (starting X)
|
||||
#<starting_Z> = #<_z> (starting Z)
|
||||
|
||||
G96 D#<facing_maxrpm> S#<facing_ss> ; Constant Surface Speed Mode
|
||||
M3 ; Start Spindle
|
||||
G95 F#<facing_feed> ; Feed-Per-Rev Mode
|
||||
G4P1 ; Wait to reach speed
|
||||
|
||||
o110 if [#<facing_coolant>]
|
||||
M8
|
||||
o110 endif
|
||||
|
||||
(DEBUG,facing finish rad-#<facing_x> start rad-#<starting_X> start length-#<starting_Z> finish length-#<facing_z>)
|
||||
|
||||
o200 while [#<starting_Z> GT #<facing_z>+ #<facing_doc>]
|
||||
#<starting_Z>=[#<starting_Z>-#<facing_doc>]
|
||||
G1 Z#<starting_Z>
|
||||
G1 X#<facing_x>
|
||||
G0 Z[#<starting_Z>+#<facing_doc>]
|
||||
G0 X#<starting_X>
|
||||
G0 Z#<starting_Z>
|
||||
o200 endwhile
|
||||
|
||||
G1 Z#<facing_z>
|
||||
G1 X#<facing_x>
|
||||
G0 Z[#<starting_Z>+#<facing_doc>]
|
||||
G0 X[#<starting_X>+#<facing_doc>]
|
||||
G0 Z#<facing_z>; For touch-off
|
||||
|
||||
M5
|
||||
M9
|
||||
|
||||
o<backup_restore> call ; restore g20/21, g90/g91, feedrate cuter-comp and other using now global _backup_var
|
||||
|
||||
o<facing> endsub
|
||||
|
||||
M2
|
||||
%
|
||||
10
configs/probe_basic_lathe/subroutines/go_to_g30.ngc
Normal file
10
configs/probe_basic_lathe/subroutines/go_to_g30.ngc
Normal file
@@ -0,0 +1,10 @@
|
||||
o<go_to_g30> sub
|
||||
; Lathe specific version
|
||||
|
||||
M73
|
||||
G90
|
||||
G30
|
||||
|
||||
o<go_to_g30> endsub
|
||||
|
||||
M2
|
||||
11
configs/probe_basic_lathe/subroutines/go_to_home.ngc
Normal file
11
configs/probe_basic_lathe/subroutines/go_to_home.ngc
Normal file
@@ -0,0 +1,11 @@
|
||||
o<go_to_home> sub
|
||||
; Lathe specific version
|
||||
|
||||
M73
|
||||
G90
|
||||
G53 G0 Z0
|
||||
G53 G0 X0
|
||||
|
||||
o<go_to_home> endsub
|
||||
|
||||
M2
|
||||
16
configs/probe_basic_lathe/subroutines/go_to_zero.ngc
Normal file
16
configs/probe_basic_lathe/subroutines/go_to_zero.ngc
Normal file
@@ -0,0 +1,16 @@
|
||||
o<go_to_zero> sub
|
||||
; Lathe specific version
|
||||
|
||||
M73
|
||||
G90
|
||||
o100 if [#5422 LT 0]
|
||||
G0 Z0
|
||||
G0 X0
|
||||
o100 else if [#5422 GE 0]
|
||||
G0 X0
|
||||
G0 Z0
|
||||
o100 endif
|
||||
|
||||
o<go_to_zero> endsub
|
||||
|
||||
M2
|
||||
39
configs/probe_basic_lathe/subroutines/m10.ngc
Normal file
39
configs/probe_basic_lathe/subroutines/m10.ngc
Normal file
@@ -0,0 +1,39 @@
|
||||
o<m10> sub
|
||||
|
||||
; Move tool carousel best direction to pocket P
|
||||
; Parameter #3989 is used to track if the carousel is homed (M13) (volatile)
|
||||
; Parameter #3990 is used to track the current tool pocket (persistently)
|
||||
; #<number_of_pockets>: The number of pockets in the ATC is automaticity pulled from the INI via #<_ini[atc]pockets>
|
||||
(PRINT, o<m10> P#<p>)
|
||||
|
||||
o100 if [#3989 NE 1]
|
||||
M13
|
||||
o100 endif
|
||||
|
||||
; default to a 12 pocket ATC (matching DynATC Widget behaviour), then update based on INI settings
|
||||
#<number_of_pockets> = 12
|
||||
o110 if [EXISTS[#<_ini[atc]pockets>]]
|
||||
#<number_of_pockets> = #<_ini[atc]pockets>
|
||||
o110 endif
|
||||
|
||||
#<steps> = [#3990 - #<p>]
|
||||
(PRINT, o<m10> P#<p>, steps=#<steps>)
|
||||
o120 if [#<steps> GT [#<number_of_pockets> / 2]]
|
||||
#<steps>=[#<steps> - #<number_of_pockets>]
|
||||
o120 endif
|
||||
|
||||
o130 if [#<steps> LT -[#<number_of_pockets> / 2]]
|
||||
#<steps>=[#<steps> + #<number_of_pockets>]
|
||||
o130 endif
|
||||
|
||||
o140 if [#<steps> GT 0]
|
||||
M12 P[#<steps>]
|
||||
o140 elseif [#<steps> LT 0]
|
||||
#<steps>=[#<steps> * -1]
|
||||
M11 P[#<steps>]
|
||||
o140 endif
|
||||
|
||||
(PRINT, o<m10> endsub)
|
||||
o<m10> endsub [1]
|
||||
|
||||
M2
|
||||
50
configs/probe_basic_lathe/subroutines/m11.ngc
Normal file
50
configs/probe_basic_lathe/subroutines/m11.ngc
Normal file
@@ -0,0 +1,50 @@
|
||||
o<m11> sub
|
||||
|
||||
; Move tool carousel CW Parameter P number of steps
|
||||
; Without parameter one step CW.
|
||||
; Parameter #3989 is used to track if the carousel is homed (M13) (volatile)
|
||||
; Parameter #3990 is used to track the current tool pocket (persistently)
|
||||
; #<number_of_pockets>: The number of pockets in the ATC is automaticity pulled from the INI via #<_ini[atc]pockets>
|
||||
(PRINT, o<m11> P#<p>)
|
||||
|
||||
o100 if [#3989 NE 1]
|
||||
(PRINT, atc not homed, homing)
|
||||
M13
|
||||
o100 endif
|
||||
|
||||
; default to a 12 pocket ATC (matching DynATC Widget behaviour), then update based on INI settings
|
||||
#<number_of_pockets> = 12
|
||||
o110 if [EXISTS[#<_ini[atc]pockets>]]
|
||||
#<number_of_pockets> = #<_ini[atc]pockets>
|
||||
o110 endif
|
||||
|
||||
o120 if [EXISTS[#<p>]]
|
||||
#<steps_to_move> = #<p>
|
||||
o120 else
|
||||
#<steps_to_move> = 1
|
||||
(tells the atc widget move 1 step forward)
|
||||
o120 endif
|
||||
|
||||
(tells the atc widget how many steps to move and start moving forward)
|
||||
(DEBUG, EVAL[vcp.getWidget{"dynatc"}.rotate{#<steps_to_move>, "cw"}])
|
||||
|
||||
M64 P4 ; Move atc motor FWD
|
||||
|
||||
o130 do
|
||||
M66 P4 L1 Q3 ; wait for rising edge on rotation index
|
||||
o131 if [#5399 LT 0]
|
||||
M65 P4 ; Stop atc motor
|
||||
(abort, Failed to get rotation index)
|
||||
o131 endif
|
||||
#3990 = [[[#3990+2] MOD #<number_of_pockets>]-1] ; Pocket is no.1-#<number_of_pockets>
|
||||
#<steps_to_move> = [#<steps_to_move>-1]
|
||||
o130 while [#<steps_to_move> GT 0]
|
||||
|
||||
M65 P4 ; Stop motor
|
||||
|
||||
#<_my_current_pocket> = #3990
|
||||
|
||||
(PRINT, o<m11> endsub)
|
||||
o<m11> endsub [1]
|
||||
|
||||
M2
|
||||
50
configs/probe_basic_lathe/subroutines/m12.ngc
Normal file
50
configs/probe_basic_lathe/subroutines/m12.ngc
Normal file
@@ -0,0 +1,50 @@
|
||||
o<m12> sub
|
||||
|
||||
; Move tool carousel CCW Parameter P number of steps
|
||||
; Without parameter one step CCW.
|
||||
; Parameter #3989 is used to track if the carousel is homed (M13) (volatile)
|
||||
; Parameter #3990 is used to track the current tool pocket (persistently)
|
||||
; #<number_of_pockets>: The number of pockets in the ATC is automaticity pulled from the INI via #<_ini[atc]pockets>
|
||||
(PRINT, o<m12> P#<p>)
|
||||
|
||||
o100 if [#3989 NE 1]
|
||||
(PRINT, atc not homed, homing)
|
||||
M13
|
||||
o100 endif
|
||||
|
||||
; default to a 12 pocket ATC (matching DynATC Widget behaviour), then update based on INI settings
|
||||
#<number_of_pockets> = 12
|
||||
o110 if [EXISTS[#<_ini[atc]pockets>]]
|
||||
#<number_of_pockets> = #<_ini[atc]pockets>
|
||||
o110 endif
|
||||
|
||||
o120 if [EXISTS[#<p>]]
|
||||
#<steps_to_move> = #<p>
|
||||
o120 else
|
||||
#<steps_to_move>=1
|
||||
(tells the atc widget move 1 step reverse)
|
||||
o120 endif
|
||||
|
||||
(tells the atc widget how many steps to move and start moving reverse)
|
||||
(DEBUG, EVAL[vcp.getWidget{"dynatc"}.rotate{#<steps_to_move>, "ccw"}])
|
||||
|
||||
M64 P3 ; Move atc motor REV
|
||||
|
||||
o130 do
|
||||
M66 P4 L1 Q3 ; wait for rising edge on rotation index
|
||||
o131 if [#5399 LT 0]
|
||||
M65 P3 ; Stop atc motor
|
||||
(abort, Failed to get rotation index)
|
||||
o131 endif
|
||||
#3990 = [[[#3990-2] MOD #<number_of_pockets>]+1] ; Pocket is no.1-#<number_of_pockets>
|
||||
#<steps_to_move> = [#<steps_to_move>-1]
|
||||
o130 while [#<steps_to_move> GT 0]
|
||||
|
||||
M65 P3 ; Stop motor
|
||||
|
||||
#<_my_current_pocket> = #3990
|
||||
|
||||
(PRINT, o<m12> endsub)
|
||||
o<m12> endsub [1]
|
||||
|
||||
M2
|
||||
42
configs/probe_basic_lathe/subroutines/m13.ngc
Normal file
42
configs/probe_basic_lathe/subroutines/m13.ngc
Normal file
@@ -0,0 +1,42 @@
|
||||
o<m13> sub
|
||||
|
||||
; Move tool carousel CW until ATC zero
|
||||
; Parameter #3989 is used to track if the carousel is homed (M13) (volatile)
|
||||
; Parameter #3990 is used to track the current tool pocket (persistently)
|
||||
; #<number_of_pockets>: The number of pockets in the ATC is automaticity pulled from the INI via #<_ini[atc]pockets>
|
||||
(PRINT, o<m13>)
|
||||
|
||||
(DEBUG, EVAL[vcp.getWidget{"dynatc"}.atc_message{"REFERENCING"}])
|
||||
|
||||
M64 P3 ; Move Motor FWD
|
||||
M66 P3 L1 Q20 ; wait for rising edge on home index
|
||||
o100 if [#5399 LT 0]
|
||||
M65 P3 ; stop motor
|
||||
(abort, Failed to home carousel)
|
||||
o100 endif
|
||||
|
||||
#3990 = 1
|
||||
M65 P3 ; Stop motor
|
||||
#3989 = 1
|
||||
|
||||
(DEBUG, EVAL[vcp.getWidget{"dynatc"}.atc_message{}])
|
||||
|
||||
#<number_of_pockets> = 12
|
||||
o110 if [EXISTS[#<_ini[atc]pockets>]]
|
||||
#<number_of_pockets> = #<_ini[atc]pockets>
|
||||
o110 endif
|
||||
|
||||
#1 = 0
|
||||
|
||||
o120 while [#1 LT #<number_of_pockets>]
|
||||
#1 = [#1+1]
|
||||
#2 = #[4000+#1]
|
||||
(DEBUG, EVAL[vcp.getWidget{"dynatc"}.store_tool{#1, #2}])
|
||||
o120 endwhile
|
||||
|
||||
M61 Q#3991 G43 H#3991
|
||||
|
||||
(PRINT, o<m13> endsub)
|
||||
o<m13> endsub [1]
|
||||
|
||||
M2
|
||||
45
configs/probe_basic_lathe/subroutines/m21.ngc
Normal file
45
configs/probe_basic_lathe/subroutines/m21.ngc
Normal file
@@ -0,0 +1,45 @@
|
||||
o<m21> sub
|
||||
|
||||
; Move Carousel to the tool change position - OUT
|
||||
; then unload any tool in the spindle into the current pocket
|
||||
; Parameter #3991 is used to track the current tool loaded it in the spindle (persistently)
|
||||
; #<atc_z_tool_change_height> is the height you spindle needs to be at to clamp/unclamp a tool form the ATC (Set via INI [ATC]Z_TOOL_CHANGE_HEIGHT)
|
||||
; #<atc_z_tool_clearance_height> is the clearance height you spindle needs to be at to safely clear the ATC (Set via INI [ATC]Z_TOOL_CLEARANCE_HEIGHT)
|
||||
(PRINT, o<m21>)
|
||||
|
||||
#<atc_z_tool_change_height> = -3.9000
|
||||
o100 if [EXISTS[#<_ini[atc]z_tool_change_height>]]
|
||||
#<atc_z_tool_change_height> = #<_ini[atc]z_tool_change_height>
|
||||
o100 endif
|
||||
#<atc_z_tool_clearance_height> = [#<_ini[AXIS_Z]MAX_LIMIT>-0.01]
|
||||
o110 if [EXISTS[#<_ini[atc]z_tool_clearance_height>]]
|
||||
#<atc_z_tool_clearance_height> = #<_ini[atc]z_tool_clearance_height>
|
||||
o110 endif
|
||||
|
||||
M65 P1 ; switch off carousel in solenoid
|
||||
M66 P1 L3 Q1
|
||||
|
||||
M5 M9
|
||||
G90
|
||||
G0 G53 Z#<atc_z_tool_change_height> ; rapid move to above the tool change height
|
||||
|
||||
;M19 R0 Q3 ; orient spindle
|
||||
|
||||
M64 P0 ; Move Carousel out
|
||||
M66 P1 L3 Q5 ; check for carousel out sensor
|
||||
o120 if [#5399 LT 0]
|
||||
M65 P0 ; switch off atc out solenoid
|
||||
(abort, ATC not in position)
|
||||
o120 endif
|
||||
|
||||
M24 ; activate drawbar, release the tool
|
||||
M5 ; turn off spindle lock
|
||||
|
||||
G0 G53 Z#<atc_z_tool_clearance_height> ; move z to clear height
|
||||
|
||||
#3991 = 0; save fact there is now no tool in the spindle
|
||||
|
||||
(PRINT, o<m21> endsub)
|
||||
o<m21> endsub [1]
|
||||
|
||||
M2
|
||||
42
configs/probe_basic_lathe/subroutines/m22.ngc
Normal file
42
configs/probe_basic_lathe/subroutines/m22.ngc
Normal file
@@ -0,0 +1,42 @@
|
||||
o<m22> sub
|
||||
|
||||
; Move Carousel to the home position - IN
|
||||
; after loading any tool in the current pocket to the spindle
|
||||
; #<atc_z_tool_change_height> is the height you spindle needs to be at to clamp/unclamp a tool form the ATC (Set via INI [ATC]Z_TOOL_CHANGE_HEIGHT)
|
||||
; #<atc_z_tool_clearance_height> is the clearance height you spindle needs to be at to safely clear the ATC (Set via INI [ATC]Z_TOOL_CLEARANCE_HEIGHT)
|
||||
(PRINT, o<m22>)
|
||||
|
||||
#<atc_z_tool_change_height> = -3.9000
|
||||
o100 if [EXISTS[#<_ini[atc]z_tool_change_height>]]
|
||||
#<atc_z_tool_change_height> = #<_ini[atc]z_tool_change_height>
|
||||
o100 endif
|
||||
#<atc_z_tool_clearance_height> = [#<_ini[AXIS_Z]MAX_LIMIT>-0.01]
|
||||
o110 if [EXISTS[#<_ini[atc]z_tool_clearance_height>]]
|
||||
#<atc_z_tool_clearance_height> = #<_ini[atc]z_tool_clearance_height>
|
||||
o110 endif
|
||||
|
||||
;M19 R0 Q2
|
||||
M24
|
||||
;M19 R0 Q1
|
||||
;G90
|
||||
G0 G53 Z#<atc_z_tool_change_height> ; rapid move to above the tool change height
|
||||
M65 P2 ; release the drawbar to clamp the tool
|
||||
M5
|
||||
M66 P5 L3 Q1 ; check the tool clamped sensor
|
||||
o120 if [#5399 LT 0]
|
||||
(abort, Failed to reclamp tool)
|
||||
o120 endif
|
||||
|
||||
M65 P0 ; Move Carousel home
|
||||
M66 P0 L3 Q4 ; check carousel in position sensor
|
||||
o130 if [#5399 LT 0]
|
||||
M65 P1 ; turn off the solenoid to send atc home
|
||||
(abort, Failed to send carousel home) ; abort if the sensor does not activate in 5 seconds
|
||||
o130 endif
|
||||
|
||||
;M65 P1 ; Turn off carousel home position solenoid
|
||||
|
||||
(PRINT, o<m22> endsub)
|
||||
o<m22> endsub [1]
|
||||
|
||||
M2
|
||||
0
configs/probe_basic_lathe/subroutines/m23.ngc
Normal file
0
configs/probe_basic_lathe/subroutines/m23.ngc
Normal file
14
configs/probe_basic_lathe/subroutines/m24.ngc
Normal file
14
configs/probe_basic_lathe/subroutines/m24.ngc
Normal file
@@ -0,0 +1,14 @@
|
||||
o<m24> sub
|
||||
(PRINT, o<m24>)
|
||||
|
||||
M64 P2 ; unclamp the tool
|
||||
M66 P2 L3 Q2 ; check the unclamped tool sensor
|
||||
o100 if [#5399 LT 0]
|
||||
M65 P2 ; turn off the drawbar
|
||||
(abort, failed to release tool) ; abort if the sensor does not activate in 3 seconds
|
||||
o100 endif
|
||||
|
||||
(PRINT, o<m24> endsub)
|
||||
o<m24> endsub [1]
|
||||
|
||||
M2
|
||||
15
configs/probe_basic_lathe/subroutines/m25.ngc
Normal file
15
configs/probe_basic_lathe/subroutines/m25.ngc
Normal file
@@ -0,0 +1,15 @@
|
||||
o<m25> sub
|
||||
(PRINT, o<m25>)
|
||||
|
||||
M64 P0 ; Move Carousel out
|
||||
|
||||
M66 P1 L3 Q5 ; check for carousel out sensor
|
||||
o100 if [#5399 LT 0]
|
||||
M65 P0 ; switch off atc out solenoid
|
||||
(abort, ATC not in position)
|
||||
o100 endif
|
||||
|
||||
(PRINT, o<m25> endsub)
|
||||
o<m25> endsub [1]
|
||||
|
||||
M2
|
||||
0
configs/probe_basic_lathe/subroutines/m26.ngc
Normal file
0
configs/probe_basic_lathe/subroutines/m26.ngc
Normal file
@@ -0,0 +1,30 @@
|
||||
(author: Chris P)
|
||||
(version: 0.1)
|
||||
(date: 05/30/20)
|
||||
|
||||
(m6 tool call with g43 offset applied)
|
||||
|
||||
o<m6_tool_call_main_panel> sub
|
||||
; Lathe specific version
|
||||
|
||||
#<tool_number_entry_main_panel> = #1
|
||||
#<x_tool_change_position> = #2
|
||||
#<z_tool_change_position> = #3
|
||||
#<use_tcp_mode> = #4
|
||||
|
||||
G49
|
||||
|
||||
(probe mode rules for WCO, Rotation and probe position measuring only)
|
||||
o100 if [#<use_tcp_mode> EQ 1]
|
||||
(move to stored tool change position for m6 call)
|
||||
G90
|
||||
G53 G0 Z#<z_tool_change_position>
|
||||
G53 G0 X#<x_tool_change_position>
|
||||
o<m6_tool_call_main_panel> return
|
||||
o100 endif
|
||||
|
||||
T#<tool_number_entry_main_panel> M6 G43
|
||||
|
||||
o<m6_tool_call_main_panel> endsub
|
||||
|
||||
M2 (end program)
|
||||
@@ -0,0 +1,29 @@
|
||||
(author: Chris P)
|
||||
(version: 0.1)
|
||||
(date: 05/30/20)
|
||||
|
||||
(m6 tool call with g43 offset applied)
|
||||
|
||||
o<m6_tool_call_touch_panel> sub
|
||||
|
||||
#<tool_number_entry_touch_panel> = #1
|
||||
#<x_tool_change_position> = #2
|
||||
#<z_tool_change_position> = #3
|
||||
#<use_tcp_mode> = #4
|
||||
|
||||
G49
|
||||
|
||||
(probe mode rules for WCO, Rotation and probe position measuring only)
|
||||
o100 if [#<use_tcp_mode> EQ 1]
|
||||
(move to stored tool change position for m6 call)
|
||||
G90
|
||||
G53 G0 Z#<z_tool_change_position>
|
||||
G53 G0 X#<x_tool_change_position>
|
||||
o<m6_tool_call_touch_panel> return
|
||||
o100 endif
|
||||
|
||||
T#<tool_number_entry_touch_panel> M6 g43
|
||||
|
||||
o<m6_tool_call_touch_Panel> endsub
|
||||
|
||||
M2 (end program)
|
||||
@@ -0,0 +1,19 @@
|
||||
o<move_head_above_carousel> sub
|
||||
|
||||
; #<atc_z_tool_change_height> is the height you spindle needs to be at to clamp/unclamp a tool form the ATC (Set via INI [ATC]Z_TOOL_CHANGE_HEIGHT)
|
||||
; #<atc_z_tool_clearance_height> is the clearance height you spindle needs to be at to safely clear the ATC (Set via INI [ATC]Z_TOOL_CLEARANCE_HEIGHT)
|
||||
|
||||
#<atc_z_tool_change_height> = -3.9000
|
||||
o100 if [EXISTS[#<_ini[atc]z_tool_change_height>]]
|
||||
#<atc_z_tool_change_height> = #<_ini[atc]z_tool_change_height>
|
||||
o100 endif
|
||||
#<atc_z_tool_clearance_height> = [#<_ini[AXIS_Z]MAX_LIMIT>-0.01]
|
||||
o110 if [EXISTS[#<_ini[atc]z_tool_clearance_height>]]
|
||||
#<atc_z_tool_clearance_height> = #<_ini[atc]z_tool_clearance_height>
|
||||
o110 endif
|
||||
|
||||
G0 G53 Z#<atc_z_tool_clearance_height> ; move z to clear height
|
||||
|
||||
o<move_head_above_carousel> endsub [1]
|
||||
|
||||
M2
|
||||
@@ -0,0 +1,18 @@
|
||||
o<move_tool_to_carousel_height> sub
|
||||
; #<atc_z_tool_change_height> is the height you spindle needs to be at to clamp/unclamp a tool form the ATC (Set via INI [ATC]Z_TOOL_CHANGE_HEIGHT)
|
||||
; #<atc_z_tool_clearance_height> is the clearance height you spindle needs to be at to safely clear the ATC (Set via INI [ATC]Z_TOOL_CLEARANCE_HEIGHT)
|
||||
|
||||
#<atc_z_tool_change_height> = -3.9000
|
||||
o100 if [EXISTS[#<_ini[atc]z_tool_change_height>]]
|
||||
#<atc_z_tool_change_height> = #<_ini[atc]z_tool_change_height>
|
||||
o100 endif
|
||||
#<atc_z_tool_clearance_height> = [#<_ini[AXIS_Z]MAX_LIMIT>-0.01]
|
||||
o110 if [EXISTS[#<_ini[atc]z_tool_clearance_height>]]
|
||||
#<atc_z_tool_clearance_height> = #<_ini[atc]z_tool_clearance_height>
|
||||
o110 endif
|
||||
|
||||
G0 G53 Z#<atc_z_tool_change_height> ; rapid move to above the tool change height
|
||||
|
||||
o<move_tool_to_carousel_height> endsub [1]
|
||||
|
||||
M2
|
||||
9
configs/probe_basic_lathe/subroutines/on_abort.ngc
Normal file
9
configs/probe_basic_lathe/subroutines/on_abort.ngc
Normal file
@@ -0,0 +1,9 @@
|
||||
%
|
||||
o<on_abort> sub
|
||||
|
||||
G90
|
||||
G40
|
||||
G49
|
||||
|
||||
o<on_abort> endsub
|
||||
%
|
||||
11
configs/probe_basic_lathe/subroutines/orientspindle.ngc
Normal file
11
configs/probe_basic_lathe/subroutines/orientspindle.ngc
Normal file
@@ -0,0 +1,11 @@
|
||||
o<orientspindle> sub
|
||||
; Orient the spindle with platter
|
||||
(PRINT, o<orientspindle>)
|
||||
|
||||
M5 M9 ; stop all spindle motion and coolant
|
||||
M19 R0 Q4 ; orient spindle
|
||||
M5 ; turn off spindle lock
|
||||
|
||||
o<orientspindle> endsub [1]
|
||||
|
||||
M2
|
||||
@@ -0,0 +1,114 @@
|
||||
(author: Chris P)
|
||||
(version: 0.2)
|
||||
(date: 06/27/24)
|
||||
|
||||
(Probe back left inside corner for x,y,z 0,0,0 position)
|
||||
(Start probe position is over back left inside corner of stock)
|
||||
(inside the step off width square and within max z distance)
|
||||
(ensure all settings have been set properly according to help diagrams)
|
||||
|
||||
o<probe_back_left_inside_corner> sub
|
||||
|
||||
(uses NGCGUI style arg spec)
|
||||
(number after "=" in comment is default value)
|
||||
#<probe_tool_number> = #3014 (=99)
|
||||
#<probe_slow_fr> = #3015 (=0)
|
||||
#<probe_fast_fr> = #3016 (=10.0)
|
||||
#<probe_traverse_fr> = #3017 (=50)
|
||||
#<max_xy_distance> = #3018 (=0.5000)
|
||||
#<xy_clearance> = #3019 (=0.1000)
|
||||
#<max_z_distance> = #3020 (=0.5000)
|
||||
#<z_clearance> = #3021 (=0.1000)
|
||||
#<extra_probe_depth> = #3022 (=0.0000)
|
||||
#<step_off_width> = #3023 (=0.5000)
|
||||
#<probe_mode> = #3030 (=0)
|
||||
#<calibration_offset> = #3032 (=0)
|
||||
|
||||
(Cancel G92 offsets)
|
||||
G92.1
|
||||
|
||||
#<workspace_x> = #[5201 + [20 * #5220]]
|
||||
#<workspace_y> = #[5202 + [20 * #5220]]
|
||||
|
||||
(Probe Tool Safety Check)
|
||||
o100 if [#5400 NE #<probe_tool_number>]
|
||||
(MSG, Specified probe tool #<probe_tool_number> not in spindle, aborting)
|
||||
o<probe_back_left_inside_corner> return
|
||||
o100 endif
|
||||
|
||||
(Probe Diameter)
|
||||
#<probe_diameter> = #5410
|
||||
|
||||
(Probing depth from the z probed clearance height, used for z moves)
|
||||
#<z_probe_stack> = [#<z_clearance> + #<probe_diameter> + #<extra_probe_depth>]
|
||||
|
||||
(Call sub "probe_z_minus_sub" to Probe top of Workpiece)
|
||||
o<probe_z_minus_sub> call [#3014][#3015][#3016][#3017][#3020][#3021][#3030]
|
||||
|
||||
(Probe X Positioning Move, Traverse Workpiece Top at Z Clearance Height plane)
|
||||
G91
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 X[#<step_off_width>] Y-[#<step_off_width>]
|
||||
|
||||
(Probe X Positioning Move, to Probing Depth)
|
||||
F[#<probe_fast_fr>]
|
||||
G38.3 Z-[#<z_probe_stack>]
|
||||
|
||||
G90
|
||||
(Current X Position including offsets in current program units)
|
||||
#<x_start> = #5420
|
||||
|
||||
(Call sub "probe_x_minus_sub" to Probe x- side of Workpiece)
|
||||
o<probe_x_minus> call [#3014][#3015][#3016][#3017][#3018][#3019][#3032]
|
||||
|
||||
#<x_minus_zero_edge> = #<_value>
|
||||
|
||||
(value returned safety check, aborts if no value returned)
|
||||
o110 if [#<probe_mode> EQ 1 AND #<_value_returned> NE 1]
|
||||
(MSG, Missing X Sub returned edge parameter, aborting)
|
||||
o<probe_back_left_inside_corner> return
|
||||
o110 endif
|
||||
|
||||
(move to X start Position)
|
||||
G90
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 X[#<x_start>]
|
||||
|
||||
(Current Y Position including offsets in current program units)
|
||||
#<y_start> = #5421
|
||||
|
||||
(Call sub "probe_y_plus" to Probe y+ side of Workpiece)
|
||||
o<probe_y_plus> call [#3014][#3015][#3016][#3017][#3018][#3019][#3032]
|
||||
|
||||
#<y_plus_zero_edge> = #<_value>
|
||||
|
||||
(value returned safety check, aborts if no value returned)
|
||||
o120 if [#<probe_mode> EQ 1 AND #<_value_returned> NE 1]
|
||||
(MSG, Missing Y Sub returned edge parameter, aborting)
|
||||
o<probe_back_left_inside_corner> return
|
||||
o120 endif
|
||||
|
||||
(move to Y start Position)
|
||||
G90
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 Y[#<y_start>]
|
||||
|
||||
(Probe Completion Move to Z Clearance Plane, and X Zero, Y Zero)
|
||||
G91
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 Z[#<z_probe_stack>]
|
||||
G90
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 X[#<x_minus_zero_edge>] Y[#<y_plus_zero_edge>]
|
||||
|
||||
(probe mode rules for WCO or probe position measuring only)
|
||||
o130 if [#<probe_mode> EQ 0]
|
||||
(Record Zero in selected axes and WCO)
|
||||
G10 L2 P#5220 X[#<x_minus_zero_edge> + #<workspace_x>]
|
||||
G10 L2 P#5220 Y[#<y_plus_zero_edge> + #<workspace_y>]
|
||||
o<probe_rect_pocket> return
|
||||
o130 endif
|
||||
|
||||
o<probe_back_left_inside_corner> endsub
|
||||
|
||||
M2 (end program)
|
||||
@@ -0,0 +1,110 @@
|
||||
(author: Chris P)
|
||||
(version: 0.2)
|
||||
(date: 06/27/24)
|
||||
|
||||
(Probe back left top corner for x,y,z 0,0,0 position)
|
||||
(Start probe position is over back left corner of stock)
|
||||
(inside the step off width square and within max z distance)
|
||||
(ensure all settings have been set properly according to help diagrams)
|
||||
|
||||
o<probe_back_left_top_corner> sub
|
||||
|
||||
(uses NGCGUI style arg spec)
|
||||
(number after "=" in comment is default value)
|
||||
#<probe_tool_number> = #3014 (=99)
|
||||
#<probe_slow_fr> = #3015 (=0)
|
||||
#<probe_fast_fr> = #3016 (=10.0)
|
||||
#<probe_traverse_fr> = #3017 (=50)
|
||||
#<max_xy_distance> = #3018 (=0.5000)
|
||||
#<xy_clearance> = #3019 (=0.1000)
|
||||
#<max_z_distance> = #3020 (=0.5000)
|
||||
#<z_clearance> = #3021 (=0.1000)
|
||||
#<extra_probe_depth> = #3022 (=0.0000)
|
||||
#<step_off_width> = #3023 (=0.5000)
|
||||
#<probe_mode> = #3030 (=0)
|
||||
#<calibration_offset> = #3032 (=0)
|
||||
|
||||
(Cancel G92 offsets)
|
||||
G92.1
|
||||
|
||||
#<workspace_x> = #[5201 + [20 * #5220]]
|
||||
#<workspace_y> = #[5202 + [20 * #5220]]
|
||||
|
||||
(Probe Tool Safety Check)
|
||||
o100 if [#5400 NE #<probe_tool_number>]
|
||||
(MSG, Specified probe tool #<probe_tool_number> not in spindle, aborting)
|
||||
o<probe_back_left_top_corner> return
|
||||
o100 endif
|
||||
|
||||
(Probe Diameter)
|
||||
#<probe_diameter> = #5410
|
||||
|
||||
(Probing depth from the z probed clearance height, used for z moves)
|
||||
#<z_probe_stack> = [#<z_clearance> + #<probe_diameter> + #<extra_probe_depth>]
|
||||
|
||||
(Call sub "probe_z_minus_sub" to Probe top of Workpiece)
|
||||
o<probe_z_minus_sub> call [#3014][#3015][#3016][#3017][#3020][#3021][#3030]
|
||||
|
||||
(Probe X Positioning Move, Step Off Width)
|
||||
G91
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 X-[#<step_off_width>]
|
||||
|
||||
(Probe X Positioning Move, to Probing Depth)
|
||||
F[#<probe_fast_fr>]
|
||||
G38.3 Z-[#<z_probe_stack>]
|
||||
|
||||
(Call sub "probe_x_plus" to Probe x+ side of Workpiece)
|
||||
o<probe_x_plus> call [#3014][#3015][#3016][#3017][#3018][#3019][#3032]
|
||||
|
||||
#<x_plus_zero_edge> = #<_value>
|
||||
|
||||
(value returned safety check, aborts if no value returned)
|
||||
o110 if [#<probe_mode> EQ 1 AND #<_value_returned> NE 1]
|
||||
(MSG, Missing X Sub returned edge parameter, aborting)
|
||||
o<probe_back_left_top_corner> return
|
||||
o110 endif
|
||||
|
||||
(Probe Y Positioning Move, up to Z clearance plane)
|
||||
G91
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 Z[#<z_probe_stack>]
|
||||
|
||||
(Probe Y Positioning Move, Traverse Workpiece at Z Clearance plane)
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 X[#<step_off_width>] Y[#<step_off_width>]
|
||||
|
||||
(Probe Y Positioning Move,to Probing Depth)
|
||||
F[#<probe_fast_fr>]
|
||||
G38.3 Z-[#<z_probe_stack>]
|
||||
|
||||
(Call sub "probe_y_minus" to Probe y- side of Workpiece)
|
||||
o<probe_y_minus> call [#3014][#3015][#3016][#3017][#3018][#3019][#3032]
|
||||
|
||||
#<y_minus_zero_edge> = #<_value>
|
||||
|
||||
(value returned safety check, aborts if no value returned)
|
||||
o120 if [#<probe_mode> EQ 1 AND #<_value_returned> NE 1]
|
||||
(MSG, Missing Y Sub returned edge parameter, aborting)
|
||||
o<probe_back_left_top_corner> return
|
||||
o120 endif
|
||||
|
||||
(Probe Completion Move to Z Clearance Plane, and XY Zero)
|
||||
G91
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 Z[#<z_probe_stack>]
|
||||
G90
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 X[#<x_plus_zero_edge>] Y[#<y_minus_zero_edge>]
|
||||
|
||||
(probe mode rules for WCO or probe position measuring only)
|
||||
o130 if [#<probe_mode> EQ 0]
|
||||
(Record Zero in selected axes and WCO)
|
||||
G10 L2 P#5220 X[#<x_plus_zero_edge> + #<workspace_x>]
|
||||
G10 L2 P#5220 Y[#<y_minus_zero_edge> + #<workspace_y>]
|
||||
o<probe_back_left_top_corner> return
|
||||
o130 endif
|
||||
|
||||
o<probe_back_left_top_corner> endsub
|
||||
|
||||
M2 (end program)
|
||||
@@ -0,0 +1,114 @@
|
||||
(author: Chris P)
|
||||
(version: 0.2)
|
||||
(date: 06/27/24)
|
||||
|
||||
(Probe back right inside corner for x,y,z 0,0,0 position)
|
||||
(Start probe position is over back right inside corner of stock)
|
||||
(inside the step off width square and within max z distance)
|
||||
(ensure all settings have been set properly according to help diagrams)
|
||||
|
||||
o<probe_back_right_inside_corner> sub
|
||||
|
||||
(uses NGCGUI style arg spec)
|
||||
(number after "=" in comment is default value)
|
||||
#<probe_tool_number> = #3014 (=99)
|
||||
#<probe_slow_fr> = #3015 (=0)
|
||||
#<probe_fast_fr> = #3016 (=10.0)
|
||||
#<probe_traverse_fr> = #3017 (=50)
|
||||
#<max_xy_distance> = #3018 (=0.5000)
|
||||
#<xy_clearance> = #3019 (=0.1000)
|
||||
#<max_z_distance> = #3020 (=0.5000)
|
||||
#<z_clearance> = #3021 (=0.1000)
|
||||
#<extra_probe_depth> = #3022 (=0.0000)
|
||||
#<step_off_width> = #3023 (=0.5000)
|
||||
#<probe_mode> = #3030 (=0)
|
||||
#<calibration_offset> = #3032 (=0)
|
||||
|
||||
(Cancel G92 offsets)
|
||||
G92.1
|
||||
|
||||
#<workspace_x> = #[5201 + [20 * #5220]]
|
||||
#<workspace_y> = #[5202 + [20 * #5220]]
|
||||
|
||||
(Probe Tool Safety Check)
|
||||
o100 if [#5400 NE #<probe_tool_number>]
|
||||
(MSG, Specified probe tool #<probe_tool_number> not in spindle, aborting)
|
||||
o<probe_back_right_inside_corner> return
|
||||
o100 endif
|
||||
|
||||
(Probe Diameter)
|
||||
#<probe_diameter> = #5410
|
||||
|
||||
(Probing depth from the z probed clearance height, used for z moves)
|
||||
#<z_probe_stack> = [#<z_clearance> + #<probe_diameter> + #<extra_probe_depth>]
|
||||
|
||||
(Call sub "probe_z_minus_sub" to Probe top of Workpiece)
|
||||
o<probe_z_minus_sub> call [#3014][#3015][#3016][#3017][#3020][#3021][#3030]
|
||||
|
||||
(Probe X Positioning Move, Step Off Width X and Y)
|
||||
G91
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 X-[#<step_off_width>] Y-[#<step_off_width>]
|
||||
|
||||
(Probe X Positioning Move, to Probing Depth)
|
||||
F[#<probe_fast_fr>]
|
||||
G38.3 Z-[#<z_probe_stack>]
|
||||
|
||||
G90
|
||||
(Current X Position including offsets in current program units)
|
||||
#<x_start> = #5420
|
||||
|
||||
(Call sub "probe_x_plus" to Probe x+ side of Workpiece)
|
||||
o<probe_x_plus> call [#3014][#3015][#3016][#3017][#3018][#3019][#3032]
|
||||
|
||||
#<x_plus_zero_edge> = #<_value>
|
||||
|
||||
(value returned safety check, aborts if no value returned)
|
||||
o110 if [#<probe_mode> EQ 1 AND #<_value_returned> NE 1]
|
||||
(MSG, Missing X Sub returned edge parameter, aborting)
|
||||
o<probe_back_right_inside_corner> return
|
||||
o110 endif
|
||||
|
||||
(move to X start Position)
|
||||
G90
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 X[#<x_start>]
|
||||
|
||||
(Current Y Position including offsets in current program units)
|
||||
#<y_start> = #5421
|
||||
|
||||
(Call sub "probe_y_plus" to Probe y+ side of Workpiece)
|
||||
o<probe_y_plus> call [#3014][#3015][#3016][#3017][#3018][#3019][#3032]
|
||||
|
||||
#<y_plus_zero_edge> = #<_value>
|
||||
|
||||
(value returned safety check, aborts if no value returned)
|
||||
o120 if [#<probe_mode> EQ 1 AND #<_value_returned> NE 1]
|
||||
(MSG, Missing Y Sub returned edge parameter, aborting)
|
||||
o<probe_back_right_inside_corner> return
|
||||
o120 endif
|
||||
|
||||
(move to Y start Position)
|
||||
G90
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 Y[#<y_start>]
|
||||
|
||||
(Probe Completion Move to Z Clearance Plane, and X Zero, Y Zero)
|
||||
G91
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 Z[#<z_probe_stack>]
|
||||
G90
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 X[#<x_plus_zero_edge>] Y[#<y_plus_zero_edge>]
|
||||
|
||||
(probe mode rules for WCO or probe position measuring only)
|
||||
o130 if [#<probe_mode> EQ 0]
|
||||
(Record Zero in selected axes and WCO)
|
||||
G10 L2 P#5220 X[#<x_plus_zero_edge> + #<workspace_x>]
|
||||
G10 L2 P#5220 Y[#<y_plus_zero_edge> + #<workspace_y>]
|
||||
o<probe_back_right_inside_corner> return
|
||||
o130 endif
|
||||
|
||||
o<probe_back_right_inside_corner> endsub
|
||||
|
||||
M2 (end program)
|
||||
@@ -0,0 +1,109 @@
|
||||
(author: Chris P)
|
||||
(version: 0.2)
|
||||
(date: 06/27/24)
|
||||
|
||||
(Probe back right top corner for x,y,z 0,0,0 position)
|
||||
(Start probe position is over back right corner of stock)
|
||||
(inside the step off width square and within max z distance)
|
||||
(ensure all settings have been set properly according to help diagrams)
|
||||
|
||||
o<probe_back_right_top_corner> sub
|
||||
|
||||
(uses NGCGUI style arg spec)
|
||||
(number after "=" in comment is default value)
|
||||
#<probe_tool_number> = #3014 (=99)
|
||||
#<probe_slow_fr> = #3015 (=0)
|
||||
#<probe_fast_fr> = #3016 (=10.0)
|
||||
#<probe_traverse_fr> = #3017 (=50)
|
||||
#<max_xy_distance> = #3018 (=0.5000)
|
||||
#<xy_clearance> = #3019 (=0.1000)
|
||||
#<max_z_distance> = #3020 (=0.5000)
|
||||
#<z_clearance> = #3021 (=0.1000)
|
||||
#<extra_probe_depth> = #3022 (=0.0000)
|
||||
#<step_off_width> = #3023 (=0.5000)
|
||||
#<probe_mode> = #3030 (=0)
|
||||
#<calibration_offset> = #3032 (=0)
|
||||
|
||||
(Cancel G92 offsets)
|
||||
G92.1
|
||||
|
||||
#<workspace_x> = #[5201 + [20 * #5220]]
|
||||
#<workspace_y> = #[5202 + [20 * #5220]]
|
||||
|
||||
(Probe Tool Safety Check)
|
||||
o100 if [#5400 NE #<probe_tool_number>]
|
||||
(MSG, Specified probe tool #<probe_tool_number> not in spindle, aborting)
|
||||
o<probe_back_right_top_corner> return
|
||||
o100 endif
|
||||
|
||||
(Probe Diameter)
|
||||
#<probe_diameter> = #5410
|
||||
|
||||
(Probing depth from the z probed clearance height, used for z moves)
|
||||
#<z_probe_stack> = [#<z_clearance> + #<probe_diameter> + #<extra_probe_depth>]
|
||||
|
||||
(Call sub "probe_z_minus_sub" to Probe top of Workpiece)
|
||||
o<probe_z_minus_sub> call [#3014][#3015][#3016][#3017][#3020][#3021][#3030]
|
||||
|
||||
(Probe X Positioning Move, Step Off Width)
|
||||
G91
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 X[#<step_off_width>]
|
||||
|
||||
(Probe X Positioning Move, to Probing Depth)
|
||||
F[#<probe_fast_fr>]
|
||||
G38.3 Z-[#<z_probe_stack>]
|
||||
|
||||
(Call sub "probe_x_minus" to Probe x- side of Workpiece)
|
||||
o<probe_x_minus> call [#3014][#3015][#3016][#3017][#3018][#3019][#3032]
|
||||
|
||||
#<x_minus_zero_edge> = #<_value>
|
||||
|
||||
(value returned safety check, aborts if no value returned)
|
||||
o110 if [#<probe_mode> EQ 1 AND #<_value_returned> NE 1]
|
||||
(MSG, Missing X Sub returned edge parameter, aborting)
|
||||
o<probe_back_right_top_corner> return
|
||||
o110 endif
|
||||
|
||||
(Probe Y Positioning Move, up to Z clearance plane)
|
||||
G91
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 Z[#<z_probe_stack>]
|
||||
(Probe Y Positioning Move)
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 X-[#<step_off_width>] Y[#<step_off_width>]
|
||||
|
||||
(Probe Y Positioning Move,to Probing Depth)
|
||||
F[#<probe_fast_fr>]
|
||||
G38.3 Z-[#<z_probe_stack>]
|
||||
|
||||
(Call sub "probe_y_minus" to Probe y- side of Workpiece)
|
||||
o<probe_y_minus> call [#3014][#3015][#3016][#3017][#3018][#3019][#3032]
|
||||
|
||||
#<y_minus_zero_edge> = #<_value>
|
||||
|
||||
(value returned safety check, aborts if no value returned)
|
||||
o120 if [#<probe_mode> EQ 1 AND #<_value_returned> NE 1]
|
||||
(MSG, Missing Y Sub returned edge parameter, aborting)
|
||||
o<probe_back_right_top_corner> return
|
||||
o120 endif
|
||||
|
||||
(Probe Completion Move to Z Clearance Plane, and XY Zero)
|
||||
G91
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 Z[#<z_probe_stack>]
|
||||
G90
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 X[#<x_minus_zero_edge>] Y[#<y_minus_zero_edge>]
|
||||
|
||||
(probe mode rules for WCO or probe position measuring only)
|
||||
o130 if [#<probe_mode> EQ 0]
|
||||
(Record Zero in selected axes and WCO)
|
||||
G10 L2 P#5220 X[#<x_minus_zero_edge> + #<workspace_x>]
|
||||
G10 L2 P#5220 Y[#<y_minus_zero_edge> + #<workspace_y>]
|
||||
o<probe_back_right_top_corner> return
|
||||
o130 endif
|
||||
|
||||
o<probe_back_right_top_corner> endsub
|
||||
|
||||
M2 (end program)
|
||||
@@ -0,0 +1,84 @@
|
||||
(author: Chris P)
|
||||
(version: 0.4)
|
||||
(date: 06/27/24)
|
||||
|
||||
(Probe back top side for y,z 0,0 position)
|
||||
(Start probe position is over back edge of stock)
|
||||
(inside the step off width distance and within max z distance)
|
||||
(ensure all settings have been set properly according to help diagrams)
|
||||
|
||||
o<Probe_back_top_side> sub
|
||||
|
||||
(uses NGCGUI style arg spec)
|
||||
(number after "=" in comment is default value)
|
||||
#<probe_tool_number> = #3014 (=99)
|
||||
#<probe_slow_fr> = #3015 (=0)
|
||||
#<probe_fast_fr> = #3016 (=10.0)
|
||||
#<probe_traverse_fr> = #3017 (=50)
|
||||
#<max_xy_distance> = #3018 (=0.5000)
|
||||
#<xy_clearance> = #3019 (=0.1000)
|
||||
#<max_z_distance> = #3020 (=0.5000)
|
||||
#<z_clearance> = #3021 (=0.1000)
|
||||
#<extra_probe_depth> = #3022 (=0.0000)
|
||||
#<step_off_width> = #3023 (=0.5000)
|
||||
#<probe_mode> = #3030 (=0)
|
||||
#<calibration_offset> = #3032 (=0)
|
||||
|
||||
(Cancel G92 offsets)
|
||||
G92.1
|
||||
|
||||
#<workspace_y> = #[5202 + [20 * #5220]]
|
||||
|
||||
(Probe Tool Safety Check)
|
||||
o100 if [#5400 NE #<probe_tool_number>]
|
||||
(MSG, Specified probe tool #<probe_tool_number> not in spindle, aborting)
|
||||
o<Probe_back_top_side> return
|
||||
o100 endif
|
||||
|
||||
(Probe Diameter)
|
||||
#<probe_diameter> = #5410
|
||||
|
||||
(Probing depth from the z probed clearance height, used for z moves)
|
||||
#<z_probe_stack> = [#<z_clearance> + #<probe_diameter> + #<extra_probe_depth>]
|
||||
|
||||
(Call sub "probe_z_minus_sub" to Probe top of Workpiece)
|
||||
o<probe_z_minus_sub> call [#3014][#3015][#3016][#3017][#3020][#3021][#3030]
|
||||
|
||||
(Probe Y Positioning Move, Step Off Width)
|
||||
G91
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 Y[#<step_off_width>]
|
||||
|
||||
(Probe Y Positioning Move, to Probing Depth)
|
||||
F[#<probe_fast_fr>]
|
||||
G38.3 Z-[#<z_probe_stack>]
|
||||
|
||||
(Call sub "probe_y_minus" to Probe y- side of Workpiece)
|
||||
o<probe_y_minus> call [#3014][#3015][#3016][#3017][#3018][#3019][#3032]
|
||||
|
||||
#<y_minus_zero_edge> = #<_value>
|
||||
|
||||
(value returned safety check, aborts if no value returned)
|
||||
o110 if [#<probe_mode> EQ 1 AND #<_value_returned> NE 1]
|
||||
(MSG, Missing Y Sub returned edge parameter, aborting)
|
||||
o<probe_back_top_side> return
|
||||
o110 endif
|
||||
|
||||
(Probe Completion Move to Z Clearance Plane, and Y Zero)
|
||||
G91
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 Z[#<z_probe_stack>]
|
||||
G90
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 Y[#<y_minus_zero_edge>]
|
||||
|
||||
(probe mode rules for WCO or probe position measuring only)
|
||||
o120 if [#<probe_mode> EQ 0]
|
||||
(Record Zero in selected axes and WCO)
|
||||
G10 L2 P#5220 Y[#<y_minus_zero_edge> + #<workspace_y>]
|
||||
o<probe_back_top_side> return
|
||||
o120 endif
|
||||
|
||||
o<Probe_back_top_side> endsub
|
||||
|
||||
M2 (end program)
|
||||
@@ -0,0 +1,8 @@
|
||||
o<probe_cal_reset> sub
|
||||
|
||||
#3032 = 0
|
||||
(DEBUG, EVAL[vcp.getWidget{"calibration_offset_3032"}.setValue{#3032}])
|
||||
|
||||
o<probe_cal_reset> endsub
|
||||
|
||||
M2 (end program)
|
||||
323
configs/probe_basic_lathe/subroutines/probe_cal_round_boss.ngc
Normal file
323
configs/probe_basic_lathe/subroutines/probe_cal_round_boss.ngc
Normal file
@@ -0,0 +1,323 @@
|
||||
(author: Chris P)
|
||||
(version: 0.2)
|
||||
(date: 06/27/24)
|
||||
|
||||
(Probe calibration offset using defined diam round boss)
|
||||
(Start probe position is over center of stock in X and Y axis)
|
||||
(within max z distance, ensure all settings have been)
|
||||
(set properly according to help diagrams)
|
||||
|
||||
o<probe_cal_round_boss> sub
|
||||
|
||||
(uses NGCGUI style arg spec)
|
||||
(number after "=" in comment is default value)
|
||||
#<probe_tool_number> = #3014 (=99)
|
||||
#<probe_slow_fr> = #3015 (=0)
|
||||
#<probe_fast_fr> = #3016 (=10.0)
|
||||
#<probe_traverse_fr> = #3017 (=50)
|
||||
#<max_xy_distance> = #3018 (=0.5000)
|
||||
#<xy_clearance> = #3019 (=0.1000)
|
||||
#<max_z_distance> = #3020 (=0.5000)
|
||||
#<z_clearance> = #3021 (=0.1000)
|
||||
#<extra_probe_depth> = #3022 (=0.0000)
|
||||
#<step_off_width> = #3023 (=0.5000)
|
||||
#<probe_mode> = #3030 (=0)
|
||||
#<cal_diameter> = #3033 (=0)
|
||||
#<sq_cal_axis> = #3036 (=0)
|
||||
|
||||
(Cancel G92 offsets)
|
||||
G92.1
|
||||
|
||||
#<workspace_x> = #[5201 + [20 * #5220]]
|
||||
#<workspace_y> = #[5202 + [20 * #5220]]
|
||||
#<workspace_z> = #[5203 + [20 * #5220]]
|
||||
|
||||
(clear current probe calibration offset)
|
||||
#3032 = 0
|
||||
(DEBUG, EVAL[vcp.getWidget{"calibration_offset_3032"}.setValue{#3032}])
|
||||
|
||||
(Probe Tool Safety Check)
|
||||
o100 if [#5400 NE #<probe_tool_number>]
|
||||
(MSG, Specified probe tool #<probe_tool_number> not in spindle, aborting)
|
||||
o<probe_cal_round_boss> return
|
||||
o100 endif
|
||||
|
||||
(Probe Diameter)
|
||||
#<probe_diameter> = #5410
|
||||
|
||||
(Probe Radius)
|
||||
#<probe_radius> = [#<probe_diameter> / 2]
|
||||
|
||||
(Probe Centerline Offset)
|
||||
#<probe_center_offset> = [#<probe_radius>]
|
||||
|
||||
(remove probe tip diam and cal offset from probed width calculations)
|
||||
#<probe_diameter_offset> = [#<probe_diameter>]
|
||||
|
||||
#<z_probe_stack> = [#<z_clearance> + #<probe_diameter> + #<extra_probe_depth>]
|
||||
|
||||
(Call sub "probe_z_minus_sub" to Probe top of Workpiece)
|
||||
o<probe_z_minus_sub> call [#3014][#3015][#3016][#3017][#3020][#3021][#3030][#3032]
|
||||
|
||||
(Probe X Positioning Move, X hint/2 + Step Off Width)
|
||||
G91
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 X-[#<cal_diameter>/2 + #<step_off_width>]
|
||||
|
||||
(Probe X Positioning Move, to Probing Depth)
|
||||
F[#<probe_fast_fr>]
|
||||
G38.3 Z-[#<z_probe_stack>]
|
||||
|
||||
(Call sub "probe_x_plus" to Probe x+ side of Workpiece)
|
||||
o<probe_x_plus> call [#3014][#3015][#3016][#3017][#3018][#3019][#3032]
|
||||
|
||||
#<x_plus_probed> = #5061
|
||||
|
||||
(first side Probe Completion Move to Z Clearance Plane)
|
||||
G91
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 Z[#<z_probe_stack>]
|
||||
|
||||
(Positioning move in X, X Hint + Step Off Width at Rapid Speed)
|
||||
G91
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 X[#<cal_diameter> + #<step_off_width> + #<xy_clearance>]
|
||||
|
||||
(Probe X Positioning Move, to Probing Depth)
|
||||
F[#<probe_fast_fr>]
|
||||
G38.3 Z-[#<z_probe_stack>]
|
||||
|
||||
(Call sub "probe_x_minus" to Probe x- side of Workpiece)
|
||||
o<probe_x_minus> call [#3014][#3015][#3016][#3017][#3018][#3019][#3032]
|
||||
|
||||
#<x_minus_probed> = #5061
|
||||
|
||||
(probed center calulation)
|
||||
#<x_center_probed> = [[#<x_minus_probed> + #<x_plus_probed>] / 2]
|
||||
|
||||
#1002 = #<x_center_probed>
|
||||
(DEBUG, EVAL[vcp.getWidget{"x_center_probed"}.setValue{#1002}])
|
||||
|
||||
G91
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 Z[#<z_probe_stack>]
|
||||
G90
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 X[#<x_center_probed>]
|
||||
|
||||
(Probe Y Positioning Move, Y hint/2 + Step Off Width)
|
||||
G91
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 Y-[#<cal_diameter>/2 + #<step_off_width>]
|
||||
|
||||
(Probe Y Positioning Move, to Probing Depth)
|
||||
F[#<probe_fast_fr>]
|
||||
G38.3 Z-[#<z_probe_stack>]
|
||||
|
||||
(Call sub "probe_y_plus" to Probe y+ side of Workpiece)
|
||||
o<probe_y_plus> call [#3014][#3015][#3016][#3017][#3018][#3019][#3032]
|
||||
|
||||
#<y_plus_probed> = #5062
|
||||
|
||||
(first side Probe Completion Move to Z Clearance Plane)
|
||||
G91
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 Z[#<z_probe_stack>]
|
||||
|
||||
(Positioning move in Y, Y Hint + Step Off Width at Rapid Speed)
|
||||
G91
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 Y[#<cal_diameter> + #<step_off_width> + #<xy_clearance>]
|
||||
|
||||
(Probe Y Positioning Move, to Probing Depth)
|
||||
F[#<probe_fast_fr>]
|
||||
G38.3 Z-[#<z_probe_stack>]
|
||||
|
||||
(Call sub "probe_y_minus" to Probe y- side of Workpiece)
|
||||
o<probe_y_minus> call [#3014][#3015][#3016][#3017][#3018][#3019][#3032]
|
||||
|
||||
#<y_minus_probed> = #5062
|
||||
|
||||
(probed center calulation)
|
||||
#<y_center_probed> = [[#<y_minus_probed> + #<y_plus_probed>] / 2]
|
||||
|
||||
#1004 = #<y_center_probed>
|
||||
(DEBUG, EVAL[vcp.getWidget{"y_center_probed"}.setValue{#1004}])
|
||||
|
||||
(Move to z clearance plane)
|
||||
G91
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 Z[#<z_probe_stack>]
|
||||
|
||||
(Move to Y Center)
|
||||
G90
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 Y[#<y_center_probed>]
|
||||
|
||||
(Probe X Positioning Move, X hint/2 + Step Off Width)
|
||||
G91
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 X-[#<cal_diameter>/2 + #<step_off_width>]
|
||||
|
||||
(Probe X Positioning Move, to Probing Depth)
|
||||
F[#<probe_fast_fr>]
|
||||
G38.3 Z-[#<z_probe_stack>]
|
||||
|
||||
(Call sub "probe_x_plus" to Probe x+ side of Workpiece)
|
||||
o<probe_x_plus> call [#3014][#3015][#3016][#3017][#3018][#3019][#3032]
|
||||
|
||||
#<x_plus_probed> = #5061
|
||||
|
||||
(first side Probe Completion Move to Z Clearance Plane)
|
||||
G91
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 Z[#<z_probe_stack>]
|
||||
|
||||
(Positioning move in X, X Hint + Step Off Width at Rapid Speed)
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 X[#<cal_diameter> + #<step_off_width> + #<xy_clearance>]
|
||||
|
||||
(Probe X Positioning Move, to Probing Depth)
|
||||
F[#<probe_fast_fr>]
|
||||
G38.3 Z-[#<z_probe_stack>]
|
||||
|
||||
(Call sub "probe_x_minus" to Probe x- side of Workpiece)
|
||||
o<probe_x_minus> call [#3014][#3015][#3016][#3017][#3018][#3019][#3032]
|
||||
|
||||
#<x_minus_probed> = #5061
|
||||
|
||||
(probed center calulation)
|
||||
#<x_center_probed> = [[#<x_minus_probed> + #<x_plus_probed>] / 2]
|
||||
|
||||
(calculate X Width Probed)
|
||||
o110 if [#<x_minus_probed> GT #<x_plus_probed>]
|
||||
#<x_raw_width> = [#<x_minus_probed> - #<x_plus_probed>]
|
||||
o110 else
|
||||
#<x_raw_width> = [#<x_plus_probed> - #<x_minus_probed>]
|
||||
o110 endif
|
||||
|
||||
(Completed probed width calculations)
|
||||
#<x_probed_width> = [#<x_raw_width> - #<probe_diameter_offset>]
|
||||
|
||||
#1001 = #<x_probed_width>
|
||||
(DEBUG, EVAL[vcp.getWidget{"x_probed_width"}.setValue{#1001}])
|
||||
|
||||
#1002 = #<x_center_probed>
|
||||
(DEBUG, EVAL[vcp.getWidget{"x_center_probed"}.setValue{#1002}])
|
||||
|
||||
G91
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 Z[#<z_probe_stack>]
|
||||
G90
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 X[#<x_center_probed>]
|
||||
|
||||
(Probe Y Positioning Move, Y hint/2 + Step Off Width)
|
||||
G91
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 Y-[#<cal_diameter>/2 + #<step_off_width>]
|
||||
|
||||
(Probe Y Positioning Move, to Probing Depth)
|
||||
F[#<probe_fast_fr>]
|
||||
G38.3 Z-[#<z_probe_stack>]
|
||||
|
||||
(Call sub "probe_y_plus" to Probe y+ side of Workpiece)
|
||||
o<probe_y_plus> call [#3014][#3015][#3016][#3017][#3018][#3019][#3032]
|
||||
|
||||
#<y_plus_probed> = #5062
|
||||
|
||||
(first side Probe Completion Move to Z Clearance Plane)
|
||||
G91
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 Z[#<z_probe_stack>]
|
||||
|
||||
(Positioning move in Y, Y Hint + Step Off Width at Rapid Speed)
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 Y[#<cal_diameter> + #<step_off_width> + #<xy_clearance>]
|
||||
|
||||
(Probe Y Positioning Move, to Probing Depth)
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 Z-[#<z_probe_stack>]
|
||||
|
||||
(Call sub "probe_y_minus" to Probe y- side of Workpiece)
|
||||
o<probe_y_minus> call [#3014][#3015][#3016][#3017][#3018][#3019][#3032]
|
||||
|
||||
#<y_minus_probed> = #5062
|
||||
|
||||
(probed center calulation)
|
||||
#<y_center_probed> = [[#<y_minus_probed> + #<y_plus_probed>] / 2]
|
||||
|
||||
(calculate Y Width Probed)
|
||||
o120 if [#<y_minus_probed> GT #<y_plus_probed>]
|
||||
#<y_raw_width> = [#<y_minus_probed> - #<y_plus_probed>]
|
||||
o120 else
|
||||
#<y_raw_width> = [#<y_plus_probed> - #<y_minus_probed>]
|
||||
o<probe_round_boss> return
|
||||
o120 endif
|
||||
|
||||
(Completed probed width calculations)
|
||||
#<y_probed_width> = [#<y_raw_width> - #<probe_diameter_offset>]
|
||||
|
||||
#1003 = #<y_probed_width>
|
||||
(DEBUG, EVAL[vcp.getWidget{"y_probed_width"}.setValue{#1003}])
|
||||
|
||||
#1004 = #<y_center_probed>
|
||||
(DEBUG, EVAL[vcp.getWidget{"y_center_probed"}.setValue{#1004}])
|
||||
|
||||
#<averaged_diam> = [[#<x_probed_width> + #<y_probed_width>] / 2]
|
||||
|
||||
#1010 = #<averaged_diam>
|
||||
(DEBUG, EVAL[vcp.getWidget{"averaged_diam"}.setValue{#1010}])
|
||||
|
||||
G91
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 Z[#<z_probe_stack>]
|
||||
G90
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 X[#<x_center_probed>] Y[#<y_center_probed>]
|
||||
|
||||
o130 if [#<cal_diameter> GT #<x_probed_width>]
|
||||
(calculate calibration error and adjust calibration offset)
|
||||
#<x_cal_error> = [[#<cal_diameter> - #<x_probed_width>] / 2]
|
||||
#<new_x_cal_offset> = [#<x_cal_error>]
|
||||
o130 else
|
||||
#<x_cal_error> = [[#<x_probed_width> - #<cal_diameter>] / 2]
|
||||
#<new_x_cal_offset> = [#<x_cal_error>]
|
||||
o130 endif
|
||||
|
||||
o140 if [#<cal_diameter> GT #<y_probed_width>]
|
||||
(calculate calibration error and adjust calibration offset)
|
||||
#<y_cal_error> = [[#<cal_diameter> - #<y_probed_width>] / 2]
|
||||
#<new_y_cal_offset> = [#<y_cal_error>]
|
||||
o140 else
|
||||
#<y_cal_error> = [[#<y_probed_width> - #<cal_diameter>] / 2]
|
||||
#<new_y_cal_offset> = [#<y_cal_error>]
|
||||
o140 endif
|
||||
|
||||
#<new_avg_cal_offset> = [[#<new_x_cal_offset> + #<new_y_cal_offset>] / 2]
|
||||
|
||||
o150 if [#<sq_cal_axis> EQ 0]
|
||||
#3032 = [ABS[#<new_avg_cal_offset>]]
|
||||
(DEBUG, EVAL[vcp.getWidget{"calibration_offset_3032"}.setValue{#3032}])
|
||||
o150 else if [#<sq_cal_axis> EQ 1]
|
||||
#3032 = [ABS[#<new_x_cal_offset>]]
|
||||
(DEBUG, EVAL[vcp.getWidget{"calibration_offset_3032"}.setValue{#3032}])
|
||||
o150 else
|
||||
#3032 = [ABS[#<new_y_cal_offset>]]
|
||||
(DEBUG, EVAL[vcp.getWidget{"calibration_offset_3032"}.setValue{#3032}])
|
||||
o150 endif
|
||||
|
||||
#<x_zero> = [#<x_center_probed> + #<workspace_x>]
|
||||
|
||||
#<y_zero> = [#<y_center_probed> + #<workspace_y>]
|
||||
|
||||
(probe mode rules for WCO or probe position measuring only)
|
||||
o160 if [#<probe_mode> EQ 0]
|
||||
(Record XY Zero in selected WCO)
|
||||
G10 L2 P#5220 X[#<x_zero>] Y[#<y_zero>]
|
||||
o<probe_cal_round_boss> return
|
||||
o160 endif
|
||||
|
||||
o<probe_cal_round_boss> endsub
|
||||
|
||||
M2 (end program)
|
||||
223
configs/probe_basic_lathe/subroutines/probe_cal_round_pocket.ngc
Normal file
223
configs/probe_basic_lathe/subroutines/probe_cal_round_pocket.ngc
Normal file
@@ -0,0 +1,223 @@
|
||||
(author: Chris P)
|
||||
(version: 0.2)
|
||||
(date: 06/27/24)
|
||||
|
||||
(Probe calibration offset using defined diam round pocket)
|
||||
(Start probe position is over left side edge of pocket wall)
|
||||
(inside the step off width distance and within max z distance)
|
||||
(ensure all settings have been set properly according to help diagrams)
|
||||
|
||||
o<probe_cal_round_pocket> sub
|
||||
|
||||
(uses NGCGUI style arg spec)
|
||||
(number after "=" in comment is default value)
|
||||
#<probe_tool_number> = #3014 (=99)
|
||||
#<probe_slow_fr> = #3015 (=0)
|
||||
#<probe_fast_fr> = #3016 (=10.0)
|
||||
#<probe_traverse_fr> = #3017 (=50)
|
||||
#<max_xy_distance> = #3018 (=0.5000)
|
||||
#<xy_clearance> = #3019 (=0.1000)
|
||||
#<max_z_distance> = #3020 (=0.5000)
|
||||
#<z_clearance> = #3021 (=0.1000)
|
||||
#<extra_probe_depth> = #3022 (=0.0000)
|
||||
#<step_off_width> = #3023 (=0.5000)
|
||||
#<probe_mode> = #3030 (=0)
|
||||
#<cal_diameter> = #3033 (=0)
|
||||
#<sq_cal_axis> = #3036 (=0)
|
||||
|
||||
(Cancel G92 offsets)
|
||||
G92.1
|
||||
|
||||
(Cancel Feedrate Override)
|
||||
M50 P0
|
||||
|
||||
#<workspace_x> = #[5201 + [20 * #5220]]
|
||||
#<workspace_y> = #[5202 + [20 * #5220]]
|
||||
|
||||
(clear current probe calibration offset)
|
||||
#3032 = 0
|
||||
(DEBUG, EVAL[vcp.getWidget{"calibration_offset_3032"}.setValue{#3032}])
|
||||
|
||||
(Probe Tool Safety Check)
|
||||
o100 if [#5400 NE #<probe_tool_number>]
|
||||
(MSG, Specified probe tool #<probe_tool_number> not in spindle, aborting)
|
||||
M50 P1
|
||||
o<probe_cal_round_pocket> return
|
||||
o100 endif
|
||||
|
||||
(Probe Diameter)
|
||||
#<probe_diameter> = #5410
|
||||
|
||||
(remove probe tip diam and cal offset from probed width calculations)
|
||||
#<probe_diameter_offset> = [#<probe_diameter>]
|
||||
|
||||
#<z_probe_stack> = [#<z_clearance> + #<probe_diameter> + #<extra_probe_depth>]
|
||||
|
||||
(Call sub "probe_z_minus_sub" to Probe top of Workpiece)
|
||||
o<probe_z_minus_sub> call [#3014][#3015][#3016][#3017][#3020][#3021][#3030][#3032]
|
||||
|
||||
(Probe X Positioning Move, Step Off Width)
|
||||
G91
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 X[#<step_off_width>]
|
||||
|
||||
(Probe X Positioning Move, to Probing Depth)
|
||||
F[#<probe_fast_fr>]
|
||||
G38.3 Z-[#<z_probe_stack>]
|
||||
|
||||
(Call sub "probe_x_minus" to Probe x-)
|
||||
o<probe_x_minus> call [#3014][#3015][#3016][#3017][#3018][#3019][#3032]
|
||||
|
||||
#<x_minus_probed> = #5061
|
||||
|
||||
(Call sub "probe_x_plus" to Probe x+)
|
||||
o<probe_x_plus> call [#3014][#3015][#3016][3017][#3018 + #3033][#3019][#3032]
|
||||
|
||||
#<x_plus_probed> = #5061
|
||||
|
||||
(probed center calculation)
|
||||
#<x_center_probed> = [[#<x_plus_probed> + #<x_minus_probed>] / 2]
|
||||
|
||||
#1002 = #<x_center_probed>
|
||||
(DEBUG, EVAL[vcp.getWidget{"x_center_probed"}.setValue{#1002}])
|
||||
|
||||
(Probe Completion Move to Z Clearance Plane, and X Zero)
|
||||
G90
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 X[#<x_center_probed>]
|
||||
|
||||
(Call sub "probe_y_plus" to Probe Y+)
|
||||
o<probe_y_plus> call [#3014][#3015][#3016][3017][#3018 + #3033 / 2][#3019][#3032]
|
||||
|
||||
#<y_plus_probed> = #5062
|
||||
|
||||
(Call sub "probe_y_minus" to Probe Y-)
|
||||
o<probe_y_minus> call [#3014][#3015][#3016][3017][#3018 + #3033][#3019][#3032]
|
||||
|
||||
#<y_minus_probed> = #5062
|
||||
|
||||
(probed center calculation)
|
||||
#<y_center_probed> = [[#<y_plus_probed> + #<y_minus_probed>] / 2]
|
||||
|
||||
#1004 = #<y_center_probed>
|
||||
(DEBUG, EVAL[vcp.getWidget{"y_center_probed"}.setValue{#1004}])
|
||||
|
||||
(Probe Completion Move to Z Clearance Plane, Y Zero)
|
||||
G90
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 Y[#<y_center_probed>]
|
||||
|
||||
(Call sub "probe_x_minus" to Probe x-)
|
||||
o<probe_x_minus> call [#3014][#3015][#3016][3017][#3018 + #3033 / 2][#3019][#3032]
|
||||
|
||||
#<x_minus_probed> = #5061
|
||||
|
||||
(Call sub "probe_x_plus" to Probe x+)
|
||||
o<probe_x_plus> call [#3014][#3015][#3016][3017][#3018 + #3033][#3019][#3032]
|
||||
|
||||
#<x_plus_probed> = #5061
|
||||
|
||||
(probed center calculation)
|
||||
#<x_center_probed> = [[#<x_plus_probed> + #<x_minus_probed>] / 2]
|
||||
|
||||
(calculate X Width Probed)
|
||||
#<raw_width> = [#<x_plus_probed> - #<x_minus_probed>]
|
||||
|
||||
(Completed probed width calculations)
|
||||
#<x_probed_width> = [#<raw_width> + #<probe_diameter_offset>]
|
||||
|
||||
#1001 = #<x_probed_width>
|
||||
(DEBUG, EVAL[vcp.getWidget{"x_probed_width"}.setValue{#1001}])
|
||||
|
||||
#1002 = #<x_center_probed>
|
||||
(DEBUG, EVAL[vcp.getWidget{"x_center_probed"}.setValue{#1002}])
|
||||
|
||||
G90
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 X[#<x_center_probed>]
|
||||
|
||||
(Call sub "probe_y_plus" to Probe Y+)
|
||||
o<probe_y_plus> call [#3014][#3015][#3016][3017][#3018 + #3033 / 2][#3019][#3032]
|
||||
|
||||
#<y_plus_probed> = #5062
|
||||
|
||||
(Call sub "probe_y_minus" to Probe Y-)
|
||||
o<probe_y_minus> call [#3014][#3015][#3016][3017][#3018 + #3033][#3019][#3032]
|
||||
|
||||
#<y_minus_probed> = #5062
|
||||
|
||||
(probed center calculation)
|
||||
#<y_center_probed> = [[#<y_plus_probed> + #<y_minus_probed>] / 2]
|
||||
|
||||
(calculate Y Width Probed)
|
||||
#<raw_width> = [#<y_plus_probed> - #<y_minus_probed>]
|
||||
|
||||
(Completed probed diameter calculations)
|
||||
#<y_probed_width> = [#<raw_width> + #<probe_diameter_offset>]
|
||||
|
||||
#1003 = #<y_probed_width>
|
||||
(DEBUG, EVAL[vcp.getWidget{"y_probed_width"}.setValue{#1003}])
|
||||
|
||||
#1004 = #<y_center_probed>
|
||||
(DEBUG, EVAL[vcp.getWidget{"y_center_probed"}.setValue{#1004}])
|
||||
|
||||
#<averaged_diam> = [[#<x_probed_width> + #<y_probed_width>] / 2]
|
||||
|
||||
#1010 = #<averaged_diam>
|
||||
(DEBUG, EVAL[vcp.getWidget{"averaged_diam"}.setValue{#1010}])
|
||||
|
||||
G90
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 Y[#<y_center_probed>]
|
||||
G91
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 Z[#<z_probe_stack>]
|
||||
|
||||
o110 if [#<cal_diameter> GT #<x_probed_width>]
|
||||
(calculate calibration error and adjust calibration offset)
|
||||
#<x_cal_error> = [[#<cal_diameter> - #<x_probed_width>] / 2]
|
||||
#<new_x_cal_offset> = [#<x_cal_error>]
|
||||
o110 else
|
||||
#<x_cal_error> = [[#<x_probed_width> - #<cal_diameter>] / 2]
|
||||
#<new_x_cal_offset> = [#<x_cal_error>]
|
||||
o110 endif
|
||||
|
||||
o120 if [#<cal_diameter> GT #<y_probed_width>]
|
||||
(calculate calibration error and adjust calibration offset)
|
||||
#<y_cal_error> = [[#<cal_diameter> - #<y_probed_width>] / 2]
|
||||
#<new_y_cal_offset> = [#<y_cal_error>]
|
||||
o120 else
|
||||
#<y_cal_error> = [[#<y_probed_width> - #<cal_diameter>] / 2]
|
||||
#<new_y_cal_offset> = [#<y_cal_error>]
|
||||
o120 endif
|
||||
|
||||
#<new_avg_cal_offset> = [[#<new_x_cal_offset> + #<new_y_cal_offset>] / 2]
|
||||
|
||||
o130 if [#<sq_cal_axis> EQ 0]
|
||||
#3032 = [ABS[#<new_avg_cal_offset>]]
|
||||
(DEBUG, EVAL[vcp.getWidget{"calibration_offset_3032"}.setValue{#3032}])
|
||||
o130 else if [#<sq_cal_axis> EQ 1]
|
||||
#3032 = [ABS[#<new_x_cal_offset>]]
|
||||
(DEBUG, EVAL[vcp.getWidget{"calibration_offset_3032"}.setValue{#3032}])
|
||||
o130 else
|
||||
#3032 = [ABS[#<new_y_cal_offset>]]
|
||||
(DEBUG, EVAL[vcp.getWidget{"calibration_offset_3032"}.setValue{#3032}])
|
||||
o130 endif
|
||||
|
||||
#<x_zero> = [#<x_center_probed> + #<workspace_x>]
|
||||
|
||||
#<y_zero> = [#<y_center_probed> + #<workspace_y>]
|
||||
|
||||
(probe mode rules for WCO or probe position measuring only)
|
||||
o140 if [#<probe_mode> EQ 0]
|
||||
(Record Y Zero in selected WCO)
|
||||
G10 L2 P#5220 X[#<x_zero>] Y[#<y_zero>]
|
||||
(Probe Completion Move to Z Clearance Plane, and X Zero, Y Zero)
|
||||
o140 endif
|
||||
|
||||
(Reinstate Feedrate Override)
|
||||
M50 P1
|
||||
|
||||
o<probe_cal_round_pocket> endsub
|
||||
|
||||
M2 (end program)
|
||||
218
configs/probe_basic_lathe/subroutines/probe_cal_square_boss.ngc
Normal file
218
configs/probe_basic_lathe/subroutines/probe_cal_square_boss.ngc
Normal file
@@ -0,0 +1,218 @@
|
||||
(author: Chris P)
|
||||
(version: 0.2)
|
||||
(date: 06/27/24)
|
||||
|
||||
(Probe calibration offset using defined width square boss)
|
||||
(Start probe position is over center of stock in X and Y axis)
|
||||
(within max z distance, ensure all settings have been)
|
||||
(set properly according to help diagrams)
|
||||
|
||||
o<probe_cal_square_boss> sub
|
||||
|
||||
(uses NGCGUI style arg spec)
|
||||
(number after "=" in comment is default value)
|
||||
#<probe_tool_number> = #3014 (=99)
|
||||
#<probe_slow_fr> = #3015 (=0)
|
||||
#<probe_fast_fr> = #3016 (=10.0)
|
||||
#<probe_traverse_fr> = #3017 (=50)
|
||||
#<max_xy_distance> = #3018 (=0.5000)
|
||||
#<xy_clearance> = #3019 (=0.1000)
|
||||
#<max_z_distance> = #3020 (=0.5000)
|
||||
#<z_clearance> = #3021 (=0.1000)
|
||||
#<extra_probe_depth> = #3022 (=0.0000)
|
||||
#<step_off_width> = #3023 (=0.5000)
|
||||
#<probe_mode> = #3030 (=0)
|
||||
#<x_cal_width> = #3034 (=0)
|
||||
#<y_cal_width> = #3035 (=0)
|
||||
#<sq_cal_axis> = #3036 (=0)
|
||||
|
||||
(Cancel G92 offsets)
|
||||
G92.1
|
||||
|
||||
#<workspace_x> = #[5201 + [20 * #5220]]
|
||||
#<workspace_y> = #[5202 + [20 * #5220]]
|
||||
#<workspace_z> = #[5203 + [20 * #5220]]
|
||||
|
||||
(clear current probe calibration offset)
|
||||
#3032 = 0
|
||||
(DEBUG, EVAL[vcp.getWidget{"calibration_offset_3032"}.setValue{#3032}])
|
||||
|
||||
(Probe Tool Safety Check)
|
||||
o100 if [#5400 NE #<probe_tool_number>]
|
||||
(MSG, Specified probe tool #<probe_tool_number> not in spindle, aborting)
|
||||
o<probe_cal_square_boss> return
|
||||
o100 endif
|
||||
|
||||
(Probe Diameter)
|
||||
#<probe_diameter> = #5410
|
||||
|
||||
(Probe Radius)
|
||||
#<probe_radius> = [#<probe_diameter> / 2]
|
||||
|
||||
(Probe Centerline Offset)
|
||||
#<probe_center_offset> = [#<probe_radius>]
|
||||
|
||||
(remove probe tip diam and cal offset from probed width calculations)
|
||||
#<probe_diameter_offset> = [#<probe_diameter>]
|
||||
|
||||
#<z_probe_stack> = [#<z_clearance> + #<probe_diameter> + #<extra_probe_depth>]
|
||||
|
||||
(Call sub "probe_z_minus_sub" to Probe top of Workpiece)
|
||||
o<probe_z_minus_sub> call [#3014][#3015][#3016][#3017][#3020][#3021][#3030][#3032]
|
||||
|
||||
(Probe X Positioning Move, X hint/2 + Step Off Width)
|
||||
G91
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 X-[#<x_cal_width>/2 + #<step_off_width>]
|
||||
|
||||
(Probe X Positioning Move, to Probing Depth)
|
||||
F[#<probe_fast_fr>]
|
||||
G38.3 Z-[#<z_probe_stack>]
|
||||
|
||||
(Call sub "probe_x_plus" to Probe x+ side of Workpiece)
|
||||
o<probe_x_plus> call [#3014][#3015][#3016][#3017][#3018][#3019][#3032]
|
||||
|
||||
#<x_plus_probed> = #5061
|
||||
|
||||
(first side Probe Completion Move to Z Clearance Plane)
|
||||
G91
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 Z[#<z_probe_stack>]
|
||||
|
||||
(Positioning move in X, X Hint + Step Off Width at Traverse Speed)
|
||||
G91
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 X[#<x_cal_width> + #<step_off_width> + #<xy_clearance>]
|
||||
|
||||
(Probe X Positioning Move, to Probing Depth)
|
||||
F[#<probe_fast_fr>]
|
||||
G38.3 Z-[#<z_probe_stack>]
|
||||
|
||||
(Call sub "probe_x_minus" to Probe x- side of Workpiece)
|
||||
o<probe_x_minus> call [#3014][#3015][#3016][#3017][#3018][#3019][#3032]
|
||||
|
||||
#<x_minus_probed> = #5061
|
||||
|
||||
(probed center calulation)
|
||||
#<x_center_probed> = [[#<x_minus_probed> + #<x_plus_probed>] / 2]
|
||||
|
||||
(calculate X Width Probed)
|
||||
#<raw_width> = [#<x_minus_probed> - #<x_plus_probed>]
|
||||
|
||||
(Completed probed width calculations)
|
||||
#<x_probed_width> = [#<raw_width> - #<probe_diameter_offset>]
|
||||
|
||||
#1001 = #<x_probed_width>
|
||||
(DEBUG, EVAL[vcp.getWidget{"x_probed_width"}.setValue{#1001}])
|
||||
|
||||
#1002 = #<x_center_probed>
|
||||
(DEBUG, EVAL[vcp.getWidget{"x_center_probed"}.setValue{#1002}])
|
||||
|
||||
G91
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 Z[#<z_probe_stack>]
|
||||
G90
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 X[#<x_center_probed>]
|
||||
|
||||
(Probe Y Positioning Move, Y hint/2 + Step Off Width)
|
||||
G91
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 Y-[#<y_cal_width>/2 + #<step_off_width>]
|
||||
|
||||
(Probe Y Positioning Move, to Probing Depth)
|
||||
F[#<probe_fast_fr>]
|
||||
G38.3 Z-[#<z_probe_stack>]
|
||||
|
||||
(Call sub "probe_y_plus" to Probe y+ side of Workpiece)
|
||||
o<probe_y_plus> call [#3014][#3015][#3016][#3017][#3018][#3019][#3032]
|
||||
|
||||
#<y_plus_probed> = #5062
|
||||
|
||||
(first side Probe Completion Move to Z Clearance Plane)
|
||||
G91
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 Z[#<z_probe_stack>]
|
||||
|
||||
(Positioning move in Y, Y Hint + Step Off Width at traverse Speed)
|
||||
G91
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 Y[#<y_cal_width> + #<step_off_width> + #<xy_clearance>]
|
||||
|
||||
(Probe Y Positioning Move, to Probing Depth)
|
||||
F[#<probe_fast_fr>]
|
||||
G38.3 Z-[#<z_probe_stack>]
|
||||
|
||||
(Call sub "probe_y_minus" to Probe y- side of Workpiece)
|
||||
o<probe_y_minus> call [#3014][#3015][#3016][#3017][#3018][#3019][#3032]
|
||||
|
||||
#<y_minus_probed> = #5062
|
||||
|
||||
(probed center calulation)
|
||||
#<y_center_probed> = [[#<y_minus_probed> + #<y_plus_probed>] / 2]
|
||||
|
||||
(calculate Y Width Probed)
|
||||
#<raw_width> = [#<y_minus_probed> - #<y_plus_probed>]
|
||||
|
||||
(Completed probed width calculations)
|
||||
#<y_probed_width> = [#<raw_width> - #<probe_diameter_offset>]
|
||||
|
||||
#1003 = #<y_probed_width>
|
||||
(DEBUG, EVAL[vcp.getWidget{"y_probed_width"}.setValue{#1003}])
|
||||
|
||||
#1004 = #<y_center_probed>
|
||||
(DEBUG, EVAL[vcp.getWidget{"y_center_probed"}.setValue{#1004}])
|
||||
|
||||
G91
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 Z[#<z_probe_stack>]
|
||||
G90
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 X[#<x_center_probed>] Y[#<y_center_probed>]
|
||||
|
||||
o110 if [#<x_cal_width> GT #<x_probed_width>]
|
||||
(calculate calibration error and adjust calibration offset)
|
||||
#<x_cal_error> = [[#<x_cal_width> - #<x_probed_width>] / 2]
|
||||
#<new_x_cal_offset> = [#<x_cal_error>]
|
||||
o110 else
|
||||
#<x_cal_error> = [[#<x_probed_width> - #<x_cal_width>] / 2]
|
||||
#<new_x_cal_offset> = [#<x_cal_error>]
|
||||
o110 endif
|
||||
|
||||
o120 if [#<y_cal_width> GT #<y_probed_width>]
|
||||
(calculate calibration error and adjust calibration offset)
|
||||
#<y_cal_error> = [[#<y_cal_width> - #<y_probed_width>] / 2]
|
||||
#<new_y_cal_offset> = [#<y_cal_error>]
|
||||
o120 else
|
||||
#<y_cal_error> = [[#<y_probed_width> - #<y_cal_width>] / 2]
|
||||
#<new_y_cal_offset> = [#<y_cal_error>]
|
||||
o120 endif
|
||||
|
||||
#<new_avg_cal_offset> = [[#<new_x_cal_offset> + #<new_y_cal_offset>] / 2]
|
||||
|
||||
o130 if [#<sq_cal_axis> EQ 0]
|
||||
#3032 = [ABS[#<new_avg_cal_offset>]]
|
||||
(DEBUG, EVAL[vcp.getWidget{"calibration_offset_3032"}.setValue{#3032}])
|
||||
o130 else if [#<sq_cal_axis> EQ 1]
|
||||
#3032 = [ABS[#<new_x_cal_offset>]]
|
||||
(DEBUG, EVAL[vcp.getWidget{"calibration_offset_3032"}.setValue{#3032}])
|
||||
o130 else
|
||||
#3032 = [ABS[#<new_y_cal_offset>]]
|
||||
(DEBUG, EVAL[vcp.getWidget{"calibration_offset_3032"}.setValue{#3032}])
|
||||
o130 endif
|
||||
|
||||
#<x_zero> = [#<x_center_probed> + #<workspace_x>]
|
||||
|
||||
#<y_zero> = [#<y_center_probed> + #<workspace_y>]
|
||||
|
||||
(probe mode rules for WCO or probe position measuring only)
|
||||
o140 if [#<probe_mode> EQ 0]
|
||||
(Record XY Zero in selected WCO)
|
||||
G10 L2 P#5220 X[#<x_zero>] Y[#<y_zero>]
|
||||
(Probe Completion Move to Z Clearance Plane, and X Zero, Y Zero)
|
||||
o<probe_cal_square_boss> return
|
||||
o140 endif
|
||||
|
||||
o<probe_cal_square_boss> endsub
|
||||
|
||||
M2 (end program)
|
||||
@@ -0,0 +1,172 @@
|
||||
(author: Chris P)
|
||||
(version: 0.2)
|
||||
(date: 06/27/24)
|
||||
|
||||
(Probe calibration offset using defined width square pocket)
|
||||
(Start probe position is over left side edge of pocket wall)
|
||||
(inside the step off width distance and within max z distance)
|
||||
(ensure all settings have been set properly according to help diagrams)
|
||||
|
||||
o<probe_cal_square_pocket> sub
|
||||
|
||||
(uses NGCGUI style arg spec)
|
||||
(number after "=" in comment is default value)
|
||||
#<probe_tool_number> = #3014 (=99)
|
||||
#<probe_slow_fr> = #3015 (=0)
|
||||
#<probe_fast_fr> = #3016 (=10.0)
|
||||
#<probe_traverse_fr> = #3017 (=50)
|
||||
#<max_xy_distance> = #3018 (=0.5000)
|
||||
#<xy_clearance> = #3019 (=0.1000)
|
||||
#<max_z_distance> = #3020 (=0.5000)
|
||||
#<z_clearance> = #3021 (=0.1000)
|
||||
#<extra_probe_depth> = #3022 (=0.0000)
|
||||
#<step_off_width> = #3023 (=0.5000)
|
||||
#<edge_width> = #3024 (=0.5000)
|
||||
#<probe_mode> = #3030 (=0)
|
||||
#<x_cal_width> = #3034 (=0)
|
||||
#<y_cal_width> = #3035 (=0)
|
||||
#<sq_cal_axis> = #3036 (=0)
|
||||
|
||||
(Cancel G92 offsets)
|
||||
G92.1
|
||||
|
||||
#<workspace_x> = #[5201 + [20 * #5220]]
|
||||
#<workspace_y> = #[5202 + [20 * #5220]]
|
||||
|
||||
(clear current probe calibration offset)
|
||||
#3032 = 0
|
||||
(DEBUG, EVAL[vcp.getWidget{"calibration_offset_3032"}.setValue{#3032}])
|
||||
|
||||
(Probe Tool Safety Check)
|
||||
o100 if [#5400 NE #<probe_tool_number>]
|
||||
(MSG, Specified probe tool #<probe_tool_number> not in spindle, aborting)
|
||||
o<probe_cal_square_pocket> return
|
||||
o100 endif
|
||||
|
||||
(Probe Diameter)
|
||||
#<probe_diameter> = #5410
|
||||
|
||||
(remove probe tip diam and cal offset from probed width calculations)
|
||||
#<probe_diameter_offset> = [#<probe_diameter>]
|
||||
|
||||
#<z_probe_stack> = [#<z_clearance> + #<probe_diameter> + #<extra_probe_depth>]
|
||||
|
||||
(Call sub "probe_z_minus_sub" to Probe top of Workpiece)
|
||||
o<probe_z_minus_sub> call [#3014][#3015][#3016][#3017][#3020][#3021][#3030][#3032]
|
||||
|
||||
(Probe X Positioning Move, Step Off Width)
|
||||
G91
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 X[#<step_off_width>]
|
||||
|
||||
(Probe X Positioning Move, to Probing Depth)
|
||||
F[#<probe_fast_fr>]
|
||||
G38.3 Z-[#<z_probe_stack>]
|
||||
|
||||
(Call sub "probe_x_minus" to Probe x- side of Workpiece)
|
||||
o<probe_x_minus> call [#3014][#3015][#3016][#3017][#3018][#3019][#3032]
|
||||
|
||||
#<x_minus_probed> = #5061
|
||||
|
||||
(Call sub "probe_x_plus" to Probe x+ side of Workpiece)
|
||||
o<probe_x_plus> call [#3014][#3015][#3016][3017][#3018 + #3034][#3019][#3032]
|
||||
|
||||
#<x_plus_probed> = #5061
|
||||
|
||||
(probed center calculation)
|
||||
#<x_center_probed> = [[#<x_plus_probed> + #<x_minus_probed>] / 2]
|
||||
|
||||
(calculate X Width Probed)
|
||||
#<raw_width> = [#<x_plus_probed> - #<x_minus_probed>]
|
||||
|
||||
(Completed probed width calculations)
|
||||
#<x_probed_width> = [#<raw_width> + #<probe_diameter_offset>]
|
||||
|
||||
#1001 = #<x_probed_width>
|
||||
(DEBUG, EVAL[vcp.getWidget{"x_probed_width"}.setValue{#1001}])
|
||||
|
||||
#1002 = #<x_center_probed>
|
||||
(DEBUG, EVAL[vcp.getWidget{"x_center_probed"}.setValue{#1002}])
|
||||
|
||||
(Probe Completion Move to Z Clearance Plane, and X Zero, Y Zero)
|
||||
G90
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 X[#<x_center_probed>]
|
||||
|
||||
(Call sub "probe_y_plus" to Probe Y+ side of Workpiece)
|
||||
o<probe_y_plus> call [#3014][#3015][#3016][3017][#3018 + #3035 / 2][#3019][#3032]
|
||||
|
||||
#<y_plus_probed> = #5062
|
||||
|
||||
(Call sub "probe_y_minus" to Probe Y- side of Workpiece)
|
||||
o<probe_y_minus> call [#3014][#3015][#3016][3017][#3018 + #3035][#3019][#3032]
|
||||
|
||||
#<y_minus_probed> = #5062
|
||||
|
||||
(probed center calculation)
|
||||
#<y_center_probed> = [[#<y_plus_probed> + #<y_minus_probed>] / 2]
|
||||
|
||||
(calculate Y Width Probed)
|
||||
#<raw_width> = [#<y_plus_probed> - #<y_minus_probed>]
|
||||
|
||||
(Completed probed width calculations)
|
||||
#<y_probed_width> = [#<raw_width> + #<probe_diameter_offset>]
|
||||
|
||||
#1003 = #<y_probed_width>
|
||||
(DEBUG, EVAL[vcp.getWidget{"y_probed_width"}.setValue{#1003}])
|
||||
|
||||
#1004 = #<y_center_probed>
|
||||
(DEBUG, EVAL[vcp.getWidget{"y_center_probed"}.setValue{#1004}])
|
||||
|
||||
G90
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 Y[#<y_center_probed>]
|
||||
G91
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 Z[#<z_probe_stack>]
|
||||
|
||||
o110 if [#<x_cal_width> GT #<x_probed_width>]
|
||||
(calculate calibration error and adjust calibration offset)
|
||||
#<x_cal_error> = [[#<x_cal_width> - #<x_probed_width>] / 2]
|
||||
#<new_x_cal_offset> = [#<x_cal_error>]
|
||||
o110 else
|
||||
#<x_cal_error> = [[#<x_probed_width> - #<x_cal_width>] / 2]
|
||||
#<new_x_cal_offset> = [#<x_cal_error>]
|
||||
o110 endif
|
||||
|
||||
o120 if [#<y_cal_width> GT #<y_probed_width>]
|
||||
(calculate calibration error and adjust calibration offset)
|
||||
#<y_cal_error> = [[#<y_cal_width> - #<y_probed_width>] / 2]
|
||||
#<new_y_cal_offset> = [#<y_cal_error>]
|
||||
o120 else
|
||||
#<y_cal_error> = [[#<y_probed_width> - #<y_cal_width>] / 2]
|
||||
#<new_y_cal_offset> = [#<y_cal_error>]
|
||||
o120 endif
|
||||
|
||||
#<new_avg_cal_offset> = [[#<new_x_cal_offset> + #<new_y_cal_offset>] / 2]
|
||||
|
||||
o130 if [#<sq_cal_axis> EQ 0]
|
||||
#3032 = [ABS[#<new_avg_cal_offset>]]
|
||||
(DEBUG, EVAL[vcp.getWidget{"calibration_offset_3032"}.setValue{#3032}])
|
||||
o130 else if [#<sq_cal_axis> EQ 1]
|
||||
#3032 = [ABS[#<new_x_cal_offset>]]
|
||||
(DEBUG, EVAL[vcp.getWidget{"calibration_offset_3032"}.setValue{#3032}])
|
||||
o130 else
|
||||
#3032 = [ABS[#<new_y_cal_offset>]]
|
||||
(DEBUG, EVAL[vcp.getWidget{"calibration_offset_3032"}.setValue{#3032}])
|
||||
o130 endif
|
||||
|
||||
#<x_zero> = [#<x_center_probed> + #<workspace_x>]
|
||||
|
||||
#<y_zero> = [#<y_center_probed> + #<workspace_y>]
|
||||
|
||||
(probe mode rules for WCO or probe position measuring only)
|
||||
o140 if [#<probe_mode> EQ 0]
|
||||
(Record X Zero in selected WCO)
|
||||
G10 L2 P#5220 X[#<x_zero>] Y[#<y_zero>]
|
||||
o<probe_cal_square_pocket> return
|
||||
o140 endif
|
||||
|
||||
o<probe_cal_square_pocket> endsub
|
||||
|
||||
M2 (end program)
|
||||
@@ -0,0 +1,165 @@
|
||||
(author: Chris P)
|
||||
(version: 0.2)
|
||||
(date: 06/27/24)
|
||||
|
||||
(Probe Corner X minus Edge Angle for x,y,z 0,0,0 position)
|
||||
(Start probe position is over front right corner of stock)
|
||||
(inside the step off width square and within max z distance)
|
||||
(ensure all settings have been set properly according to help diagrams)
|
||||
|
||||
o<probe_corner_x_minus_edge_angle> sub
|
||||
|
||||
(uses NGCGUI style arg spec)
|
||||
(number after "=" in comment is default value)
|
||||
#<probe_tool_number> = #3014 (=99)
|
||||
#<probe_slow_fr> = #3015 (=0)
|
||||
#<probe_fast_fr> = #3016 (=10.0)
|
||||
#<probe_traverse_fr> = #3017 (=50)
|
||||
#<max_xy_distance> = #3018 (=0.5000)
|
||||
#<xy_clearance> = #3019 (=0.1000)
|
||||
#<max_z_distance> = #3020 (=0.5000)
|
||||
#<z_clearance> = #3021 (=0.1000)
|
||||
#<extra_probe_depth> = #3022 (=0.0000)
|
||||
#<step_off_width> = #3023 (=0.5000)
|
||||
#<edge_width> = #3024 (=0.5000)
|
||||
#<probe_mode> = #3030 (=0)
|
||||
#<wco_rotation> = #3031 (=0)
|
||||
#<calibration_offset> = #3032 (=0)
|
||||
|
||||
(Cancel G92 offsets)
|
||||
G92.1
|
||||
|
||||
(set rotation offset to zero for new probe cycle)
|
||||
G10 L2 P[#5220] R0
|
||||
|
||||
#<workspace_x> = #[5201 + [20 * #5220]]
|
||||
#<workspace_y> = #[5202 + [20 * #5220]]
|
||||
|
||||
(Probe Tool Safety Check)
|
||||
o100 if [#5400 NE #<probe_tool_number>]
|
||||
(MSG, Specified probe tool #<probe_tool_number> not in spindle, aborting)
|
||||
o<probe_corner_x_minus_edge_angle> return
|
||||
o100 endif
|
||||
|
||||
(Probe Diameter)
|
||||
#<probe_diameter> = #5410
|
||||
|
||||
(Probing depth from the z probed clearance height, used for z moves)
|
||||
#<z_probe_stack> = [#<z_clearance> + #<probe_diameter> + #<extra_probe_depth>]
|
||||
|
||||
#<z1x> = #5420
|
||||
|
||||
#<z1y> = #5421
|
||||
|
||||
(Call sub "probe_z_minus_sub" to Probe top of Workpiece)
|
||||
o<probe_z_minus_sub> call [#3014][#3015][#3016][#3017][#3020][#3021][#3030]
|
||||
|
||||
(Probe X Positioning Move, Step Off Width)
|
||||
G91
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 y-[#<step_off_width>]
|
||||
|
||||
(Probe X Positioning Move, to Probing Depth)
|
||||
F[#<probe_fast_fr>]
|
||||
G38.3 Z-[#<z_probe_stack>]
|
||||
|
||||
#<p1x> = #5420
|
||||
|
||||
(Call sub "probe_y_plus" to Probe y+ side of Workpiece)
|
||||
o<probe_y_plus> call [#3014][#3015][#3016][#3017][#3018][#3019][#3032]
|
||||
|
||||
#<p1y> = #<_value>
|
||||
|
||||
(value returned safety check, aborts if no value returned)
|
||||
o110 if [#<probe_mode> EQ 1 AND #<_value_returned> NE 1]
|
||||
(MSG, Missing Y Sub returned edge parameter, aborting)
|
||||
o<probe_corner_x_minus_edge_angle> return
|
||||
o110 endif
|
||||
|
||||
(Probe Y Positioning Move, up to Z clearance plane)
|
||||
G91
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 Z[#<z_probe_stack>]
|
||||
|
||||
(Probe Y Positioning Move, Traverse Workpiece at Z Clearance plane)
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 X[#<step_off_width>] Y[#<step_off_width>]
|
||||
|
||||
(Probe Y Positioning Move,to Probing Depth)
|
||||
F[#<probe_fast_fr>]
|
||||
G38.3 Z-[#<z_probe_stack>]
|
||||
|
||||
#<p2y> = #5421
|
||||
|
||||
(Call sub "probe_x_minus" to Probe X- side of Workpiece)
|
||||
o<probe_x_minus> call [#3014][#3015][#3016][#3017][#3018][#3019][#3032]
|
||||
|
||||
#<p2x> = #<_value>
|
||||
|
||||
(value returned safety check, aborts if no value returned)
|
||||
o120 if [#<probe_mode> EQ 1 AND #<_value_returned> NE 1]
|
||||
(MSG, Missing X Sub returned edge parameter, aborting)
|
||||
o<probe_corner_x_minus_edge_angle> return
|
||||
o120 endif
|
||||
|
||||
(edge width move to edge second probing point)
|
||||
G91
|
||||
F[#<probe_fast_fr>]
|
||||
G38.3 Y[#<edge_width>]
|
||||
|
||||
#<p3y> = #5421
|
||||
|
||||
(Call sub "probe_x_minus" to Probe X- side of Workpiece)
|
||||
o<probe_x_minus> call [#3014][#3015][#3016][#3017][#3018][#3019][#3032]
|
||||
|
||||
#<p3x> = #<_value>
|
||||
|
||||
(value returned safety check, aborts if no value returned)
|
||||
o130 if [#<probe_mode> EQ 1 AND #<_value_returned> NE 1]
|
||||
(MSG, Missing X Sub returned edge parameter, aborting)
|
||||
o<probe_corner_x_minus_edge_angle> return
|
||||
o130 endif
|
||||
|
||||
#<edge_delta> = [#<p2x> - #<p3x>]
|
||||
|
||||
#<edge_angle> = [ATAN [#<edge_delta>] / [#<edge_width>]]
|
||||
|
||||
#1011 = #<edge_delta>
|
||||
(DEBUG, EVAL[vcp.getWidget{"edge_delta"}.setValue{#1011}])
|
||||
|
||||
#1012 = #<edge_angle>
|
||||
(DEBUG, EVAL[vcp.getWidget{"edge_angle"}.setValue{#1012}])
|
||||
|
||||
#<c1xr> = [#<z1x> + [#<p2x> - #<z1x>] * COS[-#<edge_angle>] - [#<p2y> - #<z1y>] * SIN[-#<edge_angle>]]
|
||||
|
||||
#<c1yr> = [#<z1y> + [#<p1x> - #<z1x>] * SIN[-#<edge_angle>] + [#<p1y> - #<z1y>] * COS[-#<edge_angle>]]
|
||||
|
||||
#<c1x> = [#<z1x> + [#<c1xr> - #<z1x>] * COS[#<edge_angle>] - [#<c1yr> - #<z1y>] * SIN[#<edge_angle>]]
|
||||
|
||||
#<c1y> = [#<z1y> + [#<c1xr> - #<z1x>] * SIN[#<edge_angle>] + [#<c1yr> - #<z1y>] * COS[#<edge_angle>]]
|
||||
|
||||
(Probe Completion Move to Z Clearance Plane, and XY Zero)
|
||||
G91
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 Z[#<z_probe_stack>]
|
||||
G90
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 X[#<c1x>] Y[#<c1y>]
|
||||
|
||||
(probe mode rules for WCO,Rotation and probe position measuring only)
|
||||
o140 if [#<probe_mode> EQ 0 AND #<wco_rotation> EQ 0]
|
||||
(Record Zero in selected axes and WCO)
|
||||
G10 L2 P#5220 X[#<c1x> + #<workspace_x>] Y[#<c1y> + #<workspace_y>]
|
||||
o<probe_corner_x_minus_edge_angle> return
|
||||
o140 endif
|
||||
|
||||
(probe mode rules for WCO,Rotation and probe position measuring only)
|
||||
o150 if [#<probe_mode> EQ 0 AND #<wco_rotation> EQ 1]
|
||||
(Record Zero in selected axes and WCO)
|
||||
G10 L2 P#5220 X[#<c1x> + #<workspace_x>] Y[#<c1y> + #<workspace_y>] R[#<edge_angle>]
|
||||
o<probe_corner_x_minus_edge_angle> return
|
||||
o150 endif
|
||||
|
||||
o<probe_corner_x_minus_edge_angle> endsub
|
||||
|
||||
M2 (end program)
|
||||
@@ -0,0 +1,165 @@
|
||||
(author: Chris P)
|
||||
(version: 0.2)
|
||||
(date: 06/27/24)
|
||||
|
||||
(Probe Corner X plus Edge Angle for x,y,z 0,0,0 position)
|
||||
(Start probe position is over back left corner of stock)
|
||||
(inside the step off width square and within max z distance)
|
||||
(ensure all settings have been set properly according to help diagrams)
|
||||
|
||||
o<probe_corner_x_plus_edge_angle> sub
|
||||
|
||||
(uses NGCGUI style arg spec)
|
||||
(number after "=" in comment is default value)
|
||||
#<probe_tool_number> = #3014 (=99)
|
||||
#<probe_slow_fr> = #3015 (=0)
|
||||
#<probe_fast_fr> = #3016 (=10.0)
|
||||
#<probe_traverse_fr> = #3017 (=50)
|
||||
#<max_xy_distance> = #3018 (=0.5000)
|
||||
#<xy_clearance> = #3019 (=0.1000)
|
||||
#<max_z_distance> = #3020 (=0.5000)
|
||||
#<z_clearance> = #3021 (=0.1000)
|
||||
#<extra_probe_depth> = #3022 (=0.0000)
|
||||
#<step_off_width> = #3023 (=0.5000)
|
||||
#<edge_width> = #3024 (=0.5000)
|
||||
#<probe_mode> = #3030 (=0)
|
||||
#<wco_rotation> = #3031 (=0)
|
||||
#<calibration_offset> = #3032 (=0)
|
||||
|
||||
(Cancel G92 offsets)
|
||||
G92.1
|
||||
|
||||
(set rotation offset to zero for new probe cycle)
|
||||
G10 L2 P[#5220] R0
|
||||
|
||||
#<workspace_x> = #[5201 + [20 * #5220]]
|
||||
#<workspace_y> = #[5202 + [20 * #5220]]
|
||||
|
||||
(Probe Tool Safety Check)
|
||||
o100 if [#5400 NE #<probe_tool_number>]
|
||||
(MSG, Specified probe tool #<probe_tool_number> not in spindle, aborting)
|
||||
o<probe_corner_x_plus_edge_angle> return
|
||||
o100 endif
|
||||
|
||||
(Probe Diameter)
|
||||
#<probe_diameter> = #5410
|
||||
|
||||
(Probing depth from the z probed clearance height, used for z moves)
|
||||
#<z_probe_stack> = [#<z_clearance> + #<probe_diameter> + #<extra_probe_depth>]
|
||||
|
||||
#<z1x> = #5420
|
||||
|
||||
#<z1y> = #5421
|
||||
|
||||
(Call sub "probe_z_minus_sub" to Probe top of Workpiece)
|
||||
o<probe_z_minus_sub> call [#3014][#3015][#3016][#3017][#3020][#3021][#3030]
|
||||
|
||||
(Probe X Positioning Move, Step Off Width)
|
||||
G91
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 y[#<step_off_width>]
|
||||
|
||||
(Probe X Positioning Move, to Probing Depth)
|
||||
F[#<probe_fast_fr>]
|
||||
G38.3 Z-[#<z_probe_stack>]
|
||||
|
||||
#<p1x> = #5420
|
||||
|
||||
(Call sub "probe_y_minus" to Probe y- side of Workpiece)
|
||||
o<probe_y_minus> call [#3014][#3015][#3016][#3017][#3018][#3019][#3032]
|
||||
|
||||
#<p1y> = #<_value>
|
||||
|
||||
(value returned safety check, aborts if no value returned)
|
||||
o110 if [#<probe_mode> EQ 1 AND #<_value_returned> NE 1]
|
||||
(MSG, Missing Y Sub returned edge parameter, aborting)
|
||||
o<probe_corner_x_plus_edge_angle> return
|
||||
o110 endif
|
||||
|
||||
(Probe Y Positioning Move, up to Z clearance plane)
|
||||
G91
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 Z[#<z_probe_stack>]
|
||||
|
||||
(Probe Y Positioning Move, Traverse Workpiece at Z Clearance plane)
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 X-[#<step_off_width>] Y-[#<step_off_width>]
|
||||
|
||||
(Probe Y Positioning Move,to Probing Depth)
|
||||
F[#<probe_fast_fr>]
|
||||
G38.3 Z-[#<z_probe_stack>]
|
||||
|
||||
#<p2y> = #5421
|
||||
|
||||
(Call sub "probe_x_plus" to Probe X+ side of Workpiece)
|
||||
o<probe_x_plus> call [#3014][#3015][#3016][#3017][#3018][#3019][#3032]
|
||||
|
||||
#<p2x> = #<_value>
|
||||
|
||||
(value returned safety check, aborts if no value returned)
|
||||
o120 if [#<probe_mode> EQ 1 AND #<_value_returned> NE 1]
|
||||
(MSG, Missing X Sub returned edge parameter, aborting)
|
||||
o<probe_corner_x_plus_edge_angle> return
|
||||
o120 endif
|
||||
|
||||
(edge width move to edge second probing point)
|
||||
G91
|
||||
F[#<probe_fast_fr>]
|
||||
G38.3 Y-[#<edge_width>]
|
||||
|
||||
#<p3y> = #5421
|
||||
|
||||
(Call sub "probe_x_plus" to Probe X+ side of Workpiece)
|
||||
o<probe_x_plus> call [#3014][#3015][#3016][#3017][#3018][#3019][#3032]
|
||||
|
||||
#<p3x> = #<_value>
|
||||
|
||||
(value returned safety check, aborts if no value returned)
|
||||
o130 if [#<probe_mode> EQ 1 AND #<_value_returned> NE 1]
|
||||
(MSG, Missing X Sub returned edge parameter, aborting)
|
||||
o<probe_corner_x_plus_edge_angle> return
|
||||
o130 endif
|
||||
|
||||
#<edge_delta> = [#<p3x> - #<p2x>]
|
||||
|
||||
#<edge_angle> = [ATAN [#<edge_delta>] / [#<edge_width>]]
|
||||
|
||||
#1011 = #<edge_delta>
|
||||
(DEBUG, EVAL[vcp.getWidget{"edge_delta"}.setValue{#1011}])
|
||||
|
||||
#1012 = #<edge_angle>
|
||||
(DEBUG, EVAL[vcp.getWidget{"edge_angle"}.setValue{#1012}])
|
||||
|
||||
#<c1xr> = [#<z1x> + [#<p2x> - #<z1x>] * COS[-#<edge_angle>] - [#<p2y> - #<z1y>] * SIN[-#<edge_angle>]]
|
||||
|
||||
#<c1yr> = [#<z1y> + [#<p1x> - #<z1x>] * SIN[-#<edge_angle>] + [#<p1y> - #<z1y>] * COS[-#<edge_angle>]]
|
||||
|
||||
#<c1x> = [#<z1x> + [#<c1xr> - #<z1x>] * COS[#<edge_angle>] - [#<c1yr> - #<z1y>] * SIN[#<edge_angle>]]
|
||||
|
||||
#<c1y> = [#<z1y> + [#<c1xr> - #<z1x>] * SIN[#<edge_angle>] + [#<c1yr> - #<z1y>] * COS[#<edge_angle>]]
|
||||
|
||||
(Probe Completion Move to Z Clearance Plane, and XY Zero)
|
||||
G91
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 Z[#<z_probe_stack>]
|
||||
G90
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 X[#<c1x>] Y[#<c1y>]
|
||||
|
||||
(probe mode rules for WCO,Rotation and probe position measuring only)
|
||||
o140 if [#<probe_mode> EQ 0 AND #<wco_rotation> EQ 0]
|
||||
(Record Zero in selected axes and WCO)
|
||||
G10 L2 P#5220 X[#<c1x> + #<workspace_x>] Y[#<c1y> + #<workspace_y>]
|
||||
o<probe_corner_x_plus_edge_angle> return
|
||||
o140 endif
|
||||
|
||||
(probe mode rules for WCO,Rotation and probe position measuring only)
|
||||
o150 if [#<probe_mode> EQ 0 AND #<wco_rotation> EQ 1]
|
||||
(Record Zero in selected axes and WCO)
|
||||
G10 L2 P#5220 X[#<c1x> + #<workspace_x>] Y[#<c1y> + #<workspace_y>] R[#<edge_angle>]
|
||||
o<probe_corner_x_plus_edge_angle> return
|
||||
o150 endif
|
||||
|
||||
o<probe_corner_x_plus_edge_angle> endsub
|
||||
|
||||
M2 (end program)
|
||||
@@ -0,0 +1,165 @@
|
||||
(author: Chris P)
|
||||
(version: 0.2)
|
||||
(date: 06/27/24)
|
||||
|
||||
(Probe Corner Y minus Edge Angle for x,y,z 0,0,0 position)
|
||||
(Start probe position is over back right corner of stock)
|
||||
(inside the step off width square and within max z distance)
|
||||
(ensure all settings have been set properly according to help diagrams)
|
||||
|
||||
o<probe_corner_y_minus_edge_angle> sub
|
||||
|
||||
(uses NGCGUI style arg spec)
|
||||
(number after "=" in comment is default value)
|
||||
#<probe_tool_number> = #3014 (=99)
|
||||
#<probe_slow_fr> = #3015 (=0)
|
||||
#<probe_fast_fr> = #3016 (=10.0)
|
||||
#<probe_traverse_fr> = #3017 (=50)
|
||||
#<max_xy_distance> = #3018 (=0.5000)
|
||||
#<xy_clearance> = #3019 (=0.1000)
|
||||
#<max_z_distance> = #3020 (=0.5000)
|
||||
#<z_clearance> = #3021 (=0.1000)
|
||||
#<extra_probe_depth> = #3022 (=0.0000)
|
||||
#<step_off_width> = #3023 (=0.5000)
|
||||
#<edge_width> = #3024 (=0.5000)
|
||||
#<probe_mode> = #3030 (=0)
|
||||
#<wco_rotation> = #3031 (=0)
|
||||
#<calibration_offset> = #3032 (=0)
|
||||
|
||||
(Cancel G92 offsets)
|
||||
G92.1
|
||||
|
||||
(set rotation offset to zero for new probe cycle)
|
||||
G10 L2 P[#5220] R0
|
||||
|
||||
#<workspace_x> = #[5201 + [20 * #5220]]
|
||||
#<workspace_y> = #[5202 + [20 * #5220]]
|
||||
|
||||
(Probe Tool Safety Check)
|
||||
o100 if [#5400 NE #<probe_tool_number>]
|
||||
(MSG, Specified probe tool #<probe_tool_number> not in spindle, aborting)
|
||||
o<probe_corner_y_minus_edge_angle> return
|
||||
o100 endif
|
||||
|
||||
(Probe Diameter)
|
||||
#<probe_diameter> = #5410
|
||||
|
||||
(Probing depth from the z probed clearance height, used for z moves)
|
||||
#<z_probe_stack> = [#<z_clearance> + #<probe_diameter> + #<extra_probe_depth>]
|
||||
|
||||
#<z1x> = #5420
|
||||
|
||||
#<z1y> = #5421
|
||||
|
||||
(Call sub "probe_z_minus_sub" to Probe top of Workpiece)
|
||||
o<probe_z_minus_sub> call [#3014][#3015][#3016][#3017][#3020][#3021][#3030]
|
||||
|
||||
(Probe X Positioning Move, Step Off Width)
|
||||
G91
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 X[#<step_off_width>]
|
||||
|
||||
(Probe X Positioning Move, to Probing Depth)
|
||||
F[#<probe_fast_fr>]
|
||||
G38.3 Z-[#<z_probe_stack>]
|
||||
|
||||
#<p1y> = #5421
|
||||
|
||||
(Call sub "probe_x_minus" to Probe x- side of Workpiece)
|
||||
o<probe_x_minus> call [#3014][#3015][#3016][#3017][#3018][#3019][#3032]
|
||||
|
||||
#<p1x> = #<_value>
|
||||
|
||||
(value returned safety check, aborts if no value returned)
|
||||
o110 if [#<probe_mode> EQ 1 AND #<_value_returned> NE 1]
|
||||
(MSG, Missing X Sub returned edge parameter, aborting)
|
||||
o<probe_corner_y_minus_edge_angle> return
|
||||
o110 endif
|
||||
|
||||
(Probe Y Positioning Move, up to Z clearance plane)
|
||||
G91
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 Z[#<z_probe_stack>]
|
||||
|
||||
(Probe Y Positioning Move, Traverse Workpiece at Z Clearance plane)
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 X-[#<step_off_width>] Y[#<step_off_width>]
|
||||
|
||||
(Probe Y Positioning Move,to Probing Depth)
|
||||
F[#<probe_fast_fr>]
|
||||
G38.3 Z-[#<z_probe_stack>]
|
||||
|
||||
#<p2x> = #5420
|
||||
|
||||
(Call sub "probe_y_minus" to Probe y- side of Workpiece)
|
||||
o<probe_y_minus> call [#3014][#3015][#3016][#3017][#3018][#3019][#3032]
|
||||
|
||||
#<p2y> = #<_value>
|
||||
|
||||
(value returned safety check, aborts if no value returned)
|
||||
o120 if [#<probe_mode> EQ 1 AND #<_value_returned> NE 1]
|
||||
(MSG, Missing Y Sub returned edge parameter, aborting)
|
||||
o<probe_corner_y_minus_edge_angle> return
|
||||
o120 endif
|
||||
|
||||
(edge width move to edge second probing point)
|
||||
G91
|
||||
F[#<probe_fast_fr>]
|
||||
G38.3 X-[#<edge_width>]
|
||||
|
||||
#<p3x> = #5420
|
||||
|
||||
(Call sub "probe_y_minus" to Probe y- side of Workpiece)
|
||||
o<probe_y_minus> call [#3014][#3015][#3016][#3017][#3018][#3019][#3032]
|
||||
|
||||
#<p3y> = #<_value>
|
||||
|
||||
(value returned safety check, aborts if no value returned)
|
||||
o130 if [#<probe_mode> EQ 1 AND #<_value_returned> NE 1]
|
||||
(MSG, Missing Y Sub returned edge parameter, aborting)
|
||||
o<probe_corner_y_minus_edge_angle> return
|
||||
o130 endif
|
||||
|
||||
#<edge_delta> = [#<p2y> - #<p3y>]
|
||||
|
||||
#<edge_angle> = [ATAN [#<edge_delta>] / [#<edge_width>]]
|
||||
|
||||
#1011 = #<edge_delta>
|
||||
(DEBUG, EVAL[vcp.getWidget{"edge_delta"}.setValue{#1011}])
|
||||
|
||||
#1012 = #<edge_angle>
|
||||
(DEBUG, EVAL[vcp.getWidget{"edge_angle"}.setValue{#1012}])
|
||||
|
||||
#<c1xr> = [#<z1x> + [#<p1x> - #<z1x>] * COS[-#<edge_angle>] - [#<p1y> - #<z1y>] * SIN[-#<edge_angle>]]
|
||||
|
||||
#<c1yr> = [#<z1y> + [#<p2x> - #<z1x>] * SIN[-#<edge_angle>] + [#<p2y> - #<z1y>] * COS[-#<edge_angle>]]
|
||||
|
||||
#<c1x> = [#<z1x> + [#<c1xr> - #<z1x>] * COS[#<edge_angle>] - [#<c1yr> - #<z1y>] * SIN[#<edge_angle>]]
|
||||
|
||||
#<c1y> = [#<z1y> + [#<c1xr> - #<z1x>] * SIN[#<edge_angle>] + [#<c1yr> - #<z1y>] * COS[#<edge_angle>]]
|
||||
|
||||
(Probe Completion Move to Z Clearance Plane, and XY Zero)
|
||||
G91
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 Z[#<z_probe_stack>]
|
||||
G90
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 X[#<c1x>] Y[#<c1y>]
|
||||
|
||||
(probe mode rules for WCO,Rotation and probe position measuring only)
|
||||
o140 if [#<probe_mode> EQ 0 AND #<wco_rotation> EQ 0]
|
||||
(Record Zero in selected axes and WCO)
|
||||
G10 L2 P#5220 X[#<c1x> + #<workspace_x>] Y[#<c1y> + #<workspace_y>]
|
||||
o<probe_corner_y_minus_edge_angle> return
|
||||
o140 endif
|
||||
|
||||
(probe mode rules for WCO,Rotation and probe position measuring only)
|
||||
o150 if [#<probe_mode> EQ 0 AND #<wco_rotation> EQ 1]
|
||||
(Record Zero in selected axes and WCO)
|
||||
G10 L2 P#5220 X[#<c1x> + #<workspace_x>] Y[#<c1y> + #<workspace_y>] R[#<edge_angle>]
|
||||
o<probe_corner_y_minus_edge_angle> return
|
||||
o150 endif
|
||||
|
||||
o<probe_corner_y_minus_edge_angle> endsub
|
||||
|
||||
M2 (end program)
|
||||
@@ -0,0 +1,165 @@
|
||||
(author: Chris P)
|
||||
(version: 0.2)
|
||||
(date: 06/27/24)
|
||||
|
||||
(Probe Corner Y Plus Edge Angle for x,y,z 0,0,0 position)
|
||||
(Start probe position is over front left corner of stock)
|
||||
(inside the step off width square and within max z distance)
|
||||
(ensure all settings have been set properly according to help diagrams)
|
||||
|
||||
o<probe_corner_y_plus_edge_angle> sub
|
||||
|
||||
(uses NGCGUI style arg spec)
|
||||
(number after "=" in comment is default value)
|
||||
#<probe_tool_number> = #3014 (=99)
|
||||
#<probe_slow_fr> = #3015 (=0)
|
||||
#<probe_fast_fr> = #3016 (=10.0)
|
||||
#<probe_traverse_fr> = #3017 (=50)
|
||||
#<max_xy_distance> = #3018 (=0.5000)
|
||||
#<xy_clearance> = #3019 (=0.1000)
|
||||
#<max_z_distance> = #3020 (=0.5000)
|
||||
#<z_clearance> = #3021 (=0.1000)
|
||||
#<extra_probe_depth> = #3022 (=0.0000)
|
||||
#<step_off_width> = #3023 (=0.5000)
|
||||
#<edge_width> = #3024 (=0.5000)
|
||||
#<probe_mode> = #3030 (=0)
|
||||
#<wco_rotation> = #3031 (=0)
|
||||
#<calibration_offset> = #3032 (=0)
|
||||
|
||||
(Cancel G92 offsets)
|
||||
G92.1
|
||||
|
||||
(set rotation offset to zero for new probe cycle)
|
||||
G10 L2 P[#5220] R0
|
||||
|
||||
#<workspace_x> = #[5201 + [20 * #5220]]
|
||||
#<workspace_y> = #[5202 + [20 * #5220]]
|
||||
|
||||
(Probe Tool Safety Check)
|
||||
o100 if [#5400 NE #<probe_tool_number>]
|
||||
(MSG, Specified probe tool #<probe_tool_number> not in spindle, aborting)
|
||||
o<probe_corner_y_plus_edge_angle> return
|
||||
o100 endif
|
||||
|
||||
(Probe Diameter)
|
||||
#<probe_diameter> = #5410
|
||||
|
||||
(Probing depth from the z probed clearance height, used for z moves)
|
||||
#<z_probe_stack> = [#<z_clearance> + #<probe_diameter> + #<extra_probe_depth>]
|
||||
|
||||
#<z1x> = #5420
|
||||
|
||||
#<z1y> = #5421
|
||||
|
||||
(Call sub "probe_z_minus_sub" to Probe top of Workpiece)
|
||||
o<probe_z_minus_sub> call [#3014][#3015][#3016][#3017][#3020][#3021][#3030]
|
||||
|
||||
(Probe X Positioning Move, Step Off Width)
|
||||
G91
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 X-[#<step_off_width>]
|
||||
|
||||
(Probe X Positioning Move, to Probing Depth)
|
||||
F[#<probe_fast_fr>]
|
||||
G38.3 Z-[#<z_probe_stack>]
|
||||
|
||||
#<p1y> = #5421
|
||||
|
||||
(Call sub "probe_x_plus" to Probe x+ side of Workpiece)
|
||||
o<probe_x_plus> call [#3014][#3015][#3016][#3017][#3018][#3019][#3032]
|
||||
|
||||
#<p1x> = #<_value>
|
||||
|
||||
(value returned safety check, aborts if no value returned)
|
||||
o110 if [#<probe_mode> EQ 1 AND #<_value_returned> NE 1]
|
||||
(MSG, Missing X Sub returned edge parameter, aborting)
|
||||
o<probe_corner_y_plus_edge_angle> return
|
||||
o110 endif
|
||||
|
||||
(Probe Y Positioning Move, up to Z clearance plane)
|
||||
G91
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 Z[#<z_probe_stack>]
|
||||
|
||||
(Probe Y Positioning Move, Traverse Workpiece at Z Clearance plane)
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 X[#<step_off_width>] Y-[#<step_off_width>]
|
||||
|
||||
(Probe Y Positioning Move,to Probing Depth)
|
||||
F[#<probe_fast_fr>]
|
||||
G38.3 Z-[#<z_probe_stack>]
|
||||
|
||||
#<p2x> = #5420
|
||||
|
||||
(Call sub "probe_y_plus" to Probe y+ side of Workpiece)
|
||||
o<probe_y_plus> call [#3014][#3015][#3016][#3017][#3018][#3019][#3032]
|
||||
|
||||
#<p2y> = #<_value>
|
||||
|
||||
(value returned safety check, aborts if no value returned)
|
||||
o120 if [#<probe_mode> EQ 1 AND #<_value_returned> NE 1]
|
||||
(MSG, Missing Y Sub returned edge parameter, aborting)
|
||||
o<probe_corner_y_plus_edge_angle> return
|
||||
o120 endif
|
||||
|
||||
(edge width move to edge second probing point)
|
||||
G91
|
||||
F[#<probe_fast_fr>]
|
||||
G38.3 X[#<edge_width>]
|
||||
|
||||
#<p3x> = #5420
|
||||
|
||||
(Call sub "probe_y_plus" to Probe y+ side of Workpiece)
|
||||
o<probe_y_plus> call [#3014][#3015][#3016][#3017][#3018][#3019][#3032]
|
||||
|
||||
#<p3y> = #<_value>
|
||||
|
||||
(value returned safety check, aborts if no value returned)
|
||||
o130 if [#<probe_mode> EQ 1 AND #<_value_returned> NE 1]
|
||||
(MSG, Missing Y Sub returned edge parameter, aborting)
|
||||
o<probe_corner_y_plus_edge_angle> return
|
||||
o130 endif
|
||||
|
||||
#<edge_delta> = [#<p3y> - #<p2y>]
|
||||
|
||||
#<edge_angle> = [ATAN [#<edge_delta>] / [#<edge_width>]]
|
||||
|
||||
#1011 = #<edge_delta>
|
||||
(DEBUG, EVAL[vcp.getWidget{"edge_delta"}.setValue{#1011}])
|
||||
|
||||
#1012 = #<edge_angle>
|
||||
(DEBUG, EVAL[vcp.getWidget{"edge_angle"}.setValue{#1012}])
|
||||
|
||||
#<c1xr> = [#<z1x> + [#<p1x> - #<z1x>] * COS[-#<edge_angle>] - [#<p1y> - #<z1y>] * SIN[-#<edge_angle>]]
|
||||
|
||||
#<c1yr> = [#<z1y> + [#<p2x> - #<z1x>] * SIN[-#<edge_angle>] + [#<p2y> - #<z1y>] * COS[-#<edge_angle>]]
|
||||
|
||||
#<c1x> = [#<z1x> + [#<c1xr> - #<z1x>] * COS[#<edge_angle>] - [#<c1yr> - #<z1y>] * SIN[#<edge_angle>]]
|
||||
|
||||
#<c1y> = [#<z1y> + [#<c1xr> - #<z1x>] * SIN[#<edge_angle>] + [#<c1yr> - #<z1y>] * COS[#<edge_angle>]]
|
||||
|
||||
(Probe Completion Move to Z Clearance Plane, and XY Zero)
|
||||
G91
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 Z[#<z_probe_stack>]
|
||||
G90
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 X[#<c1x>] Y[#<c1y>]
|
||||
|
||||
(probe mode rules for WCO,Rotation and probe position measuring only)
|
||||
o140 if [#<probe_mode> EQ 0 AND #<wco_rotation> EQ 0]
|
||||
(Record Zero in selected axes and WCO)
|
||||
G10 L2 P#5220 X[#<c1x> + #<workspace_x>] Y[#<c1y> + #<workspace_y>]
|
||||
o<probe_corner_y_plus_edge_angle> return
|
||||
o140 endif
|
||||
|
||||
(probe mode rules for WCO,Rotation and probe position measuring only)
|
||||
o150 if [#<probe_mode> EQ 0 AND #<wco_rotation> EQ 1]
|
||||
(Record Zero in selected axes and WCO)
|
||||
G10 L2 P#5220 X[#<c1x> + #<workspace_x>] Y[#<c1y> + #<workspace_y>] R[#<edge_angle>]
|
||||
o<probe_corner_y_plus_edge_angle> return
|
||||
o150 endif
|
||||
|
||||
o<probe_corner_y_plus_edge_angle> endsub
|
||||
|
||||
M2 (end program)
|
||||
@@ -0,0 +1,115 @@
|
||||
(author: Chris P)
|
||||
(version: 0.2)
|
||||
(date: 06/27/24)
|
||||
|
||||
(Probe front left inside corner for x,y,z 0,0,0 position)
|
||||
(Start probe position is over front left inside corner of stock)
|
||||
(inside the step off width square and within max z distance)
|
||||
(ensure all settings have been set properly according to help diagrams)
|
||||
|
||||
o<probe_front_left_inside_corner> sub
|
||||
|
||||
(uses NGCGUI style arg spec)
|
||||
(number after "=" in comment is default value)
|
||||
#<probe_tool_number> = #3014 (=99)
|
||||
#<probe_slow_fr> = #3015 (=0)
|
||||
#<probe_fast_fr> = #3016 (=10.0)
|
||||
#<probe_traverse_fr> = #3017 (=50)
|
||||
#<max_xy_distance> = #3018 (=0.5000)
|
||||
#<xy_clearance> = #3019 (=0.1000)
|
||||
#<max_z_distance> = #3020 (=0.5000)
|
||||
#<z_clearance> = #3021 (=0.1000)
|
||||
#<extra_probe_depth> = #3022 (=0.0000)
|
||||
#<step_off_width> = #3023 (=0.5000)
|
||||
#<edge_width> = #3024 (=0.5000)
|
||||
#<probe_mode> = #3030 (=0)
|
||||
#<calibration_offset> = #3032 (=0)
|
||||
|
||||
(Cancel G92 offsets)
|
||||
G92.1
|
||||
|
||||
#<workspace_x> = #[5201 + [20 * #5220]]
|
||||
#<workspace_y> = #[5202 + [20 * #5220]]
|
||||
|
||||
(Probe Tool Safety Check)
|
||||
o100 if [#5400 NE #<probe_tool_number>]
|
||||
(MSG, Specified probe tool #<probe_tool_number> not in spindle, aborting)
|
||||
o<probe_front_left_inside_corner> return
|
||||
o100 endif
|
||||
|
||||
(Probe Diameter)
|
||||
#<probe_diameter> = #5410
|
||||
|
||||
(Probing depth from the z probed clearance height, used for z moves)
|
||||
#<z_probe_stack> = [#<z_clearance> + #<probe_diameter> + #<extra_probe_depth>]
|
||||
|
||||
(Call sub "probe_z_minus_sub" to Probe top of Workpiece)
|
||||
o<probe_z_minus_sub> call [#3014][#3015][#3016][#3017][#3020][#3021][#3030]
|
||||
|
||||
(Probe X Positioning Move, Traverse Workpiece Top at Z Clearance Height plane)
|
||||
G91
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 X[#<step_off_width>] Y[#<step_off_width>]
|
||||
|
||||
(Probe X Positioning Move, to Probing Depth)
|
||||
F[#<probe_fast_fr>]
|
||||
G38.3 Z-[#<z_probe_stack>]
|
||||
|
||||
G90
|
||||
(Current X Position including offsets in current program units)
|
||||
#<x_start> = #5420
|
||||
|
||||
(Call sub "probe_x_minus" to Probe x- side of Workpiece)
|
||||
o<probe_x_minus> call [#3014][#3015][#3016][#3017][#3018][#3019][#3032]
|
||||
|
||||
#<x_minus_zero_edge> = #<_value>
|
||||
|
||||
(value returned safety check, aborts if no value returned)
|
||||
o110 if [#<probe_mode> EQ 1 AND #<_value_returned> NE 1]
|
||||
(MSG, Missing X Sub returned edge parameter, aborting)
|
||||
o<probe_front_left_inside_corner> return
|
||||
o110 endif
|
||||
|
||||
(move to X start Position)
|
||||
G90
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 X[#<x_start>]
|
||||
|
||||
(Current Y Position including offsets in current program units)
|
||||
#<y_start> = #5421
|
||||
|
||||
(Call sub "probe_y_minus" to Probe y- side of Workpiece)
|
||||
o<probe_y_minus> call [#3014][#3015][#3016][#3017][#3018][#3019][#3032]
|
||||
|
||||
#<y_minus_zero_edge> = #<_value>
|
||||
|
||||
(value returned safety check, aborts if no value returned)
|
||||
o120 if [#<probe_mode> EQ 1 AND #<_value_returned> NE 1]
|
||||
(MSG, Missing Y Sub returned edge parameter, aborting)
|
||||
o<probe_front_left_inside_corner> return
|
||||
o120 endif
|
||||
|
||||
(move to Y start Position)
|
||||
G90
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 Y[#<y_start>]
|
||||
|
||||
(Probe Completion Move to Z Clearance Plane, and X Zero, Y Zero)
|
||||
G91
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 Z[#<z_probe_stack>]
|
||||
G90
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 X[#<x_minus_zero_edge>] Y[#<y_minus_zero_edge>]
|
||||
|
||||
(probe mode rules for WCO or probe position measuring only)
|
||||
o130 if [#<probe_mode> EQ 0]
|
||||
(Record Zero in selected axes and WCO)
|
||||
G10 L2 P#5220 X[#<x_minus_zero_edge> + #<workspace_x>]
|
||||
G10 L2 P#5220 Y[#<y_minus_zero_edge> + #<workspace_y>]
|
||||
o<probe_front_left_inside_corner> return
|
||||
o130 endif
|
||||
|
||||
o<probe_front_left_inside_corner> endsub
|
||||
|
||||
M2 (end program)
|
||||
@@ -0,0 +1,111 @@
|
||||
(author: Chris P)
|
||||
(version: 0.5)
|
||||
(date: 06/27/24)
|
||||
|
||||
(Probe front left top corner for x,y,z 0,0,0 position)
|
||||
(Start probe position is over front left corner of stock)
|
||||
(inside the step off width square and within max z distance)
|
||||
(ensure all settings have been set properly according to help diagrams)
|
||||
|
||||
o<probe_front_left_top_corner> sub
|
||||
|
||||
(uses NGCGUI style arg spec)
|
||||
(number after "=" in comment is default value)
|
||||
#<probe_tool_number> = #3014 (=99)
|
||||
#<probe_slow_fr> = #3015 (=0)
|
||||
#<probe_fast_fr> = #3016 (=10.0)
|
||||
#<probe_traverse_fr> = #3017 (=50)
|
||||
#<max_xy_distance> = #3018 (=0.5000)
|
||||
#<xy_clearance> = #3019 (=0.1000)
|
||||
#<max_z_distance> = #3020 (=0.5000)
|
||||
#<z_clearance> = #3021 (=0.1000)
|
||||
#<extra_probe_depth> = #3022 (=0.0000)
|
||||
#<step_off_width> = #3023 (=0.5000)
|
||||
#<edge_width> = #3024 (=0.5000)
|
||||
#<probe_mode> = #3030 (=0)
|
||||
#<calibration_offset> = #3032 (=0)
|
||||
|
||||
(Cancel G92 offsets)
|
||||
G92.1
|
||||
|
||||
#<workspace_x> = #[5201 + [20 * #5220]]
|
||||
#<workspace_y> = #[5202 + [20 * #5220]]
|
||||
|
||||
(Probe Tool Safety Check)
|
||||
o100 if [#5400 NE #<probe_tool_number>]
|
||||
(MSG, Specified probe tool #<probe_tool_number> not in spindle, aborting)
|
||||
o<probe_front_left_top_corner> return
|
||||
o100 endif
|
||||
|
||||
(Probe Diameter)
|
||||
#<probe_diameter> = #5410
|
||||
|
||||
(Probing depth from the z probed clearance height, used for z moves)
|
||||
#<z_probe_stack> = [#<z_clearance> + #<probe_diameter> + #<extra_probe_depth>]
|
||||
|
||||
(Call sub "probe_z_minus_sub" to Probe top of Workpiece)
|
||||
o<probe_z_minus_sub> call [#3014][#3015][#3016][#3017][#3020][#3021][#3030]
|
||||
|
||||
(Probe X Positioning Move, Step Off Width)
|
||||
G91
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 X-[#<step_off_width>]
|
||||
|
||||
(Probe X Positioning Move, to Probing Depth)
|
||||
F[#<probe_fast_fr>]
|
||||
G38.3 Z-[#<z_probe_stack>]
|
||||
|
||||
(Call sub "probe_x_plus" to Probe x+ side of Workpiece)
|
||||
o<probe_x_plus> call [#3014][#3015][#3016][#3017][#3018][#3019][#3032]
|
||||
|
||||
#<x_plus_zero_edge> = #<_value>
|
||||
|
||||
(value returned safety check, aborts if no value returned)
|
||||
o110 if [#<probe_mode> EQ 1 AND #<_value_returned> NE 1]
|
||||
(MSG, Missing X Sub returned edge parameter, aborting)
|
||||
o<probe_front_left_top_corner> return
|
||||
o110 endif
|
||||
|
||||
(Probe Y Positioning Move, up to Z clearance plane)
|
||||
G91
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 Z[#<z_probe_stack>]
|
||||
|
||||
(Probe Y Positioning Move, Traverse Workpiece at Z Clearance plane)
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 X[#<step_off_width>] Y-[#<step_off_width>]
|
||||
|
||||
(Probe Y Positioning Move,to Probing Depth)
|
||||
F[#<probe_fast_fr>]
|
||||
G38.3 Z-[#<z_probe_stack>]
|
||||
|
||||
(Call sub "probe_y_plus" to Probe y+ side of Workpiece)
|
||||
o<probe_y_plus> call [#3014][#3015][#3016][#3017][#3018][#3019][#3032]
|
||||
|
||||
#<y_plus_zero_edge> = #<_value>
|
||||
|
||||
(value returned safety check, aborts if no value returned)
|
||||
o120 if [#<probe_mode> EQ 1 AND #<_value_returned> NE 1]
|
||||
(MSG, Missing Y Sub returned edge parameter, aborting)
|
||||
o<probe_front_left_top_corner> return
|
||||
o120 endif
|
||||
|
||||
(Probe Completion Move to Z Clearance Plane, and XY Zero)
|
||||
G91
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 Z[#<z_probe_stack>]
|
||||
G90
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 X[#<x_plus_zero_edge>] Y[#<y_plus_zero_edge>]
|
||||
|
||||
(probe mode rules for WCO or probe position measuring only)
|
||||
o130 if [#<probe_mode> EQ 0]
|
||||
(Record Zero in selected axes and WCO)
|
||||
G10 L2 P#5220 X[#<x_plus_zero_edge> + #<workspace_x>]
|
||||
G10 L2 P#5220 Y[#<y_plus_zero_edge> + #<workspace_y>]
|
||||
o<probe_front_left_top_corner> return
|
||||
o130 endif
|
||||
|
||||
o<probe_front_left_top_corner> endsub
|
||||
|
||||
M2 (end program)
|
||||
@@ -0,0 +1,115 @@
|
||||
(author: Chris P)
|
||||
(version: 0.2)
|
||||
(date: 06/27/24)
|
||||
|
||||
(Probe front right inside corner for x,y,z 0,0,0 position)
|
||||
(Start probe position is over front right inside corner of stock)
|
||||
(inside the step off width square and within max z distance)
|
||||
(ensure all settings have been set properly according to help diagrams)
|
||||
|
||||
o<probe_front_right_inside_corner> sub
|
||||
|
||||
(uses NGCGUI style arg spec)
|
||||
(number after "=" in comment is default value)
|
||||
#<probe_tool_number> = #3014 (=99)
|
||||
#<probe_slow_fr> = #3015 (=0)
|
||||
#<probe_fast_fr> = #3016 (=10.0)
|
||||
#<probe_traverse_fr> = #3017 (=50)
|
||||
#<max_xy_distance> = #3018 (=0.5000)
|
||||
#<xy_clearance> = #3019 (=0.1000)
|
||||
#<max_z_distance> = #3020 (=0.5000)
|
||||
#<z_clearance> = #3021 (=0.1000)
|
||||
#<extra_probe_depth> = #3022 (=0.0000)
|
||||
#<step_off_width> = #3023 (=0.5000)
|
||||
#<edge_width> = #3024 (=0.5000)
|
||||
#<probe_mode> = #3030 (=0)
|
||||
#<calibration_offset> = #3032 (=0)
|
||||
|
||||
(Cancel G92 offsets)
|
||||
G92.1
|
||||
|
||||
#<workspace_x> = #[5201 + [20 * #5220]]
|
||||
#<workspace_y> = #[5202 + [20 * #5220]]
|
||||
|
||||
(Probe Tool Safety Check)
|
||||
o100 if [#5400 NE #<probe_tool_number>]
|
||||
(MSG, Specified probe tool #<probe_tool_number> not in spindle, aborting)
|
||||
o<probe_front_right_inside_corner> return
|
||||
o100 endif
|
||||
|
||||
(Probe Diameter)
|
||||
#<probe_diameter> = #5410
|
||||
|
||||
(Probing depth from the z probed clearance height, used for z moves)
|
||||
#<z_probe_stack> = [#<z_clearance> + #<probe_diameter> + #<extra_probe_depth>]
|
||||
|
||||
(Call sub "probe_z_minus_sub" to Probe top of Workpiece)
|
||||
o<probe_z_minus_sub> call [#3014][#3015][#3016][#3017][#3020][#3021][#3030]
|
||||
|
||||
(Probe X Positioning Move, Step Off Width X and Y)
|
||||
G91
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 X-[#<step_off_width>] Y[#<step_off_width>]
|
||||
|
||||
(Probe X Positioning Move, to Probing Depth)
|
||||
F[#<probe_fast_fr>]
|
||||
G38.3 Z-[#<z_probe_stack>]
|
||||
|
||||
G90
|
||||
(Current X Position including offsets in current program units)
|
||||
#<x_start> = #5420
|
||||
|
||||
(Call sub "probe_x_plus" to Probe x+ side of Workpiece)
|
||||
o<probe_x_plus> call [#3014][#3015][#3016][#3017][#3018][#3019][#3032]
|
||||
|
||||
#<x_plus_zero_edge> = #<_value>
|
||||
|
||||
(value returned safety check, aborts if no value returned)
|
||||
o110 if [#<probe_mode> EQ 1 AND #<_value_returned> NE 1]
|
||||
(MSG, Missing X Sub returned edge parameter, aborting)
|
||||
o<probe_front_right_inside_corner> return
|
||||
o110 endif
|
||||
|
||||
(move to X start Position)
|
||||
G90
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 X[#<x_start>]
|
||||
|
||||
(Current Y Position including offsets in current program units)
|
||||
#<y_start> = #5421
|
||||
|
||||
(Call sub "probe_y_minus" to Probe y- side of Workpiece)
|
||||
o<probe_y_minus> call [#3014][#3015][#3016][#3017][#3018][#3019][#3032]
|
||||
|
||||
#<y_minus_zero_edge> = #<_value>
|
||||
|
||||
(value returned safety check, aborts if no value returned)
|
||||
o120 if [#<probe_mode> EQ 1 AND #<_value_returned> NE 1]
|
||||
(MSG, Missing Y Sub returned edge parameter, aborting)
|
||||
o<probe_front_right_inside_corner> return
|
||||
o120 endif
|
||||
|
||||
(move to Y start Position)
|
||||
G90
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 Y[#<y_start>]
|
||||
|
||||
(Probe Completion Move to Z Clearance Plane, and X Zero, Y Zero)
|
||||
G91
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 Z[#<z_probe_stack>]
|
||||
G90
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 X[#<x_plus_zero_edge>] Y[#<y_minus_zero_edge>]
|
||||
|
||||
(probe mode rules for WCO or probe position measuring only)
|
||||
o130 if [#<probe_mode> EQ 0]
|
||||
(Record Zero in selected axes and WCO)
|
||||
G10 L2 P#5220 X[#<x_plus_zero_edge> + #<workspace_x>]
|
||||
G10 L2 P#5220 Y[#<y_minus_zero_edge> + #<workspace_y>]
|
||||
o<probe_front_right_inside_corner> return
|
||||
o130 endif
|
||||
|
||||
o<probe_front_right_inside_corner> endsub
|
||||
|
||||
M2 (end program)
|
||||
@@ -0,0 +1,112 @@
|
||||
(author: Chris P)
|
||||
(version: 0.2)
|
||||
(date: 06/27/24)
|
||||
|
||||
(Probe front right top corner for x,y,z 0,0,0 position)
|
||||
(Start probe position is over front right corner of stock)
|
||||
(inside the step off width square and within max z distance)
|
||||
(ensure all settings have been set properly according to help diagrams)
|
||||
|
||||
o<probe_front_right_top_corner> sub
|
||||
|
||||
(uses NGCGUI style arg spec)
|
||||
(number after "=" in comment is default value)
|
||||
#<probe_tool_number> = #3014 (=99)
|
||||
#<probe_slow_fr> = #3015 (=0)
|
||||
#<probe_fast_fr> = #3016 (=10.0)
|
||||
#<probe_traverse_fr> = #3017 (=50)
|
||||
#<max_xy_distance> = #3018 (=0.5000)
|
||||
#<xy_clearance> = #3019 (=0.1000)
|
||||
#<max_z_distance> = #3020 (=0.5000)
|
||||
#<z_clearance> = #3021 (=0.1000)
|
||||
#<extra_probe_depth> = #3022 (=0.0000)
|
||||
#<step_off_width> = #3023 (=0.5000)
|
||||
#<edge_width> = #3024 (=0.5000)
|
||||
#<probe_mode> = #3030 (=0)
|
||||
#<calibration_offset> = #3032 (=0)
|
||||
|
||||
|
||||
(Cancel G92 offsets)
|
||||
G92.1
|
||||
|
||||
#<workspace_x> = #[5201 + [20 * #5220]]
|
||||
#<workspace_y> = #[5202 + [20 * #5220]]
|
||||
|
||||
(Probe Tool Safety Check)
|
||||
o100 if [#5400 NE #<probe_tool_number>]
|
||||
(MSG, Specified probe tool #<probe_tool_number> not in spindle, aborting)
|
||||
o<probe_front_right_top_corner> return
|
||||
o100 endif
|
||||
|
||||
(Probe Diameter)
|
||||
#<probe_diameter> = #5410
|
||||
|
||||
(Probing depth from the z probed clearance height, used for z moves)
|
||||
#<z_probe_stack> = [#<z_clearance> + #<probe_diameter> + #<extra_probe_depth>]
|
||||
|
||||
(Call sub "probe_z_minus_sub" to Probe top of Workpiece)
|
||||
o<probe_z_minus_sub> call [#3014][#3015][#3016][#3017][#3020][#3021][#3030]
|
||||
|
||||
(Probe X Positioning Move, Step Off Width)
|
||||
G91
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 X[#<step_off_width>]
|
||||
|
||||
(Probe X Positioning Move, to Probing Depth)
|
||||
F[#<probe_fast_fr>]
|
||||
G38.3 Z-[#<z_probe_stack>]
|
||||
|
||||
(Call sub "probe_x_minus" to Probe x- side of Workpiece)
|
||||
o<probe_x_minus> call [#3014][#3015][#3016][#3017][#3018][#3019][#3032]
|
||||
|
||||
#<x_minus_zero_edge> = #<_value>
|
||||
|
||||
(value returned safety check, aborts if no value returned)
|
||||
o110 if [#<probe_mode> EQ 1 AND #<_value_returned> NE 1]
|
||||
(MSG, Missing X Sub returned edge parameter, aborting)
|
||||
o<probe_front_right_top_corner> return
|
||||
o110 endif
|
||||
|
||||
(Probe Y Positioning Move, up to Z clearance plane)
|
||||
G91
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 Z[#<z_probe_stack>]
|
||||
|
||||
(Probe Y Positioning Move, Traverse Workpiece Top at Z Clearance Height plane)
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 X-[#<step_off_width>] Y-[#<step_off_width>]
|
||||
|
||||
(Probe Y Positioning Move,to Probing Depth)
|
||||
F[#<probe_fast_fr>]
|
||||
G38.3 Z-[#<z_probe_stack>]
|
||||
|
||||
(Call sub "probe_y_plus" to Probe y- side of Workpiece)
|
||||
o<probe_y_plus> call [#3014][#3015][#3016][#3017][#3018][#3019][#3032]
|
||||
|
||||
#<y_plus_zero_edge> = #<_value>
|
||||
|
||||
(value returned safety check, aborts if no value returned)
|
||||
o120 if [#<probe_mode> EQ 1 AND #<_value_returned> NE 1]
|
||||
(MSG, Missing Y Sub returned edge parameter, aborting)
|
||||
o<probe_front_right_top_corner> return
|
||||
o120 endif
|
||||
|
||||
(Probe Completion Move to Z Clearance Plane, and XY Zero)
|
||||
G91
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 Z[#<z_probe_stack>]
|
||||
G90
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 X[#<x_minus_zero_edge>] Y[#<y_plus_zero_edge>]
|
||||
|
||||
(probe mode rules for WCO or probe position measuring only)
|
||||
o130 if [#<probe_mode> EQ 0]
|
||||
(Record Zero in selected axes and WCO)
|
||||
G10 L2 P#5220 X[#<x_minus_zero_edge> + #<workspace_x>]
|
||||
G10 L2 P#5220 Y[#<y_plus_zero_edge> + #<workspace_y>]
|
||||
o<probe_front_right_top_corner> return
|
||||
o130 endif
|
||||
|
||||
o<probe_front_right_top_corner> endsub
|
||||
|
||||
M2 (end program)
|
||||
@@ -0,0 +1,85 @@
|
||||
(author: Chris P)
|
||||
(version: 0.5)
|
||||
(date: 06/27/24)
|
||||
|
||||
(Probe front top side for y,z 0,0 position)
|
||||
(Start probe position is over front edge of stock)
|
||||
(inside the step off width distance and within max z distance)
|
||||
(ensure all settings have been set properly according to help diagrams)
|
||||
|
||||
o<Probe_front_top_side> sub
|
||||
|
||||
(uses NGCGUI style arg spec)
|
||||
(number after "=" in comment is default value)
|
||||
#<probe_tool_number> = #3014 (=99)
|
||||
#<probe_slow_fr> = #3015 (=0)
|
||||
#<probe_fast_fr> = #3016 (=10.0)
|
||||
#<probe_traverse_fr> = #3017 (=50)
|
||||
#<max_xy_distance> = #3018 (=0.5000)
|
||||
#<xy_clearance> = #3019 (=0.1000)
|
||||
#<max_z_distance> = #3020 (=0.5000)
|
||||
#<z_clearance> = #3021 (=0.1000)
|
||||
#<extra_probe_depth> = #3022 (=0.0000)
|
||||
#<step_off_width> = #3023 (=0.5000)
|
||||
#<edge_width> = #3024 (=0.5000)
|
||||
#<probe_mode> = #3030 (=0)
|
||||
#<calibration_offset> = #3032 (=0)
|
||||
|
||||
(Cancel G92 offsets)
|
||||
G92.1
|
||||
|
||||
#<workspace_y> = #[5202 + [20 * #5220]]
|
||||
|
||||
(Probe Tool Safety Check)
|
||||
o100 if [#5400 NE #<probe_tool_number>]
|
||||
(MSG, Specified probe tool #<probe_tool_number> not in spindle, aborting)
|
||||
o<Probe_front_top_side> return
|
||||
o100 endif
|
||||
|
||||
(Probe Diameter)
|
||||
#<probe_diameter> = #5410
|
||||
|
||||
(Probing depth from the z probed clearance height, used for z moves)
|
||||
#<z_probe_stack> = [#<z_clearance> + #<probe_diameter> + #<extra_probe_depth>]
|
||||
|
||||
(Call sub "probe_z_minus_sub" to Probe top of Workpiece)
|
||||
o<probe_z_minus_sub> call [#3014][#3015][#3016][#3017][#3020][#3021][#3030]
|
||||
|
||||
(Probe Y Positioning Move, Step Off Width)
|
||||
G91
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 Y-[#<step_off_width>]
|
||||
|
||||
(Probe Y Positioning Move, to Probing Depth)
|
||||
F[#<probe_fast_fr>]
|
||||
G38.3 Z-[#<z_probe_stack>]
|
||||
|
||||
(Call sub "probe_y_plus" to Probe y+ side of Workpiece)
|
||||
o<probe_y_plus> call [#3014][#3015][#3016][#3017][#3018][#3019][#3032]
|
||||
|
||||
#<y_plus_zero_edge> = #<_value>
|
||||
|
||||
(value returned safety check, aborts if no value returned)
|
||||
o110 if [#<probe_mode> EQ 1 AND #<_value_returned> NE 1]
|
||||
(MSG, Missing Y Sub returned edge parameter, aborting)
|
||||
o<probe_front_top_side> return
|
||||
o110 endif
|
||||
|
||||
(Probe Completion Move to Z Clearance Plane, and Y Zero)
|
||||
G91
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 Z[#<z_probe_stack>]
|
||||
G90
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 Y[#<y_plus_zero_edge>]
|
||||
|
||||
(probe mode rules for WCO or probe position measuring only)
|
||||
o120 if [#<probe_mode> EQ 0]
|
||||
(Record Zero in selected axes and WCO)
|
||||
G10 L2 P#5220 Y[#<y_plus_zero_edge> + #<workspace_y>]
|
||||
o<probe_front_top_side> return
|
||||
o120 endif
|
||||
|
||||
o<Probe_front_top_side> endsub
|
||||
|
||||
M2 (end program)
|
||||
@@ -0,0 +1,85 @@
|
||||
(author: Chris P)
|
||||
(version: 0.4)
|
||||
(date: 06/27/24)
|
||||
|
||||
(Probe left top side for x,z 0,0 position)
|
||||
(Start probe position is over left side edge of stock)
|
||||
(inside the step off width distance and within max z distance)
|
||||
(ensure all settings have been set properly according to help diagrams)
|
||||
|
||||
o<Probe_left_top_side> sub
|
||||
|
||||
(uses NGCGUI style arg spec)
|
||||
(number after "=" in comment is default value)
|
||||
#<probe_tool_number> = #3014 (=99)
|
||||
#<probe_slow_fr> = #3015 (=0)
|
||||
#<probe_fast_fr> = #3016 (=10.0)
|
||||
#<probe_traverse_fr> = #3017 (=50)
|
||||
#<max_xy_distance> = #3018 (=0.5000)
|
||||
#<xy_clearance> = #3019 (=0.1000)
|
||||
#<max_z_distance> = #3020 (=0.5000)
|
||||
#<z_clearance> = #3021 (=0.1000)
|
||||
#<extra_probe_depth> = #3022 (=0.0000)
|
||||
#<step_off_width> = #3023 (=0.5000)
|
||||
#<edge_width> = #3024 (=0.5000)
|
||||
#<probe_mode> = #3030 (=0)
|
||||
#<calibration_offset> = #3032 (=0)
|
||||
|
||||
(Cancel G92 offsets)
|
||||
G92.1
|
||||
|
||||
#<workspace_x> = #[5201 + [20 * #5220]]
|
||||
|
||||
(Probe Tool Safety Check)
|
||||
o100 if [#5400 NE #<probe_tool_number>]
|
||||
(MSG, Specified probe tool #<probe_tool_number> not in spindle, aborting)
|
||||
o<Probe_left_top_side> return
|
||||
o100 endif
|
||||
|
||||
(Probe Diameter)
|
||||
#<probe_diameter> = #5410
|
||||
|
||||
(Probing depth from the z probed clearance height, used for z moves)
|
||||
#<z_probe_stack> = [#<z_clearance> + #<probe_diameter> + #<extra_probe_depth>]
|
||||
|
||||
(Call sub "probe_z_minus_sub" to Probe top of Workpiece)
|
||||
o<probe_z_minus_sub> call [#3014][#3015][#3016][#3017][#3020][#3021][#3030]
|
||||
|
||||
(Probe X Positioning Move, Step Off Width)
|
||||
G91
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 X-[#<step_off_width>]
|
||||
|
||||
(Probe X Positioning Move, to Probing Depth)
|
||||
F[#<probe_fast_fr>]
|
||||
Z-[#<z_probe_stack>]
|
||||
|
||||
(Call sub "probe_x_plus" to Probe x+ side of Workpiece)
|
||||
o<probe_x_plus> call [#3014][#3015][#3016][#3017][#3018][#3019][#3032]
|
||||
|
||||
#<x_plus_zero_edge> = #<_value>
|
||||
|
||||
(value returned safety check, aborts if no value returned)
|
||||
o110 if [#<probe_mode> EQ 1 AND #<_value_returned> NE 1]
|
||||
(MSG, Missing X Sub returned edge parameter, aborting)
|
||||
o<probe_left_top_side> return
|
||||
o110 endif
|
||||
|
||||
(Probe Completion Move to Z Clearance Plane, and Y Zero)
|
||||
G91
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 Z[#<z_probe_stack>]
|
||||
G90
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 X[#<x_plus_zero_edge>]
|
||||
|
||||
(probe mode rules for WCO or probe position measuring only)
|
||||
o120 if [#<probe_mode> EQ 0]
|
||||
(Record Zero in selected axes and WCO)
|
||||
G10 L2 P#5220 X[#<x_plus_zero_edge> + #<workspace_x>]
|
||||
o<probe_left_top_side> return
|
||||
o120 endif
|
||||
|
||||
o<Probe_left_top_side> endsub
|
||||
|
||||
M2 (end program)
|
||||
180
configs/probe_basic_lathe/subroutines/probe_rect_boss.ngc
Normal file
180
configs/probe_basic_lathe/subroutines/probe_rect_boss.ngc
Normal file
@@ -0,0 +1,180 @@
|
||||
(author: Chris P)
|
||||
(version: 0.2)
|
||||
(date: 06/27/24)
|
||||
|
||||
(Probe Boss in X and Y Axes, find center and z 0 position)
|
||||
(Start probe position is over center of stock in X and Y axis)
|
||||
(within max z distance, ensure all settings have been)
|
||||
(set properly according to help diagrams)
|
||||
|
||||
o<probe_rect_boss> sub
|
||||
|
||||
(uses NGCGUI style arg spec)
|
||||
(number after "=" in comment is default value)
|
||||
#<probe_tool_number> = #3014 (=99)
|
||||
#<probe_slow_fr> = #3015 (=0)
|
||||
#<probe_fast_fr> = #3016 (=10.0)
|
||||
#<probe_traverse_fr> = #3017 (=50)
|
||||
#<max_xy_distance> = #3018 (=0.5000)
|
||||
#<xy_clearance> = #3019 (=0.1000)
|
||||
#<max_z_distance> = #3020 (=0.5000)
|
||||
#<z_clearance> = #3021 (=0.1000)
|
||||
#<extra_probe_depth> = #3022 (=0.0000)
|
||||
#<step_off_width> = #3023 (=0.5000)
|
||||
#<edge_width> = #3024 (=0.5000)
|
||||
#<x_hint_boss_pocket> = #3026 (=0)
|
||||
#<y_hint_boss_pocket> = #3027 (=0)
|
||||
#<probe_mode> = #3030 (=0)
|
||||
#<calibration_offset> = #3032 (=0)
|
||||
|
||||
(Cancel G92 offsets)
|
||||
G92.1
|
||||
|
||||
#<workspace_x> = #[5201 + [20 * #5220]]
|
||||
#<workspace_y> = #[5202 + [20 * #5220]]
|
||||
#<workspace_z> = #[5203 + [20 * #5220]]
|
||||
|
||||
(Probe Tool Safety Check)
|
||||
o100 if [#5400 NE #<probe_tool_number>]
|
||||
(MSG, Specified probe tool #<probe_tool_number> not in spindle, aborting)
|
||||
o<probe_rect_boss> return
|
||||
o100 endif
|
||||
|
||||
(Probe Diameter)
|
||||
#<probe_diameter> = #5410
|
||||
|
||||
(Probe Radius)
|
||||
#<probe_radius> = [#<probe_diameter> / 2]
|
||||
|
||||
(Probe Centerline Offset)
|
||||
#<probe_center_offset> = [#<probe_radius> - #<calibration_offset>]
|
||||
|
||||
(remove probe tip diam and cal offset from probed width calculations)
|
||||
#<probe_diameter_offset> = [#<probe_diameter> - [#<calibration_offset> * 2]]
|
||||
|
||||
#<z_probe_stack> = [#<z_clearance> + #<probe_diameter> + #<extra_probe_depth>]
|
||||
|
||||
(Call sub "probe_z_minus_sub" to Probe top of Workpiece)
|
||||
o<probe_z_minus_sub> call [#3014][#3015][#3016][#3017][#3020][#3021][#3030]
|
||||
|
||||
(Probe X Positioning Move, X hint/2 + Step Off Width)
|
||||
G91
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 X-[[#<x_hint_boss_pocket>/2] + #<step_off_width>]
|
||||
|
||||
(Probe X Positioning Move, to Probing Depth)
|
||||
F[#<probe_fast_fr>]
|
||||
G38.3 Z-[#<z_probe_stack>]
|
||||
|
||||
(Call sub "probe_x_plus" to Probe x+ side of Workpiece)
|
||||
o<probe_x_plus> call [#3014][#3015][#3016][#3017][#3018][#3019][#3032]
|
||||
|
||||
#<x_plus_probed> = #5061
|
||||
|
||||
(first side Probe Completion Move to Z Clearance Plane)
|
||||
G91
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 Z[#<z_probe_stack>]
|
||||
|
||||
(Positioning move in X, X Hint + Step Off Width at Rapid Speed)
|
||||
G91
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 X[#<x_hint_boss_pocket> + #<step_off_width> + #<xy_clearance>]
|
||||
|
||||
(Probe X Positioning Move, to Probing Depth)
|
||||
F[#<probe_fast_fr>]
|
||||
G38.3 Z-[#<z_probe_stack>]
|
||||
|
||||
(Call sub "probe_x_minus" to Probe x- side of Workpiece)
|
||||
o<probe_x_minus> call [#3014][#3015][#3016][#3017][#3018][#3019][#3032]
|
||||
|
||||
#<x_minus_probed> = #5061
|
||||
|
||||
(probed center calulation)
|
||||
#<x_center_probed> = [[#<x_minus_probed> + #<x_plus_probed>] / 2]
|
||||
|
||||
(calculate X Width Probed)
|
||||
#<raw_width> = [#<x_minus_probed> - #<x_plus_probed>]
|
||||
|
||||
(Completed probed width calculations)
|
||||
#<x_probed_width> = [#<raw_width> - #<probe_diameter_offset>]
|
||||
|
||||
#1001 = #<x_probed_width>
|
||||
(DEBUG, EVAL[vcp.getWidget{"x_probed_width"}.setValue{#1001}])
|
||||
|
||||
#1002 = #<x_center_probed>
|
||||
(DEBUG, EVAL[vcp.getWidget{"x_center_probed"}.setValue{#1002}])
|
||||
|
||||
G91
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 Z[#<z_probe_stack>]
|
||||
G90
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 X[#<x_center_probed>]
|
||||
|
||||
(Probe Y Positioning Move, Y hint/2 + Step Off Width)
|
||||
G91
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 Y-[[#<y_hint_boss_pocket>/2] + #<step_off_width>]
|
||||
|
||||
(Probe Y Positioning Move, to Probing Depth)
|
||||
F[#<probe_fast_fr>]
|
||||
G38.3 Z-[#<z_probe_stack>]
|
||||
|
||||
(Call sub "probe_y_plus" to Probe y+ side of Workpiece)
|
||||
o<probe_y_plus> call [#3014][#3015][#3016][#3017][#3018][#3019][#3032]
|
||||
|
||||
#<y_plus_probed> = #5062
|
||||
|
||||
(first side Probe Completion Move to Z Clearance Plane)
|
||||
G91
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 Z[#<z_probe_stack>]
|
||||
|
||||
(Positioning move in Y, Y Hint + Step Off Width at Rapid Speed)
|
||||
G91
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 Y[#<y_hint_boss_pocket> + #<step_off_width> + #<xy_clearance>]
|
||||
|
||||
(Probe Y Positioning Move, to Probing Depth)
|
||||
F[#<probe_fast_fr>]
|
||||
G38.3 Z-[#<z_probe_stack>]
|
||||
|
||||
(Call sub "probe_y_minus" to Probe y- side of Workpiece)
|
||||
o<probe_y_minus> call [#3014][#3015][#3016][#3017][#3018][#3019][#3032]
|
||||
|
||||
#<y_minus_probed> = #5062
|
||||
|
||||
(probed center calulation)
|
||||
#<y_center_probed> = [[#<y_minus_probed> + #<y_plus_probed>] / 2]
|
||||
|
||||
(calculate Y Width Probed)
|
||||
#<raw_width> = [#<y_minus_probed> - #<y_plus_probed>]
|
||||
|
||||
(Completed probed width calculations)
|
||||
#<y_probed_width> = [#<raw_width> - #<probe_diameter_offset>]
|
||||
|
||||
#1003 = #<y_probed_width>
|
||||
(DEBUG, EVAL[vcp.getWidget{"y_probed_width"}.setValue{#1003}])
|
||||
|
||||
#1004 = #<y_center_probed>
|
||||
(DEBUG, EVAL[vcp.getWidget{"y_center_probed"}.setValue{#1004}])
|
||||
|
||||
G91
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 Z[#<z_probe_stack>]
|
||||
G90
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 X[#<x_center_probed>] Y[#<y_center_probed>]
|
||||
|
||||
(probe mode rules for WCO or probe position measuring only)
|
||||
o110 if [#<probe_mode> EQ 0]
|
||||
(Record XY Zero in selected WCO)
|
||||
G10 L2 P#5220 X[#<x_center_probed> + #<workspace_x>] Y[#<y_center_probed> + #<workspace_y>]
|
||||
(Probe Completion Move to Z Clearance Plane, and X Zero, Y Zero)
|
||||
o<probe_rect_boss> return
|
||||
o110 endif
|
||||
|
||||
o<probe_rect_boss> endsub
|
||||
|
||||
M2 (end program)
|
||||
133
configs/probe_basic_lathe/subroutines/probe_rect_pocket.ngc
Normal file
133
configs/probe_basic_lathe/subroutines/probe_rect_pocket.ngc
Normal file
@@ -0,0 +1,133 @@
|
||||
(author: Chris P)
|
||||
(version: 0.2)
|
||||
(date: 06/27/24)
|
||||
|
||||
(Probe rect pocket center measure x and widths, find xy center position)
|
||||
(Start probe position is over left side edge of pocket wall)
|
||||
(inside the step off width distance and within max z distance)
|
||||
(ensure all settings have been set properly according to help diagrams)
|
||||
|
||||
o<probe_rect_pocket> sub
|
||||
|
||||
(uses NGCGUI style arg spec)
|
||||
(number after "=" in comment is default value)
|
||||
#<probe_tool_number> = #3014 (=99)
|
||||
#<probe_slow_fr> = #3015 (=0)
|
||||
#<probe_fast_fr> = #3016 (=10.0)
|
||||
#<probe_traverse_fr> = #3017 (=50)
|
||||
#<max_xy_distance> = #3018 (=0.5000)
|
||||
#<xy_clearance> = #3019 (=0.1000)
|
||||
#<max_z_distance> = #3020 (=0.5000)
|
||||
#<z_clearance> = #3021 (=0.1000)
|
||||
#<extra_probe_depth> = #3022 (=0.0000)
|
||||
#<step_off_width> = #3023 (=0.5000)
|
||||
#<edge_width> = #3024 (=0.5000)
|
||||
#<x_hint_boss_pocket> = #3026 (=0)
|
||||
#<y_hint_boss_pocket> = #3027 (=0)
|
||||
#<probe_mode> = #3030 (=0)
|
||||
#<calibration_offset> = #3032 (=0)
|
||||
|
||||
(Cancel G92 offsets)
|
||||
G92.1
|
||||
|
||||
#<workspace_x> = #[5201 + [20 * #5220]]
|
||||
#<workspace_y> = #[5202 + [20 * #5220]]
|
||||
|
||||
(Probe Tool Safety Check)
|
||||
o100 if [#5400 NE #<probe_tool_number>]
|
||||
(MSG, Specified probe tool #<probe_tool_number> not in spindle, aborting)
|
||||
o<probe_rect_pocket> return
|
||||
o100 endif
|
||||
|
||||
(Probe Diameter)
|
||||
#<probe_diameter> = #5410
|
||||
|
||||
(remove probe tip diam and cal offset from probed width calculations)
|
||||
#<probe_diameter_offset> = [#<probe_diameter> - [#<calibration_offset> * 2]]
|
||||
|
||||
#<z_probe_stack> = [#<z_clearance> + #<probe_diameter> + #<extra_probe_depth>]
|
||||
|
||||
(Call sub "probe_z_minus_sub" to Probe top of Workpiece)
|
||||
o<probe_z_minus_sub> call [#3014][#3015][#3016][#3017][#3020][#3021][#3030]
|
||||
|
||||
(Probe X Positioning Move, Step Off Width)
|
||||
G91
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 X[#<step_off_width>]
|
||||
|
||||
(Probe X Positioning Move, to Probing Depth)
|
||||
F[#<probe_fast_fr>]
|
||||
G38.3 Z-[#<z_probe_stack>]
|
||||
|
||||
(Call sub "probe_x_minus" to Probe x- side of Workpiece)
|
||||
o<probe_x_minus> call [#3014][#3015][#3016][#3017][#3018][#3019][#3032]
|
||||
|
||||
#<x_minus_probed> = #5061
|
||||
|
||||
(Call sub "probe_x_plus" to Probe x+ side of Workpiece)
|
||||
o<probe_x_plus> call [#3014][#3015][#3016][3017][#3018 + #3026][#3019][#3032]
|
||||
|
||||
#<x_plus_probed> = #5061
|
||||
|
||||
(probed center calculation)
|
||||
#<x_center_probed> = [[#<x_plus_probed> + #<x_minus_probed>] / 2]
|
||||
|
||||
(calculate X Width Probed)
|
||||
#<raw_width> = [#<x_plus_probed> - #<x_minus_probed>]
|
||||
|
||||
(Completed probed width calculations)
|
||||
#<x_probed_width> = [#<raw_width> + #<probe_diameter_offset>]
|
||||
|
||||
#1001 = #<x_probed_width>
|
||||
(DEBUG, EVAL[vcp.getWidget{"x_probed_width"}.setValue{#1001}])
|
||||
|
||||
#1002 = #<x_center_probed>
|
||||
(DEBUG, EVAL[vcp.getWidget{"x_center_probed"}.setValue{#1002}])
|
||||
|
||||
(Probe Completion Move to Z Clearance Plane, and X Zero, Y Zero)
|
||||
G90
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 X[#<x_center_probed>]
|
||||
|
||||
(Call sub "probe_y_plus" to Probe Y+ side of Workpiece)
|
||||
o<probe_y_plus> call [#3014][#3015][#3016][3017][#3018 + #3027 / 2][#3019][#3032]
|
||||
|
||||
#<y_plus_probed> = #5062
|
||||
|
||||
(Call sub "probe_y_minus" to Probe Y- side of Workpiece)
|
||||
o<probe_y_minus> call [#3014][#3015][#3016][3017][#3018 + #3027][#3019][#3032]
|
||||
|
||||
#<y_minus_probed> = #5062
|
||||
|
||||
(probed center calculation)
|
||||
#<y_center_probed> = [[#<y_plus_probed> + #<y_minus_probed>] / 2]
|
||||
|
||||
(calculate Y Width Probed)
|
||||
#<raw_width> = [#<y_plus_probed> - #<y_minus_probed>]
|
||||
|
||||
(Completed probed width calculations)
|
||||
#<y_probed_width> = [#<raw_width> + #<probe_diameter_offset>]
|
||||
|
||||
#1003 = #<y_probed_width>
|
||||
(DEBUG, EVAL[vcp.getWidget{"y_probed_width"}.setValue{#1003}])
|
||||
|
||||
#1004 = #<y_center_probed>
|
||||
(DEBUG, EVAL[vcp.getWidget{"y_center_probed"}.setValue{#1004}])
|
||||
|
||||
G90
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 Y[#<y_center_probed>]
|
||||
G91
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 Z[#<z_probe_stack>]
|
||||
|
||||
(probe mode rules for WCO or probe position measuring only)
|
||||
o110 if [#<probe_mode> EQ 0]
|
||||
(Record X Zero in selected WCO)
|
||||
G10 L2 P#5220 X[#<x_center_probed> + #<workspace_x>] Y[#<y_center_probed> + #<workspace_y>]
|
||||
o<probe_rect_pocket> return
|
||||
o110 endif
|
||||
|
||||
o<probe_rect_pocket> endsub
|
||||
|
||||
M2 (end program)
|
||||
@@ -0,0 +1,115 @@
|
||||
(author: Chris P)
|
||||
(version: 0.2)
|
||||
(date: 06/27/24)
|
||||
|
||||
(Probe rect pocket center measure x and y widths, find xy center position)
|
||||
(Start probe position is rough center of pocket probe tip below top edge)
|
||||
(ensure all settings have been set properly according to help diagrams)
|
||||
|
||||
o<probe_rect_pocket_center_start> sub
|
||||
|
||||
(uses NGCGUI style arg spec)
|
||||
(number after "=" in comment is default value)
|
||||
#<probe_tool_number> = #3014 (=99)
|
||||
#<probe_slow_fr> = #3015 (=0)
|
||||
#<probe_fast_fr> = #3016 (=10.0)
|
||||
#<probe_traverse_fr> = #3017 (=50)
|
||||
#<max_xy_distance> = #3018 (=0.5000)
|
||||
#<xy_clearance> = #3019 (=0.1000)
|
||||
#<max_z_distance> = #3020 (=0.5000)
|
||||
#<z_clearance> = #3021 (=0.1000)
|
||||
#<extra_probe_depth> = #3022 (=0.0000)
|
||||
#<step_off_width> = #3023 (=0.5000)
|
||||
#<edge_width> = #3024 (=0.5000)
|
||||
#<x_hint_boss_pocket> = #3026 (=0)
|
||||
#<y_hint_boss_pocket> = #3027 (=0)
|
||||
#<probe_mode> = #3030 (=0)
|
||||
#<calibration_offset> = #3032 (=0)
|
||||
|
||||
(Cancel G92 offsets)
|
||||
G92.1
|
||||
|
||||
#<workspace_x> = #[5201 + [20 * #5220]]
|
||||
#<workspace_y> = #[5202 + [20 * #5220]]
|
||||
|
||||
(Probe Tool Safety Check)
|
||||
o100 if [#5400 NE #<probe_tool_number>]
|
||||
(MSG, Specified probe tool #<probe_tool_number> not in spindle, aborting)
|
||||
o<probe_rect_pocket_center_start> return
|
||||
o100 endif
|
||||
|
||||
(Probe Diameter)
|
||||
#<probe_diameter> = #5410
|
||||
|
||||
(remove probe tip diam and cal offset from probed width calculations)
|
||||
#<probe_diameter_offset> = [#<probe_diameter> - [#<calibration_offset> * 2]]
|
||||
|
||||
(Call sub "probe_x_minus" to Probe x- side of Workpiece)
|
||||
o<probe_x_minus> call [#3014][#3015][#3016][3017][#3018 + #3026 / 2][#3019][#3032]
|
||||
|
||||
#<x_minus_probed> = #5061
|
||||
|
||||
(Call sub "probe_x_plus" to Probe x+ side of Workpiece)
|
||||
o<probe_x_plus> call [#3014][#3015][#3016][3017][#3018 + #3026][#3019][#3032]
|
||||
|
||||
#<x_plus_probed> = #5061
|
||||
|
||||
(probed center calculation)
|
||||
#<x_center_probed> = [[#<x_plus_probed> + #<x_minus_probed>] / 2]
|
||||
|
||||
(calculate X Width Probed)
|
||||
#<raw_width> = [#<x_plus_probed> - #<x_minus_probed>]
|
||||
|
||||
(Completed probed width calculations)
|
||||
#<x_probed_width> = [#<raw_width> + #<probe_diameter_offset>]
|
||||
|
||||
#1001 = #<x_probed_width>
|
||||
(DEBUG, EVAL[vcp.getWidget{"x_probed_width"}.setValue{#1001}])
|
||||
|
||||
#1002 = #<x_center_probed>
|
||||
(DEBUG, EVAL[vcp.getWidget{"x_center_probed"}.setValue{#1002}])
|
||||
|
||||
(Probe Completion Move to X Zero, Y Zero)
|
||||
G90
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 X[#<x_center_probed>]
|
||||
|
||||
(Call sub "probe_y_plus" to Probe Y+ side of Workpiece)
|
||||
o<probe_y_plus> call [#3014][#3015][#3016][3017][#3018 + #3027 / 2][#3019][#3032]
|
||||
|
||||
#<y_plus_probed> = #5062
|
||||
|
||||
(Call sub "probe_y_minus" to Probe Y- side of Workpiece)
|
||||
o<probe_y_minus> call [#3014][#3015][#3016][3017][#3018 + #3027][#3019][#3032]
|
||||
|
||||
#<y_minus_probed> = #5062
|
||||
|
||||
(probed center calculation)
|
||||
#<y_center_probed> = [[#<y_plus_probed> + #<y_minus_probed>] / 2]
|
||||
|
||||
(calculate Y Width Probed)
|
||||
#<raw_width> = [#<y_plus_probed> - #<y_minus_probed>]
|
||||
|
||||
(Completed probed width calculations)
|
||||
#<y_probed_width> = [#<raw_width> + #<probe_diameter_offset>]
|
||||
|
||||
#1003 = #<y_probed_width>
|
||||
(DEBUG, EVAL[vcp.getWidget{"y_probed_width"}.setValue{#1003}])
|
||||
|
||||
#1004 = #<y_center_probed>
|
||||
(DEBUG, EVAL[vcp.getWidget{"y_center_probed"}.setValue{#1004}])
|
||||
|
||||
G90
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 Y[#<y_center_probed>]
|
||||
|
||||
(probe mode rules for WCO or probe position measuring only)
|
||||
o110 if [#<probe_mode> EQ 0]
|
||||
(Record X and Y Zero in selected WCO)
|
||||
G10 L2 P#5220 X[#<x_center_probed> + #<workspace_x>] Y[#<y_center_probed> + #<workspace_y>]
|
||||
o<probe_rect_pocket_center_start> return
|
||||
o110 endif
|
||||
|
||||
o<probe_rect_pocket_center_start> endsub
|
||||
|
||||
M2 (end program)
|
||||
123
configs/probe_basic_lathe/subroutines/probe_ridge_x.ngc
Normal file
123
configs/probe_basic_lathe/subroutines/probe_ridge_x.ngc
Normal file
@@ -0,0 +1,123 @@
|
||||
(author: Chris P)
|
||||
(version: 0.2)
|
||||
(date: 06/27/24)
|
||||
|
||||
(Probe Ridge in X Axis to find center and z 0 position)
|
||||
(Start probe position is over center of stock in the X axis)
|
||||
(within max z distance, ensure all settings have been)
|
||||
(set properly according to help diagrams)
|
||||
|
||||
o<probe_ridge_x> sub
|
||||
|
||||
(uses NGCGUI style arg spec)
|
||||
(number after "=" in comment is default value)
|
||||
#<probe_tool_number> = #3014 (=99)
|
||||
#<probe_slow_fr> = #3015 (=0)
|
||||
#<probe_fast_fr> = #3016 (=10.0)
|
||||
#<probe_traverse_fr> = #3017 (=50)
|
||||
#<max_xy_distance> = #3018 (=0.5000)
|
||||
#<xy_clearance> = #3019 (=0.1000)
|
||||
#<max_z_distance> = #3020 (=0.5000)
|
||||
#<z_clearance> = #3021 (=0.1000)
|
||||
#<extra_probe_depth> = #3022 (=0.0000)
|
||||
#<step_off_width> = #3023 (=0.5000)
|
||||
#<edge_width> = #3024 (=0.5000)
|
||||
#<x_hint_ridge_valley> = #3028 (=0)
|
||||
#<y_hint_ridge_valley> = #3029 (=0)
|
||||
#<probe_mode> = #3030 (=0)
|
||||
#<calibration_offset> = #3032 (=0)
|
||||
|
||||
(Cancel G92 offsets)
|
||||
G92.1
|
||||
|
||||
#<workspace_x> = #[5201 + [20 * #5220]]
|
||||
#<workspace_z> = #[5203 + [20 * #5220]]
|
||||
|
||||
(Probe Tool Safety Check)
|
||||
o100 if [#5400 NE #<probe_tool_number>]
|
||||
(MSG, Specified probe tool #<probe_tool_number> not in spindle, aborting)
|
||||
o<probe_ridge_x> return
|
||||
o100 endif
|
||||
|
||||
(Probe Diameter)
|
||||
#<probe_diameter> = #5410
|
||||
|
||||
(Probe Radius)
|
||||
#<probe_radius> = [#<probe_diameter> / 2]
|
||||
|
||||
(Probe Centerline Offset)
|
||||
#<probe_center_offset> = [#<probe_radius> - #<calibration_offset>]
|
||||
|
||||
(remove probe tip diam and cal offset from probed width calculations)
|
||||
#<probe_diameter_offset> = [#<probe_diameter> - [#<calibration_offset> * 2]]
|
||||
|
||||
#<z_probe_stack> = [#<z_clearance> + #<probe_diameter> + #<extra_probe_depth>]
|
||||
|
||||
(Call sub "probe_z_minus_sub" to Probe top of Workpiece)
|
||||
o<probe_z_minus_sub> call [#3014][#3015][#3016][#3017][#3020][#3021][#3030]
|
||||
|
||||
(Probe X Positioning Move, X hint/2 + Step Off Width)
|
||||
G91
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 X-[[#<x_hint_ridge_valley>/2] + #<step_off_width>]
|
||||
|
||||
(Probe X Positioning Move, to Probing Depth)
|
||||
F[#<probe_fast_fr>]
|
||||
G38.3 Z-[#<z_probe_stack>]
|
||||
|
||||
(Call sub "probe_x_plus" to Probe x+ side of Workpiece)
|
||||
o<probe_x_plus> call [#3014][#3015][#3016][#3017][#3018][#3019][#3032]
|
||||
|
||||
#<x_plus_probed> = #5061
|
||||
|
||||
(first side Probe Completion Move to Z Clearance Plane)
|
||||
G91
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 Z[#<z_probe_stack>]
|
||||
|
||||
(Positioning move in X, X Hint + Step Off Width at Rapid Speed)
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 X[#<x_hint_ridge_valley> + #<step_off_width>]
|
||||
|
||||
(Probe X Positioning Move, to Probing Depth)
|
||||
F[#<probe_fast_fr>]
|
||||
G38.3 Z-[#<z_probe_stack>]
|
||||
|
||||
(Call sub "probe_x_minus" to Probe x- side of Workpiece)
|
||||
o<probe_x_minus> call [#3014][#3015][#3016][#3017][#3018][#3019][#3032]
|
||||
|
||||
#<x_minus_probed> = #5061
|
||||
|
||||
(probed center calulation)
|
||||
#<x_center_probed> = [[#<x_plus_probed> + #<x_minus_probed>] / 2]
|
||||
|
||||
(calculate X Width Probed)
|
||||
#<raw_width> = [#<x_minus_probed> - #<x_plus_probed>]
|
||||
|
||||
(Completed probed width calculations)
|
||||
#<x_probed_width> = [#<raw_width> - #<probe_diameter_offset>]
|
||||
|
||||
#1001 = #<x_probed_width>
|
||||
(DEBUG, EVAL[vcp.getWidget{"x_probed_width"}.setValue{#1001}])
|
||||
|
||||
#1002 = #<x_center_probed>
|
||||
(DEBUG, EVAL[vcp.getWidget{"x_center_probed"}.setValue{#1002}])
|
||||
|
||||
(Probe Completion Move to Z Clearance Plane, and X Zero)
|
||||
G91
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 Z[#<z_probe_stack>]
|
||||
G90
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 X[#<x_center_probed>]
|
||||
|
||||
(probe mode rules for WCO or probe position measuring only)
|
||||
o110 if [#<probe_mode> EQ 0]
|
||||
(Record X Zero in selected WCO)
|
||||
G10 L2 P#5220 X[#<x_center_probed> + #<workspace_x>]
|
||||
o<probe_ridge_x> return
|
||||
o110 endif
|
||||
|
||||
o<probe_ridge_x> endsub
|
||||
|
||||
M2 (end program)
|
||||
123
configs/probe_basic_lathe/subroutines/probe_ridge_y.ngc
Normal file
123
configs/probe_basic_lathe/subroutines/probe_ridge_y.ngc
Normal file
@@ -0,0 +1,123 @@
|
||||
(author: Chris P)
|
||||
(version: 0.2)
|
||||
(date: 06/27/24)
|
||||
|
||||
(Probe Ridge in Y Axis to find center and z 0 position)
|
||||
(Start probe position is over center of stock in the Y axis)
|
||||
(within max z distance, ensure all settings have been)
|
||||
(set properly according to help diagrams)
|
||||
|
||||
o<probe_ridge_y> sub
|
||||
|
||||
(uses NGCGUI style arg spec)
|
||||
#<probe_tool_number> = #3014
|
||||
#<probe_slow_fr> = #3015
|
||||
#<probe_fast_fr> = #3016
|
||||
#<probe_traverse_fr> = #3017
|
||||
#<max_xy_distance> = #3018
|
||||
#<xy_clearance> = #3019
|
||||
#<max_z_distance> = #3020
|
||||
#<z_clearance> = #3021
|
||||
#<extra_probe_depth> = #3022
|
||||
#<step_off_width> = #3023
|
||||
#<edge_width> = #3024
|
||||
#<x_hint_ridge_valley> = #3028
|
||||
#<y_hint_ridge_valley> = #3029
|
||||
#<probe_mode> = #3030
|
||||
#<calibration_offset> = #3032
|
||||
|
||||
(Cancel G92 offsets)
|
||||
G92.1
|
||||
|
||||
#<workspace_y> = #[5202 + [20 * #5220]]
|
||||
#<workspace_z> = #[5203 + [20 * #5220]]
|
||||
|
||||
(Probe Tool Safety Check)
|
||||
o100 if [#5400 NE #<probe_tool_number>]
|
||||
(MSG, Specified probe tool #<probe_tool_number> not in spindle, aborting)
|
||||
o<probe_ridge_y> return
|
||||
o100 endif
|
||||
|
||||
(Probe Diameter)
|
||||
#<probe_diameter> = #5410
|
||||
|
||||
(Probe Radius)
|
||||
#<probe_radius> = [#<probe_diameter> / 2]
|
||||
|
||||
(Probe Centerline Offset)
|
||||
#<probe_center_offset> = [#<probe_radius> - #<calibration_offset>]
|
||||
|
||||
(remove probe tip diam and cal offset from probed width calculations)
|
||||
#<probe_diameter_offset> = [#<probe_diameter> - [#<calibration_offset> * 2]]
|
||||
|
||||
#<z_probe_stack> = [#<z_clearance> + #<probe_diameter> + #<extra_probe_depth>]
|
||||
|
||||
(Call sub "probe_z_minus_sub" to Probe top of Workpiece)
|
||||
o<probe_z_minus_sub> call [#3014][#3015][#3016][#3017][#3020][#3021][#3030]
|
||||
|
||||
(Probe Y Positioning Move, Y hint/2 + Step Off Width)
|
||||
G91
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 Y-[[#<y_hint_ridge_valley>/2] + #<step_off_width>]
|
||||
|
||||
(Probe Y Positioning Move, to Probing Depth)
|
||||
F[#<probe_fast_fr>]
|
||||
Z-[#<z_probe_stack>]
|
||||
|
||||
(Call sub "probe_y_plus" to Probe y+ side of Workpiece)
|
||||
o<probe_y_plus> call [#3014][#3015][#3016][#3017][#3018][#3019][#3032]
|
||||
|
||||
#<y_plus_probed> = #5062
|
||||
|
||||
(first side Probe Completion Move to Z Clearance Plane)
|
||||
G91
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 Z[#<z_probe_stack>]
|
||||
|
||||
(Positioning move in Y, Y Hint + Step Off Width at Rapid Speed)
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 Y[#<y_hint_ridge_valley> + #<step_off_width>]
|
||||
|
||||
(Probe Y Positioning Move, to Probing Depth)
|
||||
F[#<probe_fast_fr>]
|
||||
Z-[#<z_probe_stack>]
|
||||
|
||||
(Call sub "probe_y_minus" to Probe y- side of Workpiece)
|
||||
o<probe_y_minus> call [#3014][#3015][#3016][#3017][#3018][#3019][#3032]
|
||||
|
||||
#<y_minus_probed> = #5062
|
||||
|
||||
(probed center calulation)
|
||||
#<y_center_probed> = [[#<y_plus_probed> + #<y_minus_probed>] / 2]
|
||||
|
||||
(calculate Y Width Probed)
|
||||
#<raw_width> = [#<y_minus_probed> - #<y_plus_probed>]
|
||||
|
||||
(Completed probed width calculations)
|
||||
#<y_probed_width> = [#<raw_width> - #<probe_diameter_offset>]
|
||||
|
||||
#1003 = #<y_probed_width>
|
||||
(DEBUG, EVAL[vcp.getWidget{"y_probed_width"}.setValue{#1003}])
|
||||
|
||||
#1004 = #<y_center_probed>
|
||||
(DEBUG, EVAL[vcp.getWidget{"y_center_probed"}.setValue{#1004}])
|
||||
|
||||
(Probe Completion Move to Z Clearance Plane, and X Zero)
|
||||
G91
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 Z[#<z_probe_stack>]
|
||||
G90
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 Y[#<y_center_probed>]
|
||||
|
||||
(probe mode rules for WCO or probe position measuring only)
|
||||
o110 if [#<probe_mode> EQ 0]
|
||||
(Record Y Zero in selected WCO)
|
||||
G10 L2 P#5220 Y[#<y_center_probed> + #<workspace_y>]
|
||||
(Probe Completion Move to Z Clearance Plane, and X Zero, Y Zero)
|
||||
o<probe_ridge_y> return
|
||||
o110 endif
|
||||
|
||||
o<probe_ridge_y> endsub
|
||||
|
||||
M2 (end program)
|
||||
@@ -0,0 +1,84 @@
|
||||
(author: Chris P)
|
||||
(version: 0.4)
|
||||
(date: 06/27/24)
|
||||
|
||||
(Probe right top side for x,z 0,0 position)
|
||||
(Start probe position is over right side edge of stock)
|
||||
(inside the step off width distance and within max z distance)
|
||||
(ensure all settings have been set properly according to help diagrams)
|
||||
|
||||
o<Probe_right_top_side> sub
|
||||
|
||||
(uses NGCGUI style arg spec)
|
||||
(number after "=" in comment is default value)
|
||||
#<probe_tool_number> = #3014 (=99)
|
||||
#<probe_slow_fr> = #3015 (=0)
|
||||
#<probe_fast_fr> = #3016 (=10.0)
|
||||
#<probe_traverse_fr> = #3017 (=50)
|
||||
#<max_xy_distance> = #3018 (=0.5000)
|
||||
#<xy_clearance> = #3019 (=0.1000)
|
||||
#<max_z_distance> = #3020 (=0.5000)
|
||||
#<z_clearance> = #3021 (=0.1000)
|
||||
#<extra_probe_depth> = #3022 (=0.0000)
|
||||
#<step_off_width> = #3023 (=0.5000)
|
||||
#<probe_mode> = #3030 (=0)
|
||||
#<calibration_offset> = #3032 (=0)
|
||||
|
||||
(Cancel G92 offsets)
|
||||
G92.1
|
||||
|
||||
#<workspace_x> = #[5201 + [20 * #5220]]
|
||||
|
||||
(Probe Tool Safety Check)
|
||||
o100 if [#5400 NE #<probe_tool_number>]
|
||||
(MSG, Specified probe tool #<probe_tool_number> not in spindle, aborting)
|
||||
o<Probe_right_top_side> return
|
||||
o100 endif
|
||||
|
||||
(Probe Diameter)
|
||||
#<probe_diameter> = #5410
|
||||
|
||||
(Probing depth from the z probed clearance height, used for z moves)
|
||||
#<z_probe_stack> = [#<z_clearance> + #<probe_diameter> + #<extra_probe_depth>]
|
||||
|
||||
(Call sub "probe_z_minus_sub" to Probe top of Workpiece)
|
||||
o<probe_z_minus_sub> call [#3014][#3015][#3016][#3017][#3020][#3021][#3030]
|
||||
|
||||
(Probe X Positioning Move, Step Off Width)
|
||||
G91
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 X[#<step_off_width>]
|
||||
|
||||
(Probe X Positioning Move, to Probing Depth)
|
||||
F[#<probe_fast_fr>]
|
||||
G38.3 Z-[#<z_probe_stack>]
|
||||
|
||||
(Call sub "probe_x_minus" to Probe x- side of Workpiece)
|
||||
o<probe_x_minus> call [#3014][#3015][#3016][#3017][#3018][#3019][#3032]
|
||||
|
||||
#<x_minus_zero_edge> = #<_value>
|
||||
|
||||
(value returned safety check, aborts if no value returned)
|
||||
o110 if [#<probe_mode> EQ 1 AND #<_value_returned> NE 1]
|
||||
(MSG, Missing X Sub returned edge parameter, aborting)
|
||||
o<probe_right_top_side> return
|
||||
o110 endif
|
||||
|
||||
(Probe Completion Move to Z Clearance Plane, and Y Zero)
|
||||
G91
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 Z[#<z_probe_stack>]
|
||||
G90
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 X[#<x_minus_zero_edge>]
|
||||
|
||||
(probe mode rules for WCO or probe position measuring only)
|
||||
o120 if [#<probe_mode> EQ 0]
|
||||
(Record Zero in selected axes and WCO)
|
||||
G10 L2 P#5220 X[#<x_minus_zero_edge> + #<workspace_x>]
|
||||
o<probe_right_top_side> return
|
||||
o120 endif
|
||||
|
||||
o<Probe_right_top_side> endsub
|
||||
|
||||
M2 (end program)
|
||||
287
configs/probe_basic_lathe/subroutines/probe_round_boss.ngc
Normal file
287
configs/probe_basic_lathe/subroutines/probe_round_boss.ngc
Normal file
@@ -0,0 +1,287 @@
|
||||
(author: Chris P)
|
||||
(version: 0.2)
|
||||
(date: 06/27/24)
|
||||
|
||||
(Probe Boss in X and Y Axes, find center, Diam and z 0 position)
|
||||
(Start probe position is over center of stock in X and Y axis)
|
||||
(within max z distance, ensure all settings have been)
|
||||
(set properly according to help diagrams)
|
||||
|
||||
o<probe_round_boss> sub
|
||||
|
||||
(uses NGCGUI style arg spec)
|
||||
(number after "=" in comment is default value)
|
||||
#<probe_tool_number> = #3014 (=99)
|
||||
#<probe_slow_fr> = #3015 (=0)
|
||||
#<probe_fast_fr> = #3016 (=10.0)
|
||||
#<probe_traverse_fr> = #3017 (=50)
|
||||
#<max_xy_distance> = #3018 (=0.5000)
|
||||
#<xy_clearance> = #3019 (=0.1000)
|
||||
#<max_z_distance> = #3020 (=0.5000)
|
||||
#<z_clearance> = #3021 (=0.1000)
|
||||
#<extra_probe_depth> = #3022 (=0.0000)
|
||||
#<step_off_width> = #3023 (=0.5000)
|
||||
#<diameter_hint> = #3025 (=0)
|
||||
#<probe_mode> = #3030 (=0)
|
||||
#<calibration_offset> = #3032 (=0)
|
||||
|
||||
(Cancel G92 offsets)
|
||||
G92.1
|
||||
|
||||
#<workspace_x> = #[5201 + [20 * #5220]]
|
||||
#<workspace_y> = #[5202 + [20 * #5220]]
|
||||
#<workspace_z> = #[5203 + [20 * #5220]]
|
||||
|
||||
(Probe Tool Safety Check)
|
||||
o100 if [#5400 NE #<probe_tool_number>]
|
||||
(MSG, Specified probe tool #<probe_tool_number> not in spindle, aborting)
|
||||
o<probe_round_boss> return
|
||||
o100 endif
|
||||
|
||||
(Probe Diameter)
|
||||
#<probe_diameter> = #5410
|
||||
|
||||
(Probe Radius)
|
||||
#<probe_radius> = [#<probe_diameter> / 2]
|
||||
|
||||
(Probe Centerline Offset)
|
||||
#<probe_center_offset> = [#<probe_radius> - #<calibration_offset>]
|
||||
|
||||
(remove probe tip diam and cal offset from probed width calculations)
|
||||
#<probe_diameter_offset> = [#<probe_diameter> - [#<calibration_offset> * 2]]
|
||||
|
||||
#<z_probe_stack> = [#<z_clearance> + #<probe_diameter> + #<extra_probe_depth>]
|
||||
|
||||
(Call sub "probe_z_minus_sub" to Probe top of Workpiece)
|
||||
o<probe_z_minus_sub> call [#3014][#3015][#3016][#3017][#3020][#3021][#3030]
|
||||
|
||||
(Probe X Positioning Move, X hint/2 + Step Off Width)
|
||||
G91
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 X-[[#<diameter_hint> / 2] + [#<step_off_width>]]
|
||||
|
||||
(Probe X Positioning Move, to Probing Depth)
|
||||
F[#<probe_fast_fr>]
|
||||
G38.3 Z-[#<z_probe_stack>]
|
||||
|
||||
(Call sub "probe_x_plus" to Probe x+ side of Workpiece)
|
||||
o<probe_x_plus> call [#3014][#3015][#3016][#3017][#3018][#3019][#3032]
|
||||
|
||||
#<x_plus_probed> = #5061
|
||||
|
||||
(first side Probe Completion Move to Z Clearance Plane)
|
||||
G91
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 Z[#<z_probe_stack>]
|
||||
|
||||
(Positioning move in X, X Hint + Step Off Width at Rapid Speed)
|
||||
G91
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 X[#<diameter_hint> + #<step_off_width> + #<xy_clearance>]
|
||||
|
||||
(Probe X Positioning Move, to Probing Depth)
|
||||
F[#<probe_fast_fr>]
|
||||
G38.3 Z-[#<z_probe_stack>]
|
||||
|
||||
(Call sub "probe_x_minus" to Probe x- side of Workpiece)
|
||||
o<probe_x_minus> call [#3014][#3015][#3016][#3017][#3018][#3019][#3032]
|
||||
|
||||
#<x_minus_probed> = #5061
|
||||
|
||||
(probed center calulation)
|
||||
#<x_center_probed> = [[#<x_minus_probed> + #<x_plus_probed>] / 2]
|
||||
|
||||
#1002 = #<x_center_probed>
|
||||
(DEBUG, EVAL[vcp.getWidget{"x_center_probed"}.setValue{#1002}])
|
||||
|
||||
G91
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 Z[#<z_probe_stack>]
|
||||
G90
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 X[#<x_center_probed>]
|
||||
|
||||
(Probe Y Positioning Move, Y hint/2 + Step Off Width)
|
||||
G91
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 Y-[[#<diameter_hint> / 2] + [#<step_off_width>]]
|
||||
|
||||
(Probe Y Positioning Move, to Probing Depth)
|
||||
F[#<probe_fast_fr>]
|
||||
G38.3 Z-[#<z_probe_stack>]
|
||||
|
||||
(Call sub "probe_y_plus" to Probe y+ side of Workpiece)
|
||||
o<probe_y_plus> call [#3014][#3015][#3016][#3017][#3018][#3019][#3032]
|
||||
|
||||
#<y_plus_probed> = #5062
|
||||
|
||||
(first side Probe Completion Move to Z Clearance Plane)
|
||||
G91
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 Z[#<z_probe_stack>]
|
||||
|
||||
(Positioning move in Y, Y Hint + Step Off Width at Rapid Speed)
|
||||
G91
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 Y[#<diameter_hint> + #<step_off_width> + #<xy_clearance>]
|
||||
|
||||
(Probe Y Positioning Move, to Probing Depth)
|
||||
F[#<probe_fast_fr>]
|
||||
G38.3 Z-[#<z_probe_stack>]
|
||||
|
||||
(Call sub "probe_y_minus" to Probe y- side of Workpiece)
|
||||
o<probe_y_minus> call [#3014][#3015][#3016][#3017][#3018][#3019][#3032]
|
||||
|
||||
#<y_minus_probed> = #5062
|
||||
|
||||
(probed center calulation)
|
||||
#<y_center_probed> = [[#<y_minus_probed> + #<y_plus_probed>] / 2]
|
||||
|
||||
#1004 = #<y_center_probed>
|
||||
(DEBUG, EVAL[vcp.getWidget{"y_center_probed"}.setValue{#1004}])
|
||||
|
||||
(Move to z clearance plane)
|
||||
G91
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 Z[#<z_probe_stack>]
|
||||
|
||||
(Move to Y Center)
|
||||
G90
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 Y[#<y_center_probed>]
|
||||
|
||||
(Probe X Positioning Move, X hint/2 + Step Off Width)
|
||||
G91
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 X-[[#<diameter_hint> / 2] + [#<step_off_width>]]
|
||||
|
||||
(Probe X Positioning Move, to Probing Depth)
|
||||
F[#<probe_fast_fr>]
|
||||
G38.3 Z-[#<z_probe_stack>]
|
||||
|
||||
(Call sub "probe_x_plus" to Probe x+ side of Workpiece)
|
||||
o<probe_x_plus> call [#3014][#3015][#3016][#3017][#3018][#3019][#3032]
|
||||
|
||||
#<x_plus_probed> = #5061
|
||||
|
||||
(first side Probe Completion Move to Z Clearance Plane)
|
||||
G91
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 Z[#<z_probe_stack>]
|
||||
|
||||
(Positioning move in X, X Hint + Step Off Width at Rapid Speed)
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 X[#<diameter_hint> + #<step_off_width> + #<xy_clearance>]
|
||||
|
||||
(Probe X Positioning Move, to Probing Depth)
|
||||
F[#<probe_fast_fr>]
|
||||
G38.3 Z-[#<z_probe_stack>]
|
||||
|
||||
(Call sub "probe_x_minus" to Probe x- side of Workpiece)
|
||||
o<probe_x_minus> call [#3014][#3015][#3016][#3017][#3018][#3019][#3032]
|
||||
|
||||
#<x_minus_probed> = #5061
|
||||
|
||||
(probed center calulation)
|
||||
#<x_center_probed> = [[#<x_minus_probed> + #<x_plus_probed>] / 2]
|
||||
|
||||
(calculate X Width Probed)
|
||||
o110 if [#<x_minus_probed> GT #<x_plus_probed>]
|
||||
#<x_raw_width> = [#<x_minus_probed> - #<x_plus_probed>]
|
||||
o110 else
|
||||
#<x_raw_width> = [#<x_plus_probed> - #<x_minus_probed>]
|
||||
o110 endif
|
||||
|
||||
(Completed probed width calculations)
|
||||
#<x_probed_width> = [#<x_raw_width> - #<probe_diameter_offset>]
|
||||
|
||||
#1001 = #<x_probed_width>
|
||||
(DEBUG, EVAL[vcp.getWidget{"x_probed_width"}.setValue{#1001}])
|
||||
|
||||
#1002 = #<x_center_probed>
|
||||
(DEBUG, EVAL[vcp.getWidget{"x_center_probed"}.setValue{#1002}])
|
||||
|
||||
G91
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 Z[#<z_probe_stack>]
|
||||
G90
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 X[#<x_center_probed>]
|
||||
|
||||
(Probe Y Positioning Move, Y hint/2 + Step Off Width)
|
||||
G91
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 Y-[[#<diameter_hint> / 2] + [#<step_off_width>]]
|
||||
|
||||
(Probe Y Positioning Move, to Probing Depth)
|
||||
F[#<probe_fast_fr>]
|
||||
G38.3 Z-[#<z_probe_stack>]
|
||||
|
||||
(Call sub "probe_y_plus" to Probe y+ side of Workpiece)
|
||||
o<probe_y_plus> call [#3014][#3015][#3016][#3017][#3018][#3019][#3032]
|
||||
|
||||
#<y_plus_probed> = #5062
|
||||
|
||||
(first side Probe Completion Move to Z Clearance Plane)
|
||||
G91
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 Z[#<z_probe_stack>]
|
||||
|
||||
(Positioning move in Y, Y Hint + Step Off Width at Rapid Speed)
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 Y[#<diameter_hint> + #<step_off_width> + #<xy_clearance>]
|
||||
|
||||
(Probe Y Positioning Move, to Probing Depth)
|
||||
F[#<probe_fast_fr>]
|
||||
G38.3 Z-[#<z_probe_stack>]
|
||||
|
||||
(Call sub "probe_y_minus" to Probe y- side of Workpiece)
|
||||
o<probe_y_minus> call [#3014][#3015][#3016][#3017][#3018][#3019][#3032]
|
||||
|
||||
#<y_minus_probed> = #5062
|
||||
|
||||
(probed center calulation)
|
||||
#<y_center_probed> = [[#<y_minus_probed> + #<y_plus_probed>] / 2]
|
||||
|
||||
(calculate Y Width Probed)
|
||||
o120 if [#<y_minus_probed> GT #<y_plus_probed>]
|
||||
#<y_raw_width> = [#<y_minus_probed> - #<y_plus_probed>]
|
||||
o120 else
|
||||
#<y_raw_width> = [#<y_plus_probed> - #<y_minus_probed>]
|
||||
o120 endif
|
||||
|
||||
(Completed probed width calculations)
|
||||
#<y_probed_width> = [#<y_raw_width> - #<probe_diameter_offset>]
|
||||
|
||||
#1003 = #<y_probed_width>
|
||||
(DEBUG, EVAL[vcp.getWidget{"y_probed_width"}.setValue{#1003}])
|
||||
|
||||
#1004 = #<y_center_probed>
|
||||
(DEBUG, EVAL[vcp.getWidget{"y_center_probed"}.setValue{#1004}])
|
||||
|
||||
#<averaged_diam> = [[#<x_probed_width> + #<y_probed_width>] / 2]
|
||||
|
||||
#1010 = #<averaged_diam>
|
||||
(DEBUG, EVAL[vcp.getWidget{"averaged_diam"}.setValue{#1010}])
|
||||
|
||||
G91
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 Z[#<z_probe_stack>]
|
||||
G90
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 X[#<x_center_probed>] Y[#<y_center_probed>]
|
||||
|
||||
#<x_zero> = [#<x_center_probed> + #<workspace_x>]
|
||||
|
||||
#<y_zero> = [#<y_center_probed> + #<workspace_y>]
|
||||
|
||||
(probe mode rules for WCO or probe position measuring only)
|
||||
o130 if [#<probe_mode> EQ 0]
|
||||
(Record XY Zero in selected WCO)
|
||||
G10 L2 P#5220 X[#<x_zero>] Y[#<y_zero>]
|
||||
o<probe_cal_round_boss> return
|
||||
o130 endif
|
||||
|
||||
o<probe_round_boss> endsub
|
||||
|
||||
M2 (end program)
|
||||
179
configs/probe_basic_lathe/subroutines/probe_round_pocket.ngc
Normal file
179
configs/probe_basic_lathe/subroutines/probe_round_pocket.ngc
Normal file
@@ -0,0 +1,179 @@
|
||||
(author: Chris P)
|
||||
(version: 0.2)
|
||||
(date: 06/27/24)
|
||||
|
||||
(Probe round pocket center measure x and y Diam, find xy center position)
|
||||
(Start probe position is over left side edge of pocket wall)
|
||||
(inside the step off width distance and within max z distance)
|
||||
(ensure all settings have been set properly according to help diagrams)
|
||||
|
||||
o<probe_round_pocket> sub
|
||||
|
||||
(uses NGCGUI style arg spec)
|
||||
(number after "=" in comment is default value)
|
||||
#<probe_tool_number> = #3014 (=99)
|
||||
#<probe_slow_fr> = #3015 (=0)
|
||||
#<probe_fast_fr> = #3016 (=10.0)
|
||||
#<probe_traverse_fr> = #3017 (=50)
|
||||
#<max_xy_distance> = #3018 (=0.5000)
|
||||
#<xy_clearance> = #3019 (=0.1000)
|
||||
#<max_z_distance> = #3020 (=0.5000)
|
||||
#<z_clearance> = #3021 (=0.1000)
|
||||
#<extra_probe_depth> = #3022 (=0.0000)
|
||||
#<step_off_width> = #3023 (=0.5000)
|
||||
#<diameter_hint> = #3025 (=0)
|
||||
#<probe_mode> = #3030 (=0)
|
||||
#<calibration_offset> = #3032 (=0)
|
||||
|
||||
(Cancel G92 offsets)
|
||||
G92.1
|
||||
|
||||
#<workspace_x> = #[5201 + [20 * #5220]]
|
||||
#<workspace_y> = #[5202 + [20 * #5220]]
|
||||
|
||||
(Probe Tool Safety Check)
|
||||
o100 if [#5400 NE #<probe_tool_number>]
|
||||
(MSG, Specified probe tool #<probe_tool_number> not in spindle, aborting)
|
||||
o<probe_round_pocket> return
|
||||
o100 endif
|
||||
|
||||
(Probe Diameter)
|
||||
#<probe_diameter> = #5410
|
||||
|
||||
(remove probe tip diam and cal offset from probed width calculations)
|
||||
#<probe_diameter_offset> = [#<probe_diameter> - [#<calibration_offset> * 2]]
|
||||
|
||||
#<z_probe_stack> = [#<z_clearance> + #<probe_diameter> + #<extra_probe_depth>]
|
||||
|
||||
(Call sub "probe_z_minus_sub" to Probe top of Workpiece)
|
||||
o<probe_z_minus_sub> call [#3014][#3015][#3016][#3017][#3020][#3021][#3030]
|
||||
|
||||
(Probe X Positioning Move, Step Off Width)
|
||||
G91
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 X[#<step_off_width>]
|
||||
|
||||
(Probe X Positioning Move, to Probing Depth)
|
||||
F[#<probe_fast_fr>]
|
||||
G38.3 Z-[#<z_probe_stack>]
|
||||
|
||||
(Call sub "probe_x_minus" to Probe x-)
|
||||
o<probe_x_minus> call [#3014][#3015][#3016][#3017][#3018][#3019][#3032]
|
||||
|
||||
#<x_minus_probed> = #5061
|
||||
|
||||
(Call sub "probe_x_plus" to Probe x+)
|
||||
o<probe_x_plus> call [#3014][#3015][#3016][3017][#3018 + #3025][#3019][#3032]
|
||||
|
||||
#<x_plus_probed> = #5061
|
||||
|
||||
(probed center calculation)
|
||||
#<x_center_probed> = [[#<x_plus_probed> + #<x_minus_probed>] / 2]
|
||||
|
||||
#1002 = #<x_center_probed>
|
||||
(DEBUG, EVAL[vcp.getWidget{"x_center_probed"}.setValue{#1002}])
|
||||
|
||||
(Probe Completion Move to Z Clearance Plane, and X Zero)
|
||||
G90
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 X[#<x_center_probed>]
|
||||
|
||||
(Call sub "probe_y_plus" to Probe Y+)
|
||||
o<probe_y_plus> call [#3014][#3015][#3016][3017][#3018 + #3025 / 2][#3019][#3032]
|
||||
|
||||
#<y_plus_probed> = #5062
|
||||
|
||||
(Call sub "probe_y_minus" to Probe Y-)
|
||||
o<probe_y_minus> call [#3014][#3015][#3016][3017][#3018 + #3025][#3019][#3032]
|
||||
|
||||
#<y_minus_probed> = #5062
|
||||
|
||||
(probed center calculation)
|
||||
#<y_center_probed> = [[#<y_plus_probed> + #<y_minus_probed>] / 2]
|
||||
|
||||
#1004 = #<y_center_probed>
|
||||
(DEBUG, EVAL[vcp.getWidget{"y_center_probed"}.setValue{#1004}])
|
||||
|
||||
(Probe Completion Move to Z Clearance Plane, Y Zero)
|
||||
G90
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 Y[#<y_center_probed>]
|
||||
|
||||
(Call sub "probe_x_minus" to Probe x-)
|
||||
o<probe_x_minus> call [#3014][#3015][#3016][3017][#3018 + #3025 / 2][#3019][#3032]
|
||||
|
||||
#<x_minus_probed> = #5061
|
||||
|
||||
(Call sub "probe_x_plus" to Probe x+)
|
||||
o<probe_x_plus> call [#3014][#3015][#3016][3017][#3018 + #3025][#3019][#3032]
|
||||
|
||||
#<x_plus_probed> = #5061
|
||||
|
||||
(probed center calculation)
|
||||
#<x_center_probed> = [[#<x_plus_probed> + #<x_minus_probed>] / 2]
|
||||
|
||||
(calculate X Width Probed)
|
||||
#<raw_width> = [#<x_plus_probed> - #<x_minus_probed>]
|
||||
|
||||
(Completed probed width calculations)
|
||||
#<x_probed_width> = [#<raw_width> + #<probe_diameter_offset>]
|
||||
|
||||
#1001 = #<x_probed_width>
|
||||
(DEBUG, EVAL[vcp.getWidget{"x_probed_width"}.setValue{#1001}])
|
||||
|
||||
#1002 = #<x_center_probed>
|
||||
(DEBUG, EVAL[vcp.getWidget{"x_center_probed"}.setValue{#1002}])
|
||||
|
||||
G90
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 X[#<x_center_probed>]
|
||||
|
||||
(Call sub "probe_y_plus" to Probe Y+)
|
||||
o<probe_y_plus> call [#3014][#3015][#3016][3017][#3018 + #3025 / 2][#3019][#3032]
|
||||
|
||||
#<y_plus_probed> = #5062
|
||||
|
||||
(Call sub "probe_y_minus" to Probe Y-)
|
||||
o<probe_y_minus> call [#3014][#3015][#3016][3017][#3018 + #3025][#3019][#3032]
|
||||
|
||||
#<y_minus_probed> = #5062
|
||||
|
||||
(probed center calculation)
|
||||
#<y_center_probed> = [[#<y_plus_probed> + #<y_minus_probed>] / 2]
|
||||
|
||||
(calculate Y Width Probed)
|
||||
#<raw_width> = [#<y_plus_probed> - #<y_minus_probed>]
|
||||
|
||||
(Completed probed diameter calculations)
|
||||
#<y_probed_width> = [#<raw_width> + #<probe_diameter_offset>]
|
||||
|
||||
#1003 = #<y_probed_width>
|
||||
(DEBUG, EVAL[vcp.getWidget{"y_probed_width"}.setValue{#1003}])
|
||||
|
||||
#1004 = #<y_center_probed>
|
||||
(DEBUG, EVAL[vcp.getWidget{"y_center_probed"}.setValue{#1004}])
|
||||
|
||||
#<averaged_diam> = [[#<x_probed_width> + #<y_probed_width>] / 2]
|
||||
|
||||
#1010 = #<averaged_diam>
|
||||
(DEBUG, EVAL[vcp.getWidget{"averaged_diam"}.setValue{#1010}])
|
||||
|
||||
G90
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 Y[#<y_center_probed>]
|
||||
G91
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 Z[#<z_probe_stack>]
|
||||
|
||||
(probe mode rules for WCO or probe position measuring only)
|
||||
o110 if [#<probe_mode> EQ 0]
|
||||
(Record Y Zero in selected WCO)
|
||||
G10 L2 P#5220 X[#<x_center_probed> + #<workspace_x>]
|
||||
G10 L2 P#5220 Y[#<y_center_probed> + #<workspace_y>]
|
||||
(Probe Completion Move to Z Clearance Plane, and X Zero, Y Zero)
|
||||
o<probe_round_pocket> return
|
||||
o110 endif
|
||||
|
||||
o<probe_round_pocket> endsub
|
||||
|
||||
M2 (end program)
|
||||
@@ -0,0 +1,161 @@
|
||||
(author: Chris P)
|
||||
(version: 0.2)
|
||||
(date: 06/27/24)
|
||||
|
||||
(Probe round pocket center start measure x and y Diam, find xy center position)
|
||||
(Start probe position is rough center of pocket a safe distance below top edge)
|
||||
(no z move will be initiated in this routine. end position is hole center)
|
||||
(ensure all settings have been set properly according to help diagrams)
|
||||
|
||||
o<probe_round_pocket_center_start> sub
|
||||
|
||||
(uses NGCGUI style arg spec)
|
||||
(number after "=" in comment is default value)
|
||||
#<probe_tool_number> = #3014 (=99)
|
||||
#<probe_slow_fr> = #3015 (=0)
|
||||
#<probe_fast_fr> = #3016 (=10.0)
|
||||
#<probe_traverse_fr> = #3017 (=50)
|
||||
#<max_xy_distance> = #3018 (=0.5000)
|
||||
#<xy_clearance> = #3019 (=0.1000)
|
||||
#<max_z_distance> = #3020 (=0.5000)
|
||||
#<z_clearance> = #3021 (=0.1000)
|
||||
#<extra_probe_depth> = #3022 (=0.0000)
|
||||
#<step_off_width> = #3023 (=0.5000)
|
||||
#<diameter_hint> = #3025 (=0)
|
||||
#<probe_mode> = #3030 (=0)
|
||||
#<calibration_offset> = #3032 (=0)
|
||||
|
||||
(Cancel G92 offsets)
|
||||
G92.1
|
||||
|
||||
#<workspace_x> = #[5201 + [20 * #5220]]
|
||||
#<workspace_y> = #[5202 + [20 * #5220]]
|
||||
|
||||
(Probe Tool Safety Check)
|
||||
o100 if [#5400 NE #<probe_tool_number>]
|
||||
(MSG, Specified probe tool #<probe_tool_number> not in spindle, aborting)
|
||||
o<probe_round_pocket_center_start> return
|
||||
o100 endif
|
||||
|
||||
(Probe Diameter)
|
||||
#<probe_diameter> = #5410
|
||||
|
||||
(remove probe tip diam and cal offset from probed width calculations)
|
||||
#<probe_diameter_offset> = [#<probe_diameter> - [#<calibration_offset> * 2]]
|
||||
|
||||
(Call sub "probe_x_minus" to Probe x-)
|
||||
o<probe_x_minus> call [#3014][#3015][#3016][3017][#3018 + #3025 / 2][#3019][#3032]
|
||||
|
||||
#<x_minus_probed> = #5061
|
||||
|
||||
(Call sub "probe_x_plus" to Probe x+)
|
||||
o<probe_x_plus> call [#3014][#3015][#3016][3017][#3018 + #3025][#3019][#3032]
|
||||
|
||||
#<x_plus_probed> = #5061
|
||||
|
||||
(probed center calculation)
|
||||
#<x_center_probed> = [[#<x_plus_probed> + #<x_minus_probed>] / 2]
|
||||
|
||||
#1002 = #<x_center_probed>
|
||||
(DEBUG, EVAL[vcp.getWidget{"x_center_probed"}.setValue{#1002}])
|
||||
|
||||
(Probe Completion Move to X Zero)
|
||||
G90
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 X[#<x_center_probed>]
|
||||
|
||||
(Call sub "probe_y_plus" to Probe Y+)
|
||||
o<probe_y_plus> call [#3014][#3015][#3016][3017][#3018 + #3025 / 2][#3019][#3032]
|
||||
|
||||
#<y_plus_probed> = #5062
|
||||
|
||||
(Call sub "probe_y_minus" to Probe Y-)
|
||||
o<probe_y_minus> call [#3014][#3015][#3016][3017][#3018 + #3025][#3019][#3032]
|
||||
|
||||
#<y_minus_probed> = #5062
|
||||
|
||||
(probed center calculation)
|
||||
#<y_center_probed> = [[#<y_plus_probed> + #<y_minus_probed>] / 2]
|
||||
|
||||
#1004 = #<y_center_probed>
|
||||
(DEBUG, EVAL[vcp.getWidget{"y_center_probed"}.setValue{#1004}])
|
||||
|
||||
(Probe Completion Move to Y Zero)
|
||||
G90
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 Y[#<y_center_probed>]
|
||||
|
||||
(Call sub "probe_x_minus" to Probe x-)
|
||||
o<probe_x_minus> call [#3014][#3015][#3016][3017][#3018 + #3025 / 2][#3019][#3032]
|
||||
|
||||
#<x_minus_probed> = #5061
|
||||
|
||||
(Call sub "probe_x_plus" to Probe x+)
|
||||
o<probe_x_plus> call [#3014][#3015][#3016][3017][#3018 + #3025][#3019][#3032]
|
||||
|
||||
#<x_plus_probed> = #5061
|
||||
|
||||
(probed center calculation)
|
||||
#<x_center_probed> = [[#<x_plus_probed> + #<x_minus_probed>] / 2]
|
||||
|
||||
(calculate X Width Probed)
|
||||
#<raw_width> = [#<x_plus_probed> - #<x_minus_probed>]
|
||||
|
||||
(Completed probed width calculations)
|
||||
#<x_probed_width> = [#<raw_width> + #<probe_diameter_offset>]
|
||||
|
||||
#1001 = #<x_probed_width>
|
||||
(DEBUG, EVAL[vcp.getWidget{"x_probed_width"}.setValue{#1001}])
|
||||
|
||||
#1002 = #<x_center_probed>
|
||||
(DEBUG, EVAL[vcp.getWidget{"x_center_probed"}.setValue{#1002}])
|
||||
|
||||
G90
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 X[#<x_center_probed>]
|
||||
|
||||
(Call sub "probe_y_plus" to Probe Y+)
|
||||
o<probe_y_plus> call [#3014][#3015][#3016][3017][#3018 + #3025 / 2][#3019][#3032]
|
||||
|
||||
#<y_plus_probed> = #5062
|
||||
|
||||
(Call sub "probe_y_minus" to Probe Y-)
|
||||
o<probe_y_minus> call [#3014][#3015][#3016][3017][#3018 + #3025][#3019][#3032]
|
||||
|
||||
#<y_minus_probed> = #5062
|
||||
|
||||
(probed center calculation)
|
||||
#<y_center_probed> = [[#<y_plus_probed> + #<y_minus_probed>] / 2]
|
||||
|
||||
(calculate Y Width Probed)
|
||||
#<raw_width> = [#<y_plus_probed> - #<y_minus_probed>]
|
||||
|
||||
(Completed probed diameter calculations)
|
||||
#<y_probed_width> = [#<raw_width> + #<probe_diameter_offset>]
|
||||
|
||||
#1003 = #<y_probed_width>
|
||||
(DEBUG, EVAL[vcp.getWidget{"y_probed_width"}.setValue{#1003}])
|
||||
|
||||
#1004 = #<y_center_probed>
|
||||
(DEBUG, EVAL[vcp.getWidget{"y_center_probed"}.setValue{#1004}])
|
||||
|
||||
#<averaged_diam> = [[#<x_probed_width> + #<y_probed_width>] / 2]
|
||||
|
||||
#1010 = #<averaged_diam>
|
||||
(DEBUG, EVAL[vcp.getWidget{"averaged_diam"}.setValue{#1010}])
|
||||
|
||||
G90
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 Y[#<y_center_probed>]
|
||||
|
||||
(probe mode rules for WCO or probe position measuring only)
|
||||
o110 if [#<probe_mode> EQ 0]
|
||||
(Record Y Zero in selected WCO)
|
||||
G10 L2 P#5220 X[#<x_center_probed> + #<workspace_x>]
|
||||
G10 L2 P#5220 Y[#<y_center_probed> + #<workspace_y>]
|
||||
o<probe_round_pocket_center_start> return
|
||||
o110 endif
|
||||
|
||||
o<probe_round_pocket_center_start> endsub
|
||||
|
||||
M2 (end program)
|
||||
77
configs/probe_basic_lathe/subroutines/probe_spindle_nose.ngc
Normal file
77
configs/probe_basic_lathe/subroutines/probe_spindle_nose.ngc
Normal file
@@ -0,0 +1,77 @@
|
||||
(author: Chris P)
|
||||
(version: 0.0)
|
||||
(date: 12/26/24)
|
||||
|
||||
(Probe Spindle Nose in Z Minus direction over tool setter and set Spindle Zero Distance)
|
||||
(Start probe position is over toolsetter platter within max z distance)
|
||||
(ensure all settings have been set properly according to help diagrams)
|
||||
|
||||
o<probe_spindle_nose> sub
|
||||
|
||||
(uses NGCGUI style arg spec)
|
||||
(number after "=" in comment is default value)
|
||||
|
||||
#<probe_fast_fr> = #3004 (=10.0)
|
||||
#<probe_slow_fr> = #3005 (=0)
|
||||
#<probe_traverse_fr> = #3006 (=50)
|
||||
#<max_z_distance> = #3007 (=12.5)
|
||||
#<retract_distance> = #3009 (=0.1000)
|
||||
|
||||
(Cancel G92 offsets)
|
||||
G92.1
|
||||
|
||||
o100 if [2 EQ 2]
|
||||
G49
|
||||
o100 endif
|
||||
|
||||
#<offset_z> = #5422
|
||||
|
||||
(Initial Fast Z- Probe)
|
||||
G91
|
||||
F[#<probe_fast_fr>]
|
||||
G38.2 Z-[#<max_z_distance>]
|
||||
#<z_minus_probed> = #5063
|
||||
|
||||
(Probe Error check, #5070 will be 0 if failed)
|
||||
o110 if [#5070 EQ 0]
|
||||
(back to start point and feed)
|
||||
G90
|
||||
G1 F[#<probe_traverse_fr>] Z#<z>
|
||||
F[#<probe_fast_fr>]
|
||||
(return from sub)
|
||||
o<probe_spindle_nose> return
|
||||
o110 endif
|
||||
|
||||
(Move up retract_distance height for slow probe)
|
||||
G90
|
||||
G1 F[#<probe_traverse_fr>] Z[#<z_minus_probed> + #<retract_distance>]
|
||||
|
||||
(Slow Probe Rule, if Slow Probe FR is set to 0, Slow Probe is Bypassed)
|
||||
o120 if [#<probe_slow_fr> GT 0]
|
||||
(Initiate Slow Z- Probe)
|
||||
G91
|
||||
F[#<probe_slow_fr>]
|
||||
G38.2 Z-[#<retract_distance> * 2]
|
||||
#<z_minus_probed> = #5063
|
||||
G90
|
||||
G1 F[#<probe_traverse_fr>] Z[#<z_minus_probed> + #<retract_distance>]
|
||||
o120 endif
|
||||
|
||||
(defines the edge as z_probed_position for DRO reporting)
|
||||
#<z_minus_probed_position> = #<z_minus_probed>
|
||||
|
||||
(output to gui DRO "Z PROBED POSITION")
|
||||
#1009 = #<z_minus_probed_position>
|
||||
#3010 = [ABS[#<z_minus_probed_position> - #<offset_z>]]
|
||||
#<max_z_travel_default> = [#3010 * 1.001]
|
||||
#3007 = #<max_z_travel_default>
|
||||
|
||||
(DEBUG, EVAL[vcp.getWidget{"z_minus_probed_position"}.setValue{#1009}])
|
||||
(DEBUG, EVAL[vcp.getWidget{"spindle_zero_height_3010"}.setValue{#3010}])
|
||||
(DEBUG, EVAL[vcp.getWidget{"z_max_travel_3007"}.setValue{#3007}])
|
||||
|
||||
G53 G0 Z0.0
|
||||
|
||||
o<probe_spindle_nose> endsub
|
||||
|
||||
M2 (end program)
|
||||
@@ -0,0 +1,124 @@
|
||||
(author: Chris P)
|
||||
(version: 0.4)
|
||||
(date: 06/27/24)
|
||||
|
||||
(Probe back top edge angle for y,z 0,0 position and edge angle)
|
||||
(Start probe position is over back edge of stock, set edge width,)
|
||||
(step off width distance and within max z distance)
|
||||
(ensure all settings have been set properly according to help diagrams)
|
||||
|
||||
o<probe_top_back_edge_angle> sub
|
||||
|
||||
(uses NGCGUI style arg spec)
|
||||
(number after "=" in comment is default value)
|
||||
#<probe_tool_number> = #3014 (=99)
|
||||
#<probe_slow_fr> = #3015 (=0)
|
||||
#<probe_fast_fr> = #3016 (=10.0)
|
||||
#<probe_traverse_fr> = #3017 (=50)
|
||||
#<max_xy_distance> = #3018 (=0.5000)
|
||||
#<xy_clearance> = #3019 (=0.1000)
|
||||
#<max_z_distance> = #3020 (=0.5000)
|
||||
#<z_clearance> = #3021 (=0.1000)
|
||||
#<extra_probe_depth> = #3022 (=0.0000)
|
||||
#<step_off_width> = #3023 (=0.5000)
|
||||
#<edge_width> = #3024 (=0.5000)
|
||||
#<probe_mode> = #3030 (=0)
|
||||
#<wco_rotation> = #3031 (=0)
|
||||
#<calibration_offset> = #3032 (=0)
|
||||
|
||||
(Cancel G92 offsets)
|
||||
G92.1
|
||||
|
||||
(set rotation offset to zero for new probe cycle)
|
||||
G10 L2 P[#5220] R0
|
||||
|
||||
#<workspace_y> = #[5202 + [20 * #5220]]
|
||||
|
||||
(Probe Tool Safety Check)
|
||||
o100 if [#5400 NE #<probe_tool_number>]
|
||||
(MSG, Specified probe tool #<probe_tool_number> not in spindle, aborting)
|
||||
o<probe_top_back_edge_angle> return
|
||||
o100 endif
|
||||
|
||||
(Probe Diameter)
|
||||
#<probe_diameter> = #5410
|
||||
|
||||
(Probing depth from the z probed clearance height, used for z moves)
|
||||
#<z_probe_stack> = [#<z_clearance> + #<probe_diameter> + #<extra_probe_depth>]
|
||||
|
||||
#<x_start_position> = #5420
|
||||
|
||||
(Call sub "probe_z_minus_sub" to Probe top of Workpiece)
|
||||
o<probe_z_minus_sub> call [#3014][#3015][#3016][#3017][#3020][#3021][#3030]
|
||||
|
||||
(Probe Y Positioning Move, Step Off Width)
|
||||
G91
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 Y[#<step_off_width>]
|
||||
|
||||
(Probe Y Positioning Move, to Probing Depth)
|
||||
F[#<probe_fast_fr>]
|
||||
G38.3 Z-[#<z_probe_stack>]
|
||||
|
||||
(Call sub "probe_y_minus" to Probe y- side of Workpiece)
|
||||
o<probe_y_minus> call [#3014][#3015][#3016][#3017][#3018][#3019][#3032]
|
||||
|
||||
#<y_minus_zero_edge_start> = #<_value>
|
||||
|
||||
(value returned safety check, aborts if no value returned)
|
||||
o110 if [#<probe_mode> EQ 1 AND #<_value_returned> NE 1]
|
||||
(MSG, Missing Y Sub returned edge parameter, aborting)
|
||||
o<probe_top_back_edge_angle> return
|
||||
o110 endif
|
||||
|
||||
(edge width move to edge second probing point)
|
||||
G91
|
||||
F[#<probe_fast_fr>]
|
||||
G38.3 X-[#<edge_width>]
|
||||
|
||||
(Call sub "probe_y_minus" to Probe y- side of Workpiece)
|
||||
o<probe_y_minus> call [#3014][#3015][#3016][#3017][#3018][#3019][#3032]
|
||||
|
||||
#<y_minus_zero_edge_end> = #<_value>
|
||||
|
||||
(value returned safety check, aborts if no value returned)
|
||||
o120 if [#<probe_mode> EQ 1 AND #<_value_returned> NE 1]
|
||||
(MSG, Missing Y Sub returned edge parameter, aborting)
|
||||
o<probe_top_back_edge_angle> return
|
||||
o120 endif
|
||||
|
||||
#<edge_delta> = [#<y_minus_zero_edge_start> - #<y_minus_zero_edge_end>]
|
||||
|
||||
#<edge_angle> = [ATAN [#<edge_delta>] / [#<edge_width>]]
|
||||
|
||||
#1011 = #<edge_delta>
|
||||
(DEBUG, EVAL[vcp.getWidget{"edge_delta"}.setValue{#1011}])
|
||||
|
||||
#1012 = #<edge_angle>
|
||||
(DEBUG, EVAL[vcp.getWidget{"edge_angle"}.setValue{#1012}])
|
||||
|
||||
(Probe Completion Move to Z Clearance Plane, and Y Zero)
|
||||
G91
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 Z[#<z_probe_stack>]
|
||||
G90
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 X[#<x_start_position>] Y[#<y_minus_zero_edge_start>]
|
||||
|
||||
(probe mode rules for WCO, Rotation and probe position measuring only)
|
||||
o130 if [#<probe_mode> EQ 0 AND #<wco_rotation> EQ 0]
|
||||
(Record Zero in selected axes and WCO)
|
||||
G10 L2 P#5220 X[#<x_start_position>] Y[#<y_minus_zero_edge_start> + #<workspace_y>]
|
||||
o<probe_top_back_edge_angle> return
|
||||
o130 endif
|
||||
|
||||
(probe mode rules for WCO, Rotation and probe position measuring only)
|
||||
o140 if [#<probe_mode> EQ 0 AND #<wco_rotation> EQ 1]
|
||||
(Record Zero in selected axes and WCO)
|
||||
G10 L2 P#5220 X[#<x_start_position>] Y[#<y_minus_zero_edge_start> + #<workspace_y>] R[#<edge_angle>]
|
||||
o<probe_top_back_edge_angle> return
|
||||
o140 endif
|
||||
|
||||
o<probe_top_back_edge_angle> endsub
|
||||
|
||||
M2 (end program)
|
||||
@@ -0,0 +1,124 @@
|
||||
(author: Chris P)
|
||||
(version: 0.5)
|
||||
(date: 06/27/24)
|
||||
|
||||
(Probe top front edge angle for y,z 0,0 position and edge angle)
|
||||
(Start probe position is over front edge of stock, set edge width,)
|
||||
(step off width distance and within max z distance)
|
||||
(ensure all settings have been set properly according to help diagrams)
|
||||
|
||||
o<probe_top_front_edge_angle> sub
|
||||
|
||||
(uses NGCGUI style arg spec)
|
||||
(number after "=" in comment is default value)
|
||||
#<probe_tool_number> = #3014 (=99)
|
||||
#<probe_slow_fr> = #3015 (=0)
|
||||
#<probe_fast_fr> = #3016 (=10.0)
|
||||
#<probe_traverse_fr> = #3017 (=50)
|
||||
#<max_xy_distance> = #3018 (=0.5000)
|
||||
#<xy_clearance> = #3019 (=0.1000)
|
||||
#<max_z_distance> = #3020 (=0.5000)
|
||||
#<z_clearance> = #3021 (=0.1000)
|
||||
#<extra_probe_depth> = #3022 (=0.0000)
|
||||
#<step_off_width> = #3023 (=0.5000)
|
||||
#<edge_width> = #3024 (=0.5000)
|
||||
#<probe_mode> = #3030 (=0)
|
||||
#<wco_rotation> = #3031 (=0)
|
||||
#<calibration_offset> = #3032 (=0)
|
||||
|
||||
(Cancel G92 offsets)
|
||||
G92.1
|
||||
|
||||
(set rotation offset to zero for new probe cycle)
|
||||
G10 L2 P[#5220] R0
|
||||
|
||||
#<workspace_y> = #[5202 + [20 * #5220]]
|
||||
|
||||
(Probe Tool Safety Check)
|
||||
o100 if [#5400 NE #<probe_tool_number>]
|
||||
(MSG, Specified probe tool #<probe_tool_number> not in spindle, aborting)
|
||||
o<probe_top_front_edge_angle> return
|
||||
o100 endif
|
||||
|
||||
(Probe Diameter)
|
||||
#<probe_diameter> = #5410
|
||||
|
||||
(Probing depth from the z probed clearance height, used for z moves)
|
||||
#<z_probe_stack> = [#<z_clearance> + #<probe_diameter> + #<extra_probe_depth>]
|
||||
|
||||
#<x_start_position> = #5420
|
||||
|
||||
(Call sub "probe_z_minus_sub" to Probe top of Workpiece)
|
||||
o<probe_z_minus_sub> call [#3014][#3015][#3016][#3017][#3020][#3021][#3030]
|
||||
|
||||
(Probe Y Positioning Move, Step Off Width)
|
||||
G91
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 Y-[#<step_off_width>]
|
||||
|
||||
(Probe Y Positioning Move, to Probing Depth)
|
||||
F[#<probe_fast_fr>]
|
||||
G38.3 Z-[#<z_probe_stack>]
|
||||
|
||||
(Call sub "probe_y_plus" to Probe y+ side of Workpiece)
|
||||
o<probe_y_plus> call [#3014][#3015][#3016][#3017][#3018][#3019][#3032]
|
||||
|
||||
#<y_plus_zero_edge_start> = #<_value>
|
||||
|
||||
(value returned safety check, aborts if no value returned)
|
||||
o110 if [#<probe_mode> EQ 1 AND #<_value_returned> NE 1]
|
||||
(MSG, Missing Y Sub returned edge parameter, aborting)
|
||||
o<probe_top_front_edge_angle> return
|
||||
o110 endif
|
||||
|
||||
(edge width move to edge second probing point)
|
||||
G91
|
||||
F[#<probe_fast_fr>]
|
||||
G38.3 X[#<edge_width>]
|
||||
|
||||
(Call sub "probe_y_plus" to Probe y+ side of Workpiece)
|
||||
o<probe_y_plus> call [#3014][#3015][#3016][#3017][#3018][#3019][#3032]
|
||||
|
||||
#<y_plus_zero_edge_end> = #<_value>
|
||||
|
||||
(value returned safety check, aborts if no value returned)
|
||||
o120 if [#<probe_mode> EQ 1 AND #<_value_returned> NE 1]
|
||||
(MSG, Missing Y Sub returned edge parameter, aborting)
|
||||
o<probe_top_front_edge_angle> return
|
||||
o120 endif
|
||||
|
||||
#<edge_delta> = [#<y_plus_zero_edge_end> - #<y_plus_zero_edge_start>]
|
||||
|
||||
#<edge_angle> = [ATAN [#<edge_delta>] / [#<edge_width>]]
|
||||
|
||||
#1011 = #<edge_delta>
|
||||
(DEBUG, EVAL[vcp.getWidget{"edge_delta"}.setValue{#1011}])
|
||||
|
||||
#1012 = #<edge_angle>
|
||||
(DEBUG, EVAL[vcp.getWidget{"edge_angle"}.setValue{#1012}])
|
||||
|
||||
(Probe Completion Move to Z Clearance Plane, and Y Zero)
|
||||
G91
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 Z[#<z_probe_stack>]
|
||||
G90
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 X[#<x_start_position>] Y[#<y_plus_zero_edge_start>]
|
||||
|
||||
(probe mode rules for WCO, Rotation and probe position measuring only)
|
||||
o130 if [#<probe_mode> EQ 0 AND #<wco_rotation> EQ 0]
|
||||
(Record Zero in selected axes and WCO)
|
||||
G10 L2 P#5220 X[#<x_start_position>] Y[#<y_plus_zero_edge_start> + #<workspace_y>]
|
||||
o<probe_top_front_edge_angle> return
|
||||
o130 endif
|
||||
|
||||
(probe mode rules for WCO, Rotation and probe position measuring only)
|
||||
o140 if [#<probe_mode> EQ 0 AND #<wco_rotation> EQ 1]
|
||||
(Record Zero in selected axes and WCO)
|
||||
G10 L2 P#5220 X[#<x_start_position>] Y[#<y_plus_zero_edge_start> + #<workspace_y>] R[#<edge_angle>]
|
||||
o<probe_top_front_edge_angle> return
|
||||
o140 endif
|
||||
|
||||
o<probe_top_front_edge_angle> endsub
|
||||
|
||||
M2 (end program)
|
||||
@@ -0,0 +1,124 @@
|
||||
(author: Chris P)
|
||||
(version: 0.4)
|
||||
(date: 06/27/24)
|
||||
|
||||
(Probe top left edge angle for y,z 0,0 position and edge angle)
|
||||
(Start probe position is over left edge of stock, set edge width,)
|
||||
(step off width distance and within max z distance)
|
||||
(ensure all settings have been set properly according to help diagrams)
|
||||
|
||||
o<probe_top_left_edge_angle> sub
|
||||
|
||||
(uses NGCGUI style arg spec)
|
||||
(number after "=" in comment is default value)
|
||||
#<probe_tool_number> = #3014 (=99)
|
||||
#<probe_slow_fr> = #3015 (=0)
|
||||
#<probe_fast_fr> = #3016 (=10.0)
|
||||
#<probe_traverse_fr> = #3017 (=50)
|
||||
#<max_xy_distance> = #3018 (=0.5000)
|
||||
#<xy_clearance> = #3019 (=0.1000)
|
||||
#<max_z_distance> = #3020 (=0.5000)
|
||||
#<z_clearance> = #3021 (=0.1000)
|
||||
#<extra_probe_depth> = #3022 (=0.0000)
|
||||
#<step_off_width> = #3023 (=0.5000)
|
||||
#<edge_width> = #3024 (=0.5000)
|
||||
#<probe_mode> = #3030 (=0)
|
||||
#<wco_rotation> = #3031 (=0)
|
||||
#<calibration_offset> = #3032 (=0)
|
||||
|
||||
(Cancel G92 offsets)
|
||||
G92.1
|
||||
|
||||
(set rotation offset to zero for new probe cycle)
|
||||
G10 L2 P[#5220] R0
|
||||
|
||||
#<workspace_x> = #[5201 + [20 * #5220]]
|
||||
|
||||
(Probe Tool Safety Check)
|
||||
o100 if [#5400 NE #<probe_tool_number>]
|
||||
(MSG, Specified probe tool #<probe_tool_number> not in spindle, aborting)
|
||||
o<probe_top_left_edge_angle> return
|
||||
o100 endif
|
||||
|
||||
(Probe Diameter)
|
||||
#<probe_diameter> = #5410
|
||||
|
||||
(Probing depth from the z probed clearance height, used for z moves)
|
||||
#<z_probe_stack> = [#<z_clearance> + #<probe_diameter> + #<extra_probe_depth>]
|
||||
|
||||
#<y_start_position> = #5421
|
||||
|
||||
(Call sub "probe_z_minus_sub" to Probe top of Workpiece)
|
||||
o<probe_z_minus_sub> call [#3014][#3015][#3016][#3017][#3020][#3021][#3030]
|
||||
|
||||
(Probe X Positioning Move, Step Off Width)
|
||||
G91
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 X-[#<step_off_width>]
|
||||
|
||||
(Probe X Positioning Move, to Probing Depth)
|
||||
F[#<probe_fast_fr>]
|
||||
G38.3 Z-[#<z_probe_stack>]
|
||||
|
||||
(Call sub "probe_x_plus" to Probe x+ side of Workpiece)
|
||||
o<probe_x_plus> call [#3014][#3015][#3016][#3017][#3018][#3019][#3032]
|
||||
|
||||
#<x_plus_zero_edge_start> = #<_value>
|
||||
|
||||
(value returned safety check, aborts if no value returned)
|
||||
o110 if [#<probe_mode> EQ 1 AND #<_value_returned> NE 1]
|
||||
(MSG, Missing X Sub returned edge parameter, aborting)
|
||||
o<probe_top_left_edge_angle> return
|
||||
o110 endif
|
||||
|
||||
(edge width move to edge second probing point)
|
||||
G91
|
||||
F[#<probe_fast_fr>]
|
||||
G38.3 Y-[#<edge_width>]
|
||||
|
||||
(Call sub "probe_x_plus" to Probe x+ side of Workpiece)
|
||||
o<probe_x_plus> call [#3014][#3015][#3016][#3017][#3018][#3019][#3032]
|
||||
|
||||
#<x_plus_zero_edge_end> = #<_value>
|
||||
|
||||
(value returned safety check, aborts if no value returned)
|
||||
o120 if [#<probe_mode> EQ 1 AND #<_value_returned> NE 1]
|
||||
(MSG, Missing X Sub returned edge parameter, aborting)
|
||||
o<probe_top_left_edge_angle> return
|
||||
o120 endif
|
||||
|
||||
#<edge_delta> = [#<x_plus_zero_edge_end> - #<x_plus_zero_edge_start>]
|
||||
|
||||
#<edge_angle> = [ATAN [#<edge_delta>] / [#<edge_width>]]
|
||||
|
||||
#1011 = #<edge_delta>
|
||||
(DEBUG, EVAL[vcp.getWidget{"edge_delta"}.setValue{#1011}])
|
||||
|
||||
#1012 = #<edge_angle>
|
||||
(DEBUG, EVAL[vcp.getWidget{"edge_angle"}.setValue{#1012}])
|
||||
|
||||
(Probe Completion Move to Z Clearance Plane, and Y Zero)
|
||||
G91
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 Z[#<z_probe_stack>]
|
||||
G90
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 X[#<x_plus_zero_edge_start>] Y[#<y_start_position>]
|
||||
|
||||
(probe mode rules for WCO, Rotation and probe position measuring only)
|
||||
o130 if [#<probe_mode> EQ 0 AND #<wco_rotation> EQ 0]
|
||||
(Record Zero in selected axes and WCO)
|
||||
G10 L2 P#5220 X[#<x_plus_zero_edge_start> + #<workspace_x>] Y[#<y_start_position>]
|
||||
o<probe_top_left_edge_angle> return
|
||||
o130 endif
|
||||
|
||||
(probe mode rules for WCO, Rotation and probe position measuring only)
|
||||
o140 if [#<probe_mode> EQ 0 AND #<wco_rotation> EQ 1]
|
||||
(Record Zero in selected axes and WCO)
|
||||
G10 L2 P#5220 X[#<x_plus_zero_edge_start> + #<workspace_x>] Y[#<y_start_position>] R[#<edge_angle>]
|
||||
o<probe_top_left_edge_angle> return
|
||||
o140 endif
|
||||
|
||||
o<probe_top_left_edge_angle> endsub
|
||||
|
||||
M2 (end program)
|
||||
@@ -0,0 +1,124 @@
|
||||
(author: Chris P)
|
||||
(version: 0.4)
|
||||
(date: 06/27/24)
|
||||
|
||||
(Probe top right edge angle for y,z 0,0 position and edge angle)
|
||||
(Start probe position is over right edge of stock, set edge width,)
|
||||
(step off width distance and within max z distance)
|
||||
(ensure all settings have been set properly according to help diagrams)
|
||||
|
||||
o<probe_top_right_edge_angle> sub
|
||||
|
||||
(uses NGCGUI style arg spec)
|
||||
(number after "=" in comment is default value)
|
||||
#<probe_tool_number> = #3014 (=99)
|
||||
#<probe_slow_fr> = #3015 (=0)
|
||||
#<probe_fast_fr> = #3016 (=10.0)
|
||||
#<probe_traverse_fr> = #3017 (=50)
|
||||
#<max_xy_distance> = #3018 (=0.5000)
|
||||
#<xy_clearance> = #3019 (=0.1000)
|
||||
#<max_z_distance> = #3020 (=0.5000)
|
||||
#<z_clearance> = #3021 (=0.1000)
|
||||
#<extra_probe_depth> = #3022 (=0.0000)
|
||||
#<step_off_width> = #3023 (=0.5000)
|
||||
#<edge_width> = #3024 (=0.5000)
|
||||
#<probe_mode> = #3030 (=0)
|
||||
#wco_rotation> = #3031 (=0)
|
||||
#<calibration_offset> = #3032 (=0)
|
||||
|
||||
(Cancel G92 offsets)
|
||||
G92.1
|
||||
|
||||
(set rotation offset to zero for new probe cycle)
|
||||
G10 L2 P[#5220] R0
|
||||
|
||||
#<workspace_x> = #[5201 + [20 * #5220]]
|
||||
|
||||
(Probe Tool Safety Check)
|
||||
o100 if [#5400 NE #<probe_tool_number>]
|
||||
(MSG, Specified probe tool #<probe_tool_number> not in spindle, aborting)
|
||||
o<probe_top_right_edge_angle> return
|
||||
o100 endif
|
||||
|
||||
(Probe Diameter)
|
||||
#<probe_diameter> = #5410
|
||||
|
||||
(Probing depth from the z probed clearance height, used for z moves)
|
||||
#<z_probe_stack> = [#<z_clearance> + #<probe_diameter> + #<extra_probe_depth>]
|
||||
|
||||
#<y_start_position> = #5421
|
||||
|
||||
(Call sub "probe_z_minus_sub" to Probe top of Workpiece)
|
||||
o<probe_z_minus_sub> call [#3014][#3015][#3016][#3017][#3020][#3021][#3030]
|
||||
|
||||
(Probe X Positioning Move, Step Off Width)
|
||||
G91
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 X[#<step_off_width>]
|
||||
|
||||
(Probe X Positioning Move, to Probing Depth)
|
||||
F[#<probe_fast_fr>]
|
||||
G38.3 Z-[#<z_probe_stack>]
|
||||
|
||||
(Call sub "probe_x_minus" to Probe x- side of Workpiece)
|
||||
o<probe_x_minus> call [#3014][#3015][#3016][#3017][#3018][#3019][#3032]
|
||||
|
||||
#<x_minus_zero_edge_start> = #<_value>
|
||||
|
||||
(value returned safety check, aborts if no value returned)
|
||||
o110 if [#<probe_mode> EQ 1 AND #<_value_returned> NE 1]
|
||||
(MSG, Missing X Sub returned edge parameter, aborting)
|
||||
o<probe_top_right_edge_angle> return
|
||||
o110 endif
|
||||
|
||||
(edge width move to edge second probing point)
|
||||
G91
|
||||
F[#<probe_fast_fr>]
|
||||
G38.3 Y[#<edge_width>]
|
||||
|
||||
(Call sub "probe_x_minus" to Probe x- side of Workpiece)
|
||||
o<probe_x_minus> call [#3014][#3015][#3016][#3017][#3018][#3019][#3032]
|
||||
|
||||
#<x_minus_zero_edge_end> = #<_value>
|
||||
|
||||
(value returned safety check, aborts if no value returned)
|
||||
o120 if [#<probe_mode> EQ 1 AND #<_value_returned> NE 1]
|
||||
(MSG, Missing X Sub returned edge parameter, aborting)
|
||||
o<probe_top_right_edge_angle> return
|
||||
o120 endif
|
||||
|
||||
#<edge_delta> = [#<x_minus_zero_edge_start> - #<x_minus_zero_edge_end>]
|
||||
|
||||
#<edge_angle> = [ATAN [#<edge_delta>] / [#<edge_width>]]
|
||||
|
||||
#1011 = #<edge_delta>
|
||||
(DEBUG, EVAL[vcp.getWidget{"edge_delta"}.setValue{#1011}])
|
||||
|
||||
#1012 = #<edge_angle>
|
||||
(DEBUG, EVAL[vcp.getWidget{"edge_angle"}.setValue{#1012}])
|
||||
|
||||
(Probe Completion Move to Z Clearance Plane, and Y Zero)
|
||||
G91
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 Z[#<z_probe_stack>]
|
||||
G90
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 X[#<x_minus_zero_edge_start>] Y[#<y_start_position>]
|
||||
|
||||
(probe mode rules for WCO, Rotation and probe position measuring only)
|
||||
o130 if [#<probe_mode> EQ 0 AND #<wco_rotation> EQ 0]
|
||||
(Record Zero in selected axes and WCO)
|
||||
G10 L2 P#5220 X[#<x_minus_zero_edge_start> + #<workspace_x>] Y[#<y_start_position>]
|
||||
o<probe_top_right_edge_angle> return
|
||||
o130 endif
|
||||
|
||||
(probe mode rules for WCO, Rotation and probe position measuring only)
|
||||
o140 if [#<probe_mode> EQ 0 AND #<wco_rotation> EQ 1]
|
||||
(Record Zero in selected axes and WCO)
|
||||
G10 L2 P#5220 X[#<x_minus_zero_edge_start> + #<workspace_x>] Y[#<y_start_position>] R[#<edge_angle>]
|
||||
o<probe_top_right_edge_angle> return
|
||||
o140 endif
|
||||
|
||||
o<probe_top_right_edge_angle> endsub
|
||||
|
||||
M2 (end program)
|
||||
104
configs/probe_basic_lathe/subroutines/probe_valley_x.ngc
Normal file
104
configs/probe_basic_lathe/subroutines/probe_valley_x.ngc
Normal file
@@ -0,0 +1,104 @@
|
||||
(author: Chris P)
|
||||
(version: 0.2)
|
||||
(date: 06/27/24)
|
||||
|
||||
(Probe valley in x, find Z0, X0 valley center position)
|
||||
(Start probe position is over left side edge of valley wall)
|
||||
(inside the step off width distance and within max z distance)
|
||||
(ensure all settings have been set properly according to help diagrams)
|
||||
|
||||
o<probe_valley_x> sub
|
||||
|
||||
(uses NGCGUI style arg spec)
|
||||
(number after "=" in comment is default value)
|
||||
#<probe_tool_number> = #3014 (=99)
|
||||
#<probe_slow_fr> = #3015 (=0)
|
||||
#<probe_fast_fr> = #3016 (=10.0)
|
||||
#<probe_traverse_fr> = #3017 (=50)
|
||||
#<max_xy_distance> = #3018 (=0.5000)
|
||||
#<xy_clearance> = #3019 (=0.1000)
|
||||
#<max_z_distance> = #3020 (=0.5000)
|
||||
#<z_clearance> = #3021 (=0.1000)
|
||||
#<extra_probe_depth> = #3022 (=0.0000)
|
||||
#<step_off_width> = #3023 (=0.5000)
|
||||
#<edge_width> = #3024 (=0.5000)
|
||||
#<x_hint_ridge_valley> = #3028 (=0)
|
||||
#<y_hint_ridge_valley> = #3029 (=0)
|
||||
#<probe_mode> = #3030 (=0)
|
||||
#<calibration_offset> = #3032 (=0)
|
||||
|
||||
(Cancel G92 offsets)
|
||||
G92.1
|
||||
|
||||
#<workspace_x> = #[5201 + [20 * #5220]]
|
||||
|
||||
(Probe Tool Safety Check)
|
||||
o100 if [#5400 NE #<probe_tool_number>]
|
||||
(MSG, Specified probe tool #<probe_tool_number> not in spindle, aborting)
|
||||
o<probe_valley_x> return
|
||||
o100 endif
|
||||
|
||||
(Probe Diameter)
|
||||
#<probe_diameter> = #5410
|
||||
|
||||
(remove probe tip diam and cal offset from probed width calculations)
|
||||
#<probe_diameter_offset> = [#<probe_diameter> - [#<calibration_offset> * 2]]
|
||||
|
||||
#<z_probe_stack> = [#<z_clearance> + #<probe_diameter> + #<extra_probe_depth>]
|
||||
|
||||
(Call sub "probe_z_minus_sub" to Probe top of Workpiece)
|
||||
o<probe_z_minus_sub> call [#3014][#3015][#3016][#3017][#3020][#3021][#3030]
|
||||
|
||||
(Probe X Positioning Move, Step Off Width)
|
||||
G91
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 X[#<step_off_width>]
|
||||
|
||||
(Probe X Positioning Move, to Probing Depth)
|
||||
F[#<probe_fast_fr>]
|
||||
G38.3 Z-[#<z_probe_stack>]
|
||||
|
||||
(Call sub "probe_x_minus" to Probe x- side of Workpiece)
|
||||
o<probe_x_minus> call [#3014][#3015][#3016][#3017][#3018][#3019][#3032]
|
||||
|
||||
#<x_minus_probed> = #5061
|
||||
|
||||
(Call sub "probe_x_plus" to Probe x+ side of Workpiece)
|
||||
o<probe_x_plus> call [#3014][#3015][#3016][3017][#3018 + #3026][#3019][#3032]
|
||||
|
||||
#<x_plus_probed> = #5061
|
||||
|
||||
(probed center calculation)
|
||||
#<x_center_probed> = [[#<x_plus_probed> + #<x_minus_probed>] / 2]
|
||||
|
||||
(calculate X Width Probed)
|
||||
#<raw_width> = [#<x_plus_probed> - #<x_minus_probed>]
|
||||
|
||||
(Completed probed width calculations)
|
||||
#<x_probed_width> = [#<raw_width> + #<probe_diameter_offset>]
|
||||
|
||||
#1001 = #<x_probed_width>
|
||||
(DEBUG, EVAL[vcp.getWidget{"x_probed_width"}.setValue{#1001}])
|
||||
|
||||
#1002 = #<x_center_probed>
|
||||
(DEBUG, EVAL[vcp.getWidget{"x_center_probed"}.setValue{#1002}])
|
||||
|
||||
(Probe Completion Move to Z Clearance Plane, and X Zero)
|
||||
G90
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 X[#<x_center_probed>]
|
||||
G91
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 Z[#<z_probe_stack>]
|
||||
|
||||
(probe mode rules for WCO or probe position measuring only)
|
||||
o110 if [#<probe_mode> EQ 0]
|
||||
(Record X Zero in selected WCO)
|
||||
G10 L2 P#5220 X[#<x_center_probed> + #<workspace_x>]
|
||||
o<probe_valley_x> return
|
||||
o110 endif
|
||||
|
||||
|
||||
o<probe_valley_x> endsub
|
||||
|
||||
M2 (end program)
|
||||
@@ -0,0 +1,85 @@
|
||||
(author: Chris P)
|
||||
(version: 0.2)
|
||||
(date: 06/27/24)
|
||||
|
||||
(Probe valley in x, find X zero valley center position)
|
||||
(Start probe position is centered between valley walls)
|
||||
(ensure all settings have been set properly according to help diagrams)
|
||||
|
||||
o<probe_valley_x_center_start> sub
|
||||
|
||||
(uses NGCGUI style arg spec)
|
||||
(number after "=" in comment is default value)
|
||||
#<probe_tool_number> = #3014 (=99)
|
||||
#<probe_slow_fr> = #3015 (=0)
|
||||
#<probe_fast_fr> = #3016 (=10.0)
|
||||
#<probe_traverse_fr> = #3017 (=50)
|
||||
#<max_xy_distance> = #3018 (=0.5000)
|
||||
#<xy_clearance> = #3019 (=0.1000)
|
||||
#<max_z_distance> = #3020 (=0.5000)
|
||||
#<z_clearance> = #3021 (=0.1000)
|
||||
#<extra_probe_depth> = #3022 (=0.0000)
|
||||
#<step_off_width> = #3023 (=0.5000)
|
||||
#<edge_width> = #3024 (=0.5000)
|
||||
#<x_hint_ridge_valley> = #3028 (=0)
|
||||
#<y_hint_ridge_valley> = #3029 (=0)
|
||||
#<probe_mode> = #3030 (=0)
|
||||
#<calibration_offset> = #3032 (=0)
|
||||
|
||||
(Cancel G92 offsets)
|
||||
G92.1
|
||||
|
||||
#<workspace_x> = #[5201 + [20 * #5220]]
|
||||
|
||||
(Probe Tool Safety Check)
|
||||
o100 if [#5400 NE #<probe_tool_number>]
|
||||
(MSG, Specified probe tool #<probe_tool_number> not in spindle, aborting)
|
||||
o<probe_valley_x_center_start> return
|
||||
o100 endif
|
||||
|
||||
(Probe Diameter)
|
||||
#<probe_diameter> = #5410
|
||||
|
||||
(remove probe tip diam and cal offset from probed width calculations)
|
||||
#<probe_diameter_offset> = [#<probe_diameter> - [#<calibration_offset> * 2]]
|
||||
|
||||
(Call sub "probe_x_minus" to Probe x- side of Workpiece)
|
||||
o<probe_x_minus> call [#3014][#3015][#3016][3017][#3018 + #3026 / 2][#3019][#3032]
|
||||
|
||||
#<x_minus_probed> = #5061
|
||||
|
||||
(Call sub "probe_x_plus" to Probe x+ side of Workpiece)
|
||||
o<probe_x_plus> call [#3014][#3015][#3016][3017][#3018 + #3026][#3019][#3032]
|
||||
|
||||
#<x_plus_probed> = #5061
|
||||
|
||||
(probed center calculation)
|
||||
#<x_center_probed> = [[#<x_plus_probed> + #<x_minus_probed>] / 2]
|
||||
|
||||
(calculate X Width Probed)
|
||||
#<raw_width> = [#<x_plus_probed> - #<x_minus_probed>]
|
||||
|
||||
(Completed probed width calculations)
|
||||
#<x_probed_width> = [#<raw_width> + #<probe_diameter_offset>]
|
||||
|
||||
#1001 = #<x_probed_width>
|
||||
(DEBUG, EVAL[vcp.getWidget{"x_probed_width"}.setValue{#1001}])
|
||||
|
||||
#1002 = #<x_center_probed>
|
||||
(DEBUG, EVAL[vcp.getWidget{"x_center_probed"}.setValue{#1002}])
|
||||
|
||||
(Probe Completion Move to X Zero)
|
||||
G90
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 X[#<x_center_probed>]
|
||||
|
||||
(probe mode rules for WCO or probe position measuring only)
|
||||
o110 if [#<probe_mode> EQ 0]
|
||||
(Record X Zero in selected WCO)
|
||||
G10 L2 P#5220 X[#<x_center_probed> + #<workspace_x>]
|
||||
o<probe_valley_x_center_start> return
|
||||
o110 endif
|
||||
|
||||
o<probe_valley_x_center_start> endsub
|
||||
|
||||
M2 (end program)
|
||||
101
configs/probe_basic_lathe/subroutines/probe_valley_y.ngc
Normal file
101
configs/probe_basic_lathe/subroutines/probe_valley_y.ngc
Normal file
@@ -0,0 +1,101 @@
|
||||
(author: Chris P)
|
||||
(version: 0.2)
|
||||
(date: 06/27/24)
|
||||
|
||||
(Probe valley in Y, find Z0, Y0 valley center position)
|
||||
(Start probe position is over back side edge of valley wall)
|
||||
(inside the step off width distance and within max z distance)
|
||||
(ensure all settings have been set properly according to help diagrams)
|
||||
|
||||
o<probe_valley_y> sub
|
||||
|
||||
(uses NGCGUI style arg spec)
|
||||
(number after "=" in comment is default value)
|
||||
#<probe_tool_number> = #3014 (=99)
|
||||
#<probe_slow_fr> = #3015 (=0)
|
||||
#<probe_fast_fr> = #3016 (=10.0)
|
||||
#<probe_traverse_fr> = #3017 (=50)
|
||||
#<max_xy_distance> = #3018 (=0.5000)
|
||||
#<xy_clearance> = #3019 (=0.1000)
|
||||
#<max_z_distance> = #3020 (=0.5000)
|
||||
#<z_clearance> = #3021 (=0.1000)
|
||||
#<extra_probe_depth> = #3022 (=0.0000)
|
||||
#<step_off_width> = #3023 (=0.5000)
|
||||
#<edge_width> = #3024 (=0.5000)
|
||||
#<x_hint_ridge_valley> = #3028 (=0)
|
||||
#<y_hint_ridge_valley> = #3029 (=0)
|
||||
#<probe_mode> = #3030 (=0)
|
||||
#<calibration_offset> = #3032 (=0)
|
||||
|
||||
(Cancel G92 offsets)
|
||||
G92.1
|
||||
|
||||
#<workspace_y> = #[5202 + [20 * #5220]]
|
||||
|
||||
(Probe Tool Safety Check)
|
||||
o100 if [#5400 NE #<probe_tool_number>]
|
||||
(MSG, Specified probe tool #<probe_tool_number> not in spindle, aborting)
|
||||
o<probe_valley_y> return
|
||||
o100 endif
|
||||
|
||||
(Probe Diameter)
|
||||
#<probe_diameter> = #5410
|
||||
|
||||
(remove probe tip diam and cal offset from probed width calculations)
|
||||
#<probe_diameter_offset> = [#<probe_diameter> - [#<calibration_offset> * 2]]
|
||||
|
||||
#<z_probe_stack> = [#<z_clearance> + #<probe_diameter> + #<extra_probe_depth>]
|
||||
|
||||
(Call sub "probe_z_minus_sub" to Probe top of Workpiece)
|
||||
o<probe_z_minus_sub> call [#3014][#3015][#3016][#3017][#3020][#3021][#3030]
|
||||
|
||||
(Probe Y Positioning Move, Step Off Width)
|
||||
G91
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 Y-[#<step_off_width>]
|
||||
F[#<probe_fast_fr>]
|
||||
G38.3 Z-[#<z_probe_stack>]
|
||||
|
||||
(Call sub "probe_y_plus" to Probe Y+ side of Workpiece)
|
||||
o<probe_y_plus> call [#3014][#3015][#3016][#3017][#3018][#3019][#3032]
|
||||
|
||||
#<y_plus_probed> = #5062
|
||||
|
||||
(Call sub "probe_y_minus_sub" to Probe Y- side of Workpiece)
|
||||
o<probe_y_minus> call [#3014][#3015][#3016][3017][#3018 + #3027][#3019][#3032]
|
||||
|
||||
#<y_minus_probed> = #5062
|
||||
|
||||
(probed center calculation)
|
||||
#<y_center_probed> = [[#<y_plus_probed> + #<y_minus_probed>] / 2]
|
||||
|
||||
(calculate Y Width Probed)
|
||||
#<raw_width> = [#<y_plus_probed> - #<y_minus_probed>]
|
||||
|
||||
(Completed probed width calculations)
|
||||
#<y_probed_width> = [#<raw_width> + #<probe_diameter_offset>]
|
||||
|
||||
#1003 = #<y_probed_width>
|
||||
(DEBUG, EVAL[vcp.getWidget{"y_probed_width"}.setValue{#1003}])
|
||||
|
||||
#1004 = #<y_center_probed>
|
||||
(DEBUG, EVAL[vcp.getWidget{"y_center_probed"}.setValue{#1004}])
|
||||
|
||||
(Probe Completion Move to Z Clearance Plane, and X Zero)
|
||||
G90
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 Y[#<y_center_probed>]
|
||||
G91
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 Z[#<z_probe_stack>]
|
||||
|
||||
(probe mode rules for WCO or probe position measuring only)
|
||||
o110 if [#<probe_mode> EQ 0]
|
||||
(Record X Zero in selected WCO)
|
||||
G10 L2 P#5220 Y[#<y_center_probed> + #<workspace_y>]
|
||||
o<probe_valley_y> return
|
||||
o110 endif
|
||||
|
||||
o<probe_valley_y> endsub
|
||||
|
||||
M2 (end program)
|
||||
@@ -0,0 +1,85 @@
|
||||
(author: Chris P)
|
||||
(version: 0.2)
|
||||
(date: 06/27/24)
|
||||
|
||||
(Probe valley in Y find Y0 valley center position)
|
||||
(Start probe position is rough center between valley walls)
|
||||
(ensure all settings have been set properly according to help diagrams)
|
||||
|
||||
o<probe_valley_y_center_start> sub
|
||||
|
||||
(uses NGCGUI style arg spec)
|
||||
(number after "=" in comment is default value)
|
||||
#<probe_tool_number> = #3014 (=99)
|
||||
#<probe_slow_fr> = #3015 (=0)
|
||||
#<probe_fast_fr> = #3016 (=10.0)
|
||||
#<probe_traverse_fr> = #3017 (=50)
|
||||
#<max_xy_distance> = #3018 (=0.5000)
|
||||
#<xy_clearance> = #3019 (=0.1000)
|
||||
#<max_z_distance> = #3020 (=0.5000)
|
||||
#<z_clearance> = #3021 (=0.1000)
|
||||
#<extra_probe_depth> = #3022 (=0.0000)
|
||||
#<step_off_width> = #3023 (=0.5000)
|
||||
#<edge_width> = #3024 (=0.5000)
|
||||
#<x_hint_ridge_valley> = #3028 (=0)
|
||||
#<y_hint_ridge_valley> = #3029 (=0)
|
||||
#<probe_mode> = #3030 (=0)
|
||||
#<calibration_offset> = #3032 (=0)
|
||||
|
||||
(Cancel G92 offsets)
|
||||
G92.1
|
||||
|
||||
#<workspace_y> = #[5202 + [20 * #5220]]
|
||||
|
||||
(Probe Tool Safety Check)
|
||||
o100 if [#5400 NE #<probe_tool_number>]
|
||||
(MSG, Specified probe tool #<probe_tool_number> not in spindle, aborting)
|
||||
o<probe_valley_y_center_start> return
|
||||
o100 endif
|
||||
|
||||
(Probe Diameter)
|
||||
#<probe_diameter> = #5410
|
||||
|
||||
(remove probe tip diam and cal offset from probed width calculations)
|
||||
#<probe_diameter_offset> = [#<probe_diameter> - [#<calibration_offset> * 2]]
|
||||
|
||||
(Call sub "probe_y_plus" to Probe Y+ side of Workpiece)
|
||||
o<probe_y_plus> call [#3014][#3015][#3016][3017][#3018 + #3027 / 2][#3019][#3032]
|
||||
|
||||
#<y_plus_probed> = #5062
|
||||
|
||||
(Call sub "probe_y_minus_sub" to Probe Y- side of Workpiece)
|
||||
o<probe_y_minus> call [#3014][#3015][#3016][3017][#3018 + #3027][#3019][#3032]
|
||||
|
||||
#<y_minus_probed> = #5062
|
||||
|
||||
(probed center calculation)
|
||||
#<y_center_probed> = [[#<y_plus_probed> + #<y_minus_probed>] / 2]
|
||||
|
||||
(calculate Y Width Probed)
|
||||
#<raw_width> = [#<y_plus_probed> - #<y_minus_probed>]
|
||||
|
||||
(Completed probed width calculations)
|
||||
#<y_probed_width> = [#<raw_width> + #<probe_diameter_offset>]
|
||||
|
||||
#1003 = #<y_probed_width>
|
||||
(DEBUG, EVAL[vcp.getWidget{"y_probed_width"}.setValue{#1003}])
|
||||
|
||||
#1004 = #<y_center_probed>
|
||||
(DEBUG, EVAL[vcp.getWidget{"y_center_probed"}.setValue{#1004}])
|
||||
|
||||
(Probe Completion Move to Z Clearance Plane, and X Zero)
|
||||
G90
|
||||
F[#<probe_traverse_fr>]
|
||||
G38.3 Y[#<y_center_probed>]
|
||||
|
||||
(probe mode rules for WCO or probe position measuring only)
|
||||
o110 if [#<probe_mode> EQ 0]
|
||||
(Record X Zero in selected WCO)
|
||||
G10 L2 P#5220 Y[#<y_center_probed> + #<workspace_y>]
|
||||
o<probe_valley_y_center_start> return
|
||||
o110 endif
|
||||
|
||||
o<probe_valley_y_center_start> endsub
|
||||
|
||||
M2 (end program)
|
||||
85
configs/probe_basic_lathe/subroutines/probe_x_minus.ngc
Normal file
85
configs/probe_basic_lathe/subroutines/probe_x_minus.ngc
Normal file
@@ -0,0 +1,85 @@
|
||||
(author: Chris P)
|
||||
(version: 0.2)
|
||||
(date: 06/27/24)
|
||||
|
||||
(Probe X Minus direction and set X 0 in current WCO)
|
||||
(Start probe position to the right side edge of stock)
|
||||
(inside the max xy distance with the probe tip below the stock top edge)
|
||||
(ensure all settings have been set properly according to help diagrams)
|
||||
|
||||
o<probe_x_minus> sub
|
||||
|
||||
(uses NGCGUI style arg spec)
|
||||
(number after "=" in comment is default value)
|
||||
#<probe_tool_number> = #1
|
||||
#<probe_slow_fr> = #2
|
||||
#<probe_fast_fr> = #3
|
||||
#<probe_traverse_fr> = #4
|
||||
#<max_xy_distance> = #5
|
||||
#<xy_clearance> = #6
|
||||
#<calibration_offset> = #7
|
||||
|
||||
(Cancel G92 offsets)
|
||||
G92.1
|
||||
|
||||
(Probe Tool Safety Check)
|
||||
o100 if [#5400 NE #<probe_tool_number>]
|
||||
(MSG, Specified probe tool #<probe_tool_number> not in spindle, aborting)
|
||||
o<probe_x_minus> return
|
||||
o100 endif
|
||||
|
||||
(Probe Diameter)
|
||||
#<probe_diameter> = #5410
|
||||
|
||||
(Probe Radius)
|
||||
#<probe_radius> = [#<probe_diameter> / 2]
|
||||
|
||||
(Probe Centerline Offset)
|
||||
#<probe_center_offset> = [#<probe_radius> - #<calibration_offset>]
|
||||
|
||||
(Current X Position including offsets in current program units)
|
||||
#<x> = #5420
|
||||
|
||||
(Initiate Fast X- Probe)
|
||||
G91
|
||||
F[#<probe_fast_fr>]
|
||||
G38.2 X-[#<max_xy_distance>]
|
||||
#<x_minus_probed> = #5061
|
||||
|
||||
(Probe Error check, #5070 will be 0 if failed)
|
||||
o110 if [#5070 EQ 0]
|
||||
(back to start point and feed)
|
||||
G90
|
||||
G1 F[#<probe_traverse_fr>] X#<x>
|
||||
F[#<probe_fast_fr>]
|
||||
(return from sub)
|
||||
o<probe_x_minus> return
|
||||
o110 endif
|
||||
|
||||
(Move to xy_clearance distance for slow probe)
|
||||
G90
|
||||
G1 F[#<probe_traverse_fr>] X[#<x_minus_probed> + #<xy_clearance>]
|
||||
|
||||
(Slow Probe Rule, if Slow Probe FR is set to 0, Slow Probe is Bypassed)
|
||||
o120 if [#<probe_slow_fr> GT 0]
|
||||
(Initiate Slow X- Probe)
|
||||
G91
|
||||
F[#<probe_slow_fr>]
|
||||
G38.2 X-[#<xy_clearance> * 2]
|
||||
#<x_minus_probed> = #5061
|
||||
G90
|
||||
G1 F[#<probe_traverse_fr>] X[#<x_minus_probed> + #<xy_clearance>]
|
||||
o120 endif
|
||||
|
||||
#<x_minus_zero_edge> = [#<x_minus_probed> - #<probe_center_offset>]
|
||||
|
||||
(defines the edge as x_probed_position for DRO reporting)
|
||||
#<x_minus_probed_position> = #<x_minus_zero_edge>
|
||||
|
||||
(output to gui DRO "X PROBED POSITION")
|
||||
#1005 = #<x_minus_probed_position>
|
||||
(DEBUG, EVAL[vcp.getWidget{"x_minus_probed_position"}.setValue{#1005}])
|
||||
|
||||
o<probe_x_minus> endsub [#<x_minus_zero_edge>]
|
||||
|
||||
M2 (end program)
|
||||
99
configs/probe_basic_lathe/subroutines/probe_x_minus_wco.ngc
Normal file
99
configs/probe_basic_lathe/subroutines/probe_x_minus_wco.ngc
Normal file
@@ -0,0 +1,99 @@
|
||||
(author: Chris P)
|
||||
(version: 0.2)
|
||||
(date: 06/27/24)
|
||||
|
||||
(Probe X Minus direction and set X 0 in current WCO)
|
||||
(Start probe position to the right side edge of stock)
|
||||
(inside the max xy distance with the probe tip below the stock top edge)
|
||||
(ensure all settings have been set properly according to help diagrams)
|
||||
|
||||
o<probe_x_minus_wco> sub
|
||||
|
||||
(uses NGCGUI style arg spec)
|
||||
(number after "=" in comment is default value)
|
||||
#<probe_tool_number> = #3014 (=99)
|
||||
#<probe_slow_fr> = #3015 (=0)
|
||||
#<probe_fast_fr> = #3016 (=10.0)
|
||||
#<probe_traverse_fr> = #3017 (=50)
|
||||
#<max_xy_distance> = #3018 (=0.5000)
|
||||
#<xy_clearance> = #3019 (=0.1000)
|
||||
#<max_z_distance> = #3020 (=0.5000)
|
||||
#<z_clearance> = #3021 (=0.1000)
|
||||
#<extra_probe_depth> = #3022 (=0.0000)
|
||||
#<step_off_width> = #3023 (=0.5000)
|
||||
#<probe_mode> = #3030 (=0)
|
||||
#<calibration_offset> = #3032 (=0)
|
||||
|
||||
(Cancel G92 offsets)
|
||||
G92.1
|
||||
|
||||
#<workspace_x> = #[5201 + [20 * #5220]]
|
||||
|
||||
(Probe Tool Safety Check)
|
||||
o100 if [#5400 NE #<probe_tool_number>]
|
||||
(MSG, Specified probe tool #<probe_tool_number> not in spindle, aborting)
|
||||
o<probe_x_minus_wco> return
|
||||
o100 endif
|
||||
|
||||
(Probe Diameter)
|
||||
#<probe_diameter> = #5410
|
||||
|
||||
(Probe Radius)
|
||||
#<probe_radius> = [#<probe_diameter> / 2]
|
||||
|
||||
(Probe Centerline Offset)
|
||||
#<probe_center_offset> = [#<probe_radius> - #<calibration_offset>]
|
||||
|
||||
(Current X Position including offsets in current program units)
|
||||
#<x> = #5420
|
||||
|
||||
(Initiate Fast X- Probe)
|
||||
G91
|
||||
F[#<probe_fast_fr>]
|
||||
G38.2 X-[#<max_xy_distance>]
|
||||
#<x_minus_probed> = #5061
|
||||
|
||||
(Probe Error check, #5070 will be 0 if failed)
|
||||
o110 if [#5070 EQ 0]
|
||||
(back to start point and feed)
|
||||
G90
|
||||
G1 F[#<probe_traverse_fr>] X#<x>
|
||||
F[#<probe_fast_fr>]
|
||||
(return from sub)
|
||||
o<probe_x_minus_wco> return
|
||||
o110 endif
|
||||
|
||||
(Move to xy_clearance distance for slow probe)
|
||||
G90
|
||||
G1 F[#<probe_traverse_fr>] X[#<x_minus_probed> + #<xy_clearance>]
|
||||
|
||||
(Slow Probe Rule, if Slow Probe FR is set to 0, Slow Probe is Bypassed)
|
||||
o120 if [#<probe_slow_fr> GT 0]
|
||||
(Initiate Slow X- Probe)
|
||||
G91
|
||||
F[#<probe_slow_fr>]
|
||||
G38.2 X-[#<xy_clearance> * 2]
|
||||
#<x_minus_probed> = #5061
|
||||
G90
|
||||
G1 F[#<probe_traverse_fr>] X[#<x_minus_probed> + #<xy_clearance>]
|
||||
o120 endif
|
||||
|
||||
#<x_minus_zero_edge> = [#<x_minus_probed> - #<probe_center_offset>]
|
||||
|
||||
(defines the edge as x_probed_position for DRO reporting)
|
||||
#<x_minus_probed_position> = #<x_minus_zero_edge>
|
||||
|
||||
(output to gui DRO "X PROBED POSITION")
|
||||
#1005 = #<x_minus_probed_position>
|
||||
(DEBUG, EVAL[vcp.getWidget{"x_minus_probed_position"}.setValue{#1005}])
|
||||
|
||||
(probe mode rule for WCO or probe position measuring only)
|
||||
o130 if [#<probe_mode> EQ 0]
|
||||
(Record X Zero in selected WCO)
|
||||
G10 L2 P#5220 X[#<x_minus_zero_edge> + #<workspace_x>]
|
||||
o<probe_x_minus_wco> return
|
||||
o130 endif
|
||||
|
||||
o<probe_x_minus_wco> endsub
|
||||
|
||||
M2 (end program)
|
||||
85
configs/probe_basic_lathe/subroutines/probe_x_plus.ngc
Normal file
85
configs/probe_basic_lathe/subroutines/probe_x_plus.ngc
Normal file
@@ -0,0 +1,85 @@
|
||||
(author: Chris P)
|
||||
(version: 0.2)
|
||||
(date: 06/27/24)
|
||||
|
||||
(Probe X plus direction and set X 0 in current WCO)
|
||||
(Start probe position to the left side edge of stock)
|
||||
(inside the max xy distance with the probe tip below the stock top edge)
|
||||
(ensure all settings have been set properly according to help diagrams)
|
||||
|
||||
o<probe_x_plus> sub
|
||||
|
||||
(uses NGCGUI style arg spec)
|
||||
(number after "=" in comment is default value)
|
||||
#<probe_tool_number> = #1
|
||||
#<probe_slow_fr> = #2
|
||||
#<probe_fast_fr> = #3
|
||||
#<probe_traverse_fr> = #4
|
||||
#<max_xy_distance> = #5
|
||||
#<xy_clearance> = #6
|
||||
#<calibration_offset> = #7
|
||||
|
||||
(Cancel G92 offsets)
|
||||
G92.1
|
||||
|
||||
(Probe Tool Safety Check)
|
||||
o100 if [#5400 NE #<probe_tool_number>]
|
||||
(MSG, Specified probe tool #<probe_tool_number> not in spindle, aborting)
|
||||
o<probe_x_plus> return
|
||||
o100 endif
|
||||
|
||||
(Probe Diameter)
|
||||
#<probe_diameter> = #5410
|
||||
|
||||
(Probe Radius)
|
||||
#<probe_radius> = [#<probe_diameter> / 2]
|
||||
|
||||
(Probe Centerline Offset)
|
||||
#<probe_center_offset> = [#<probe_radius> - #<calibration_offset>]
|
||||
|
||||
(Current X Position including offsets in current program units)
|
||||
#<x> = #5420
|
||||
|
||||
(Initiate Fast X+ Probe)
|
||||
G91
|
||||
F[#<probe_fast_fr>]
|
||||
G38.2 X[#<max_xy_distance>]
|
||||
#<x_plus_probed> = #5061
|
||||
|
||||
(Probe Error check, #5070 will be 0 if failed)
|
||||
o110 if [#5070 EQ 0]
|
||||
(back to start point and feed)
|
||||
G90
|
||||
G1 F[#<probe_traverse_fr>] X#<x>
|
||||
F[#<probe_fast_fr>]
|
||||
(return from sub)
|
||||
o<probe_x_plus> return
|
||||
o110 endif
|
||||
|
||||
(Move to xy_clearance distance for slow probe)
|
||||
G90
|
||||
G1 F[#<probe_traverse_fr>] X[#<x_plus_probed> - #<xy_clearance>]
|
||||
|
||||
(Slow Probe Rule, if Slow Probe FR is set to 0, Slow Probe is Bypassed)
|
||||
o120 if [#<probe_slow_fr> GT 0]
|
||||
(Initiate Slow X+ Probe)
|
||||
G91
|
||||
F[#<probe_slow_fr>]
|
||||
G38.2 X[#<xy_clearance> * 2]
|
||||
#<x_plus_probed> = #5061
|
||||
G90
|
||||
G1 F[#<probe_traverse_fr>] X[#<x_plus_probed> - #<xy_clearance>]
|
||||
o120 endif
|
||||
|
||||
#<x_plus_zero_edge> = [#<x_plus_probed> + #<probe_center_offset>]
|
||||
|
||||
(defines the edge as x_probed_position for DRO reporting)
|
||||
#<x_plus_probed_position> = #<x_plus_zero_edge>
|
||||
|
||||
(output to gui DRO "X PROBED POSITION")
|
||||
#1006 = #<x_plus_probed_position>
|
||||
(DEBUG, EVAL[vcp.getWidget{"x_plus_probed_position"}.setValue{#1006}])
|
||||
|
||||
o<probe_x_plus> endsub [#<x_plus_zero_edge>]
|
||||
|
||||
M2 (end program)
|
||||
99
configs/probe_basic_lathe/subroutines/probe_x_plus_wco.ngc
Normal file
99
configs/probe_basic_lathe/subroutines/probe_x_plus_wco.ngc
Normal file
@@ -0,0 +1,99 @@
|
||||
(author: Chris P)
|
||||
(version: 0.2)
|
||||
(date: 06/27/24)
|
||||
|
||||
(Probe X plus direction and set X 0 in current WCO)
|
||||
(Start probe position to the left side edge of stock)
|
||||
(inside the max xy distance with the probe tip below the stock top edge)
|
||||
(ensure all settings have been set properly according to help diagrams)
|
||||
|
||||
o<probe_x_plus_wco> sub
|
||||
|
||||
(uses NGCGUI style arg spec)
|
||||
(number after "=" in comment is default value)
|
||||
#<probe_tool_number> = #3014 (=99)
|
||||
#<probe_slow_fr> = #3015 (=0)
|
||||
#<probe_fast_fr> = #3016 (=10.0)
|
||||
#<probe_traverse_fr> = #3017 (=50)
|
||||
#<max_xy_distance> = #3018 (=0.5000)
|
||||
#<xy_clearance> = #3019 (=0.1000)
|
||||
#<max_z_distance> = #3020 (=0.5000)
|
||||
#<z_clearance> = #3021 (=0.1000)
|
||||
#<extra_probe_depth> = #3022 (=0.0000)
|
||||
#<step_off_width> = #3023 (=0.5000)
|
||||
#<probe_mode> = #3030 (=0)
|
||||
#<calibration_offset> = #3032 (=0)
|
||||
|
||||
(Cancel G92 offsets)
|
||||
G92.1
|
||||
|
||||
#<workspace_x> = #[5201 + [20 * #5220]]
|
||||
|
||||
(Probe Tool Safety Check)
|
||||
o100 if [#5400 NE #<probe_tool_number>]
|
||||
(MSG, Specified probe tool #<probe_tool_number> not in spindle, aborting)
|
||||
o<probe_x_plus_wco> return
|
||||
o100 endif
|
||||
|
||||
(Probe Diameter)
|
||||
#<probe_diameter> = #5410
|
||||
|
||||
(Probe Radius)
|
||||
#<probe_radius> = [#<probe_diameter> / 2]
|
||||
|
||||
(Probe Centerline Offset)
|
||||
#<probe_center_offset> = [#<probe_radius> - #<calibration_offset>]
|
||||
|
||||
(Current X Position including offsets in current program units)
|
||||
#<x> = #5420
|
||||
|
||||
(Initiate Fast X+ Probe)
|
||||
G91
|
||||
F[#<probe_fast_fr>]
|
||||
G38.2 X[#<max_xy_distance>]
|
||||
#<x_plus_probed> = #5061
|
||||
|
||||
(Probe Error check, #5070 will be 0 if failed)
|
||||
o110 if [#5070 EQ 0]
|
||||
(back to start point and feed)
|
||||
G90
|
||||
G1 F[#<probe_traverse_fr>] X#<x>
|
||||
F[#<probe_fast_fr>]
|
||||
(return from sub)
|
||||
o<probe_x_plus_wco> return
|
||||
o110 endif
|
||||
|
||||
(Move to xy_clearance distance for slow probe)
|
||||
G90
|
||||
G1 F[#<probe_traverse_fr>] X[#<x_plus_probed> - #<xy_clearance>]
|
||||
|
||||
(Slow Probe Rule, if Slow Probe FR is set to 0, Slow Probe is Bypassed)
|
||||
o120 if [#<probe_slow_fr> GT 0]
|
||||
(Initiate Slow X+ Probe)
|
||||
G91
|
||||
F[#<probe_slow_fr>]
|
||||
G38.2 X[#<xy_clearance> * 2]
|
||||
#<x_plus_probed> = #5061
|
||||
G90
|
||||
G1 F[#<probe_traverse_fr>] X[#<x_plus_probed> - #<xy_clearance>]
|
||||
o120 endif
|
||||
|
||||
#<x_plus_zero_edge> = [#<x_plus_probed> + #<probe_center_offset>]
|
||||
|
||||
(defines the edge as x_probed_position for DRO reporting)
|
||||
#<x_plus_probed_position> = #<x_plus_zero_edge>
|
||||
|
||||
(output to gui DRO "X PROBED POSITION")
|
||||
#1006 = #<x_plus_probed_position>
|
||||
(DEBUG, EVAL[vcp.getWidget{"x_plus_probed_position"}.setValue{#1006}])
|
||||
|
||||
(probe mode rule for WCO or probe position measuring only)
|
||||
o130 if [#<probe_mode> EQ 0]
|
||||
(Record X Zero in selected WCO)
|
||||
G10 L2 P#5220 X[#<x_plus_zero_edge> + #<workspace_x>]
|
||||
o<probe_x_plus_wco> return
|
||||
o130 endif
|
||||
|
||||
o<probe_x_plus_wco> endsub
|
||||
|
||||
M2 (end program)
|
||||
85
configs/probe_basic_lathe/subroutines/probe_y_minus.ngc
Normal file
85
configs/probe_basic_lathe/subroutines/probe_y_minus.ngc
Normal file
@@ -0,0 +1,85 @@
|
||||
(author: Chris P)
|
||||
(version: 0.2)
|
||||
(date: 06/27/24)
|
||||
|
||||
(Probe Y Minus direction to locate edge, end at clearance distance)
|
||||
(Start probe position to the back side edge of stock)
|
||||
(inside the max xy distance with the probe tip below the stock top edge)
|
||||
(ensure all settings have been set properly according to help diagrams)
|
||||
|
||||
o<probe_y_minus> sub
|
||||
|
||||
(uses NGCGUI style arg spec)
|
||||
(number after "=" in comment is default value)
|
||||
#<probe_tool_number> = #1
|
||||
#<probe_slow_fr> = #2
|
||||
#<probe_fast_fr> = #3
|
||||
#<probe_traverse_fr> = #4
|
||||
#<max_xy_distance> = #5
|
||||
#<xy_clearance> = #6
|
||||
#<calibration_offset> = #7
|
||||
|
||||
(Cancel G92 offsets)
|
||||
G92.1
|
||||
|
||||
(Probe Tool Safety Check)
|
||||
o100 if [#5400 NE #<probe_tool_number>]
|
||||
(MSG, Specified probe tool #<probe_tool_number> not in spindle, aborting)
|
||||
o<probe_y_minus> return
|
||||
o100 endif
|
||||
|
||||
(Probe Diameter)
|
||||
#<probe_diameter> = #5410
|
||||
|
||||
(Probe Radius)
|
||||
#<probe_radius> = [#<probe_diameter> / 2]
|
||||
|
||||
(Probe Centerline Offset)
|
||||
#<probe_center_offset> = [#<probe_radius> - #<calibration_offset>]
|
||||
|
||||
(Current Y Position including offsets in current program units)
|
||||
#<y> = #5421
|
||||
|
||||
(Initiate Fast Y- Probe)
|
||||
G91
|
||||
F[#<probe_fast_fr>]
|
||||
G38.2 y-[#<max_xy_distance>]
|
||||
#<y_minus_probed> = #5062
|
||||
|
||||
(Probe Error check, #5070 will be 0 if failed)
|
||||
o110 if [#5070 EQ 0]
|
||||
(back to start point and feed)
|
||||
G90
|
||||
G1 F[#<probe_traverse_fr>] Y#<y>
|
||||
F[#<probe_fast_fr>]
|
||||
(return from sub)
|
||||
o<probe_y_minus> return
|
||||
o110 endif
|
||||
|
||||
(Move to xy_clearance distance for slow probe)
|
||||
G90
|
||||
G1 F[#<probe_traverse_fr>] Y[#<y_minus_probed> + #<xy_clearance>]
|
||||
|
||||
(Slow Probe Rule, if Slow Probe FR is set to 0, Slow Probe is Bypassed)
|
||||
o120 if [#<probe_slow_fr> GT 0]
|
||||
(Initiate Slow Y- Probe)
|
||||
G91
|
||||
F[#<probe_slow_fr>]
|
||||
G38.2 Y-[#<xy_clearance> * 2]
|
||||
#<y_minus_probed> = #5062
|
||||
G90
|
||||
G1 F[#<probe_traverse_fr>] Y[#<y_minus_probed> + #<xy_clearance>]
|
||||
o120 endif
|
||||
|
||||
#<y_minus_zero_edge> = [#5062 - #<probe_center_offset>]
|
||||
|
||||
(defines the edge as y_probed_position for DRO reporting)
|
||||
#<y_minus_probed_position> = #<y_minus_zero_edge>
|
||||
|
||||
(output to gui DRO "Y PROBED POSITION")
|
||||
#1007 = #<y_minus_probed_position>
|
||||
(DEBUG, EVAL[vcp.getWidget{"y_minus_probed_position"}.setValue{#1007}])
|
||||
|
||||
o<probe_y_minus> endsub [#<y_minus_zero_edge>]
|
||||
|
||||
M2 (end program)
|
||||
99
configs/probe_basic_lathe/subroutines/probe_y_minus_wco.ngc
Normal file
99
configs/probe_basic_lathe/subroutines/probe_y_minus_wco.ngc
Normal file
@@ -0,0 +1,99 @@
|
||||
(author: Chris P)
|
||||
(version: 0.2)
|
||||
(date: 06/27/24)
|
||||
|
||||
(Probe Y Minus direction and set Y 0 in current WCO)
|
||||
(Start probe position to the back side edge of stock)
|
||||
(inside the max xy distance with the probe tip below the stock top edge)
|
||||
(ensure all settings have been set properly according to help diagrams)
|
||||
|
||||
o<probe_y_minus_wco> sub
|
||||
|
||||
(uses NGCGUI style arg spec)
|
||||
(number after "=" in comment is default value)
|
||||
#<probe_tool_number> = #3014 (=99)
|
||||
#<probe_slow_fr> = #3015 (=0)
|
||||
#<probe_fast_fr> = #3016 (=10.0)
|
||||
#<probe_traverse_fr> = #3017 (=50)
|
||||
#<max_xy_distance> = #3018 (=0.5000)
|
||||
#<xy_clearance> = #3019 (=0.1000)
|
||||
#<max_z_distance> = #3020 (=0.5000)
|
||||
#<z_clearance> = #3021 (=0.1000)
|
||||
#<extra_probe_depth> = #3022 (=0.0000)
|
||||
#<step_off_width> = #3023 (=0.5000)
|
||||
#<probe_mode> = #3030 (=0)
|
||||
#<calibration_offset> = #3032 (=0)
|
||||
|
||||
(Cancel G92 offsets)
|
||||
G92.1
|
||||
|
||||
#<workspace_y> = #[5202 + [20 * #5220]]
|
||||
|
||||
(Probe Tool Safety Check)
|
||||
o100 if [#5400 NE #<probe_tool_number>]
|
||||
(MSG, Specified probe tool #<probe_tool_number> not in spindle, aborting)
|
||||
o<probe_y_minus_wco> return
|
||||
o100 endif
|
||||
|
||||
(Probe Diameter)
|
||||
#<probe_diameter> = #5410
|
||||
|
||||
(Probe Radius)
|
||||
#<probe_radius> = [#<probe_diameter> / 2]
|
||||
|
||||
(Probe Centerline Offset)
|
||||
#<probe_center_offset> = [#<probe_radius> - #<calibration_offset>]
|
||||
|
||||
(Current Y Position including offsets in current program units)
|
||||
#<y> = #5421
|
||||
|
||||
(Initiate Fast Y- Probe)
|
||||
G91
|
||||
F[#<probe_fast_fr>]
|
||||
G38.2 y-[#<max_xy_distance>]
|
||||
#<y_minus_probed> = #5062
|
||||
|
||||
(Probe Error check, #5070 will be 0 if failed)
|
||||
o110 if [#5070 EQ 0]
|
||||
(back to start point and feed)
|
||||
G90
|
||||
G1 F[#<probe_traverse_fr>] Y#<y>
|
||||
F[#<probe_fast_fr>]
|
||||
(return from sub)
|
||||
o<probe_y_minus_wco> return
|
||||
o110 endif
|
||||
|
||||
(Move to xy_clearance distance for slow probe)
|
||||
G90
|
||||
G1 F[#<probe_traverse_fr>] Y[#<y_minus_probed> + #<xy_clearance>]
|
||||
|
||||
(Slow Probe Rule, if Slow Probe FR is set to 0, Slow Probe is Bypassed)
|
||||
o120 if [#<probe_slow_fr> GT 0]
|
||||
(Initiate Slow Y- Probe)
|
||||
G91
|
||||
F[#<probe_slow_fr>]
|
||||
G38.2 Y-[#<xy_clearance> * 2]
|
||||
#<y_minus_probed> = #5062
|
||||
G90
|
||||
G1 F[#<probe_traverse_fr>] Y[#<y_minus_probed> + #<xy_clearance>]
|
||||
o120 endif
|
||||
|
||||
#<y_minus_zero_edge> = [#5062 - #<probe_center_offset>]
|
||||
|
||||
(defines the edge as y_probed_position for DRO reporting)
|
||||
#<y_minus_probed_position> = #<y_minus_zero_edge>
|
||||
|
||||
(output to gui DRO "Y PROBED POSITION")
|
||||
#1007 = #<y_minus_probed_position>
|
||||
(DEBUG, EVAL[vcp.getWidget{"y_minus_probed_position"}.setValue{#1007}])
|
||||
|
||||
(probe mode rule for WCO or probe position measuring only)
|
||||
o130 if [#<probe_mode> EQ 0]
|
||||
(Record Y Zero in selected WCO)
|
||||
G10 L2 P#5220 Y[#<y_minus_zero_edge> + #<workspace_y>]
|
||||
o<probe_y_minus_wco> return
|
||||
o130 endif
|
||||
|
||||
o<probe_y_minus_wco> endsub
|
||||
|
||||
M2 (end program)
|
||||
85
configs/probe_basic_lathe/subroutines/probe_y_plus.ngc
Normal file
85
configs/probe_basic_lathe/subroutines/probe_y_plus.ngc
Normal file
@@ -0,0 +1,85 @@
|
||||
(author: Chris P)
|
||||
(version: 0.2)
|
||||
(date: 06/27/24)
|
||||
|
||||
(Probe Y plus direction to locate edge, end at clearance distance)
|
||||
(Start probe position to the front side edge of stock)
|
||||
(inside the max xy distance with the probe tip below the stock top edge)
|
||||
(ensure all settings have been set properly according to help diagrams)
|
||||
|
||||
o<probe_y_plus> sub
|
||||
|
||||
(uses NGCGUI style arg spec)
|
||||
(number after "=" in comment is default value)
|
||||
#<probe_tool_number> = #1
|
||||
#<probe_slow_fr> = #2
|
||||
#<probe_fast_fr> = #3
|
||||
#<probe_traverse_fr> = #4
|
||||
#<max_xy_distance> = #5
|
||||
#<xy_clearance> = #6
|
||||
#<calibration_offset> = #7
|
||||
|
||||
(Cancel G92 offsets)
|
||||
G92.1
|
||||
|
||||
(Probe Tool Safety Check)
|
||||
o100 if [#5400 NE #<probe_tool_number>]
|
||||
(MSG, Specified probe tool #<probe_tool_number> not in spindle, aborting)
|
||||
o<probe_y_plus> return
|
||||
o100 endif
|
||||
|
||||
(Probe Diameter)
|
||||
#<probe_diameter> = #5410
|
||||
|
||||
(Probe Radius)
|
||||
#<probe_radius> = [#<probe_diameter> / 2]
|
||||
|
||||
(Probe Centerline Offset)
|
||||
#<probe_center_offset> = [#<probe_radius> - #<calibration_offset>]
|
||||
|
||||
(Current Y Position including offsets in current program units)
|
||||
#<y> = #5421
|
||||
|
||||
(Initiate Fast y+ Probe)
|
||||
G91
|
||||
F[#<probe_fast_fr>]
|
||||
G38.2 Y[#<max_xy_distance>]
|
||||
#<y_plus_probed> = #5062
|
||||
|
||||
(Probe Error check, #5070 will be 0 if failed)
|
||||
o110 if [#5070 EQ 0]
|
||||
(back to start point and feed)
|
||||
G90
|
||||
G1 F[#<probe_traverse_fr>] Y#<y>
|
||||
F[#<probe_fast_fr>]
|
||||
(return from sub)
|
||||
o<probe_y_plus> return
|
||||
o110 endif
|
||||
|
||||
(Move to xy_clearance distance for slow probe)
|
||||
G90
|
||||
G1 F[#<probe_traverse_fr>] Y[#<y_plus_probed> - #<xy_clearance>]
|
||||
|
||||
(Slow Probe Rule, if Slow Probe FR is set to 0, Slow Probe is Bypassed)
|
||||
o120 if [#<probe_slow_fr> GT 0]
|
||||
(Initiate Slow Y+ Probe)
|
||||
G91
|
||||
F[#<probe_slow_fr>]
|
||||
G38.2 Y[#<xy_clearance> * 2]
|
||||
#<y_plus_probed> = #5062
|
||||
G90
|
||||
G1 F[#<probe_traverse_fr>] Y[#<y_plus_probed> - #<xy_clearance>]
|
||||
o120 endif
|
||||
|
||||
#<y_plus_zero_edge> = [#5062 + #<probe_center_offset>]
|
||||
|
||||
(defines the edge as y_probed_position for DRO reporting)
|
||||
#<y_plus_probed_position> = #<y_plus_zero_edge>
|
||||
|
||||
(output to gui DRO "Y PROBED POSITION")
|
||||
#1008 = #<y_plus_probed_position>
|
||||
(DEBUG, EVAL[vcp.getWidget{"y_plus_probed_position"}.setValue{#1008}])
|
||||
|
||||
o<probe_y_plus> endsub [#<y_plus_zero_edge>]
|
||||
|
||||
M2 (end program)
|
||||
99
configs/probe_basic_lathe/subroutines/probe_y_plus_wco.ngc
Normal file
99
configs/probe_basic_lathe/subroutines/probe_y_plus_wco.ngc
Normal file
@@ -0,0 +1,99 @@
|
||||
(author: Chris P)
|
||||
(version: 0.2)
|
||||
(date: 06/27/24)
|
||||
|
||||
(Probe Y plus direction and set Y 0 in current WCO)
|
||||
(Start probe position to the front side edge of stock)
|
||||
(inside the max xy distance with the probe tip below the stock top edge)
|
||||
(ensure all settings have been set properly according to help diagrams)
|
||||
|
||||
o<probe_y_plus_wco> sub
|
||||
|
||||
(uses NGCGUI style arg spec)
|
||||
(number after "=" in comment is default value)
|
||||
#<probe_tool_number> = #3014 (=99)
|
||||
#<probe_slow_fr> = #3015 (=0)
|
||||
#<probe_fast_fr> = #3016 (=10.0)
|
||||
#<probe_traverse_fr> = #3017 (=50)
|
||||
#<max_xy_distance> = #3018 (=0.5000)
|
||||
#<xy_clearance> = #3019 (=0.1000)
|
||||
#<max_z_distance> = #3020 (=0.5000)
|
||||
#<z_clearance> = #3021 (=0.1000)
|
||||
#<extra_probe_depth> = #3022 (=0.0000)
|
||||
#<step_off_width> = #3023 (=0.5000)
|
||||
#<probe_mode> = #3030 (=0)
|
||||
#<calibration_offset> = #3032 (=0)
|
||||
|
||||
(Cancel G92 offsets)
|
||||
G92.1
|
||||
|
||||
#<workspace_y> = #[5202 + [20 * #5220]]
|
||||
|
||||
(Probe Tool Safety Check)
|
||||
o100 if [#5400 NE #<probe_tool_number>]
|
||||
(MSG, Specified probe tool #<probe_tool_number> not in spindle, aborting)
|
||||
o<probe_y_plus_wco> return
|
||||
o100 endif
|
||||
|
||||
(Probe Diameter)
|
||||
#<probe_diameter> = #5410
|
||||
|
||||
(Probe Radius)
|
||||
#<probe_radius> = [#<probe_diameter> / 2]
|
||||
|
||||
(Probe Centerline Offset)
|
||||
#<probe_center_offset> = [#<probe_radius> - #<calibration_offset>]
|
||||
|
||||
(Current Y Position including offsets in current program units)
|
||||
#<y> = #5421
|
||||
|
||||
(Initiate Fast y+ Probe)
|
||||
G91
|
||||
F[#<probe_fast_fr>]
|
||||
G38.2 Y[#<max_xy_distance>]
|
||||
#<y_plus_probed> = #5062
|
||||
|
||||
(Probe Error check, #5070 will be 0 if failed)
|
||||
o110 if [#5070 EQ 0]
|
||||
(back to start point and feed)
|
||||
G90
|
||||
G1 F[#<probe_traverse_fr>] Y#<y>
|
||||
F[#<probe_fast_fr>]
|
||||
(return from sub)
|
||||
o<probe_y_plus_wco> return
|
||||
o110 endif
|
||||
|
||||
(Move to xy_clearance distance for slow probe)
|
||||
G90
|
||||
G1 F[#<probe_traverse_fr>] Y[#<y_plus_probed> - #<xy_clearance>]
|
||||
|
||||
(Slow Probe Rule, if Slow Probe FR is set to 0, Slow Probe is Bypassed)
|
||||
o120 if [#<probe_slow_fr> GT 0]
|
||||
(Initiate Slow Y+ Probe)
|
||||
G91
|
||||
F[#<probe_slow_fr>]
|
||||
G38.2 Y[#<xy_clearance> * 2]
|
||||
#<y_plus_probed> = #5062
|
||||
G90
|
||||
G1 F[#<probe_traverse_fr>] Y[#<y_plus_probed> - #<xy_clearance>]
|
||||
o120 endif
|
||||
|
||||
#<y_plus_zero_edge> = [#5062 + #<probe_center_offset>]
|
||||
|
||||
(defines the edge as y_probed_position for DRO reporting)
|
||||
#<y_plus_probed_position> = #<y_plus_zero_edge>
|
||||
|
||||
(output to gui DRO "Y PROBED POSITION")
|
||||
#1008 = #<y_plus_probed_position>
|
||||
(DEBUG, EVAL[vcp.getWidget{"y_plus_probed_position"}.setValue{#1008}])
|
||||
|
||||
(probe mode rule for WCO or probe position measuring only)
|
||||
o130 if [#<probe_mode> EQ 0]
|
||||
(Record Y Zero in selected WCO)
|
||||
G10 L2 P#5220 Y[#<y_plus_zero_edge> + #<workspace_y>]
|
||||
o<probe_y_plus_wco> return
|
||||
o130 endif
|
||||
|
||||
o<probe_y_plus_wco> endsub
|
||||
|
||||
M2 (end program)
|
||||
84
configs/probe_basic_lathe/subroutines/probe_z_minus_sub.ngc
Normal file
84
configs/probe_basic_lathe/subroutines/probe_z_minus_sub.ngc
Normal file
@@ -0,0 +1,84 @@
|
||||
(author: Chris P)
|
||||
(version: 0.2)
|
||||
(date: 06/27/24)
|
||||
|
||||
(Probe Z Minus direction and set Z 0 in current WCO)
|
||||
(Start probe position is over stock within max z distance)
|
||||
(ensure all settings have been set properly according to help diagrams)
|
||||
|
||||
o<probe_z_minus_sub> sub
|
||||
|
||||
(uses NGCGUI style arg spec)
|
||||
(number after "=" in comment is default value)
|
||||
#<probe_tool_number> = #1
|
||||
#<probe_slow_fr> = #2
|
||||
#<probe_fast_fr> = #3
|
||||
#<probe_traverse_fr> = #4
|
||||
#<max_z_distance> = #5
|
||||
#<z_clearance> = #6
|
||||
#<probe_mode> = #7
|
||||
|
||||
(Cancel G92 offsets)
|
||||
G92.1
|
||||
|
||||
#<workspace_z> = #[5203 + [20 * #5220]]
|
||||
|
||||
(Probe Tool Safety Check)
|
||||
o100 if [#5400 NE #<probe_tool_number>]
|
||||
(MSG, Specified probe tool #<probe_tool_number> not in spindle, aborting)
|
||||
o<probe_z_minus_sub> return
|
||||
o100 endif
|
||||
|
||||
(Current Z Position including offsets in current program units)
|
||||
#<z> = #5422
|
||||
|
||||
(Initial Fast Z- Probe)
|
||||
G91
|
||||
F[#<probe_fast_fr>]
|
||||
G38.2 Z-[#<max_z_distance>]
|
||||
#<z_minus_probed> = #5063
|
||||
|
||||
(Probe Error check, #5070 will be 0 if failed)
|
||||
o110 if [#5070 EQ 0]
|
||||
(back to start point and feed)
|
||||
G90
|
||||
G1 F[#<probe_traverse_fr>] Z#<z>
|
||||
F[#<probe_fast_fr>]
|
||||
(return from sub)
|
||||
o<probe_z_minus_sub> return
|
||||
o110 endif
|
||||
|
||||
(Move to z_clearance height for slow probe)
|
||||
G90
|
||||
G1 F[#<probe_traverse_fr>] Z[#<z_minus_probed> + #<z_clearance>]
|
||||
|
||||
(Slow Probe Rule, if Slow Probe FR is set to 0, Slow Probe is Bypassed)
|
||||
o120 if [#<probe_slow_fr> GT 0]
|
||||
(Initiate Slow Z- Probe)
|
||||
G91
|
||||
F[#<probe_slow_fr>]
|
||||
G38.2 Z-[#<z_clearance> * 2]
|
||||
#<z_minus_probed> = #5063
|
||||
G90
|
||||
G1 F[#<probe_traverse_fr>] Z[#<z_minus_probed> + #<z_clearance>]
|
||||
o120 endif
|
||||
|
||||
(defines the edge as z_probed_position for DRO reporting)
|
||||
#<z_minus_probed_position> = #<z_minus_probed>
|
||||
|
||||
(output to gui DRO "Z PROBED POSITION")
|
||||
#1009 = #<z_minus_probed_position>
|
||||
(DEBUG, EVAL[vcp.getWidget{"z_minus_probed_position"}.setValue{#1009}])
|
||||
|
||||
#<z_finish_height> = [#<z_minus_probed> + #<z_clearance>]
|
||||
|
||||
(probe mode rule for WCO or probe position measuring only)
|
||||
o130 if [#<probe_mode> EQ 0]
|
||||
(Record Z zero in selected WCO)
|
||||
G10 L2 P#5220 Z[#<z_minus_probed> + #<workspace_z>]
|
||||
o<probe_z_minus_sub> return
|
||||
o130 endif
|
||||
|
||||
o<probe_z_minus_sub> endsub [#<z_finish_height>]
|
||||
|
||||
M2 (end program)
|
||||
84
configs/probe_basic_lathe/subroutines/probe_z_minus_wco.ngc
Normal file
84
configs/probe_basic_lathe/subroutines/probe_z_minus_wco.ngc
Normal file
@@ -0,0 +1,84 @@
|
||||
(author: Chris P)
|
||||
(version: 0.2)
|
||||
(date: 06/27/24)
|
||||
|
||||
(Probe Z Minus direction and set Z 0 in current WCO)
|
||||
(Start probe position is over stock within max z distance)
|
||||
(ensure all settings have been set properly according to help diagrams)
|
||||
|
||||
o<probe_z_minus_wco> sub
|
||||
|
||||
(uses NGCGUI style arg spec)
|
||||
(number after "=" in comment is default value)
|
||||
#<probe_tool_number> = #3014 (=99)
|
||||
#<probe_slow_fr> = #3015 (=0)
|
||||
#<probe_fast_fr> = #3016 (=10.0)
|
||||
#<probe_traverse_fr> = #3017 (=50)
|
||||
#<max_z_distance> = #3020 (=0.5000)
|
||||
#<z_clearance> = #3021 (=0.1000)
|
||||
#<probe_mode> = #3030 (=0)
|
||||
|
||||
(Cancel G92 offsets)
|
||||
G92.1
|
||||
|
||||
#<workspace_z> = #[5203 + [20 * #5220]]
|
||||
|
||||
(Probe Tool Safety Check)
|
||||
o100 if [#5400 NE #<probe_tool_number>]
|
||||
(MSG, Specified probe tool #<probe_tool_number> not in spindle, aborting)
|
||||
o<probe_z_minus_wco> return
|
||||
o100 endif
|
||||
|
||||
(Current Z Position including offsets in current program units)
|
||||
#<z> = #5422
|
||||
|
||||
(Initial Fast Z- Probe)
|
||||
G91
|
||||
F[#<probe_fast_fr>]
|
||||
G38.2 Z-[#<max_z_distance>]
|
||||
#<z_minus_probed> = #5063
|
||||
|
||||
(Probe Error check, #5070 will be 0 if failed)
|
||||
o110 if [#5070 EQ 0]
|
||||
(back to start point and feed)
|
||||
G90
|
||||
G1 F[#<probe_traverse_fr>] Z#<z>
|
||||
F[#<probe_fast_fr>]
|
||||
(return from sub)
|
||||
o<probe_z_minus_wco> return
|
||||
o110 endif
|
||||
|
||||
(Move to z_clearance height for slow probe)
|
||||
G90
|
||||
G1 F[#<probe_traverse_fr>] Z[#<z_minus_probed> + #<z_clearance>]
|
||||
|
||||
(Slow Probe Rule, if Slow Probe FR is set to 0, Slow Probe is Bypassed)
|
||||
o120 if [#<probe_slow_fr> GT 0]
|
||||
(Initiate Slow Z- Probe)
|
||||
G91
|
||||
F[#<probe_slow_fr>]
|
||||
G38.2 Z-[#<z_clearance> * 2]
|
||||
#<z_minus_probed> = #5063
|
||||
G90
|
||||
G1 F[#<probe_traverse_fr>] Z[#<z_minus_probed> + #<z_clearance>]
|
||||
o120 endif
|
||||
|
||||
(defines the edge as z_probed_position for DRO reporting)
|
||||
#<z_minus_probed_position> = #<z_minus_probed>
|
||||
|
||||
(output to gui DRO "Z PROBED POSITION")
|
||||
#1009 = #<z_minus_probed_position>
|
||||
(DEBUG, EVAL[vcp.getWidget{"z_minus_probed_position"}.setValue{#1009}])
|
||||
|
||||
#<z_finish_height> = [#<z_minus_probed> + #<z_clearance>]
|
||||
|
||||
(probe mode rule for WCO or probe position measuring only)
|
||||
o130 if [#<probe_mode> EQ 0]
|
||||
(Record Z zero in selected WCO)
|
||||
G10 L2 P#5220 Z[#<z_minus_probed> + #<workspace_z>]
|
||||
o<probe_z_minus_wco> return
|
||||
o130 endif
|
||||
|
||||
o<probe_z_minus_wco> endsub
|
||||
|
||||
M2 (end program)
|
||||
45
configs/probe_basic_lathe/subroutines/program_coolant.ngc
Normal file
45
configs/probe_basic_lathe/subroutines/program_coolant.ngc
Normal file
@@ -0,0 +1,45 @@
|
||||
(author: Chris P)
|
||||
(version: 0.3)
|
||||
(date: 06/27/24)
|
||||
|
||||
(programmable coolant subroutine for aiming the coolant nozzle)
|
||||
(settings for setup are displayed on probe basic setting page)
|
||||
(in the programmable coolant constants container.)
|
||||
(calculations assume coolant nozzle is located on the right side of the spindle)
|
||||
|
||||
|
||||
o<program_coolant> sub
|
||||
(PRINT, o<program_coolant>)
|
||||
|
||||
#<activate_programmable_coolant> = #3000
|
||||
#<horizontal_spindle_nozzle_dist> = #3001
|
||||
#<vertical_spindle_nozzle_dist> = #3002
|
||||
#<pc_angle_offset> = #3003
|
||||
|
||||
o100 if [#<activate_programmable_coolant> EQ 0]
|
||||
o100 return
|
||||
o100 endif
|
||||
|
||||
#<pc_tool_length> = #5403
|
||||
|
||||
#<tool_diameter> = #5410
|
||||
|
||||
#<tool_radius_offset_dist> = [#<tool_diameter> / 2]
|
||||
|
||||
#<tool_diameter_offset_dist> = [#<horizontal_spindle_nozzle_dist> - #<tool_radius_offset_dist>]
|
||||
|
||||
#<tool_tip_position> = [[#<vertical_spindle_nozzle_dist>] + [#<pc_tool_length>]]
|
||||
|
||||
#<coolant_abs_angle> = [ATAN[#<tool_tip_position>] / [#<tool_diameter_offset_dist>]]
|
||||
|
||||
#<coolant_final_angle> = [[#<coolant_abs_angle>] + [#<pc_angle_offset>]]
|
||||
|
||||
#1000 = #<coolant_final_angle>
|
||||
(DEBUG, EVAL[vcp.getWidget{"coolant_final_angle"}.setValue{#1000}])
|
||||
|
||||
M68 E0 Q[#<coolant_final_angle>]
|
||||
|
||||
(PRINT, o<program_coolant> endsub)
|
||||
o<program_coolant> endsub
|
||||
|
||||
M2 (end program)
|
||||
101
configs/probe_basic_lathe/subroutines/radius.ngc
Executable file
101
configs/probe_basic_lathe/subroutines/radius.ngc
Executable file
@@ -0,0 +1,101 @@
|
||||
;radius
|
||||
o<radius> sub
|
||||
|
||||
o<backup_status> call
|
||||
|
||||
#<radius_x> = #1
|
||||
#<radius_ss> = #2
|
||||
#<radius_feed> = #3
|
||||
#<radius_doc> = #4 ;depth of cut
|
||||
#<radius_z> = #5
|
||||
#<radius_tool> = #6
|
||||
#<radius_exterior_front> = #8 ;will be cut ig freater than 0
|
||||
#<radius_interior> = #9 ;will be cut ig freater than 0
|
||||
#<radius_exterior_rear> = #10 ;will be cut ig freater than 0
|
||||
#<radius_coolant> = #11
|
||||
#<radius_maxrpm> = #12
|
||||
|
||||
;M6 T#<tool_number> G43
|
||||
o100 if [#<radius_tool> NE #<_current_tool>]
|
||||
(MSG,ERROR : Set tool before use macro)
|
||||
o100 return [-2] ; indicate failure to epilog
|
||||
o100 endif
|
||||
|
||||
G7 ; Lathe diameter mode
|
||||
G18 ; XZ Plane
|
||||
G21 ; Metric Units
|
||||
G90 ; Absolute Distance
|
||||
|
||||
#<radius_x> = [#<radius_x> / 2] ; because of radius mode
|
||||
#<starting_X> = #<_x> (starting X)
|
||||
#<starting_Z> = #<_z> (starting Z)
|
||||
|
||||
G96 D#<radius_maxrpm> S#<radius_ss> ; Constant Surface Speed Mode
|
||||
M3 ; Start Spindle
|
||||
G95 F#<radius_feed> ; Feed-Per-Rev Mode
|
||||
G4P1 ; Wait to reach speed
|
||||
|
||||
o110 if [#<radius_coolant>]
|
||||
M8
|
||||
o110 endif
|
||||
|
||||
#<temp> = 0
|
||||
o200 if [#<radius_exterior_front> GT 0] ; Front outside
|
||||
o201 while [[#<temp> + #<radius_doc>] lt #<radius_exterior_front>]
|
||||
#<temp> = [#<temp> + #<radius_doc>]
|
||||
G0 x[#<radius_x> - #<temp>] z#<starting_Z>
|
||||
G1 z#<radius_z>
|
||||
G3 x#<radius_x> z[#<radius_z> - #<temp>] K[-#<temp>]
|
||||
G1 x#<starting_X>
|
||||
G0 z#<starting_Z>
|
||||
o201 endwhile
|
||||
|
||||
G0 x#<starting_X> z#<starting_Z>
|
||||
G0 x[#<radius_x> - #<radius_exterior_front>]
|
||||
G1 z#<radius_z>
|
||||
G3 x#<radius_x> z[#<radius_z> - #<radius_exterior_front>] K[-#<radius_exterior_front>]
|
||||
G1 x#<starting_X>
|
||||
G0 z#<starting_Z>
|
||||
o200 elseif [#<radius_interior> GT 0.5] ; front inside
|
||||
o202 while [[#<temp> + #<radius_doc>] lt #<radius_interior>]
|
||||
#<temp> = [#<temp> + #<radius_doc>]
|
||||
G0 x[#<radius_x> + #<temp>] z#<starting_Z>
|
||||
G1 z#<radius_z>
|
||||
G2 x#<radius_x> z[#<radius_z> - #<temp>] K[-#<temp>]
|
||||
G1 x#<starting_X>
|
||||
G0 z#<starting_Z>
|
||||
o202endwhile
|
||||
|
||||
G0 x#<starting_X> z#<starting_Z>
|
||||
G0 x[#<radius_x> + #<radius_interior>]
|
||||
G1 z#<radius_z>
|
||||
G2 x#<radius_x> z[#<radius_z> - #<radius_interior>] K[-#<radius_interior>]
|
||||
G1 x#<starting_X>
|
||||
G0 z#<starting_Z>
|
||||
o300 elseif [#<radius_exterior_rear> GT 0.5] ; back outside
|
||||
o301 while [[#<temp> + #<radius_doc>] lt #<radius_exterior_rear>]
|
||||
#<temp> = [#<temp> + #<radius_doc>]
|
||||
G0 x[#<radius_x> - #<temp>] z#<starting_Z>
|
||||
G1 z#<radius_z>
|
||||
G2 x#<radius_x> z[#<radius_z> + #<temp>] K#<temp>
|
||||
G1 x#<starting_X>
|
||||
G0 z#<starting_Z>
|
||||
o301 endwhile
|
||||
|
||||
G0 x#<starting_X> z#<starting_Z>
|
||||
G0 x[#<radius_x> - #<radius_size>]
|
||||
G1 z#<radius_z>
|
||||
G2 x#<radius_x> z[#<radius_z> + #<radius_exterior_rear>] K#<radius_exterior_rear>
|
||||
G1 x#<starting_X>
|
||||
G0 z#<starting_Z>
|
||||
o300 endif
|
||||
|
||||
M5
|
||||
M9
|
||||
|
||||
o<backup_restore> call ; restore g20/21, g90/g91, feedrate cuter-comp and other using now global _backup_var
|
||||
|
||||
o<radius> endsub
|
||||
|
||||
M2
|
||||
%
|
||||
41
configs/probe_basic_lathe/subroutines/reset_all_data.ngc
Normal file
41
configs/probe_basic_lathe/subroutines/reset_all_data.ngc
Normal file
@@ -0,0 +1,41 @@
|
||||
o<reset_all_data> sub
|
||||
|
||||
#1001 = 0
|
||||
(DEBUG, EVAL[vcp.getWidget{"x_center_probed"}.setValue{#1001}])
|
||||
|
||||
#1002 = 0
|
||||
(DEBUG, EVAL[vcp.getWidget{"x_probed_width"}.setValue{#1002}])
|
||||
|
||||
#1003 = 0
|
||||
(DEBUG, EVAL[vcp.getWidget{"y_center_probed"}.setValue{#1003}])
|
||||
|
||||
#1004 = 0
|
||||
(DEBUG, EVAL[vcp.getWidget{"y_probed_width"}.setValue{#1004}])
|
||||
|
||||
#1005 = 0
|
||||
(DEBUG, EVAL[vcp.getWidget{"x_minus_probed_position"}.setValue{#1005}])
|
||||
|
||||
#1006 = 0
|
||||
(DEBUG, EVAL[vcp.getWidget{"x_plus_probed_position"}.setValue{#1006}])
|
||||
|
||||
#1007 = 0
|
||||
(DEBUG, EVAL[vcp.getWidget{"y_minus_probed_position"}.setValue{#1007}])
|
||||
|
||||
#1008 = 0
|
||||
(DEBUG, EVAL[vcp.getWidget{"y_plus_probed_position"}.setValue{#1008}])
|
||||
|
||||
#1009 = 0
|
||||
(DEBUG, EVAL[vcp.getWidget{"z_minus_probed_position"}.setValue{#1009}])
|
||||
|
||||
#1010 = 0
|
||||
(DEBUG, EVAL[vcp.getWidget{"averaged_diam"}.setValue{#1010}])
|
||||
|
||||
#1011 = 0
|
||||
(DEBUG, EVAL[vcp.getWidget{"edge_delta"}.setValue{#1011}])
|
||||
|
||||
#1012 = 0
|
||||
(DEBUG, EVAL[vcp.getWidget{"edge_angle"}.setValue{#1012}])
|
||||
|
||||
o<reset_all_data> endsub
|
||||
|
||||
M2 (end program)
|
||||
15
configs/probe_basic_lathe/subroutines/retractatc.ngc
Normal file
15
configs/probe_basic_lathe/subroutines/retractatc.ngc
Normal file
@@ -0,0 +1,15 @@
|
||||
o<retractatc> sub
|
||||
|
||||
M65 P0 ; Turn off carousel out solenoid
|
||||
M64 P1 ; Move Carousel IN
|
||||
|
||||
M66 P0 L3 Q5 ; check carousel in position sensor
|
||||
o100 if [#5399 LT 0]
|
||||
M65 P1 ; turn off the solenoid to send atc home
|
||||
(abort, Failed to send carousel home) ; abort if the sensor does not activate in 5 seconds
|
||||
o100 endif
|
||||
M65 P1
|
||||
|
||||
o<retractatc> endsub [1]
|
||||
|
||||
M2
|
||||
17
configs/probe_basic_lathe/subroutines/set_g30_position.ngc
Normal file
17
configs/probe_basic_lathe/subroutines/set_g30_position.ngc
Normal file
@@ -0,0 +1,17 @@
|
||||
o<set_g30_position> sub
|
||||
; Lathe specific version
|
||||
|
||||
o100 if [1 EQ 1]
|
||||
(G30.1 records the tool touch off position in the var file)
|
||||
G30.1
|
||||
o100 endif
|
||||
|
||||
#1000 = #5181
|
||||
(DEBUG, EVAL[vcp.getWidget{"x_tool_change_position"}.setValue{#1000}])
|
||||
|
||||
#1002 = #5183
|
||||
(DEBUG, EVAL[vcp.getWidget{"z_tool_change_position"}.setValue{#1002}])
|
||||
|
||||
o<set_g30_position> endsub
|
||||
|
||||
M2
|
||||
19
configs/probe_basic_lathe/subroutines/set_mt_x_sub.ngc
Normal file
19
configs/probe_basic_lathe/subroutines/set_mt_x_sub.ngc
Normal file
@@ -0,0 +1,19 @@
|
||||
(author: Chris P)
|
||||
(version: 0.1)
|
||||
(date: 06/17/20)
|
||||
|
||||
o<set_mt_x_sub> sub
|
||||
|
||||
G8
|
||||
|
||||
#<set_mt_x_position> = #5420
|
||||
|
||||
(output to gui master tool x position "set_mt_x")
|
||||
#1000 = #<set_mt_x_position>
|
||||
(DEBUG, EVAL[vcp.getWidget{"set_mt_x"}.setValue{#1000}])
|
||||
|
||||
G7
|
||||
|
||||
o<set_mt_x_sub> endsub
|
||||
|
||||
M2 (end program)
|
||||
15
configs/probe_basic_lathe/subroutines/set_mt_z_sub.ngc
Normal file
15
configs/probe_basic_lathe/subroutines/set_mt_z_sub.ngc
Normal file
@@ -0,0 +1,15 @@
|
||||
(author: Chris P)
|
||||
(version: 0.1)
|
||||
(date: 06/17/20)
|
||||
|
||||
o<set_mt_z_sub> sub
|
||||
|
||||
#<set_mt_z_position> = #5422
|
||||
|
||||
(output to gui master tool z position "set_mt_z")
|
||||
#1001 = #<set_mt_z_position>
|
||||
(DEBUG, EVAL[vcp.getWidget{"set_mt_z"}.setValue{#1001}])
|
||||
|
||||
o<set_mt_z_sub> endsub
|
||||
|
||||
M2 (end program)
|
||||
56
configs/probe_basic_lathe/subroutines/tapping.ngc
Executable file
56
configs/probe_basic_lathe/subroutines/tapping.ngc
Executable file
@@ -0,0 +1,56 @@
|
||||
;tapping
|
||||
o<tapping> sub
|
||||
|
||||
; o<backup_status> call
|
||||
|
||||
#<tapping_diam> = #1
|
||||
#<tapping_z> = #2
|
||||
#<tapping_ss> = #3
|
||||
#<tapping_pitch> = #4
|
||||
#<tapping_tool> = #5
|
||||
#<tapping_coolant> = #6
|
||||
#<tapping_rampdistance> = #7
|
||||
|
||||
#<starting_Z> = #<_z> (starting Z)
|
||||
|
||||
o100 if [#<tapping_tool> NE #<_current_tool>]
|
||||
(MSG,ERROR : Set tool before use macro)
|
||||
o100 return [-2] ; indicate failure to epilog
|
||||
o100 endif
|
||||
|
||||
G7 ; diameter mode
|
||||
G17 ; XY Plane
|
||||
G21 ; Metric Units
|
||||
G90 ; Absolute Distance
|
||||
G91.1 ; but not for arcs
|
||||
|
||||
#<speed_calc> = [[1000 * #<tapping_ss>] / [3.1415 * #<tapping_diam>]] ; metric mode RPM
|
||||
|
||||
G97 S#<speed_calc> ; Constant RPM mode
|
||||
G97 S500
|
||||
M3 ; Start Spindle
|
||||
G4 P1 ; Wait to reach speed
|
||||
|
||||
o110 if [#<tapping_coolant>]
|
||||
M8
|
||||
o110 endif
|
||||
|
||||
(DEBUG,Tapping dia-#<tapping_diam> depth-#<tapping_z> asked-speed-#<tapping_speed> pitch-#<tapping_pitch> tool-#<tool_number> calculated-rpm-#<speed_calc> start-Z-#<starting_Z>)
|
||||
|
||||
#<new_z> = [#<tapping_z> + #<tapping_rampdistance>] ; taking care of spindle ramp distance
|
||||
|
||||
G98
|
||||
G0 X0 ; must drill from the centerline. Tool should be zeroed here
|
||||
G33.1 Z#<new_z> K#<tapping_pitch>
|
||||
G80
|
||||
|
||||
M5
|
||||
M9
|
||||
|
||||
; o<backup_restore> call ; restore g20/21, g90/g91, feedrate cuter-comp and other using now global _backup_var
|
||||
|
||||
|
||||
o<tapping> endsub
|
||||
|
||||
M2
|
||||
%
|
||||
94
configs/probe_basic_lathe/subroutines/threading.ngc
Executable file
94
configs/probe_basic_lathe/subroutines/threading.ngc
Executable file
@@ -0,0 +1,94 @@
|
||||
;threading
|
||||
o<threading> sub
|
||||
|
||||
o<backup_status> call
|
||||
|
||||
#<threading_ss> = #1
|
||||
#<threading_maxrpm>= #2
|
||||
#<threading_feed>= #3
|
||||
#<threading_doc>= #4
|
||||
#<threading_tool>= #5
|
||||
#<threading_coolant>= #6
|
||||
#<threading_x>= #9
|
||||
#<threading_z>= #10
|
||||
#<threading_pitch>= #11
|
||||
#<threading_id>= #12
|
||||
|
||||
|
||||
#<surface_speed> = #<threading_ss>
|
||||
#<cut_size> = #<threading_doc>
|
||||
|
||||
|
||||
o100 if [#<threading_tool> 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
|
||||
G90 ; Absolute Distance
|
||||
|
||||
#<threading_x> = [#<threading_x> / 2.0]
|
||||
#<starting_X> = [#<_x> * 2] (starting X)
|
||||
#<starting_Z> = #<_z> (starting Z)
|
||||
G96 D#<threading_maxrpm> S#<threading_feed> ; Constant Surface Speed Mode
|
||||
M3 ; Start Spindle
|
||||
G4 P1 ; Wait to reach speed
|
||||
|
||||
o110 if [#<threading_coolant>]
|
||||
M8
|
||||
o110 endif
|
||||
|
||||
#<height> = [0.86603 * #<threading_pitch>]
|
||||
#<majorflat> = [#<height> * 0.125]
|
||||
#<minorflat> = [#<height> * 0.250]
|
||||
#<threaddepth> = [#<height> * 0.625]
|
||||
;(DEBUG,#<height> #<majorflat> #<minorflat> #<threaddepth>)
|
||||
|
||||
o200 if [#<_metric>]
|
||||
#<cutdepth> = 0.2
|
||||
#<flatfeed> = 0.1
|
||||
o200 else
|
||||
#<cutdepth> = 0.007
|
||||
#<flatfeed> = 0.004
|
||||
o200 endif
|
||||
|
||||
G95 F#<flatfeed> ; Feed-Per-Rev Mode
|
||||
|
||||
;Threading
|
||||
o300 if [#<threading_id>GT 0.5] ;internal
|
||||
;cut the minor flat diameter
|
||||
;(DEBUG,INTERNAL Threading thread dia-#<threading_x> startZ-#<starting_Z> finishZ-#<threading_z> Pitch-#<threading_pitch> Tool-#<tool_number>)
|
||||
G0 Z #<starting_Z>
|
||||
G0 X [#<threading_x> + #<minorflat> - #<height>]
|
||||
G1 Z #<threading_z>
|
||||
G0 X [#<threading_x> - #<height>]
|
||||
G0 Z #<starting_Z>
|
||||
G96 D#<threading_maxrpm> S#<threading_feed> ; limit RPM in threading mode
|
||||
G76 P#<threading_pitch> Z#<threading_z> i#<minorflat> j#<cutdepth> k#<threaddepth> H3 R1.5 Q29.5 E0 L0
|
||||
G0 X [#<threading_x> - 0.5]
|
||||
o300 else ;external
|
||||
; cut the major diameter
|
||||
;(DEBUG,EXTERNAL Threading thread dia-#<threading_x> startZ-#<starting_Z> finishZ-#<threading_z> Pitch-#<threading_pitch> Tool-#<tool_number> MF #<majorflat>)
|
||||
G0 Z #<starting_Z>
|
||||
G0 X #<threading_x>
|
||||
G1 X [#<threading_x> - #<majorflat>]
|
||||
G1 Z #<threading_z>
|
||||
G0 X #<threading_x>
|
||||
G0 Z #<starting_Z>
|
||||
G96 D#<threading_maxrpm> S#<threading_feed> ; limit RPM in threading mode
|
||||
G76 P#<threading_pitch> Z#<threading_z> i[-#<majorflat>] j#<cutdepth> k#<threaddepth> H3 R1.5 Q29.5 E0 L0
|
||||
G0 X [#<threading_x> + 0.5]
|
||||
o300 endif
|
||||
|
||||
G0 Z#<starting_Z>
|
||||
|
||||
M5
|
||||
M9
|
||||
|
||||
o<backup_restore> call ; restore g20/21, g90/g91, feedrate cuter-comp and other using now global _backup_var
|
||||
|
||||
o<threading> endsub
|
||||
|
||||
M2
|
||||
%
|
||||
98
configs/probe_basic_lathe/subroutines/tool_touch_off.ngc
Normal file
98
configs/probe_basic_lathe/subroutines/tool_touch_off.ngc
Normal file
@@ -0,0 +1,98 @@
|
||||
(author: Chris P, TooTall18)
|
||||
(version: 0.2)
|
||||
(date: 06/27/24)
|
||||
|
||||
o<tool_touch_off> sub
|
||||
|
||||
#<fast_probe_fr> = #3004 (set from probe screen fast probe feed rate)
|
||||
#<slow_probe_fr> = #3005 (set from probe screen slow probe feedrate)
|
||||
#<traverse_fr> = #3006 (set from probe screen traverse probe feedrate)
|
||||
#<z_max_travel> = #3007 (max z distance the tool travels before erroring out if not contact is made)
|
||||
#<xy_max_travel> = #3008 (max xy distance the tool travels before erroring out if not contact is made)
|
||||
#<retract_distance> = #3009 (distance the tool retracts after making contact during fast feed mode)
|
||||
#<spindle_zero_height> = #3010 (G53 distance from home to spindle nose triggering point on touch plate)
|
||||
#<tool_diameter_probe_mode> = #3011 (activates the tool diameter probe subroutine section)
|
||||
#<tool_diameter_offset_mode> = #3012 (activates the tool diameter offset position for probe subroutine section)
|
||||
#<tool_setter_offset_direction> = #3013 (sets tool setter offset direction to move tool)
|
||||
#<tool_diameter> = #5410 (current tool's diameter used for offseting probe position in x axis)
|
||||
|
||||
G92.1 (Cancel G92 offset)
|
||||
|
||||
#<tool_touch_x_coords> = #5181
|
||||
#<tool_touch_y_coords> = #5182
|
||||
#<tool_touch_z_coords> = #5183
|
||||
|
||||
#<tool_radius_offset> = [#<tool_diameter> / 2]
|
||||
#<left_offset_probing_position> = [#<tool_touch_x_coords> - #<tool_radius_offset>]
|
||||
#<right_offset_probing_position> = [#<tool_touch_x_coords> + #<tool_radius_offset>]
|
||||
#<front_offset_probing_position> = [#<tool_touch_y_coords> - #<tool_radius_offset>]
|
||||
#<back_offset_probing_position> = [#<tool_touch_y_coords> + #<tool_radius_offset>]
|
||||
|
||||
o100 if [#<tool_diameter_offset_mode> EQ 1]
|
||||
o101 if [#<tool_setter_offset_direction> EQ 0]
|
||||
#<tool_touch_x_coords> = #<left_offset_probing_position>
|
||||
o101 else if [#<tool_setter_offset_direction> EQ 1]
|
||||
#<tool_touch_x_coords> = #<right_offset_probing_position>
|
||||
o101 else if [#<tool_setter_offset_direction> EQ 2]
|
||||
#<tool_touch_y_coords> = #<front_offset_probing_position>
|
||||
o101 else if [#<tool_setter_offset_direction> EQ 3]
|
||||
#<tool_touch_y_coords> = #<back_offset_probing_position>
|
||||
o101 endif
|
||||
o100 endif
|
||||
|
||||
o110 if [2 EQ 2]
|
||||
G49
|
||||
o110 endif
|
||||
|
||||
G90 (set absolute coordinates)
|
||||
G53 G1 F[#<traverse_fr>] Z0 (move to z0 home position)
|
||||
G53 G1 F[#<traverse_fr>] X#<tool_touch_x_coords> Y#<tool_touch_y_coords>
|
||||
G53 G1 F[#<traverse_fr>] Z#<tool_touch_z_coords>
|
||||
|
||||
#<offset_z> = #5422 ;Stores the offset of the current Z coordinate.
|
||||
|
||||
G91
|
||||
F #<fast_probe_fr>
|
||||
G38.2 Z-[#<z_max_travel>] (fast tool probe)
|
||||
#<z_fast_probe> = #5063 (save probe result of fast probe to parameters)
|
||||
G1 F[#<traverse_fr>] Z[#<retract_distance>] (retract tool retract distance amount)
|
||||
|
||||
(Slow Probe Rule, if Slow Probe FR is set to 0, Slow Probe is Bypassed)
|
||||
o120 if [#<slow_probe_fr> GT 0]
|
||||
(Initiate Slow Z- Probe)
|
||||
G91
|
||||
F[#<slow_probe_fr>] (set probe slow feedrate)
|
||||
G38.2 Z-[#<retract_distance> * 2] (slow tool probe)
|
||||
#<z_slow_probe> = #5063
|
||||
G90
|
||||
G1 F[#<traverse_fr>] Z[#<z_slow_probe> + #<retract_distance>]
|
||||
o120 endif
|
||||
|
||||
o130 if [#5070 EQ 1] (verify probe event was succesful)
|
||||
#<z_slow_probe> = #5063 (save slow probe result to parameters)
|
||||
o130 else
|
||||
(MSG,Tool Length Offset Probe Failed)
|
||||
o130 endif
|
||||
|
||||
(Tool Diameter Probe Mode Section, User must define this section as needed)
|
||||
o140 if [#<tool_diameter_probe_mode> EQ 1]
|
||||
(MSG, Tool Diameter Probing is Not Defined in Subroutine)
|
||||
o140 endif
|
||||
|
||||
o150 if [3 EQ 3]
|
||||
G49
|
||||
o150 endif
|
||||
|
||||
G90 (set absolute coordinates)
|
||||
G53 G1 F[#<traverse_fr>] Z0 (Send Spindle to home zero position)
|
||||
|
||||
(define new tool length offset parameters)
|
||||
#<new_tool_length_offset> = [ABS[#<spindle_zero_height> + #5063 - #<offset_z>]]
|
||||
|
||||
G10 L1 P #5400 Z [#<new_tool_length_offset>] (5400 = tool number)
|
||||
|
||||
T #5400 G43 H #5400 (enable tool length offset)
|
||||
|
||||
o<tool_touch_off> endsub
|
||||
|
||||
M2 (end program)
|
||||
137
configs/probe_basic_lathe/subroutines/toolchange.ngc
Normal file
137
configs/probe_basic_lathe/subroutines/toolchange.ngc
Normal file
@@ -0,0 +1,137 @@
|
||||
(author: Chris P)
|
||||
(version: 0.2)
|
||||
(date: 06/27/24)
|
||||
|
||||
o<toolchange> sub
|
||||
|
||||
; Parameter #3989 is used to track if the carousel is homed (M13) (volatile)
|
||||
; Parameter #3990 is used to track the current tool pocket (persistently)
|
||||
; Parameter #3991 is used to track the current tool loaded it in the spindle (persistently)
|
||||
; Parameters #4001 to #4024 are used to track which tool is in which pocket (persistently)
|
||||
; Parameter #4000 is not populated just used in the maths to calculate the above numbers
|
||||
; #<number_of_pockets>: The number of pockets the ATC platter has, This is user set in the INI file via #<_ini[atc]pockets>
|
||||
; #<atc_z_tool_change_height> The Z height your spindle needs to be at to clamp/unclamp a tool from the ATC platter (Set via INI [ATC]Z_TOOL_CHANGE_HEIGHT)
|
||||
; #<atc_z_tool_clearance_height> The Z clearance height in machine coordinates that your spindle needs to be at to clear the tools during carousel rotation (Set via INI [ATC]Z_TOOL_CLEARANCE_HEIGHT)
|
||||
|
||||
(PRINT, o<toolchange> selected_tool: #<selected_tool>, tool_in_spindle: #<tool_in_spindle>, selected_pocket: #<selected_pocket>, current_pocket: #<current_pocket>, task: #<_task>)
|
||||
|
||||
o100 if [#<_task> EQ 0]
|
||||
(DEBUG, Task is null)
|
||||
o<toolchange> return [999]
|
||||
o100 endif (this code eliminates tool missing error on load for multiple use tools)
|
||||
|
||||
; default to a 12 pocket ATC (matching DynATC Widget behaviour), then update based on INI settings
|
||||
#<number_of_pockets> = 12
|
||||
o110 if [EXISTS[#<_ini[atc]pockets>]]
|
||||
#<number_of_pockets> = #<_ini[atc]pockets>
|
||||
o110 endif
|
||||
|
||||
#<atc_z_tool_change_height> = -3.9000
|
||||
o120 if [EXISTS[#<_ini[atc]z_tool_change_height>]]
|
||||
#<atc_z_tool_change_height> = #<_ini[atc]z_tool_change_height>
|
||||
o120 endif
|
||||
#<atc_z_tool_clearance_height> = [#<_ini[AXIS_Z]MAX_LIMIT>-0.01]
|
||||
o130 if [EXISTS[#<_ini[atc]z_tool_clearance_height>]]
|
||||
#<atc_z_tool_clearance_height> = #<_ini[atc]z_tool_clearance_height>
|
||||
o130 endif
|
||||
|
||||
; assign the variables passed by M6 change_prolog to some parameters
|
||||
#100 = #<selected_tool>
|
||||
#110 = #<tool_in_spindle>
|
||||
#120 = #<selected_pocket>
|
||||
#121 = #<current_pocket>
|
||||
; NOTE:
|
||||
; The legacy names *selected_pocket* and *current_pocket* actually reference
|
||||
; a sequential tooldata index for tool items loaded from a tool
|
||||
; table ([EMCIO]TOOL_TABLE) or via a tooldata database ([EMCIO]DB_PROGRAM)
|
||||
; see Linuxcnc docs for further information on how these are used
|
||||
|
||||
o140 if [#<selected_tool> EQ #<tool_in_spindle>] ; checks if tool in the spindle is same as requested
|
||||
(PRINT, Requested tool already in spindle)
|
||||
(PRINT, o<toolchange> endsub)
|
||||
o<toolchange> endsub [1]
|
||||
M2
|
||||
o140 endif
|
||||
|
||||
o150 if [#3991 NE #<tool_in_spindle>]
|
||||
(PRINT, o<toolchange> tool_in_spindle does not match 3991)
|
||||
o150 endif
|
||||
|
||||
#<next_pocket> = 0 ; assigns 0 to the next pocket for a later check if the tool is found in the carousel
|
||||
#<open_pocket> = 0
|
||||
#130 = #<number_of_pockets> ; assign test parameter the number of pockets in the carousel
|
||||
|
||||
o160 do
|
||||
o161 if [#[4000 + #130] EQ #<selected_tool>] ; checks all pockets to see if it contains tool number requested as the new tool
|
||||
#<next_pocket> = #130 ; if tool is found in pocket, assigns the next pocket
|
||||
o161 endif
|
||||
o162 if [#[4000 + #130] EQ 0] ; checks if the pocket is empty, last pocket checked will be the lowest empty pocket number, for putting tool in spindle away.
|
||||
#<open_pocket> = #130
|
||||
o162 endif
|
||||
#130 = [#130 - 1]
|
||||
o160 while [#130 GT 0]
|
||||
o170 if [#<next_pocket> EQ 0] ; if tool is not found, aborts and sends a message
|
||||
(abort, Tool T%d#<selected_tool> not found in carousel)
|
||||
o170 endif
|
||||
|
||||
; now we know which pocket the next tool is sitting in
|
||||
; we need to know if we need to put a tool away
|
||||
; or if there is not tool in the spindle
|
||||
|
||||
o180 if [#<tool_in_spindle> GT 0] ; checks if there is a valid tool in the spindle
|
||||
o181 if [#<open_pocket> EQ 0] ; If there is a tool in the spindle, checks if there is an open pocket
|
||||
(abort, Carousel is full, cant put away tool T#<tool_in_spindle> in into carousel)
|
||||
o181 endif
|
||||
M10 P[#<open_pocket>] ; move carousel to an open pocket
|
||||
M21 ; puts the tool in spindle away into the open pocket
|
||||
(DEBUG, EVAL[vcp.getWidget{"dynatc"}.store_tool{#<open_pocket>, #<tool_in_spindle>}])
|
||||
#140 = #<open_pocket>
|
||||
#[4000 + #140] = #<tool_in_spindle> ; save tool number in pocket
|
||||
#3991 = 0 ; empty tool in the spindle
|
||||
M61 Q0
|
||||
G49
|
||||
o180 endif
|
||||
|
||||
G90
|
||||
G0 G53 Z#<atc_z_tool_clearance_height> ; move z to clear height
|
||||
|
||||
o190 if [#<selected_tool> GT 0] ; selected tool is not tool0
|
||||
M10 P#<next_pocket> ; set the carousel to move to the right pocket for the selected tool
|
||||
M65 P1
|
||||
M64 P0
|
||||
M66 P1 L3 Q5 ; check carousel out position sensor
|
||||
o191 if [#5399 LT 0]
|
||||
M65 P0 ; turn off the solenoid to send atc to tool change
|
||||
(abort, Failed to send carousel home) ; abort if the sensor does not activate in 5 seconds
|
||||
o191 endif
|
||||
M65 P0
|
||||
|
||||
(DEBUG, EVAL[vcp.getWidget{"dynatc"}.store_tool{#<next_pocket>, 0}])
|
||||
M22 ; Carousel out
|
||||
#150 = #<next_pocket>
|
||||
#[4000 + #150] = 0 ; empty the pocket
|
||||
#3991 = #<selected_tool> ; Set persistent variable to remember tool in spindle after power cycle
|
||||
o190 else
|
||||
M65 P2 ; deactive drawbar
|
||||
M65 P0 ; make sure ATC out solenoid is off
|
||||
M64 P1 ; move carousel home
|
||||
M66 P0 L3 Q4 ; check carousel in position sensor
|
||||
o192 if [#5399 LT 0]
|
||||
M65 P1 ; turn off the solenoid to send atc home
|
||||
(abort, Failed to send carousel home) ; abort if the sensor does not activate in 5 seconds
|
||||
o192 endif
|
||||
M65 P1
|
||||
o190 endif
|
||||
|
||||
M61 Q#<selected_tool>
|
||||
|
||||
o200 if [1 EQ 1]
|
||||
G43 H#<selected_tool>
|
||||
o200 endif
|
||||
|
||||
o<program_coolant> call
|
||||
|
||||
(PRINT, o<toolchange> endsub)
|
||||
o<toolchange> endsub [1]
|
||||
|
||||
M2
|
||||
11
configs/probe_basic_lathe/subroutines/touch_off_x.ngc
Normal file
11
configs/probe_basic_lathe/subroutines/touch_off_x.ngc
Normal file
@@ -0,0 +1,11 @@
|
||||
o<touch_off_x> sub
|
||||
|
||||
#<x_offset_touch_position> = #1
|
||||
|
||||
G10 L1 P #5400 X [#<x_offset_touch_position>] (5400 = tool number)
|
||||
|
||||
T #5400 G43 (enable tool length offset)
|
||||
|
||||
o<touch_off_x> endsub
|
||||
|
||||
M2 (end program)
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user