Skip to content

Commit

Permalink
add printer configures for all the newer k1 variants.
Browse files Browse the repository at this point in the history
  • Loading branch information
ballaswag committed Jun 21, 2024
1 parent 9adb8cd commit 7676f02
Show file tree
Hide file tree
Showing 14 changed files with 1,379 additions and 46 deletions.
39 changes: 39 additions & 0 deletions device_files/install/k1mod_init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,45 @@ do_setup()
xz -dc $WORK_DIR/chroot.tar.xz | tar -xf - -C $CHROOT_DIR
sync

##############################
# which k1 are you?
##############################

PRINTER_CONF_DIR="${CHROOT_DIR}//root/printer_data/config"
machine_info=$(tr -d '\0' </dev/mmcblk0p2)
if [[ $machine_info == *"CR-K1;CR4CU220812S12;;;;;"* ]]; then
echo "Identified machine as K1. Configuring printer.cfg for a K1."
cp $PRINTER_CONF_DIR/k1/*.cfg $PRINTER_CONF_DIR/
rm $PRINTER_CONF_DIR/printer_k1c.cfg $PRINTER_CONF_DIR/printer_variant1.cfg

elif [[ $machine_info == *"CR-K1;CR4CU220812S12;;;1;;"* ]]; then
echo "Identified machine as K1 New Variant. Configuring printer.cfg for a K1 New Variant."
cp $PRINTER_CONF_DIR/k1/*.cfg $PRINTER_CONF_DIR/
mv $PRINTER_CONF_DIR/printer_variant1.cfg $PRINTER_CONF_DIR/printer.cfg
rm $PRINTER_CONF_DIR/printer_k1c.cfg

elif [[ $machine_info == *"CR-K1 Max;CR4CU220812S12;;;;;"* ]]; then
echo "Identified machine as K1 Max. Configuring printer.cfg for a K1 Max."
cp $PRINTER_CONF_DIR/k1max/*.cfg $PRINTER_CONF_DIR/
rm $PRINTER_CONF_DIR/printer_variant1.cfg

elif [[ $machine_info == *"CR-K1 Max;CR4CU220812S12;;;1;;"* ]]; then
echo "Identified machine as K1 Max New Variant. Configuring printer.cfg for a K1 Max New Variant."
cp $PRINTER_CONF_DIR/k1max/*.cfg $PRINTER_CONF_DIR/
mv $PRINTER_CONF_DIR/printer_variant1.cfg $PRINTER_CONF_DIR/printer.cfg

elif [[ $machine_info == *"K1C;CR4CU220812S12;;;;;"* ]]; then
echo "Identified machine as K1C. Configuring printer.cfg for a K1C."
cp $PRINTER_CONF_DIR/k1/*.cfg $PRINTER_CONF_DIR/
mv $PRINTER_CONF_DIR/printer_k1c.cfg $PRINTER_CONF_DIR/printer.cfg
rm $PRINTER_CONF_DIR/printer_variant1.cfg

else
echo "Failed to idenity K1 model. Exiting.."
exit 1
fi


# do intial setup
$CHROOT_DIR/etc/init/S00klipper_mod setup
sync
Expand Down
16 changes: 5 additions & 11 deletions printer_configs/custom_gcode.cfg
Original file line number Diff line number Diff line change
@@ -1,15 +1,8 @@
[gcode_macro _CLIENT_VARIABLE]
variable_use_custom_pos : True
variable_custom_park_x : 5
variable_custom_park_y : 10
variable_custom_park_dz : 50.0 ; custom dz value; the value in mm to lift the nozzle when move to park position
variable_park_at_cancel : True
gcode:

[gcode_macro START_PRINT]
gcode:
{% set BED_TEMP=params.BED_TEMP|default(55)|float %}
{% set EXTRUDER_TEMP=params.EXTRUDER_TEMP|default(195)|float %}
{% set eddy = ('probe_eddy_current btt_eddy' in printer.configfile.settings) %}

# Home the printer
G28
Expand All @@ -18,15 +11,16 @@ gcode:
M140 S{BED_TEMP}
M190 S{BED_TEMP}

SET_VELOCITY_LIMIT ACCEL=15000 ACCEL_TO_DECEL=10000 SQUARE_CORNER_VELOCITY=25 # drop accels to prevent hyper agressive meshing
BED_MESH_CLEAR
{% if eddy %}
BED_MESH_CALIBRATE METHOD=rapid_scan ADAPTIVE=1 ADAPTIVE_MARGIN=5

{% else %}
BED_MESH_CALIBRATE ADAPTIVE=1 ADAPTIVE_MARGIN=5
{% endif %}
# Heat the extruder to the desired temperature
M104 S{EXTRUDER_TEMP}

SMART_PARK # park the printhead near the print area
SET_VELOCITY_LIMIT ACCEL=18000 ACCEL_TO_DECEL=10000 SQUARE_CORNER_VELOCITY=5 # up acceleration back to slightly below regular travel speeds
M109 S{EXTRUDER_TEMP} # wait for nozzle temperature before next step
LINE_PURGE

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,11 @@ screw4_name: rear left screw
speed: 100
horizontal_move_z: 5
screw_thread: CW-M4

[gcode_macro _CLIENT_VARIABLE]
variable_use_custom_pos : True
variable_custom_park_x : 205
variable_custom_park_y : 204
variable_custom_park_dz : 50.0
variable_park_at_cancel : True
gcode:
17 changes: 15 additions & 2 deletions printer_configs/btteddy.cfg → printer_configs/k1/btteddy.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
#
# This btt eddy configuration is for this mount:
# https://makerworld.com/en/models/494931
#

### btt eddy
[mcu eddy]
serial: /dev/serial/by-id/usb-Klipper_rp2040_45503571288CBAF8-if00
serial: /dev/serial/by-id/usb-Klipper_rp2040_45503571288CBAF8-if00 # change this based on your device path

[temperature_sensor btt_eddy_mcu]
sensor_type: temperature_mcu
Expand All @@ -20,7 +25,15 @@ y_offset: 11.8 # Set according to the actual offset relative to the nozzle
[bed_mesh]
horizontal_move_z: 2
speed: 300
mesh_min: 0, 20
mesh_min: 5, 30
mesh_max: 185, 215
probe_count: 20, 20
algorithm: bicubic

[gcode_macro _CLIENT_VARIABLE]
variable_use_custom_pos : True
variable_custom_park_x : 5
variable_custom_park_y : 10
variable_custom_park_dz : 50.0 ; custom dz value; the value in mm to lift the nozzle when move to park position
variable_park_at_cancel : True
gcode:
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ gcode:
SET_PIN PIN=probe_enable VALUE=0

[probe]
pin: ^!nozzle_mcu: PA9
#pin: ^nozzle_mcu: PA9 # MicroProbe V1 users should use this line to trigger on high
pin: ^!nozzle_mcu: PA9 # MicroProbe V2 users should use this line to trigger on low
deactivate_on_each_sample: False
x_offset: -33.0
y_offset: 0
Expand All @@ -26,30 +27,6 @@ activate_gcode:
deactivate_gcode:
PROBE_UP

[bed_mesh]
speed: 150
mesh_min: 0,3
mesh_max: 196,215
probe_count: 12,12
fade_start: 3.0
fade_end: 10.0
horizontal_move_z: 8
algorithm: bicubic
bicubic_tension: 0.1

[screws_tilt_adjust]
screw1: 59,20
screw1_name: front left screw
screw2: 229,20
screw2_name: front right screw
screw3: 229,190
screw3_name: rear right screw
screw4: 59,190
screw4_name: rear left screw
speed: 100
horizontal_move_z: 5
screw_thread: CW-M4

#
# This configuration is for the K1 and K1C only
#
Expand All @@ -68,14 +45,22 @@ algorithm: bicubic
bicubic_tension: 0.1

[screws_tilt_adjust]
screw1: 59,20
screw1_name: front left screw
screw2: 229,20
screw2_name: front right screw
screw3: 229,190
screw3_name: rear right screw
screw4: 59,190
screw4_name: rear left screw
screw1: 58,20
screw1_name: front left
screw2: 228,20
screw2_name: front right
screw3: 228,190
screw3_name: rear right
screw4: 58,190
screw4_name: rear left
speed: 100
horizontal_move_z: 5
screw_thread: CW-M4

[gcode_macro _CLIENT_VARIABLE]
variable_use_custom_pos : True
variable_custom_park_x : 185
variable_custom_park_y : 210
variable_custom_park_dz : 50.0
variable_park_at_cancel : True
gcode:
File renamed without changes.
Loading

0 comments on commit 7676f02

Please sign in to comment.