Compare commits

..

4 Commits

Author SHA1 Message Date
a3870cb152 dzialajaca konfiguracja 2026-06-07 17:16:29 +02:00
8a166698ce example z remora 2026-06-07 08:08:12 +02:00
b3d7d3a5ed skopiowana konfiguracja z expertia 2026-06-07 07:30:07 +02:00
836f1c6261 wygenerowana kofiguracja 2026-06-06 18:16:06 +02:00
17 changed files with 721 additions and 34 deletions

View File

@@ -27,9 +27,9 @@
5218 0.000000
5219 0.000000
5220 1.000000
5221 368.939500
5222 124.910000
5223 -82.054301
5221 300.000000
5222 150.000000
5223 -10.000000
5224 0.000000
5225 0.000000
5226 0.000000
@@ -37,9 +37,9 @@
5228 0.000000
5229 0.000000
5230 0.000000
5241 585.480417
5242 50.992548
5243 -40.461301
5241 0.000000
5242 0.000000
5243 0.000000
5244 0.000000
5245 0.000000
5246 0.000000
@@ -47,9 +47,9 @@
5248 0.000000
5249 0.000000
5250 0.000000
5261 469.680000
5262 113.800500
5263 -62.326301
5261 199.563000
5262 97.159000
5263 -30.157000
5264 0.000000
5265 0.000000
5266 0.000000

View File

@@ -27,9 +27,9 @@
5218 0.000000
5219 0.000000
5220 1.000000
5221 368.939500
5222 124.910000
5223 -82.054301
5221 300.000000
5222 150.000000
5223 -10.000000
5224 0.000000
5225 0.000000
5226 0.000000
@@ -37,9 +37,9 @@
5228 0.000000
5229 0.000000
5230 0.000000
5241 585.480417
5242 50.992548
5243 -40.461301
5241 0.000000
5242 0.000000
5243 0.000000
5244 0.000000
5245 0.000000
5246 0.000000
@@ -47,9 +47,9 @@
5248 0.000000
5249 0.000000
5250 0.000000
5261 469.680000
5262 113.800500
5263 -62.326301
5261 199.563000
5262 97.159000
5263 -30.157000
5264 0.000000
5265 0.000000
5266 0.000000

128
mayo-mill-remora.hal Normal file
View File

@@ -0,0 +1,128 @@
# Basic HAL config file for NVEM controller board running Remora firmware
# Configured for 3 joints (A, Y, Z axes) with home and limit switches
loadrt [KINS]KINEMATICS
loadrt [EMCMOT]EMCMOT base_period_nsec=[EMCMOT]BASE_PERIOD servo_period_nsec=[EMCMOT]SERVO_PERIOD num_joints=[KINS]JOINTS
# load the Remora real-time component
loadrt remora-eth-3.0 PRU_base_freq=75000
loadrt estop_latch names=estop_latch
loadrt and2 names=run_and,step_and
loadrt toggle names=hold_button_toggle
loadrt toggle2nist names=hold_toggle,paused_toggle
# add the remora and motion functions to threads
addf remora.read servo-thread
addf motion-command-handler servo-thread
addf motion-controller servo-thread
addf remora.update-freq servo-thread
addf remora.write servo-thread
addf estop_latch servo-thread
addf run_and servo-thread
addf step_and servo-thread
addf hold_toggle servo-thread
addf hold_button_toggle servo-thread
#toggle2nist states & mux selectors
# net program-is-paused hold_toggle.is-on <= halui.program.is-paused
# vfdmod - uncomment the below if using vfdmod (default). There are also a couple items to edit in spindle_load.hal
# loadusr -W vfdmod vfdmod.ini
# net spindle-speed-cmd vfdmod.spindle.rpm-in <= spindle.0.speed-out
# net spindle-speed-fb vfdmod.spindle.rpm-out <= spindle.0.speed-in
# net spindle-at-speed vfdmod.spindle.at-speed <= spindle.0.at-speed
# net spindle-forward vfdmod.control.run-forward <= spindle.0.forward
# net spindle-reverse vfdmod.control.run-reverse <= spindle.0.reverse
# estop and SPI comms enable and feedback
net user-enable-out <= iocontrol.0.user-enable-out => remora.enable
net user-request-enable <= iocontrol.0.user-request-enable => remora.reset estop_latch.reset
#Halt is shared with motor alarms and is in the estop loop.
#estop_latch returns 'ok' when fault-in is false, ok-in is true, and reset changes from false to true.
net estop-fault_in remora.input.03 => estop_latch.fault-in
net remora-status remora.status => estop_latch.ok-in
net estop-status estop_latch.ok-out => iocontrol.0.emc-enable-in
# joint 0 setup (X axis)
setp remora.joint.0.scale [JOINT_0]SCALE
setp remora.joint.0.maxaccel [JOINT_0]STEPGEN_MAXACCEL
setp remora.joint.0.pgain [JOINT_0]P_GAIN
setp remora.joint.0.ff1gain [JOINT_0]FF1_GAIN
setp remora.joint.0.deadband [JOINT_0]DEADBAND
net j0pos-cmd joint.0.motor-pos-cmd => remora.joint.0.pos-cmd
net j0pos-fb remora.joint.0.pos-fb => joint.0.motor-pos-fb
net j0enable joint.0.amp-enable-out => remora.joint.0.enable
net x-home joint.0.home-sw-in => remora.input.00
# joint 1 setup (Y axis)
setp remora.joint.1.scale [JOINT_1]SCALE
setp remora.joint.1.maxaccel [JOINT_1]STEPGEN_MAXACCEL
setp remora.joint.1.pgain [JOINT_1]P_GAIN
setp remora.joint.1.ff1gain [JOINT_1]FF1_GAIN
setp remora.joint.1.deadband [JOINT_1]DEADBAND
net j1pos-cmd joint.1.motor-pos-cmd => remora.joint.1.pos-cmd
net j1pos-fb remora.joint.1.pos-fb => joint.1.motor-pos-fb
net j1enable joint.1.amp-enable-out => remora.joint.1.enable
net y-home joint.1.home-sw-in => remora.input.01
# joint 2 setup (Z axis)
setp remora.joint.2.scale [JOINT_2]SCALE
setp remora.joint.2.maxaccel [JOINT_2]STEPGEN_MAXACCEL
setp remora.joint.2.pgain [JOINT_2]P_GAIN
setp remora.joint.2.ff1gain [JOINT_2]FF1_GAIN
setp remora.joint.2.deadband [JOINT_2]DEADBAND
net j2pos-cmd joint.2.motor-pos-cmd => remora.joint.2.pos-cmd
net j2pos-fb remora.joint.2.pos-fb => joint.2.motor-pos-fb
net j2enable joint.2.amp-enable-out => remora.joint.2.enable
net z-home joint.2.home-sw-in => remora.input.02
# Motor enables
net j0enable => remora.output.00
net j1enable => remora.output.01
net j2enable => remora.output.02
# Flood and mist outputs
# net flood remora.output.02 <= iocontrol.0.coolant-flood
# net mist remora.output.03 <= iocontrol.0.coolant-mist
# User buttons
#Halt is shared with motor alarms and is up in the estop loop.
#Hold logic
# net hold_button remora.input.05 => hold_button_toggle.in
# net hold_toggle_latch hold_button_toggle.out => hold_toggle.in
# net hold_on halui.program.pause <= hold_toggle.on
# net hold_off halui.program.resume <= hold_toggle.off
#Cycle start logic. When not running, start the program. When in feed hold, single step through the program.
# net run-step_button remora.input.06 => run_and.in0 step_and.in0
# net program-is-idle halui.program.is-idle => run_and.in1 #if not running AND button pressed
# net program-run run_and.out => halui.program.run #run program
# net program-is-paused => step_and.in1 #if paused AND button pressed
# net single-step step_and.out => halui.program.step #single step
# Probe
net probe-in motion.probe-input <= remora.input.04
# Manual toolchange
net tool-change-request <= iocontrol.0.tool-change
net tool-change-confirmed => iocontrol.0.tool-changed
net tool-number <= iocontrol.0.tool-prep-number
net tool-prepare-loopback iocontrol.0.tool-prepare => iocontrol.0.tool-prepared

190
mayo-mill-remora.ini Normal file
View File

@@ -0,0 +1,190 @@
# Generated by stepconf 1.1 at Thu May 29 11:48:34 2025
# Modified for Remora Ethernet configuration
[EMC]
MACHINE = mayo-mill-remora
DEBUG = 0
VERSION = 1.1
[DISPLAY]
DISPLAY = probe_basic
OPEN_FILE = ~/linuxcnc/nc_files/pb_examples/blank.ngc
CONFIG_FILE = custom_config.yml
LOG_FILE = mayo-mill-remora.log
LOG_LEVEL = DEBUG
#PROGRAM_PREFIX = /home/cnc/linuxcnc/nc_files
INTRO_GRAPHIC = pbsplash.png
INTRO_TIME = 5
#ARCDIVISION = 64
#GRIDS = 10mm 20mm 50mm 100mm
GEOMETRY = xyz
INCREMENTS = JOG 10mm 1mm .1mm .01mm
POSITION_OFFSET = RELATIVE
POSITION_FEEDBACK = ACTUAL
MAX_FEED_OVERRIDE = 1.2
MAX_SPINDLE_OVERRIDE = 1.2
MIN_SPINDLE_OVERRIDE = 0.5
MIN_LINEAR_VELOCITY = 0
MAX_LINEAR_VELOCITY = 50.00
DEFAULT_LINEAR_VELOCITY = 5.00
USER_TABS_PATH = user_tabs/
USER_BUTTONS_PATH = user_buttons/
USER_DROS_PATH = user_dro_display/
DRO_DISPLAY = xyz
# ATC tab display options, 0 = no atc tab displayed, 1 = Carousel atc display, 2 = rack atc display
ATC_TAB_DISPLAY = 0
#USER_ATC_BUTTONS_PATH = user_atc_buttons/
CYCLE_TIME = 0.100
KEYBOARD_JOG = true
KEYBOARD_JOG_SAFETY_OFF = true
TOOL_TABLE_COLUMNS = TZDR
[FILTER]
PROGRAM_EXTENSION = .png,.gif,.jpg Greyscale Depth Image
PROGRAM_EXTENSION = .py Python Script
PROGRAM_EXTENSION = .nc,.tap G-Code File
png = image-to-gcode
gif = image-to-gcode
jpg = image-to-gcode
py = python
[PYTHON]
TOPLEVEL = ./python/toplevel.py
PATH_APPEND = ./python/
[TASK]
TASK = milltask
CYCLE_TIME = 0.010
[RS274NGC]
RS274NGC_STARTUP_CODE = G17 G21 G40 G43H0 G54 G64P0.0127 G80 G90 G94 G97 M5 M9
#RS274NGC_STARTUP_CODE = F10 S300 G20 G17 G40 G49 G54 G64 P.001 G80 G90 G91.1 G92.1 G94 G97 G98
PARAMETER_FILE = linuxcnc.var
OWORD_NARGS = 1
NO_DOWNCASE_OWORD = 1
SUBROUTINE_PATH = subroutines
# The remap code for QtVCP's versaprobe's automatic tool probe of Z
REMAP=M6 modalgroup=6 prolog=change_prolog ngc=aaa epilog=change_epilog
[HAL]
HALUI = halui
HALFILE = mayo-mill-remora.hal
HALFILE = custom.hal
POSTGUI_HALFILE = probe_basic_postgui.hal
TWOPASS = one
[EMCMOT]
EMCMOT = motmod
COMM_TIMEOUT = 1.0
BASE_PERIOD = 0
SERVO_PERIOD = 1000000
[EMCIO]
EMCIO = io
CYCLE_TIME = 0.100
TOOL_TABLE = tool.tbl
[CHANGE_POSITION]
X = 10
Y = 10
Z = -2
[KINS]
JOINTS = 3
KINEMATICS = trivkins coordinates=XYZ
[TRAJ]
AXES = 3
COORDINATES = X Y Z
LINEAR_UNITS = mm
ANGULAR_UNITS = degree
DEFAULT_LINEAR_VELOCITY = 5.00
MAX_LINEAR_VELOCITY = 50.00
#*** AXIS_X *******************************
[AXIS_X]
MAX_VELOCITY = 50.0
MAX_ACCELERATION = 500.0
MIN_LIMIT = -0.001
MAX_LIMIT = 780.0
[JOINT_0]
TYPE = LINEAR
HOME = 0.0
MIN_LIMIT = -0.001
MAX_LIMIT = 780.0
MAX_VELOCITY = 50.0
MAX_ACCELERATION = 500.0
STEPGEN_MAXACCEL = 625.0
SCALE = 80.0
FERROR = 2.0
MIN_FERROR = 2
FF1_GAIN = 1
P_GAIN = 1.0
DEADBAND = 0.005
HOME_OFFSET = 0.000000
HOME_SEARCH_VEL = -20.000000
HOME_LATCH_VEL = -6.250000
HOME_SEQUENCE = 2
#******************************************
#*** AXIS_Y *******************************
[AXIS_Y]
MAX_VELOCITY = 50.0
MAX_ACCELERATION = 500.0
MIN_LIMIT = -0.001
MAX_LIMIT = 485.0
[JOINT_1]
TYPE = LINEAR
HOME = 0.0
MIN_LIMIT = -0.001
MAX_LIMIT = 485.0
MAX_VELOCITY = 50.0
MAX_ACCELERATION = 500.0
STEPGEN_MAXACCEL = 625.0
SCALE = 80.0
FERROR = 2.0
MIN_FERROR = 2
FF1_GAIN = 1
P_GAIN = 1.0
DEADBAND = 0.005
HOME_OFFSET = 0.000000
HOME_SEARCH_VEL = -20.000000
HOME_LATCH_VEL = -6.250000
HOME_SEQUENCE = 1
#******************************************
#*** AXIS_Z *******************************
[AXIS_Z]
MAX_VELOCITY = 25.0
MAX_ACCELERATION = 500.0
MIN_LIMIT = -100.0
MAX_LIMIT = 0.001
[JOINT_2]
TYPE = LINEAR
HOME = 0.0
MIN_LIMIT = -100.0
MAX_LIMIT = 0.001
MAX_VELOCITY = 25.0
MAX_ACCELERATION = 500.0
STEPGEN_MAXACCEL = 625.0
SCALE = 80.0
FERROR = 2
MIN_FERROR = 2
FF1_GAIN = 1
P_GAIN = 1.0
DEADBAND = 0.005
HOME_OFFSET = 0.000000
HOME_SEARCH_VEL = 10.000000
HOME_LATCH_VEL = 6.250000
HOME_SEQUENCE = 0
#******************************************

44
remora_example.txt Normal file
View File

@@ -0,0 +1,44 @@
{
"Board": "W5500-EVB-Pico",
"Modules":[
{
"Thread": "Servo",
"Type": "Blink",
"Comment": "Blinky",
"Pin": "GP25",
"Frequency": 2
},
{
"Thread": "Base",
"Type": "Stepgen",
"Comment": "X - Joint 0 step generator",
"Joint Number": 0,
"Step Pin": "GP22",
"Direction Pin": "GP09"
},
{
"Thread": "Base",
"Type": "Stepgen",
"Comment": "Y - Joint 1 step generator",
"Joint Number": 1,
"Step Pin": "GP23",
"Direction Pin": "GP10"
},
{
"Thread": "Base",
"Type": "Stepgen",
"Comment": "Z - Joint 2 step generator",
"Joint Number": 2,
"Step Pin": "GP24",
"Direction Pin": "GP11"
},
{
"Thread": "Servo",
"Type": "Digital Pin",
"Comment": "light",
"Pin": "GP12",
"Mode": "Output",
"Data Bit": 0
}
]
}

127
remora_pico_config.json Normal file
View File

@@ -0,0 +1,127 @@
{
"Board": "W5500-EVB-Pico",
"Threads": [
{
"Thread": "Base",
"Frequency": 40000
},
{
"Thread": "Servo",
"Frequency": 1000
}
],
"Modules": [
{
"Thread": "Servo",
"Type": "Blink",
"Comment": "Blinky status LED",
"Pin": "GP25",
"Frequency": 2
},
{
"Thread": "Base",
"Type": "Stepgen",
"Comment": "X - Joint0",
"Joint Number": 0,
"Step Pin": "GP02",
"Direction Pin": "GP03"
},
{
"Thread": "Base",
"Type": "Stepgen",
"Comment": "Y - Joint1",
"Joint Number": 1,
"Step Pin": "GP04",
"Direction Pin": "GP05"
},
{
"Thread": "Base",
"Type": "Stepgen",
"Comment": "Z - Joint2",
"Joint Number": 2,
"Step Pin": "GP06",
"Direction Pin": "GP07"
},
{
"Thread": "Servo",
"Type": "Digital Pin",
"Comment": "X limit",
"Pin": "GP13",
"Mode": "Input",
"Data Bit": 0,
"Invert": "True"
},
{
"Thread": "Servo",
"Type": "Digital Pin",
"Comment": "Y limit",
"Pin": "GP14",
"Mode": "Input",
"Data Bit": 1,
"Invert": "True"
},
{
"Thread": "Servo",
"Type": "Digital Pin",
"Comment": "Z limit",
"Pin": "GP15",
"Mode": "Input",
"Data Bit": 2,
"Invert": "True"
},
{
"Thread": "Servo",
"Type": "Digital Pin",
"Comment": "E-Stop",
"Pin": "GP28",
"Mode": "Input",
"Data Bit": 3,
"Invert": "False"
},
{
"Thread": "Servo",
"Type": "Digital Pin",
"Comment": "Probe",
"Pin": "GP27",
"Mode": "Input",
"Data Bit": 4,
"Invert": "False"
},
{
"Thread": "Servo",
"Type": "Digital Pin",
"Comment": "X enable",
"Pin": "GP09",
"Mode": "Output",
"Data Bit": 0,
"Invert": "False"
},
{
"Thread": "Servo",
"Type": "Digital Pin",
"Comment": "Y enable",
"Pin": "GP10",
"Mode": "Output",
"Data Bit": 1,
"Invert": "False"
},
{
"Thread": "Servo",
"Type": "Digital Pin",
"Comment": "Z enable",
"Pin": "GP11",
"Mode": "Output",
"Data Bit": 2,
"Invert": "False"
},
{
"Thread": "Servo",
"Type": "Digital Pin",
"Comment": "Spindle",
"Pin": "GP08",
"Mode": "Output",
"Data Bit": 3,
"Invert": "True"
}
]
}

127
remora_pico_config.txt Normal file
View File

@@ -0,0 +1,127 @@
{
"Board": "W5500-EVB-Pico",
"Threads": [
{
"Thread": "Base",
"Frequency": 40000
},
{
"Thread": "Servo",
"Frequency": 1000
}
],
"Modules": [
{
"Thread": "Servo",
"Type": "Blink",
"Comment": "Blinky status LED",
"Pin": "GP25",
"Frequency": 2
},
{
"Thread": "Base",
"Type": "Stepgen",
"Comment": "X - Joint 0 step generator",
"Joint Number": 0,
"Step Pin": "GP2",
"Direction Pin": "GP3"
},
{
"Thread": "Base",
"Type": "Stepgen",
"Comment": "Y - Joint 1 step generator",
"Joint Number": 1,
"Step Pin": "GP4",
"Direction Pin": "GP5"
},
{
"Thread": "Base",
"Type": "Stepgen",
"Comment": "Z - Joint 2 step generator",
"Joint Number": 2,
"Step Pin": "GP6",
"Direction Pin": "GP7"
},
{
"Thread": "Servo",
"Type": "Digital Pin",
"Comment": "X axis limit/home switch",
"Pin": "GP13",
"Mode": "Input",
"Data Bit": 0,
"Invert": "False"
},
{
"Thread": "Servo",
"Type": "Digital Pin",
"Comment": "Y axis limit/home switch",
"Pin": "GP14",
"Mode": "Input",
"Data Bit": 1,
"Invert": "False"
},
{
"Thread": "Servo",
"Type": "Digital Pin",
"Comment": "Z axis limit/home switch",
"Pin": "GP15",
"Mode": "Input",
"Data Bit": 2,
"Invert": "False"
},
{
"Thread": "Servo",
"Type": "Digital Pin",
"Comment": "Emergency Stop switch",
"Pin": "GP28",
"Mode": "Input",
"Data Bit": 3,
"Invert": "False"
},
{
"Thread": "Servo",
"Type": "Digital Pin",
"Comment": "Versaprobe tool probe input",
"Pin": "GP27",
"Mode": "Input",
"Data Bit": 4,
"Invert": "False"
},
{
"Thread": "Servo",
"Type": "Digital Pin",
"Comment": "X axis driver enable pin",
"Pin": "GP9",
"Mode": "Output",
"Data Bit": 0,
"Invert": "False"
},
{
"Thread": "Servo",
"Type": "Digital Pin",
"Comment": "Y axis driver enable pin",
"Pin": "GP10",
"Mode": "Output",
"Data Bit": 1,
"Invert": "False"
},
{
"Thread": "Servo",
"Type": "Digital Pin",
"Comment": "Z axis driver enable pin",
"Pin": "GP11",
"Mode": "Output",
"Data Bit": 2,
"Invert": "False"
},
{
"Thread": "Servo",
"Type": "Digital Pin",
"Comment": "Spindle On command relay",
"Pin": "GP8",
"Mode": "Output",
"Data Bit": 3,
"Invert": "True"
}
]
}

View File

@@ -47,7 +47,7 @@ o<probe_back_left_top_corner> sub
#<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]
o<probe_z_minus_sub> call [#3014][#3015][#3016][#3017][#3020][#3021][#3030]
(Probe X Positioning Move, Step Off Width)
G91

View File

@@ -47,7 +47,7 @@ o<probe_back_right_top_corner> sub
#<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]
o<probe_z_minus_sub> call [#3014][#3015][#3016][#3017][#3020][#3021][#3030]
(Probe X Positioning Move, Step Off Width)
G91

View File

@@ -46,7 +46,7 @@ o<Probe_back_top_side> sub
#<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]
o<probe_z_minus_sub> call [#3014][#3015][#3016][#3017][#3020][#3021][#3030]
(Probe Y Positioning Move, Step Off Width)
G91

View File

@@ -48,7 +48,7 @@ o<probe_front_left_top_corner> sub
#<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]
o<probe_z_minus_sub> call [#3014][#3015][#3016][#3017][#3020][#3021][#3030]
(Probe X Positioning Move, Step Off Width)
G91

View File

@@ -49,7 +49,7 @@ o<probe_front_right_top_corner> sub
#<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]
o<probe_z_minus_sub> call [#3014][#3015][#3016][#3017][#3020][#3021][#3030]
(Probe X Positioning Move, Step Off Width)
G91

View File

@@ -47,7 +47,7 @@ o<Probe_front_top_side> sub
#<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]
o<probe_z_minus_sub> call [#3014][#3015][#3016][#3017][#3020][#3021][#3030]
(Probe Y Positioning Move, Step Off Width)
G91

View File

@@ -47,7 +47,7 @@ o<Probe_left_top_side> sub
#<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]
o<probe_z_minus_sub> call [#3014][#3015][#3016][#3017][#3020][#3021][#3030]
(Probe X Positioning Move, Step Off Width)
G91

View File

@@ -46,7 +46,7 @@ o<Probe_right_top_side> sub
#<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]
o<probe_z_minus_sub> call [#3014][#3015][#3016][#3017][#3020][#3021][#3030]
(Probe X Positioning Move, Step Off Width)
G91

View File

@@ -1,8 +1,7 @@
T1 P0 D+0.850000 Z+20.461301 ; 0.85 Flat end mill
T2 P0 D+3.175000 Z+25.214300 ; 3.175 Flat end mill
T3 P0 D+3.175000 Z+15.876301 ; 3.175 Engrave mill 30* 0.2
T4 P0 D+6.000000 Z+43.291300 ; 6mm Flat end mill
T5 P0 D+1.000000 Z+21.335301 ; 1mm Flat end mill
T6 P0 D+0.800000 ; drill 0.7
T7 P0 D+12.700000 Z+29.722300 ; 12.7 mm flat end mill with baring
T8 P0 D+0.500000 Z+19.686300 ; 0.5 FLAT END MILL
T0 P0 ;Probe
T1 P0 D+0.850000 Z+20.461301 ;0.85 Flat end mill
T2 P0 D+3.175000 Z-0.012833 ;3.175 Flat end mill
T3 P0 D+3.175000 ;3.175 Engrave mill 30* 0.2
T4 P0 D+6.000000 Z+15.800167 ;6mm Flat end mill
T5 P0 D+1.000000 Z+20.472301 ;1mm Flat end mill
T6 P0 D+0.800000 ;drill 0.7

72
upload_config.py Normal file
View File

@@ -0,0 +1,72 @@
#!/usr/bin/env python3
import binascii
import sys
import math
import json
import tftpy
import time
if len(sys.argv) < 2:
print("usage: upload.py <config.txt>")
exit(-1)
# Check for a valid JSON formatted file, if ok upload to NVEM board via TFTP
with open(sys.argv[1], 'r') as jsonFile:
try:
testForValidJson = json.load(jsonFile)
print('Valid JSON config file, uploading to NVEM board')
except ValueError:
print('Incorrectly formatted JSON configuration file')
exit(-1)
# Load File
config = open(sys.argv[1], "rb").read()
# Compute length (in bytes and words)
jsonLength = len(config)
length = math.ceil(jsonLength / 4)
mod = jsonLength % 4
print('Config file length (words) =', length)
print('Config file length (bytes) =', jsonLength)
print('Remainder =', mod)
# add padding at end of file to ensure length is multiple of 4 bytes (word)
# to ensure correct CRC32 calculation
if mod > 0:
padding = [0 for i in range(4 - mod)]
print('Padding added = ', padding)
config = config + bytes(padding)
newLength = len(config)
print('Config file length with padding (bytes) =', newLength)
# Compute crc32
crc32 = binascii.crc32(config)
print('CRC-32 =',hex(crc32))
# Insert metadata
metadata = [0 for i in range(512)]
metadata[0] = crc32 & 0xff
metadata[1] = (crc32 >> 8) & 0xff
metadata[2] = (crc32 >> 16) & 0xff
metadata[3] = (crc32 >> 24) & 0xff
metadata[4] = length & 0xff
metadata[5] = (length >> 8) & 0xff
metadata[6] = (length >> 16) & 0xff
metadata[7] = (length >> 24) & 0xff
metadata[8] = jsonLength & 0xff
metadata[9] = (jsonLength >> 8) & 0xff
metadata[10] = (jsonLength >> 16) & 0xff
metadata[11] = (jsonLength >> 24) & 0xff
config = bytes(metadata) + config
open("/tmp/config.txt", "wb").write(config)
# Upload using TFTP, set large timeout
client = tftpy.TftpClient("10.10.10.10", 69)
client.upload("config", "/tmp/config.txt", timeout=30)