Skip to content

Commit

Permalink
update for fw version 1.3.3.5
Browse files Browse the repository at this point in the history
  • Loading branch information
CrealityTech committed Mar 7, 2024
1 parent 2a4ee41 commit b003d41
Show file tree
Hide file tree
Showing 28 changed files with 960 additions and 178 deletions.
102 changes: 93 additions & 9 deletions config/K1_CR4CU220812S12/factory_printer.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -283,12 +283,13 @@ probe_points:
150,150,10

[prtouch_v2]
pr_version: 2
step_base: 2
z_offset: 0
noz_ex_com: 0.06
tilt_corr_dis: 0.05
tri_min_hold: 3000
tri_max_hold: 8000
noz_ex_com: 0.09 #0.09 喷头加热补偿值
tilt_corr_dis:0# //0.05 #热床差补偿值
tri_min_hold: 6000,10000 #2000,10000
tri_max_hold: 13000,60000
pres_cnt: 4
pres0_clk_pins: leveling_mcu:PA7
pres0_sdo_pins: leveling_mcu:PA4
Expand All @@ -303,15 +304,98 @@ step_swap_pin: PC10
pres_swap_pin: leveling_mcu:PB1
g28_wait_cool_down: true
pa_clr_down_mm: -0.15
clr_noz_start_x: 95
clr_noz_start_y: 221
clr_noz_start_x: 130
clr_noz_start_y: 303
clr_noz_len_x: 40
clr_noz_len_y: 2
speeds: 2.5,1.0
tri_hftr_cut: 2,1
tri_lftr_k1: 0.70,0.30
tri_min_hold: 2000,20000
tri_max_hold: 6000,60000
tri_lftr_k1: 0.50,0.15
g29_down_min_z: 50

correct_tri_hold: 8000
correct_step_mm: 0.02
#tri_wave_ip:172.22.40.244

#进入调平状态用到的参数
tri_min_hold_1:6000,10000
tri_min_hold_2:6000,10000
tri_min_hold_3:6000,10000
tri_min_hold_4:6000,10000
tri_min_hold_5:6000,10000
tri_min_hold_6:6000,10000

tri_min_hold_7:6000,10000
tri_min_hold_8:6000,10000
tri_min_hold_9:6000,10000
tri_min_hold_10:6000,10000
tri_min_hold_11:6000,10000
tri_min_hold_12:6000,10000

tri_min_hold_13:6000,10000
tri_min_hold_14:6000,10000
tri_min_hold_15:6000,10000
tri_min_hold_16:6000,10000
tri_min_hold_17:6000,10000
tri_min_hold_18:6000,10000

tri_min_hold_19:6000,10000
tri_min_hold_20:6000,10000
tri_min_hold_21:6000,10000
tri_min_hold_22:6000,10000
tri_min_hold_23:6000,10000
tri_min_hold_24:6000,10000

tri_min_hold_25:6000,10000
tri_min_hold_26:6000,10000
tri_min_hold_27:6000,10000
tri_min_hold_28:6000,10000
tri_min_hold_29:6000,10000
tri_min_hold_30:6000,10000

tri_min_hold_31:6000,10000
tri_min_hold_32:6000,10000
tri_min_hold_33:6000,10000
tri_min_hold_34:6000,10000
tri_min_hold_35:6000,10000
tri_min_hold_36:6000,10000

tri_max_hold_1:13000,60000
tri_max_hold_2:13000,60000
tri_max_hold_3:13000,60000
tri_max_hold_4:13000,60000
tri_max_hold_5:13000,60000
tri_max_hold_6:13000,60000
tri_max_hold_7:13000,60000
tri_max_hold_8:13000,60000
tri_max_hold_9:13000,60000
tri_max_hold_10:13000,60000
tri_max_hold_11:13000,60000
tri_max_hold_12:13000,60000
tri_max_hold_13:13000,60000
tri_max_hold_14:13000,60000
tri_max_hold_15:13000,60000
tri_max_hold_16:13000,60000
tri_max_hold_17:13000,60000
tri_max_hold_18:13000,60000
tri_max_hold_19:13000,60000
tri_max_hold_20:13000,60000
tri_max_hold_21:13000,60000
tri_max_hold_22:13000,60000
tri_max_hold_23:13000,60000
tri_max_hold_24:13000,60000
tri_max_hold_25:13000,60000
tri_max_hold_26:13000,60000
tri_max_hold_27:13000,60000
tri_max_hold_28:13000,60000
tri_max_hold_29:13000,60000
tri_max_hold_30:13000,60000
tri_max_hold_31:13000,60000
tri_max_hold_32:13000,60000
tri_max_hold_33:13000,60000
tri_max_hold_34:13000,60000
tri_max_hold_35:13000,60000
tri_max_hold_36:13000,60000

[bed_mesh]
speed: 150
Expand Down
138 changes: 115 additions & 23 deletions config/K1_CR4CU220812S12/gcode_macro.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ variable_fan0_value: 0.00
variable_fan1_value: 0.00
variable_fan2_value: 0.00
variable_speed_factor: 0
variable_max_accel: 2500
variable_max_accel_to_decel: 2500
gcode:
{% set printer_state = printer.print_stats.state %}
{% if printer['gcode_macro Qmode'].flag|int == 0 %}
Expand All @@ -95,23 +97,43 @@ gcode:
SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=square_corner_velocity VALUE={printer.toolhead.square_corner_velocity}
SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=pressure_advance VALUE={printer.extruder.pressure_advance}
SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=speed_factor VALUE={printer.gcode_move.speed_factor}
SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=fan0_value VALUE={printer['output_pin fan0'].value}
SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=fan1_value VALUE={printer['output_pin fan1'].value}
SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=fan2_value VALUE={printer['output_pin fan2'].value}
SET_TMC_FIELD STEPPER=stepper_x FIELD=en_spreadcycle VALUE=0
SET_TMC_FIELD STEPPER=stepper_y FIELD=en_spreadcycle VALUE=0
SET_TMC_CURRENT STEPPER=stepper_x CURRENT=1.0
SET_TMC_CURRENT STEPPER=stepper_y CURRENT=1.0
G4 P1000

# Set Motion Parameters
SET_VELOCITY_LIMIT ACCEL=5000
SET_VELOCITY_LIMIT ACCEL=2500
SET_VELOCITY_LIMIT ACCEL_TO_DECEL=2500
SET_VELOCITY_LIMIT VELOCITY=200
SET_VELOCITY_LIMIT VELOCITY=150
SET_VELOCITY_LIMIT SQUARE_CORNER_VELOCITY=5
SET_PRESSURE_ADVANCE ADVANCE=0.05
M220 S50
M106 P0 S80
M106 P1 S0
M106 P2 S0

{% set tmp = printer['output_pin fan0'].value * 255 %}
SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=fan0_value VALUE={tmp}
{% if tmp - printer['gcode_macro PRINTER_PARAM'].fan0_min > (255 - printer['gcode_macro PRINTER_PARAM'].fan0_min) / 2 %}
{% set tmp = printer['gcode_macro PRINTER_PARAM'].fan0_min + (255 - printer['gcode_macro PRINTER_PARAM'].fan0_min) / 2 %}
SET_PIN PIN=fan0 VALUE={tmp}
{% endif %}

{% set tmp = printer['output_pin fan1'].value * 255 %}
SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=fan1_value VALUE={printer['output_pin fan1'].value * 255}
{% if tmp - printer['gcode_macro PRINTER_PARAM'].fan1_min > (255 - printer['gcode_macro PRINTER_PARAM'].fan1_min) / 2 %}
{% set tmp = printer['gcode_macro PRINTER_PARAM'].fan1_min + (255 - printer['gcode_macro PRINTER_PARAM'].fan1_min) / 2 %}
SET_PIN PIN=fan1 VALUE={tmp}
{% endif %}

{% set tmp = printer['output_pin fan2'].value * 255 %}
SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=fan2_value VALUE={printer['output_pin fan2'].value * 255}
{% if tmp - printer['gcode_macro PRINTER_PARAM'].fan2_min > (255 - printer['gcode_macro PRINTER_PARAM'].fan2_min) / 2 %}
{% set tmp = printer['gcode_macro PRINTER_PARAM'].fan2_min + (255 - printer['gcode_macro PRINTER_PARAM'].fan2_min) / 2 %}
SET_PIN PIN=fan2 VALUE={tmp}
{% endif %}

SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=flag VALUE=1
SET_QMODE_FLAG FLAG=1
{% endif %}
{% endif %}

Expand All @@ -126,31 +148,65 @@ gcode:
SET_VELOCITY_LIMIT SQUARE_CORNER_VELOCITY={printer['gcode_macro Qmode'].square_corner_velocity}
SET_PRESSURE_ADVANCE ADVANCE={printer['gcode_macro Qmode'].pressure_advance}
M220 S{printer['gcode_macro Qmode'].speed_factor * 100}
M106 P0 S{(printer['gcode_macro Qmode'].fan0_value * 255 + 0.5)|int}
M106 P1 S{(printer['gcode_macro Qmode'].fan1_value * 255 + 0.5)|int}
M106 P2 S{(printer['gcode_macro Qmode'].fan2_value * 255 + 0.5)|int}

{% set X_RUN_CUR = printer.configfile.settings['tmc2209 stepper_x'].run_current %}
{% set Y_RUN_CUR = printer.configfile.settings['tmc2209 stepper_y'].run_current %}
SET_TMC_CURRENT STEPPER=stepper_x CURRENT={X_RUN_CUR}
SET_TMC_CURRENT STEPPER=stepper_y CURRENT={Y_RUN_CUR}
SET_TMC_FIELD STEPPER=stepper_x FIELD=en_spreadcycle VALUE=1
SET_TMC_FIELD STEPPER=stepper_y FIELD=en_spreadcycle VALUE=1
G4 P1000

{% if printer['output_pin fan0'].value != 0 %}
{action_respond_info("fan0_value = %s" % printer['gcode_macro Qmode'].fan0_value)}
SET_PIN PIN=fan0 VALUE={printer['gcode_macro Qmode'].fan0_value}
SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=fan0_value VALUE=0
{% endif %}
{% if printer['output_pin fan1'].value != 0 %}
{action_respond_info("fan1_value = %s" % printer['gcode_macro Qmode'].fan1_value)}
SET_PIN PIN=fan1 VALUE={printer['gcode_macro Qmode'].fan1_value}
SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=fan1_value VALUE=0
{% endif %}
{% if printer['output_pin fan2'].value != 0 %}
{action_respond_info("fan2_value = %s" % printer['gcode_macro Qmode'].fan2_value)}
SET_PIN PIN=fan2 VALUE={printer['gcode_macro Qmode'].fan2_value}
SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=fan2_value VALUE=0
{% endif %}

SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=flag VALUE=0
SET_QMODE_FLAG FLAG=0
{% endif %}
{% endif %}

[gcode_macro M204]
rename_existing: M204.1
gcode:
{% if printer['gcode_macro Qmode'].flag|int == 0 %}
# {% if printer['gcode_macro Qmode'].flag|int == 0 %}
{% set get_params = "" %}
{% set qmode_max_accel = printer['gcode_macro Qmode'].max_accel|string %}
{% if 'S' in params|upper %}
{% set get_params = (get_params + ' ' + 'S' + params.S) %}
{% if printer['gcode_macro Qmode'].flag|int == 1 and params.S|float > qmode_max_accel|float %}
{% set get_params = (get_params + ' ' + 'S' + qmode_max_accel) %}
{% else %}
{% set get_params = (get_params + ' ' + 'S' + params.S) %}
{% endif %}
{% endif %}
{% if 'P' in params|upper %}
{% set get_params = (get_params + ' ' + 'P' + params.P) %}
{% if printer['gcode_macro Qmode'].flag|int == 1 and params.P|float > qmode_max_accel|float %}
{% set get_params = (get_params + ' ' + 'P' + qmode_max_accel) %}
{% else %}
{% set get_params = (get_params + ' ' + 'P' + params.P) %}
{% endif %}
{% endif %}
{% if 'T' in params|upper %}
{% set get_params = (get_params + ' ' + 'T' + params.T) %}
{% if printer['gcode_macro Qmode'].flag|int == 1 and params.T|float > qmode_max_accel|float %}
{% set get_params = (get_params + ' ' + 'T' + qmode_max_accel) %}
{% else %}
{% set get_params = (get_params + ' ' + 'T' + params.T) %}
{% endif %}
{% endif %}
M204.1 {get_params}
{% endif %}
# {% endif %}

[gcode_macro M205]
gcode:
Expand Down Expand Up @@ -178,13 +234,43 @@ gcode:
{% endif %}
{% if tmp > 0 %}
{% if fan == 0 %}
{% set value = printer["gcode_macro PRINTER_PARAM"].fan0_min + (255 - printer["gcode_macro PRINTER_PARAM"].fan0_min) / 255 * tmp %}
{% set value = (255 - printer["gcode_macro PRINTER_PARAM"].fan0_min) / 255 * tmp %}
{% if printer['gcode_macro Qmode'].flag | int == 1 %}
SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=fan0_value VALUE={printer["gcode_macro PRINTER_PARAM"].fan0_min + value}
{% if value > (255 - printer['gcode_macro PRINTER_PARAM'].fan0_min) / 2 %}
{% set value = printer["gcode_macro PRINTER_PARAM"].fan0_min + (255 - printer['gcode_macro PRINTER_PARAM'].fan0_min) / 2 %}
{% else %}
{% set value = printer["gcode_macro PRINTER_PARAM"].fan0_min + value %}
{% endif %}
{% else %}
{% set value = printer["gcode_macro PRINTER_PARAM"].fan0_min + value %}
{% endif %}
{% endif %}
{% if fan == 1 %}
{% set value = printer["gcode_macro PRINTER_PARAM"].fan1_min + (255 - printer["gcode_macro PRINTER_PARAM"].fan1_min) / 255 * tmp %}
{% set value = (255 - printer["gcode_macro PRINTER_PARAM"].fan1_min) / 255 * tmp %}
{% if printer['gcode_macro Qmode'].flag | int == 1 %}
SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=fan1_value VALUE={printer["gcode_macro PRINTER_PARAM"].fan1_min + value}
{% if value > (255 - printer['gcode_macro PRINTER_PARAM'].fan1_min) / 2 %}
{% set value = printer["gcode_macro PRINTER_PARAM"].fan1_min + (255 - printer['gcode_macro PRINTER_PARAM'].fan1_min) / 2 %}
{% else %}
{% set value = printer["gcode_macro PRINTER_PARAM"].fan1_min + value %}
{% endif %}
{% else %}
{% set value = printer["gcode_macro PRINTER_PARAM"].fan1_min + value %}
{% endif %}
{% endif %}
{% if fan == 2 %}
{% set value = printer["gcode_macro PRINTER_PARAM"].fan2_min + (255 - printer["gcode_macro PRINTER_PARAM"].fan2_min) / 255 * tmp %}
{% set value = (255 - printer["gcode_macro PRINTER_PARAM"].fan2_min) / 255 * tmp %}
{% if printer['gcode_macro Qmode'].flag | int == 1 %}
SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=fan2_value VALUE={printer["gcode_macro PRINTER_PARAM"].fan2_min + value}
{% if value > (255 - printer['gcode_macro PRINTER_PARAM'].fan2_min) / 2 %}
{% set value = printer["gcode_macro PRINTER_PARAM"].fan2_min + (255 - printer['gcode_macro PRINTER_PARAM'].fan2_min) / 2 %}
{% else %}
{% set value = printer["gcode_macro PRINTER_PARAM"].fan2_min + value %}
{% endif %}
{% else %}
{% set value = printer["gcode_macro PRINTER_PARAM"].fan2_min + value %}
{% endif %}
{% endif %}
{% endif %}
{% if value >= 255 %}
Expand All @@ -206,6 +292,11 @@ gcode:
SET_PIN PIN=fan2 VALUE=0
{% endif %}

[gcode_macro M141]
description: Set Chamber temperature with slicers
gcode:
SET_TEMPERATURE_FAN_TARGET TEMPERATURE_FAN=chamber_fan TARGET={params.S|default(35)}

[gcode_macro M900]
gcode:
{% if 'K' in params %}
Expand All @@ -221,21 +312,21 @@ gcode:
gcode:
{% set cur_temp = printer.extruder.temperature %}
{% if cur_temp|int < 40 %}
{action_respond_info("end_temp!\n")}
WAIT_TEMP_END
{% else %}
{action_respond_info("cur_temp = %s \n" % (cur_temp))}
UPDATE_DELAYED_GCODE ID=wait_temp DURATION=5
{% endif %}

[gcode_macro WAIT_TEMP_START]
gcode:
{action_respond_info("wait temp start\n")}
UPDATE_DELAYED_GCODE ID=wait_temp DURATION=1
M106 P0 S255
# M106 P2 S255

[gcode_macro WAIT_TEMP_END]
gcode:
{action_respond_info("wait temp end\n")}
UPDATE_DELAYED_GCODE ID=wait_temp DURATION=0
M106 P0 S0
# M106 P2 S0
Expand Down Expand Up @@ -356,10 +447,11 @@ gcode:

[gcode_macro END_PRINT]
gcode:
# Qmode_exit
Qmode_exit
EXCLUDE_OBJECT_RESET
PRINT_PREPARE_CLEAR
M220 S100
M204 S500
SET_VELOCITY_LIMIT ACCEL=5000 ACCEL_TO_DECEL=2500
TURN_OFF_HEATERS
M107 P1
M107 P2
Expand Down
23 changes: 21 additions & 2 deletions config/K1_CR4CU220812S12/printer.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# K1
# Printer_size: 220x220x250
# Version: v1.0.23
# Version: v1.0.25
# CreateDate: 2023/03/21
# Nozzle_mcu: chip: GD32F303CBT6
# version: CR-K1-MAX-NOZZLE-V1.0.0
Expand Down Expand Up @@ -62,6 +62,25 @@ sensor_pin: PC5
min_temp: 0
max_temp: 125

[duplicate_pin_override]
pins: PC0, PC5

[temperature_fan chamber_fan]
pin: PC0
cycle_time: 0.0100
hardware_pwm: false
max_power: 1
shutdown_speed: 0
sensor_type: EPCOS 100K B57560G104F
sensor_pin: PC5
min_temp: 0
max_temp: 70
control: watermark
max_delta: 2
target_temp: 35.0
max_speed: 1.0
min_speed: 0.0

[stepper_x]
step_pin: PC2
dir_pin: !PB9
Expand Down Expand Up @@ -195,7 +214,7 @@ control: watermark
# pid_ki: 0.08
# pid_kd: 0
min_temp: 0
max_temp: 120
max_temp: 115

[filament_switch_sensor filament_sensor]
pause_on_runout: true
Expand Down

0 comments on commit b003d41

Please sign in to comment.