skopiowana konfiguracja z expertia

This commit is contained in:
2026-06-07 07:30:07 +02:00
parent 836f1c6261
commit b3d7d3a5ed
4 changed files with 383 additions and 137 deletions

View File

@@ -1,69 +1,128 @@
# Generated by stepconf, adapted for Remora Ethernet on RP2040 # Basic HAL config file for NVEM controller board running Remora firmware
# Using W5500-EVB-Pico or RP2040 with W5500 module # Configured for 3 joints (A, Y, Z axes) with home and limit switches
loadrt [KINS]KINEMATICS loadrt [KINS]KINEMATICS
loadrt [EMCMOT]EMCMOT servo_period_nsec=[EMCMOT]SERVO_PERIOD num_joints=[KINS]JOINTS num_dio=6 num_aio=3 loadrt [EMCMOT]EMCMOT base_period_nsec=[EMCMOT]BASE_PERIOD servo_period_nsec=[EMCMOT]SERVO_PERIOD num_joints=[KINS]JOINTS
loadrt remora-eth-3.0
# Add Remora read/update/write functions to the servo thread # load the Remora real-time component
addf remora.read servo-thread
addf motion-command-handler servo-thread
addf motion-controller servo-thread
addf remora.update servo-thread
addf remora.write servo-thread
# --- ESTOP --- loadrt remora-eth PRU_base_freq=75000
net estop-out <= iocontrol.0.user-enable-out
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
# E-stop input from Remora input 3 (GP28) # add the remora and motion functions to threads
# If your hardware E-stop switch is active-low (Normally Closed to GND, open on press)
# and you need to invert it in HAL, you can load a 'not' component.
# Otherwise, we connect it directly here:
net estop-ext <= remora.input.3 => iocontrol.0.emc-enable-in
# --- PROBE --- addf remora.read servo-thread
# Probe input from Remora input 4 (GP27) addf motion-command-handler servo-thread
net probe-in <= remora.input.4 => motion.probe-input 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
# --- SPINDLE --- #toggle2nist states & mux selectors
# Spindle signal is driven in custom.hal, we connect it here to the Remora output 0 (GP8) # net program-is-paused hold_toggle.is-on <= halui.program.is-paused
net spindle-on => remora.output.0
# --- JOINT 0 (X AXIS) --- # vfdmod - uncomment the below if using vfdmod (default). There are also a couple items to edit in spindle_load.hal
setp remora.joint.0.scale [JOINT_0]SCALE # loadusr -W vfdmod vfdmod.ini
setp remora.joint.0.maxaccel [JOINT_0]STEPGEN_MAXACCEL # net spindle-speed-cmd vfdmod.spindle.rpm-in <= spindle.0.speed-out
setp remora.joint.0.pgain [JOINT_0]P_GAIN # net spindle-speed-fb vfdmod.spindle.rpm-out <= spindle.0.speed-in
setp remora.joint.0.deadband [JOINT_0]DEADBAND # 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 xpos-cmd joint.0.motor-pos-cmd => remora.joint.0.pos-cmd net user-enable-out <= iocontrol.0.user-enable-out => remora.enable
net xpos-fb remora.joint.0.pos-fb => joint.0.motor-pos-fb net user-request-enable <= iocontrol.0.user-request-enable => remora.reset estop_latch.reset
net xenable joint.0.amp-enable-out => remora.joint.0.enable #Halt is shared with motor alarms and is in the estop loop.
net home-x <= remora.input.0 => joint.0.home-sw-in #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.07 => 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 1 (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.deadband [JOINT_1]DEADBAND
net ypos-cmd joint.1.motor-pos-cmd => remora.joint.1.pos-cmd # joint 0 setup (X axis)
net ypos-fb remora.joint.1.pos-fb => joint.1.motor-pos-fb
net yenable joint.1.amp-enable-out => remora.joint.1.enable
net home-y <= remora.input.1 => joint.1.home-sw-in
# --- JOINT 2 (Z AXIS) --- setp remora.joint.0.scale [JOINT_0]SCALE
setp remora.joint.2.scale [JOINT_2]SCALE setp remora.joint.0.maxaccel [JOINT_0]STEPGEN_MAXACCEL
setp remora.joint.2.maxaccel [JOINT_2]STEPGEN_MAXACCEL setp remora.joint.0.pgain [JOINT_0]P_GAIN
setp remora.joint.2.pgain [JOINT_2]P_GAIN setp remora.joint.0.ff1gain [JOINT_0]FF1_GAIN
setp remora.joint.2.deadband [JOINT_2]DEADBAND setp remora.joint.0.deadband [JOINT_0]DEADBAND
net zpos-cmd joint.2.motor-pos-cmd => remora.joint.2.pos-cmd net j0pos-cmd joint.0.motor-pos-cmd => remora.joint.0.pos-cmd
net zpos-fb remora.joint.2.pos-fb => joint.2.motor-pos-fb net j0pos-fb remora.joint.0.pos-fb => joint.0.motor-pos-fb
net zenable joint.2.amp-enable-out => remora.joint.2.enable net j0enable joint.0.amp-enable-out => remora.joint.0.enable
net home-z <= remora.input.2 => joint.2.home-sw-in
net x-home joint.0.home-sw-in => remora.input.00
# --- TOOL CHANGE --- # joint 1 setup (Y axis)
net tool-change-request <= iocontrol.0.tool-change
net tool-change-confirmed => iocontrol.0.tool-changed setp remora.joint.1.scale [JOINT_1]SCALE
net tool-number <= iocontrol.0.tool-prep-number setp remora.joint.1.maxaccel [JOINT_1]STEPGEN_MAXACCEL
net tool-prepare-loopback iocontrol.0.tool-prepare => iocontrol.0.tool-prepared 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.08
# 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

View File

@@ -83,8 +83,7 @@ TWOPASS = one
[EMCMOT] [EMCMOT]
EMCMOT = motmod EMCMOT = motmod
COMM_TIMEOUT = 1.0 COMM_TIMEOUT = 1.0
# BASE_PERIOD is not required for Remora hardware step generation BASE_PERIOD = 0
# BASE_PERIOD = 100000
SERVO_PERIOD = 1000000 SERVO_PERIOD = 1000000
[EMCIO] [EMCIO]
@@ -125,14 +124,15 @@ MAX_VELOCITY = 50.0
MAX_ACCELERATION = 500.0 MAX_ACCELERATION = 500.0
STEPGEN_MAXACCEL = 625.0 STEPGEN_MAXACCEL = 625.0
SCALE = 80.0 SCALE = 80.0
FERROR = 1 FERROR = 2.0
MIN_FERROR = .25 MIN_FERROR = 2
FF1_GAIN = 1
P_GAIN = 1.0
DEADBAND = 0.005
HOME_OFFSET = 0.000000 HOME_OFFSET = 0.000000
HOME_SEARCH_VEL = -20.000000 HOME_SEARCH_VEL = -20.000000
HOME_LATCH_VEL = -6.250000 HOME_LATCH_VEL = -6.250000
HOME_SEQUENCE = 2 HOME_SEQUENCE = 2
P_GAIN = 1000.0
DEADBAND = 0.001
#****************************************** #******************************************
#*** AXIS_Y ******************************* #*** AXIS_Y *******************************
@@ -151,14 +151,15 @@ MAX_VELOCITY = 50.0
MAX_ACCELERATION = 500.0 MAX_ACCELERATION = 500.0
STEPGEN_MAXACCEL = 625.0 STEPGEN_MAXACCEL = 625.0
SCALE = 80.0 SCALE = 80.0
FERROR = 1 FERROR = 2.0
MIN_FERROR = .25 MIN_FERROR = 2
FF1_GAIN = 1
P_GAIN = 1.0
DEADBAND = 0.005
HOME_OFFSET = 0.000000 HOME_OFFSET = 0.000000
HOME_SEARCH_VEL = -20.000000 HOME_SEARCH_VEL = -20.000000
HOME_LATCH_VEL = -6.250000 HOME_LATCH_VEL = -6.250000
HOME_SEQUENCE = 1 HOME_SEQUENCE = 1
P_GAIN = 1000.0
DEADBAND = 0.001
#****************************************** #******************************************
#*** AXIS_Z ******************************* #*** AXIS_Z *******************************
@@ -177,12 +178,13 @@ MAX_VELOCITY = 25.0
MAX_ACCELERATION = 500.0 MAX_ACCELERATION = 500.0
STEPGEN_MAXACCEL = 625.0 STEPGEN_MAXACCEL = 625.0
SCALE = 80.0 SCALE = 80.0
FERROR = 1 FERROR = 2
MIN_FERROR = .25 MIN_FERROR = 2
FF1_GAIN = 1
P_GAIN = 1.0
DEADBAND = 0.005
HOME_OFFSET = 0.000000 HOME_OFFSET = 0.000000
HOME_SEARCH_VEL = 10.000000 HOME_SEARCH_VEL = 10.000000
HOME_LATCH_VEL = 6.250000 HOME_LATCH_VEL = 6.250000
HOME_SEQUENCE = 0 HOME_SEQUENCE = 0
P_GAIN = 1000.0
DEADBAND = 0.001
#****************************************** #******************************************

View File

@@ -1,69 +1,127 @@
{ {
"Version": "1.0", "Board": "W5500-EVB-Pico",
"Communication": { "Threads": [
"Type": "Ethernet", {
"IP": "10.10.10.10", "Thread": "Base",
"Port": 27182 "Frequency": 40000
}, },
"Hardware": { {
"Modules": [ "Thread": "Servo",
{ "Frequency": 1000
"Type": "Stepgen", }
"Joint": 0, ],
"Step Pin": "GP2", "Modules": [
"Direction Pin": "GP3", {
"Enable Pin": "GP9" "Thread": "Servo",
}, "Type": "Blink",
{ "Comment": "Blinky status LED",
"Type": "Stepgen", "Pin": "GP25",
"Joint": 1, "Frequency": 2
"Step Pin": "GP4", },
"Direction Pin": "GP5", {
"Enable Pin": "GP10" "Thread": "Base",
}, "Type": "Stepgen",
{ "Comment": "X - Joint 0 step generator",
"Type": "Stepgen", "Joint Number": 0,
"Joint": 2, "Step Pin": "GP2",
"Step Pin": "GP6", "Direction Pin": "GP3"
"Direction Pin": "GP7", },
"Enable Pin": "GP11" {
}, "Thread": "Base",
{ "Type": "Stepgen",
"Type": "Digital Input", "Comment": "Y - Joint 1 step generator",
"Pin": "GP13", "Joint Number": 1,
"Mode": "PullUp", "Step Pin": "GP4",
"Data Bit": 0 "Direction Pin": "GP5"
}, },
{ {
"Type": "Digital Input", "Thread": "Base",
"Pin": "GP14", "Type": "Stepgen",
"Mode": "PullUp", "Comment": "Z - Joint 2 step generator",
"Data Bit": 1 "Joint Number": 2,
}, "Step Pin": "GP6",
{ "Direction Pin": "GP7"
"Type": "Digital Input", },
"Pin": "GP15", {
"Mode": "PullUp", "Thread": "Servo",
"Data Bit": 2 "Type": "Digital Pin",
}, "Comment": "X axis limit/home switch",
{ "Pin": "GP13",
"Type": "Digital Input", "Mode": "Input",
"Pin": "GP28", "Data Bit": 0,
"Mode": "PullUp", "Invert": "False"
"Data Bit": 3 },
}, {
{ "Thread": "Servo",
"Type": "Digital Input", "Type": "Digital Pin",
"Pin": "GP27", "Comment": "Y axis limit/home switch",
"Mode": "PullUp", "Pin": "GP14",
"Data Bit": 4 "Mode": "Input",
}, "Data Bit": 1,
{ "Invert": "False"
"Type": "Digital Output", },
"Pin": "GP8", {
"Invert": true, "Thread": "Servo",
"Data Bit": 0 "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"
}
]
}

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"
}
]
}