Skip to content

Commit

Permalink
feat(voron): cartographer touch
Browse files Browse the repository at this point in the history
  • Loading branch information
truelecter committed Aug 28, 2024
1 parent a9c1a51 commit 8fc2209
Show file tree
Hide file tree
Showing 9 changed files with 152 additions and 51 deletions.
2 changes: 1 addition & 1 deletion cells/klipper/klipper-plugins/klipper-cartographer.nix
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ stdenvNoCC.mkDerivation rec {

installPhase = ''
mkdir -p $out/lib/extras
cp idm.py cartographer.py $out/lib/extras
cp idm.py cartographer.py scanner.py $out/lib/extras
'';

passthru.klipper = {
Expand Down
32 changes: 16 additions & 16 deletions cells/klipper/sources/generated.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
},
"katapult": {
"cargoLocks": null,
"date": "2024-08-08",
"date": "2024-08-24",
"extract": null,
"name": "katapult",
"passthru": null,
Expand All @@ -76,12 +76,12 @@
"name": null,
"owner": "Arksine",
"repo": "katapult",
"rev": "562fc2fafb1b24b614f196a9ad36d041fcaeafb1",
"sha256": "sha256-Q5KQZmqGoRKE1UW0e7jSEoKpp8+CXVZ9XE488gtMvpg=",
"rev": "42909f8a0d9254aa05e6d6b1c96ddf6633d114a4",
"sha256": "sha256-XRsgG9/4WX7YlkSnejsv/nSlQUG6PAL3iHote/eNcp4=",
"sparseCheckout": [],
"type": "github"
},
"version": "562fc2fafb1b24b614f196a9ad36d041fcaeafb1"
"version": "42909f8a0d9254aa05e6d6b1c96ddf6633d114a4"
},
"klipper": {
"cargoLocks": null,
Expand All @@ -106,7 +106,7 @@
},
"klipper-cartographer": {
"cargoLocks": null,
"date": "2024-08-23",
"date": "2024-08-26",
"extract": null,
"name": "klipper-cartographer",
"passthru": null,
Expand All @@ -118,12 +118,12 @@
"name": null,
"owner": "Cartographer3D",
"repo": "cartographer-klipper",
"rev": "2c9d8eb36bd84aaadd238a12a8fe200d27dc460b",
"sha256": "sha256-3M1JQmnRqA3AR2q99jeDqZmCGMK7J6538NXTQrS6fUs=",
"rev": "6e326cbf6152a771b1f51f0b930d85b75ac7ca45",
"sha256": "sha256-clMM562W+YBjnTFPxIHslXiWiTpfaELIcZDDDIsY3yo=",
"sparseCheckout": [],
"type": "github"
},
"version": "2c9d8eb36bd84aaadd238a12a8fe200d27dc460b"
"version": "6e326cbf6152a771b1f51f0b930d85b75ac7ca45"
},
"klipper-chopper-resonance-tuner": {
"cargoLocks": null,
Expand Down Expand Up @@ -316,7 +316,7 @@
},
"klipper-screen": {
"cargoLocks": null,
"date": "2024-08-06",
"date": "2024-08-25",
"extract": null,
"name": "klipper-screen",
"passthru": null,
Expand All @@ -328,12 +328,12 @@
"name": null,
"owner": "jordanruthe",
"repo": "KlipperScreen",
"rev": "8e91576470e5905cfdfd14d1d641ad854643a414",
"sha256": "sha256-BCSfnUb7YZ9/U/aHZrnsOA3DVi2xCpEtKMk3AqUSGsQ=",
"rev": "7d75d39c0e18b73c562918f32801316b623e77fc",
"sha256": "sha256-KiP7LuvdPwsozD6+iqGj/GvUN741wK93+/kwvZsSP94=",
"sparseCheckout": [],
"type": "github"
},
"version": "8e91576470e5905cfdfd14d1d641ad854643a414"
"version": "7d75d39c0e18b73c562918f32801316b623e77fc"
},
"klipper-z-calibration": {
"cargoLocks": null,
Expand Down Expand Up @@ -435,7 +435,7 @@
},
"mainsail": {
"cargoLocks": null,
"date": "2024-08-17",
"date": "2024-08-24",
"extract": null,
"name": "mainsail",
"passthru": null,
Expand All @@ -447,12 +447,12 @@
"name": null,
"owner": "mainsail-crew",
"repo": "mainsail",
"rev": "e0f5f78d348adc75851d9c468685c15cc454be2c",
"sha256": "sha256-RWelHztANPlfK4rKmAhiO1EgjB9yIEeBODSELhUAa3M=",
"rev": "85c577434efaa60fdcf1a017ab0fa00b99c9eecf",
"sha256": "sha256-mk9CUOK0SawaMxfiK5x7XkIEmjoaxTLHLO5soo8pbK8=",
"sparseCheckout": [],
"type": "github"
},
"version": "e0f5f78d348adc75851d9c468685c15cc454be2c"
"version": "85c577434efaa60fdcf1a017ab0fa00b99c9eecf"
},
"mobileraker-companion": {
"cargoLocks": null,
Expand Down
32 changes: 16 additions & 16 deletions cells/klipper/sources/generated.nix
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,15 @@
};
katapult = {
pname = "katapult";
version = "562fc2fafb1b24b614f196a9ad36d041fcaeafb1";
version = "42909f8a0d9254aa05e6d6b1c96ddf6633d114a4";
src = fetchFromGitHub {
owner = "Arksine";
repo = "katapult";
rev = "562fc2fafb1b24b614f196a9ad36d041fcaeafb1";
rev = "42909f8a0d9254aa05e6d6b1c96ddf6633d114a4";
fetchSubmodules = false;
sha256 = "sha256-Q5KQZmqGoRKE1UW0e7jSEoKpp8+CXVZ9XE488gtMvpg=";
sha256 = "sha256-XRsgG9/4WX7YlkSnejsv/nSlQUG6PAL3iHote/eNcp4=";
};
date = "2024-08-08";
date = "2024-08-24";
};
klipper = {
pname = "klipper";
Expand All @@ -62,15 +62,15 @@
};
klipper-cartographer = {
pname = "klipper-cartographer";
version = "2c9d8eb36bd84aaadd238a12a8fe200d27dc460b";
version = "6e326cbf6152a771b1f51f0b930d85b75ac7ca45";
src = fetchFromGitHub {
owner = "Cartographer3D";
repo = "cartographer-klipper";
rev = "2c9d8eb36bd84aaadd238a12a8fe200d27dc460b";
rev = "6e326cbf6152a771b1f51f0b930d85b75ac7ca45";
fetchSubmodules = false;
sha256 = "sha256-3M1JQmnRqA3AR2q99jeDqZmCGMK7J6538NXTQrS6fUs=";
sha256 = "sha256-clMM562W+YBjnTFPxIHslXiWiTpfaELIcZDDDIsY3yo=";
};
date = "2024-08-23";
date = "2024-08-26";
};
klipper-chopper-resonance-tuner = {
pname = "klipper-chopper-resonance-tuner";
Expand Down Expand Up @@ -181,15 +181,15 @@
};
klipper-screen = {
pname = "klipper-screen";
version = "8e91576470e5905cfdfd14d1d641ad854643a414";
version = "7d75d39c0e18b73c562918f32801316b623e77fc";
src = fetchFromGitHub {
owner = "jordanruthe";
repo = "KlipperScreen";
rev = "8e91576470e5905cfdfd14d1d641ad854643a414";
rev = "7d75d39c0e18b73c562918f32801316b623e77fc";
fetchSubmodules = false;
sha256 = "sha256-BCSfnUb7YZ9/U/aHZrnsOA3DVi2xCpEtKMk3AqUSGsQ=";
sha256 = "sha256-KiP7LuvdPwsozD6+iqGj/GvUN741wK93+/kwvZsSP94=";
};
date = "2024-08-06";
date = "2024-08-25";
};
klipper-z-calibration = {
pname = "klipper-z-calibration";
Expand Down Expand Up @@ -246,15 +246,15 @@
};
mainsail = {
pname = "mainsail";
version = "e0f5f78d348adc75851d9c468685c15cc454be2c";
version = "85c577434efaa60fdcf1a017ab0fa00b99c9eecf";
src = fetchFromGitHub {
owner = "mainsail-crew";
repo = "mainsail";
rev = "e0f5f78d348adc75851d9c468685c15cc454be2c";
rev = "85c577434efaa60fdcf1a017ab0fa00b99c9eecf";
fetchSubmodules = false;
sha256 = "sha256-RWelHztANPlfK4rKmAhiO1EgjB9yIEeBODSELhUAa3M=";
sha256 = "sha256-mk9CUOK0SawaMxfiK5x7XkIEmjoaxTLHLO5soo8pbK8=";
};
date = "2024-08-17";
date = "2024-08-24";
};
mobileraker-companion = {
pname = "mobileraker-companion";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[input_shaper]
shaper_freq_x: 90
shaper_type_x: ei
shaper_freq_y: 89
shaper_type_y: ei
shaper_freq_x: 76.2
shaper_type_x: mzv
shaper_freq_y: 56.2
shaper_type_y: mzv

# danger-klipper only
# enabled_extruders: extruder
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,45 @@
# pid_Kd: 59.120

# Rapido 2
[pid_profile extruder t220]
# [pid_profile extruder t220]
# pid_version: 1
# control: pid
# pid_Kp: 22.729
# pid_Ki: 2.129
# pid_Kd: 60.656

# [pid_profile extruder t255]
# pid_version: 1
# control: pid
# pid_Kp: 25.764
# pid_Ki: 2.466
# pid_Kd: 67.309

# Rapido Ace
[pid_profile extruder t225]
pid_version: 1
control: pid
pid_Kp: 25.514
pid_Ki: 12.150
pid_Kd: 13.395

[pid_profile extruder t215]
pid_version: 1
control: pid
pid_Kp: 22.729
pid_Ki: 2.129
pid_Kd: 60.656
pid_Kp: 26.666
pid_Ki: 12.698
pid_Kd: 14.000

[pid_profile extruder t255]
pid_version: 1
control: pid
pid_Kp: 25.764
pid_Ki: 2.466
pid_Kd: 67.309
pid_Kp: 26.618
pid_Ki: 11.327
pid_Kd: 15.638

[pid_profile extruder t150]
pid_version: 1
control: pid
pid_Kp: 16.981
pid_Ki: 7.076
pid_Kd: 10.189
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
[scanner]
canbus_uuid: d5d27f831859
x_offset: 0.0
y_offset: 27.1

calibration_method: touch
sensor: cartographer
sensor_alt: carto
#alternate name to call commands. CARTO_TOUCH etc
scanner_touch_z_offset: 0.05
#this is the default and will be overwritten and added to the DO NOT SAVE area by using UI to save z offset

[safe_z_home]
home_xy_position: 151, 154
speed: 200
z_hop: 10

[adxl345]
cs_pin: scanner:PA3
spi_bus: spi1

[resonance_tester]
accel_chip: adxl345
probe_points:
150, 150, 20

[stepper_z]
endstop_pin: probe:z_virtual_endstop # use cartographer as virtual endstop
homing_retract_dist: 0 # cartographer needs this to be set to 0

[gcode_macro CARTO_TOUCH]
rename_existing: _CARTO_TOUCH
gcode:
{% set TOUCH_TEMP = printer.configfile.config.scanner.scanner_touch_max_temp | default(150) | float %}
{% set ACTUAL_TEMP = printer.extruder.temperature %}
{% set TARGET_TEMP = printer.extruder.target %}
{% if not "xyz" in printer.toolhead.homed_axes %}
{action_respond_info("Printer not homed")}
{% else %}
{% if TARGET_TEMP > TOUCH_TEMP %}
{ action_respond_info('Extruder temperature target of %.1fC is too high, lowering to %.1fC' % (TARGET_TEMP, TOUCH_TEMP)) }
M104 S{ TOUCH_TEMP }
TEMPERATURE_WAIT SENSOR=extruder MAXIMUM={ TOUCH_TEMP }
{% else %}
# Temperature target is already low enough, but nozzle may still be too hot.
{% if ACTUAL_TEMP > TOUCH_TEMP %}
{ action_respond_info('Extruder temperature %.1fC is still too high, waiting until below %.1fC' % (ACTUAL_TEMP, TOUCH_TEMP)) }
TEMPERATURE_WAIT SENSOR=extruder MAXIMUM={ TOUCH_TEMP }
{% endif %}
{% endif %}
_CARTO_TOUCH {rawparams}
M109 S{ TARGET_TEMP }
{% endif %}
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,25 @@ enable_pin: !toolhead: PD2
heater_pin: toolhead: PB13

# Rapido V1
sensor_type: ATC Semitec 104NT-4-R025H42G
sensor_pin: toolhead: PA3
control: pid
# sensor_type: ATC Semitec 104NT-4-R025H42G
# sensor_pin: toolhead: PA3
# min_temp: 0
# max_temp: 350
# control: pid
# pid_Kp: 24.179
# pid_Ki: 2.178
# pid_Kd: 67.096

# Rapido Ace

min_temp: 0
max_temp: 350
sensor_type: MAX31865
sensor_pin: toolhead: PA4
spi_bus: spi1
rtd_nominal_r: 100
rtd_reference_r: 430
rtd_num_of_wires: 2
control: pid
pid_Kp: 24.179
pid_Ki: 2.178
Expand All @@ -44,7 +58,7 @@ uart_pin: toolhead: PA15

# Orbiter V2
interpolate: true
run_current: 0.85 #**
run_current: 0.80 #**
hold_current: 0.100
sense_resistor: 0.110
stealthchop_threshold: 0
Expand Down
11 changes: 8 additions & 3 deletions cells/nixos/hosts/voron/klipper/configs/klipper.d/macro.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ gcode:
{% set MESH_MIN = params.MESH_MIN|default("") %}
{% set MESH_MAX = params.MESH_MAX|default("") %}


SET_GCODE_VARIABLE MACRO=START_PRINT VARIABLE=bedtemp VALUE={BED_TEMP}
SET_GCODE_VARIABLE MACRO=START_PRINT VARIABLE=hotendtemp VALUE={EXTRUDER_TEMP}
SET_GCODE_VARIABLE MACRO=START_PRINT VARIABLE=chambertemp VALUE={CHAMBER_TEMP}
Expand All @@ -27,10 +26,12 @@ gcode:
_CG28
BED_MESH_CLEAR

PID_PROFILE LOAD=t150 HEATER=extruder

{% if printer['temperature_sensor chamber'].temperature < CHAMBER_TEMP or printer.heater_bed.temperature < (BED_TEMP - 2) %}
HEATSOAK T={BED_TEMP} C={CHAMBER_TEMP} MOVE=1 WAIT=1 NOTIFY=0
HEATSOAK T={BED_TEMP} C={CHAMBER_TEMP} H=150 MOVE=1 WAIT=1 NOTIFY=0
{% else %}
HEATSOAK T={BED_TEMP} C={CHAMBER_TEMP} MOVE=0 WAIT=1 NOTIFY=0
HEATSOAK T={BED_TEMP} C={CHAMBER_TEMP} H=150 MOVE=0 WAIT=1 NOTIFY=0
{% endif %}

# CLEAN_NOZZLE PURGE={EXTRUDER_TEMP} CLEAN=150
Expand All @@ -44,8 +45,12 @@ gcode:
BED_MESH_CALIBRATE
{% endif %}

CARTO_TOUCH

GOTO_PRIME_FILAMENT

PID_PROFILE LOAD=t255 HEATER=extruder

M104 S{EXTRUDER_TEMP}
M109 S{EXTRUDER_TEMP}

Expand Down

0 comments on commit 8fc2209

Please sign in to comment.