Skip to content

Commit

Permalink
chore(voron): lots of mods
Browse files Browse the repository at this point in the history
  • Loading branch information
truelecter committed May 5, 2024
1 parent fd7a154 commit 1c13605
Show file tree
Hide file tree
Showing 15 changed files with 180 additions and 98 deletions.
2 changes: 1 addition & 1 deletion cells/klipper/packages/katapult-firmware.nix
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ in
installPhase = ''
mkdir -p $out
cp ./.config $out/config
ls -la out/
cp out/katapult.bin $out/ || true
cp out/deployer.bin $out/ || true
cp out/katapult.uf2 $out/ || true
'';

strictDeps = true;
Expand Down
2 changes: 2 additions & 0 deletions cells/klipper/packages/klipper-firmware.nix
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ stdenv.mkDerivation rec {
installPhase = ''
mkdir -p $out
cp ./.config $out/config
ls -la out/
cp out/klipper.bin $out/ || true
cp out/klipper.uf2 $out/ || true
'';

strictDeps = true;
Expand Down
7 changes: 7 additions & 0 deletions cells/nixos/hosts/voron/hardware-configuration.nix
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
{
lib,
pkgs,
modulesPath,
...
}: {
imports = [
"${modulesPath}/installer/sd-card/sd-image-aarch64-installer.nix"
];

sdImage.compressImage = false;

boot = {
kernelPackages = pkgs.linuxPackages_rpi4;
loader = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Below you can include specific configuration files depending on what you want KAMP to do:

[include ./../plugins/kamp/Adaptive_Meshing.cfg] # Include to enable adaptive meshing configuration.
[include ./../plugins/kamp/Line_Purge.cfg] # Include to enable adaptive line purging configuration.
# [include ./../plugins/kamp/Line_Purge.cfg] # Include to enable adaptive line purging configuration.
# [include ./../plugins/kamp/Voron_Purge.cfg] # Include to enable adaptive Voron logo purging configuration.
[include ./../plugins/kamp/Smart_Park.cfg] # Include to enable the Smart Park function, which parks the printhead near the print area for final heating.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ runout_gcode:

[filament_motion_sensor SFSEN]
switch_pin: ^PC15
detection_length: 10
detection_length: 8
pause_on_runout: False
event_delay: 3.0
pause_delay: 0.5
Expand Down
98 changes: 40 additions & 58 deletions cells/nixos/hosts/voron/klipper/configs/klipper.d/hardware/leds.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,31 +3,31 @@ initial_duration: 1
gcode:
_STATUS_READY

# [neopixel chamber_right]
# pin: back_xiao:gpio7
# chain_count: 18
# color_order: GRBW
# initial_red: 0.0
# initial_green: 0.0
# initial_blue: 0.0
# initial_white: 0.0

# [neopixel chamber_left]
# pin: back_xiao:gpio6
# chain_count: 18
# color_order: GRBW
# initial_red: 0.0
# initial_green: 0.0
# initial_blue: 0.0
# initial_white: 0.0

# [led_effect chamber_light]
# frame_rate: 15
# leds:
# neopixel:chamber_left
# neopixel:chamber_right
# layers:
# static 0 0 top (0, 0, 0, 1.0)
[neopixel chamber_right]
pin: back_xiao:gpio7
chain_count: 18
color_order: GRBW
initial_red: 0.0
initial_green: 0.0
initial_blue: 0.0
initial_white: 0.0

[neopixel chamber_left]
pin: back_xiao:gpio6
chain_count: 18
color_order: GRBW
initial_red: 0.0
initial_green: 0.0
initial_blue: 0.0
initial_white: 0.0

[led_effect chamber_light]
frame_rate: 15
leds:
neopixel:chamber_left
neopixel:chamber_right
layers:
static 0 0 top (0, 0, 0, 1.0)

[led_effect sb_logo_busy]
autostart: false
Expand Down Expand Up @@ -186,40 +186,22 @@ layers:
static 0 0 top (1.0, 1.0, 1.0)

[gcode_macro LED_PROFILE_APPLY]
# variable_profiles:
# {
# "full": {
# "off": [],
# "ready": ["rainbow", "set_nozzle_leds", "chamber_light"],
# "part_ready": ["sb_nozzle_part_ready", "sb_logo_part_ready", "chamber_light"],
# "busy": ["sb_logo_busy", "set_nozzle_leds", "chamber_light"],
# "heating": ["sb_logo_heating", "sb_nozzle_heating", "chamber_light"],
# "cooling": ["sb_logo_cooling", "sb_nozzle_cooling", "chamber_light"],
# "leveling": ["sb_logo_leveling", "set_nozzle_leds", "chamber_light"],
# "homing": ["sb_logo_homing", "set_nozzle_leds", "chamber_light"],
# "cleaning": ["sb_logo_cleaning", "set_nozzle_leds", "chamber_light"],
# "meshing": ["sb_logo_meshing", "set_nozzle_leds", "chamber_light"],
# "calibrating_z": ["sb_logo_calibrating_z", "set_nozzle_leds", "chamber_light"],
# "printing": ["sb_logo_printing", "set_nozzle_leds", "chamber_light"]
# },
# "toolhead": {
# "off": [],
# "ready": ["rainbow", "set_nozzle_leds"],
# "part_ready": ["sb_nozzle_part_ready", "sb_logo_part_ready"],
# "busy": ["sb_logo_busy", "set_nozzle_leds"],
# "heating": ["sb_logo_heating", "sb_nozzle_heating"],
# "cooling": ["sb_logo_cooling", "sb_nozzle_cooling"],
# "leveling": ["sb_logo_leveling", "set_nozzle_leds"],
# "homing": ["sb_logo_homing", "set_nozzle_leds"],
# "cleaning": ["sb_logo_cleaning", "set_nozzle_leds"],
# "meshing": ["sb_logo_meshing", "set_nozzle_leds"],
# "calibrating_z": ["sb_logo_calibrating_z", "set_nozzle_leds"],
# "printing": ["sb_logo_printing", "set_nozzle_leds"]
# },
# }

variable_profiles:
{
"full": {
"off": [],
"ready": ["rainbow", "set_nozzle_leds", "chamber_light"],
"part_ready": ["sb_nozzle_part_ready", "sb_logo_part_ready", "chamber_light"],
"busy": ["sb_logo_busy", "set_nozzle_leds", "chamber_light"],
"heating": ["sb_logo_heating", "sb_nozzle_heating", "chamber_light"],
"cooling": ["sb_logo_cooling", "sb_nozzle_cooling", "chamber_light"],
"leveling": ["sb_logo_leveling", "set_nozzle_leds", "chamber_light"],
"homing": ["sb_logo_homing", "set_nozzle_leds", "chamber_light"],
"cleaning": ["sb_logo_cleaning", "set_nozzle_leds", "chamber_light"],
"meshing": ["sb_logo_meshing", "set_nozzle_leds", "chamber_light"],
"calibrating_z": ["sb_logo_calibrating_z", "set_nozzle_leds", "chamber_light"],
"printing": ["sb_logo_printing", "set_nozzle_leds", "chamber_light"]
},
"toolhead": {
"off": [],
"ready": ["rainbow", "set_nozzle_leds"],
Expand All @@ -236,7 +218,7 @@ variable_profiles:
},
}

variable_selected_profile: "toolhead"
variable_selected_profile: "full"
variable_last_status: "ready"
variable_debug: 0

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@ microsteps: 32
# endstop_pin: ^PF2
# position_endstop: 0.899
position_max: 250
position_min: -5
# To QGL some really not leveled gantry
position_min: -10
homing_speed: 15
second_homing_speed: 3
homing_retract_dist: 3
Expand Down
89 changes: 89 additions & 0 deletions cells/nixos/hosts/voron/klipper/configs/klipper.d/hardware/tap.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
[stepper_z]
endstop_pin: probe:z_virtual_endstop

[force_move]
enable_force_move: True

[homing_override]
axes: XYZ
gcode:
{% set Mx = printer['configfile'].config["stepper_x"]["position_max"]|float %}
{% set My = printer['configfile'].config["stepper_y"]["position_max"]|float %}
{% set safe_z = 15 %}
{% set z_feedrate = 6000 %}

G90

{% set home_x, home_y, home_z = False, False, False %}

{% if not 'X' in params
and not 'Y' in params
and not 'Z' in params %}

{% set home_x, home_y, home_z = True, True, True %}
{ action_respond_info("homing_override goint to home all axes") }
{% elif 'X' in params
and 'Y' in params
and 'Z' in params %}

{% set home_x, home_y, home_z = True, True, True %}
{ action_respond_info("homing_override goint to home all axes") }
{% else %}
{% if 'X' in params %}
{% set home_x = True %}
{ action_respond_info("homing_override goint to home X") }
{% endif %}

{% if 'Y' in params %}
{% set home_y = True %}
{ action_respond_info("homing_override goint to home Y") }
{% endif %}

{% if 'Z' in params %}
{% set home_z = True %}
{ action_respond_info("homing_override goint to home Z") }
{% endif %}
{% endif %}

{% if home_z %}
{% if 'x' not in printer.toolhead.homed_axes or 'y' not in printer.toolhead.homed_axes%}
{ action_respond_info("X or Y not homed, forcing full G28") }

{% set home_x, home_y, home_z = True, True, True %}
{% endif %}
{% endif %}

{% if 'z' in printer.toolhead.homed_axes %}
{% if printer.gcode_move.gcode_position.z < safe_z %}
{ action_respond_info("moving to a safe Z distance") }
G0 Z{safe_z} F{z_feedrate}
{% endif %}
{% else %}
{ action_respond_info("moving to a safe Z distance") }
SET_KINEMATIC_POSITION Z=0
G0 Z{safe_z} F{z_feedrate}
{% endif %}

{% if home_y %}
{ action_respond_info("Homing Y") }

SET_KINEMATIC_POSITION Y=0
G28 Y0
{% endif %}

{% if home_x %}
{ action_respond_info("Homing X") }

SET_KINEMATIC_POSITION X=0
G28 X0
{% endif %}


{% if home_z %}
# Move to center
G0 X{Mx/2} Y{My/2} F19500

G28 Z0

G0 Z{safe_z} F{z_feedrate}
{% endif %}
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ rtd_num_of_wires: 2
min_temp: 0
max_temp: 350
control: pid
pid_Kp: 19.769
pid_Ki: 1.757
pid_Kd: 55.602
pid_Kp: 24.179
pid_Ki: 2.178
pid_Kd: 67.096

# Rapido V1
# sensor_type: ATC Semitec 104NT-4-R025H42G
Expand Down Expand Up @@ -74,7 +74,7 @@ heater_temp: 50.0

[probe]
pin: ^ebb:PB7
z_offset: -1.480
z_offset: -1.690
x_offset: 0
y_offset: 0
speed: 5
Expand Down Expand Up @@ -109,28 +109,3 @@ initial_red: 0.0
initial_green: 0.0
initial_blue: 0.0
initial_white: 0.0

# Voron TAP
[stepper_z]
endstop_pin: probe:z_virtual_endstop

[force_move]
enable_force_move: True

[homing_override]
axes: yxz
gcode:
{% set Mx = printer['configfile'].config["stepper_x"]["position_max"]|float %}
{% set My = printer['configfile'].config["stepper_y"]["position_max"]|float %}

SET_KINEMATIC_POSITION X=0 Y=0 Z=0

G0 Z15 F6000
G28 Y0
G28 X0

G90
G1 X{Mx/2} Y{My/2} F19500

G28 Z0
G0 Z15 F6000
9 changes: 5 additions & 4 deletions cells/nixos/hosts/voron/klipper/configs/klipper.d/macro.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ gcode:
{% endif %}

_STATUS_PRINTING
# LINE_PURGE # KAMP
# M400
_ENABLE_FILAMENT_SENSOR

LINE_PURGE

[gcode_macro CANCEL_PRINT]
description: Cancel the actual running print
rename_existing: CANCEL_PRINT_BASE
Expand All @@ -59,6 +59,7 @@ gcode:
END_PRINT

[gcode_macro END_PRINT]
variable_retraction: 25
gcode:
CLEAR_PAUSE
M400
Expand All @@ -75,7 +76,7 @@ gcode:
G91
G1 E-2 F2100
G1 Z{z_safe} F3000
G1 E-25 F250
G1 E-{retraction} F600
G90
G92 E0
M104 S0
Expand Down Expand Up @@ -190,7 +191,7 @@ gcode:
G90
PARK_REAR
SAVE_GCODE_STATE NAME=PAUSEPARK
M104 S0
# M104 S0
SET_IDLE_TIMEOUT TIMEOUT=43200
{% endif %}

Expand Down
4 changes: 2 additions & 2 deletions cells/nixos/hosts/voron/klipper/configs/klipper.d/main.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ canbus_uuid: 42545159bd5a
[mcu ebb]
canbus_uuid: bb5e63afce85

# [mcu back_xiao]
# canbus_uuid: 6b76bb2f8b9c
[mcu back_xiao]
canbus_uuid: 6b76bb2f8b9c

[include ./features/*.cfg]
[include ./hardware/*.cfg]
Expand Down
1 change: 1 addition & 0 deletions cells/nixos/hosts/voron/klipper/klipper-screen.nix
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
(overlay "disable-bt")
(overlay "vc4-kms-v3d-pi4")
(overlay "vc4-kms-dsi-7inch")
(overlay "rpi-ft5406")
];
};

Expand Down
Loading

0 comments on commit 1c13605

Please sign in to comment.