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
# E-stop input from Remora input 3 (GP28) loadrt estop_latch names=estop_latch
# If your hardware E-stop switch is active-low (Normally Closed to GND, open on press) loadrt and2 names=run_and,step_and
# and you need to invert it in HAL, you can load a 'not' component. loadrt toggle names=hold_button_toggle
# Otherwise, we connect it directly here: loadrt toggle2nist names=hold_toggle,paused_toggle
net estop-ext <= remora.input.3 => iocontrol.0.emc-enable-in
# --- PROBE --- # add the remora and motion functions to threads
# Probe input from Remora input 4 (GP27)
net probe-in <= remora.input.4 => motion.probe-input
# --- SPINDLE --- addf remora.read servo-thread
# Spindle signal is driven in custom.hal, we connect it here to the Remora output 0 (GP8) addf motion-command-handler servo-thread
net spindle-on => remora.output.0 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
# --- JOINT 0 (X AXIS) --- #toggle2nist states & mux selectors
setp remora.joint.0.scale [JOINT_0]SCALE # net program-is-paused hold_toggle.is-on <= halui.program.is-paused
setp remora.joint.0.maxaccel [JOINT_0]STEPGEN_MAXACCEL
setp remora.joint.0.pgain [JOINT_0]P_GAIN
setp remora.joint.0.deadband [JOINT_0]DEADBAND
net xpos-cmd joint.0.motor-pos-cmd => remora.joint.0.pos-cmd # vfdmod - uncomment the below if using vfdmod (default). There are also a couple items to edit in spindle_load.hal
net xpos-fb remora.joint.0.pos-fb => joint.0.motor-pos-fb # loadusr -W vfdmod vfdmod.ini
net xenable joint.0.amp-enable-out => remora.joint.0.enable # net spindle-speed-cmd vfdmod.spindle.rpm-in <= spindle.0.speed-out
net home-x <= remora.input.0 => joint.0.home-sw-in # 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
# --- JOINT 1 (Y AXIS) --- # estop and SPI comms enable and feedback
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 net user-enable-out <= iocontrol.0.user-enable-out => remora.enable
net ypos-fb remora.joint.1.pos-fb => joint.1.motor-pos-fb net user-request-enable <= iocontrol.0.user-request-enable => remora.reset estop_latch.reset
net yenable joint.1.amp-enable-out => remora.joint.1.enable #Halt is shared with motor alarms and is in the estop loop.
net home-y <= remora.input.1 => joint.1.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 2 (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.deadband [JOINT_2]DEADBAND
net zpos-cmd joint.2.motor-pos-cmd => remora.joint.2.pos-cmd # joint 0 setup (X axis)
net zpos-fb remora.joint.2.pos-fb => joint.2.motor-pos-fb
net zenable joint.2.amp-enable-out => remora.joint.2.enable
net home-z <= remora.input.2 => joint.2.home-sw-in
# --- TOOL CHANGE --- setp remora.joint.0.scale [JOINT_0]SCALE
net tool-change-request <= iocontrol.0.tool-change setp remora.joint.0.maxaccel [JOINT_0]STEPGEN_MAXACCEL
net tool-change-confirmed => iocontrol.0.tool-changed setp remora.joint.0.pgain [JOINT_0]P_GAIN
net tool-number <= iocontrol.0.tool-prep-number setp remora.joint.0.ff1gain [JOINT_0]FF1_GAIN
net tool-prepare-loopback iocontrol.0.tool-prepare => iocontrol.0.tool-prepared 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.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": { {
"Thread": "Servo",
"Frequency": 1000
}
],
"Modules": [ "Modules": [
{ {
"Thread": "Servo",
"Type": "Blink",
"Comment": "Blinky status LED",
"Pin": "GP25",
"Frequency": 2
},
{
"Thread": "Base",
"Type": "Stepgen", "Type": "Stepgen",
"Joint": 0, "Comment": "X - Joint 0 step generator",
"Joint Number": 0,
"Step Pin": "GP2", "Step Pin": "GP2",
"Direction Pin": "GP3", "Direction Pin": "GP3"
"Enable Pin": "GP9"
}, },
{ {
"Thread": "Base",
"Type": "Stepgen", "Type": "Stepgen",
"Joint": 1, "Comment": "Y - Joint 1 step generator",
"Joint Number": 1,
"Step Pin": "GP4", "Step Pin": "GP4",
"Direction Pin": "GP5", "Direction Pin": "GP5"
"Enable Pin": "GP10"
}, },
{ {
"Thread": "Base",
"Type": "Stepgen", "Type": "Stepgen",
"Joint": 2, "Comment": "Z - Joint 2 step generator",
"Joint Number": 2,
"Step Pin": "GP6", "Step Pin": "GP6",
"Direction Pin": "GP7", "Direction Pin": "GP7"
"Enable Pin": "GP11"
}, },
{ {
"Type": "Digital Input", "Thread": "Servo",
"Type": "Digital Pin",
"Comment": "X axis limit/home switch",
"Pin": "GP13", "Pin": "GP13",
"Mode": "PullUp", "Mode": "Input",
"Data Bit": 0 "Data Bit": 0,
"Invert": "False"
}, },
{ {
"Type": "Digital Input", "Thread": "Servo",
"Type": "Digital Pin",
"Comment": "Y axis limit/home switch",
"Pin": "GP14", "Pin": "GP14",
"Mode": "PullUp", "Mode": "Input",
"Data Bit": 1 "Data Bit": 1,
"Invert": "False"
}, },
{ {
"Type": "Digital Input", "Thread": "Servo",
"Type": "Digital Pin",
"Comment": "Z axis limit/home switch",
"Pin": "GP15", "Pin": "GP15",
"Mode": "PullUp", "Mode": "Input",
"Data Bit": 2 "Data Bit": 2,
"Invert": "False"
}, },
{ {
"Type": "Digital Input", "Thread": "Servo",
"Type": "Digital Pin",
"Comment": "Emergency Stop switch",
"Pin": "GP28", "Pin": "GP28",
"Mode": "PullUp", "Mode": "Input",
"Data Bit": 3 "Data Bit": 3,
"Invert": "False"
}, },
{ {
"Type": "Digital Input", "Thread": "Servo",
"Type": "Digital Pin",
"Comment": "Versaprobe tool probe input",
"Pin": "GP27", "Pin": "GP27",
"Mode": "PullUp", "Mode": "Input",
"Data Bit": 4 "Data Bit": 4,
"Invert": "False"
}, },
{ {
"Type": "Digital Output", "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", "Pin": "GP8",
"Invert": true, "Mode": "Output",
"Data Bit": 0 "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"
}
]
}