-
Notifications
You must be signed in to change notification settings - Fork 1
/
printer-max3_probe.cfg
965 lines (780 loc) · 23.9 KB
/
printer-max3_probe.cfg
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
#MAX3
#V4.3.11
# This file contains common pin mappings for MKS SKIPR
# boards. To use this config, the firmware should be compiled for the
# stm32f407. When running "make menuconfig", select the 48KiB
# bootloader, and enable "Serial for communication" and select the "on USART1 PA10/PA9"
# The "make flash" command does not work on the MKS SKIPR. Instead,
# after running "make", copy the generated "out/klipper.bin" file to a
# file named "mks_skipr.bin" on an SD card and then restart the
# MKS SKIPR with that SD card.
# This file contains common pin mappings for MKS SKIPR
# boards. To use this config, the firmware should be compiled for the
# stm32f407. When running "make menuconfig", select the 48KiB
# bootloader, and enable "Serial for communication" and select the "on USART1 PA10/PA9"
# The "make flash" command does not work on the MKS SKIPR. Instead,
# after running "make", copy the generated "out/klipper.bin" file to a
# file named "mks_skipr.bin" on an SD card and then restart the
# MKS SKIPR with that SD card.
# See docs/Config_Reference.md for a description of parameters.
[include MKS_THR.cfg]
[include Adaptive_Mesh.cfg]
[mcu]
# The hardware use USART1 PA10/PA9 connect to RK3328
#serial: /dev/serial/by-id/usb-Klipper_stm32f407xx_4D0045001850314335393520-if00
serial: /dev/ttyS0
restart_method: command
#[mcu MKS_THR]
#serial:/dev/serial/by-id/usb-Klipper_rp2040_D5CE4D9543D14858-if00
#canbus_uuid: 11aa22bb33cc
#####################################################################
# 冷却风扇
#####################################################################
[extruder]
step_pin: MKS_THR:gpio5
dir_pin: MKS_THR:gpio4
enable_pin: !MKS_THR:gpio10
rotation_distance: 53.5 #22.6789511 #Bondtech 5mm Drive Gears
gear_ratio: 1628:170
microsteps: 16
full_steps_per_rotation: 200 #200 for 1.8 degree, 400 for 0.9 degree
nozzle_diameter: 0.400
filament_diameter: 1.75
min_temp: 0
max_temp: 360
min_extrude_temp: 170
smooth_time: 0.000001
heater_pin: MKS_THR:gpio0
sensor_type:MAX6675
# One of "MAX6675", "MAX31855", "MAX31856", or "MAX31865".
# One of "MAX6675", "MAX31855", "MAX31856", or "MAX31865".
sensor_pin:MKS_THR:gpio17
# The chip select line for the sensor chip. This parameter must be
# provided.
spi_speed: 100000
# The SPI speed (in hz) to use when communicating with the chip.
# The default is 4000000.
#spi_bus:spi1
spi_software_sclk_pin:MKS_THR:gpio18
spi_software_mosi_pin:MKS_THR:gpio19
spi_software_miso_pin:MKS_THR:gpio16
# See the "common SPI settings" section for a description of the
# above parameters.
#tc_type: K
#tc_use_50Hz_filter: False
#c_averaging_count: 1
# The above parameters control the sensor parameters of MAX31856
# chips. The defaults for each parameter are next to the parameter
# name in the above list.
max_power: 1.0
control : pid
pid_Kp=14.734
pid_Ki=6.549
pid_Kd=8.288
pressure_advance: 0.032
pressure_advance_smooth_time: 0.03
max_extrude_cross_section:500
instantaneous_corner_velocity: 10.000
max_extrude_only_distance: 120.0
max_extrude_only_velocity:5000
max_extrude_only_accel:2000
step_pulse_duration:0.000002
[tmc2209 extruder]
uart_pin: MKS_THR:gpio6
interpolate: True
run_current: 0.714
#hold_current: 0.5
#sense_resistor: 0.110
stealthchop_threshold: 0
[adxl345]
cs_pin: MKS_THR:gpio13
spi_software_sclk_pin: MKS_THR:gpio14
spi_software_mosi_pin: MKS_THR:gpio15
spi_software_miso_pin: MKS_THR:gpio12
axes_map: -x, z, -y
[printer]
kinematics:corexy
max_velocity: 600
max_accel: 20000
max_accel_to_decel: 10000
max_z_velocity: 20
max_z_accel: 500
square_corner_velocity: 8
##移动配置============================================================================================================
[force_move]
enable_force_move : True
[gcode_macro M84]
rename_existing:M84.1
gcode:
SET_STEPPER_ENABLE STEPPER=stepper_x enable=0
SET_STEPPER_ENABLE STEPPER=stepper_y enable=0
SET_STEPPER_ENABLE STEPPER=stepper_z enable=0
SET_STEPPER_ENABLE STEPPER=extruder enable=0
SET_KINEMATIC_POSITION
[delayed_gcode KINEMATIC_POSITION]
initial_duration:0.2
gcode:
SET_KINEMATIC_POSITION X=150
SET_KINEMATIC_POSITION Y=150
SET_KINEMATIC_POSITION Z=150
SET_FILAMENT_SENSOR SENSOR=fila ENABLE=0
[stepper_x]
step_pin:PB4
dir_pin:PB3
enable_pin:!PB5
microsteps:16
rotation_distance: 39.94
full_steps_per_rotation:200 #set to 400 for 0.9 degree stepper
endstop_pin:tmc2209_stepper_x:virtual_endstop
position_min: -7
position_endstop:-7
position_max:325
homing_speed:40
homing_retract_dist:0
homing_positive_dir:False
step_pulse_duration:0.000002
[stepper_y]
step_pin:PC14
dir_pin:PC13
enable_pin:!PC15
microsteps: 16
rotation_distance: 39.94
full_steps_per_rotation:200 #set to 400 for 0.9 degree stepper
endstop_pin:tmc2209_stepper_y:virtual_endstop
position_min: -9.5
position_endstop: -9.5
position_max: 325
homing_speed:40
homing_retract_dist:0
homing_positive_dir:False
step_pulse_duration:0.000002
[stepper_z]
step_pin:PC10
dir_pin:PA15
enable_pin: !PC11
microsteps: 16
rotation_distance: 8
full_steps_per_rotation: 200
endstop_pin:probe:z_virtual_endstop#!PC3 #for Z-max; endstop have'!' is NO
#position_endstop:326
position_max:325
position_min: -6
homing_speed: 8
homing_retract_dist: 8.0
second_homing_speed: 8
homing_positive_dir:false
step_pulse_duration:0.000002
[tmc2209 stepper_x]
uart_pin: PD2
run_current:1.07
#hold_current: 0.5
interpolate: True
stealthchop_threshold: 0
diag_pin:^PB8
driver_SGTHRS: 85
#driver_SGTHRS: 130
[tmc2209 stepper_y]
uart_pin: PB9
run_current: 1.07
#hold_current: 0.5
interpolate: True
stealthchop_threshold: 0
diag_pin:^PC0
driver_SGTHRS: 85
#driver_SGTHRS: 145
#[tmc2240 stepper_y]
#cs_pin:PB9
#spi_software_sclk_pin:PA5
#spi_software_mosi_pin:PA7
#spi_software_miso_pin:PA6
#spi_speed:200000
#run_current: 1.07
#hold_current: 0.5
#sense_resistor: 0.110
#interpolate:true
#stealthchop_threshold:1
#diag0_pin:!PC0
#driver_SGT:1
#[tmc2240 stepper_x]
#cs_pin:PD2
#spi_software_sclk_pin:PA5
#spi_software_mosi_pin:PA7
#spi_software_miso_pin:PA6
#spi_speed:200000
#run_current: 1.07
#hold_current: 0.5
#sense_resistor: 0.110
#interpolate:true
#stealthchop_threshold:1
#diag0_pin:!PB8
#driver_SGT:1
[tmc2209 stepper_z]
uart_pin: PC5
run_current: 0.95
#hold_current: 0.6
interpolate: True
stealthchop_threshold: 1200
##归零流程修改
[homing_override]
set_position_X:0
set_position_y:0
set_position_z:0
axes:xy
gcode:
{% set HOME_CUR = 1 %}
{% set driver_config = printer.configfile.settings['tmc2209 stepper_x'] %}
{% set RUN_CUR = driver_config.run_current %}
{% set HOLD_CUR = driver_config.hold_current %}
{% if params.X is defined %}
SET_TMC_CURRENT STEPPER=stepper_x CURRENT={HOME_CUR * 0.8}
G28 X
SET_TMC_CURRENT STEPPER=stepper_x CURRENT={HOME_CUR}
BEEP I=1 DUR=100
G1 X10 F1200
{% endif %}
{% if params.Y is defined %}
SET_TMC_CURRENT STEPPER=stepper_y CURRENT={HOME_CUR * 0.9}
G28 Y
SET_TMC_CURRENT STEPPER=stepper_y CURRENT={HOME_CUR}
BEEP I=1 DUR=100
G1 Y10 F1200
{% endif %}
{% if params.Z is defined %}
# G90
# G1 X{printer.toolhead.axis_maximum.x/2 - printer.probe["x_offset"]} Y{printer.toolhead.axis_maximum.y/2 - printer.probe["y_offset"]} F7800
# G91
G28 Z
G1 Z20 F480
BEEP I=1 DUR=100
{% endif %}
{% if params.X is undefined %}
{% if params.Y is undefined %}
{% if params.Z is undefined %}
G91
# G1 Z5 F600
G1 X10 F2400
G1 Y10 F2400
G4 P2000
SET_TMC_CURRENT STEPPER=stepper_x CURRENT={HOME_CUR * 0.8}
G28 X
SET_TMC_CURRENT STEPPER=stepper_x CURRENT={HOME_CUR}
BEEP I=1 DUR=100
G1 X10 F1200
SET_TMC_CURRENT STEPPER=stepper_y CURRENT={HOME_CUR * 0.9}
G28 Y
SET_TMC_CURRENT STEPPER=stepper_y CURRENT={HOME_CUR}
BEEP I=1 DUR=100
G90
G1 X{printer.toolhead.axis_maximum.x/2 - printer.probe["x_offset"]} Y{printer.toolhead.axis_maximum.y/2 - printer.probe["y_offset"]} F7800
G91
G28 Z
BEEP I=1 DUR=100
G1 Z50 F480
{% endif %}
{% endif %}
{% endif %}
SET_TMC_CURRENT STEPPER=stepper_x CURRENT={RUN_CUR}
SET_TMC_CURRENT STEPPER=stepper_y CURRENT={RUN_CUR}
M204 S10000
G90
# G1 X0 Y0 F7800
##热床热腔==================================================================================================================
[heater_bed]
heater_pin:PC8
sensor_type: NTC 100K MGB18-104F39050L32
sensor_pin: PA0
max_power: 1.0
control = pid
pid_kp = 71.039
pid_ki = 2.223
pid_kd = 567.421
min_temp: -100
max_temp: 125
[heater_generic hot]
#gcode_id:
# 使用M105查询温度时使用的ID。
# 必须提供此参数。
heater_pin:PB10
max_power:1.0
sensor_type:NTC 100K MGB18-104F39050L32
sensor_pin:PA1
control = watermark
max_delta: 1.0
#pid_Kp=63.418
#pid_Ki=1.342
#pid_Kd=749.125
min_temp:-100
max_temp:70
[verify_heater hot]
max_error: 300
check_gain_time:480
hysteresis: 5
heating_gain: 1
[verify_heater extruder]
max_error: 120
check_gain_time:20
hysteresis: 5
heating_gain: 1
[verify_heater heater_bed]
max_error: 200
check_gain_time:60
hysteresis: 5
heating_gain: 1
##一些引脚定义======================================
##主板上大涡轮风扇
[output_pin fan2]
pin: PA8
pwm: True
cycle_time: 0.0100
hardware_pwm: false
value: 0.00
scale: 255
shutdown_value: 0.0
##喷头喉管风扇 50度自启动
#[heater_fan my_nozzle_fan1]
#pin:PC9
#max_power:1
#shutdown_speed:1
#cycle_time:0.05
#kick_start_time:0.05
#off_below:0
#heater:extruder
#heater_temp:50.0
##活性炭吹风扇
[output_pin fan3]
pin:PC9
pwm: True
cycle_time: 0.0100
hardware_pwm: false
value: 0.0
scale: 255
shutdown_value: 0.0
## FAN0 喉管风扇
[heater_fan hotend_fan]
pin:MKS_THR:gpio1
max_power: 1.0
kick_start_time: 0.5
heater: extruder
heater_temp: 50.0
fan_speed: 1.0
off_below: 0
[heater_fan hotend_fan2]
pin:MKS_THR:gpio20
max_power: 1.0
kick_start_time: 0.5
heater: extruder
heater_temp: 50.0
fan_speed: 1.0
off_below: 0
[heater_fan borad_fan]
pin:PC4
max_power: 1.0
kick_start_time: 0.5
heater: extruder
heater_temp: 50.0
fan_speed: 1.0
off_below: 0
## FAN0 吹模型风扇
[output_pin fan0]
pin: MKS_THR:gpio2
pwm: True
cycle_time: 0.0100
hardware_pwm: false
value: 0
scale: 255
shutdown_value: 0.0
##LED 灯
[output_pin caselight]
## Chamber Lighting - In 5V-RGB Position
pin: PC7
pwm: false
shutdown_value:0
value:1
#cycle_time:0.01
[output_pin beeper]
## Chamber Lighting - In 5V-RGB Position
pin: PA2
pwm: false
shutdown_value:0
value:0
[output_pin pwc]
pin: PA3
pwm: False
value: 1
shutdown_value: 1
##宏定义================================================================
[filament_switch_sensor fila]
pause_on_runout: True
runout_gcode:
PAUSE
SET_FILAMENT_SENSOR SENSOR=fila ENABLE=1
event_delay: 3.0
pause_delay: 0.5
switch_pin: !PC1
[bed_mesh]
speed:150 #调平速度
horizontal_move_z:10 #调平中Z抬高高度
mesh_min:25,10 #探测点最小位置
mesh_max:315,315 #探测点最大位置
probe_count:9,9 #调平点数
algorithm:bicubic
bicubic_tension:0.2
mesh_pps: 4, 4
#[bltouch]
#sensor_pin:^MKS_THR:gpio21
#control_pin:MKS_THR:gpio11
#stow_on_each_sample: False
[probe]
pin: ^!MKS_THR:gpio21
x_offset: 28
y_offset: 4.4
z_offset: 0.0
speed: 5
samples: 2
samples_result: average
sample_retract_dist: 3.0
samples_tolerance: 0.08
samples_tolerance_retries:3
#[gcode_macro G30]
# G28
# G1 X100 Y130 Z10
# PROBE_CALIBRATE
[resonance_tester]
accel_chip:adxl345
probe_points:
160, 160, 10 # an example
[gcode_macro SHAPER_CALIBRATE]
rename_existing: RESHAPER_CALIBRATE
gcode:
RESHAPER_CALIBRATE FREQ_START=30 FREQ_END=150
[gcode_macro HOT_CALIBRATE_START]
variable_k: 0
gcode:
{% if k == 0 %}
{% if printer['heater_generic hot'].temperature > 49 %}
SET_GCODE_VARIABLE MACRO=HOT_CALIBRATE_END VARIABLE=hot_set VALUE=1
SET_GCODE_OFFSET Z_ADJUST=-0.10 MOVE=0
SET_GCODE_VARIABLE MACRO=HOT_CALIBRATE_START VARIABLE=k VALUE=1
{% endif %}
{% endif %}
[gcode_macro HOT_CALIBRATE_END]
variable_hot_set: 0
gcode:
{% if hot_set == 1 %}
SET_GCODE_VARIABLE MACRO=HOT_CALIBRATE_END VARIABLE=hot_set VALUE=0
SET_GCODE_OFFSET Z_ADJUST=+0.10 MOVE=0
SET_GCODE_VARIABLE MACRO=HOT_CALIBRATE_START VARIABLE=k VALUE=0
{% endif %}
[gcode_macro PRINT_START]
gcode:
#HOT_CALIBRATE_START
[gcode_macro PRINT_START_QD]
gcode:
#HOT_CALIBRATE_START
[gcode_macro CANCEL_PRINT]
rename_existing: BASE_CANCEL_PRINT
gcode:
{% if (printer.gcode_move.position.z) < 200 %} ; check that zhop doesn't exceed z max
G1 Z200 F600
{% endif %}
G1 X0 Y0 F12000
SDCARD_RESET_FILE
PRINT_END
BASE_CANCEL_PRINT
[gcode_macro PRINT_END]
gcode:
M106 P2 S0
M106 P0 S0
M106 P3 S0 #关闭活性炭风扇
M104 S0
M140 S0
M141 S0
M220 S100
M221 S100
SET_IDLE_TIMEOUT TIMEOUT={printer.configfile.settings.idle_timeout.timeout} ; set timeout back to configured value
CLEAR_PAUSE
SET_FILAMENT_SENSOR SENSOR=fila ENABLE=0
M84
# SET_STEPPER_ENABLE STEPPER=stepper_x enable=0
# SET_STEPPER_ENABLE STEPPER=stepper_y enable=0
# SET_STEPPER_ENABLE STEPPER=stepper_z enable=1
# SET_STEPPER_ENABLE STEPPER=extruder enable=0
BED_MESH_CLEAR #恢复调平数据
BED_MESH_PROFILE LOAD=default
G31
BEEP I=2 DUR=500
[gcode_macro PAUSE]
rename_existing: BASE_PAUSE
gcode:
# Parameters
{% set z = params.Z|default(50)|int %} ; z hop amount
{% if printer['pause_resume'].is_paused|int == 0 %}
SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=zhop VALUE={z} ; set z hop variable for reference in resume macro
SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=etemp VALUE={printer['extruder'].target} ; set hotend temp variable for reference in resume macro
# SET_FILAMENT_SENSOR SENSOR=fila ENABLE=0 ; disable filament sensor
SAVE_GCODE_STATE NAME=PAUSE ; save current print position for resume
BASE_PAUSE ; pause print
{% if (printer.gcode_move.position.z + z) < printer.toolhead.axis_maximum.z %} ; check that zhop doesn't exceed z max
G91 ; relative positioning
G1 Z{z} F600 ; raise Z up by z hop amount
{% else %}
# { action_respond_info("Pause zhop exceeds maximum Z height.") } ; if z max is exceeded, show message and set zhop value for resume to 0
SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=zhop VALUE=0
{% endif %}
SAVE_GCODE_STATE NAME=PAUSEPARK2
G90 ; absolute positioning
G1 X{printer.toolhead.axis_maximum.x/2} Y{printer.toolhead.axis_maximum.y} F6000 ; park toolhead at front center
SAVE_GCODE_STATE NAME=PAUSEPARK ; save parked position in case toolhead is moved during the pause (otherwise the return zhop can error)
M104 S0 ; turn off hotend
SET_IDLE_TIMEOUT TIMEOUT=86400 ; set timeout to 12 hours
SET_STEPPER_ENABLE STEPPER=extruder enable=0
{% endif %}
[gcode_macro RESUME]
rename_existing: BASE_RESUME
variable_zhop: 0
variable_etemp: 0
gcode:
# Parameters
{% set e = params.E|default(2.5)|int %} ; hotend prime amount (in mm)
{% if printer['pause_resume'].is_paused|int == 1 %}
# SET_FILAMENT_SENSOR SENSOR=fila ENABLE=1 ; enable filament sensor
#INITIAL_RGB ; reset LCD color
SET_IDLE_TIMEOUT TIMEOUT={printer.configfile.settings.idle_timeout.timeout} ; set timeout back to configured value
{% if etemp > 0 %}
M109 S{etemp|int} ; wait for hotend to heat back up
{% endif %}
RESTORE_GCODE_STATE NAME=PAUSEPARK MOVE=1 MOVE_SPEED=150 ; go back to parked position in case toolhead was moved during pause (otherwise the return zhop can error)
G91 ; relative positioning
M83 ; relative extruder positioning
{% if printer[printer.toolhead.extruder].temperature >= printer.configfile.settings.extruder.min_extrude_temp %}
G1 E{e} F900 ; prime nozzle by E, lower Z back down
# {% else %}
# G1 Z{zhop * -1} F900 ; lower Z back down without priming (just in case we are testing the macro with cold hotend)
{% endif %}
RESTORE_GCODE_STATE NAME=PAUSEPARK2 MOVE=1 MOVE_SPEED=150
RESTORE_GCODE_STATE NAME=PAUSE MOVE=1 MOVE_SPEED=10 ; restore position
BASE_RESUME ; resume print
{% endif %}
[pause_resume]
[display_status]
[gcode_macro BEEP]
gcode:
# Parameters
{% set i = params.I|default(1)|int %} ; Iterations (number of times to beep).
{% set dur = params.DUR|default(100)|int %} ; Duration/wait of each beep in ms. Default 100ms.
{% if printer["output_pin sound"].value|int == 1 %}
{% for iteration in range(i|int) %}
SET_PIN PIN=beeper VALUE=1
G4 P{dur}
SET_PIN PIN=beeper VALUE=0
G4 P{dur}
{% endfor %}
{% endif %}
#[gcode_macro _CG28]
#gcode:
# {% if "xyz" not in printer.toolhead.homed_axes %}
# G28
# {% endif %}
[gcode_macro G30]
gcode:
BED_MESH_CLEAR #清除调平数据
# G28
BED_MESH_CALIBRATE mesh_min=10,10 mesh_max=310,310 METHOD=manual #手动动调平
[gcode_macro M141]
gcode:
{% set s = params.S|float %}
SET_HEATER_TEMPERATURE HEATER=hot TARGET={([s, 65]|min)}
[gcode_macro M191]
gcode:
#Parameters
{% set s = params.S|float %}
M141 {% for p in params %}{'%s%s' % (p, params[p])}{% endfor %}
{% if s != 0 %}
TEMPERATURE_WAIT SENSOR="heater_generic hot" MINIMUM={([s, 65]|min)} #MAXIMUM={s+1}
{% endif %}
[gcode_macro M106]
gcode:
{% if params.P is defined %}
{% if params.S is defined %}
SET_PIN PIN=fan{params.P|int} VALUE={params.S|int}
{% else %}
SET_PIN PIN=fan{params.P|int} VALUE=255
{% endif %}
{% endif %}
{% if params.T is defined %}
{% if (params.T|int)==-2 %}
{% if params.S is defined %}
SET_PIN PIN=fan3 VALUE={params.S|int}
{% else %}
SET_PIN PIN=fan3 VALUE=255
{% endif %}
{% endif %}
{% endif %}
{% if params.P is undefined %}
{% if params.T is undefined %}
{% if params.S is defined %}
SET_PIN PIN=fan0 VALUE={params.S|int}
{% else %}
SET_PIN PIN=fan0 VALUE=255
{% endif %}
{% endif %}
{% endif %}
[gcode_macro M107]
gcode:
SET_PIN PIN=fan0 VALUE=0
# SET_PIN PIN=fan1 VALUE=0
# SET_PIN PIN=fan2 VALUE=0
[gcode_macro M303]
gcode:
{% if params.E is defined %}
{% if params.S is defined %}
{% if (params.E|int)==-1 %}
PID_CALIBRATE HEATER=heater_bed TARGET={params.S|int}
{% endif %}
{% if (params.E|int)==0 %}
PID_CALIBRATE HEATER=extruder TARGET={params.S|int}
{% endif %}
{% endif %}
{% endif %}
[gcode_macro M8029]
gcode:
{% if params.D is defined %}
{% if (params.D|int)==1 %}
SET_FILAMENT_SENSOR SENSOR=fila ENABLE=1
{% endif %}
{% if (params.D|int)==0 %}
SET_FILAMENT_SENSOR SENSOR=fila ENABLE=0
{% endif %}
{% endif %}
[gcode_macro M900]
gcode:
{% if params.K is defined %}
SET_PRESSURE_ADVANCE ADVANCE={params.K}
{% endif %}
{% if params.T is defined %}
SET_PRESSURE_ADVANCE SMOOTH_TIME={params.T}
{% endif %}
[gcode_macro M290]
gcode:
SET_GCODE_OFFSET Z_ADJUST={params.Z}
[gcode_macro M901]
gcode:
# M104 S140
G28
SHAPER_CALIBRATE
SAVE_CONFIG
[gcode_macro M0]
gcode:
PAUSE
[gcode_macro M25]
rename_existing: M9925
gcode:
PAUSE
[output_pin sound]
pin: PA13
value:0
[gcode_macro beep_on]
gcode:
SET_PIN PIN=sound VALUE=1
[gcode_macro beep_off]
gcode:
SET_PIN PIN=sound VALUE=0
[gcode_arcs]
resolution: 1.0
[gcode_macro M109]
rename_existing: M99109
gcode:
#Parameters
{% set s = params.S|float %}
M104 {% for p in params %}{'%s%s' % (p, params[p])}{% endfor %} ; Set hotend temp
{% if s != 0 %}
TEMPERATURE_WAIT SENSOR=extruder MINIMUM={s} MAXIMUM={s+1} ; Wait for hotend temp (within 1 degree)
{% endif %}
[gcode_macro M4029]
gcode:
BED_MESH_CLEAR
G91
G1 Z10 F600
G90
G28
G1 X{printer.toolhead.axis_maximum.x/2 - printer.probe["x_offset"]} Y{printer.toolhead.axis_maximum.y/2 - printer.probe["y_offset"]} F7800
G1 Z15 F600
ABORT
PROBE_CALIBRATE
ABORT
G0 Z0
[gcode_macro M603]
description: filament unlode
gcode:
G92 E0
G0 E15 F400
G4 P1000
G92 E0
G1 E-80 F800
[gcode_macro M604]
description: filament lode
gcode:
M83
G1 E80 F400
#####################################新增KAMP调平
[exclude_object]
[gcode_macro G31]
gcode:
SET_GCODE_VARIABLE MACRO=G29 VARIABLE=k VALUE=1
[gcode_macro G32]
gcode:
SET_GCODE_VARIABLE MACRO=G29 VARIABLE=k VALUE=0
[gcode_macro G29]
variable_k:1
gcode:
{% if k|int==1 %}
BED_MESH_CLEAR #清除调平数据
# G28
BED_MESH_CALIBRATE PROFILE=kamp #自动调平
{% endif %}
[gcode_macro M204]
rename_existing: M99204
gcode:
{% if params.S is defined %}
{% set s = params.S|float %}
{% endif %}
{% if params.P is defined %}
{% if params.T is defined %}
{% set s = [params.P|float ,params.T|float] | min %}
{% endif %}
{% endif %}
SET_VELOCITY_LIMIT ACCEL={s}
SET_VELOCITY_LIMIT ACCEL_TO_DECEL={s/2}
[idle_timeout]
timeout: 86400
#[x_twist_compensation]
#speed: 150
# The speed (in mm/s) of non-probing moves during the calibration.
# The default is 50.
#horizontal_move_z: 10
# The height (in mm) that the head should be commanded to move to
# just prior to starting a probe operation. The default is 5.
#start_x: 15
# Defines the minimum X coordinate of the calibration
# This should be the X coordinate that positions the nozzle at the starting
# calibration position. This parameter must be provided.
#end_x: 260
# Defines the maximum X coordinate of the calibration
# This should be the X coordinate that positions the nozzle at the ending
# calibration position. This parameter must be provided.
#y: 140
# Defines the Y coordinate of the calibration
# This should be the Y coordinate that positions the nozzle during the
# calibration process. This parameter must be provided and is recommended to
# be near the center of the bed
[gcode_macro M1029]
gcode:
# X_TWIST_PROFILE_LOAD NAME=default
# X_TWIST_COMPENSATE_MESH MESH_NAME=default COMPENSATION_NAME=default
# SAVE_CONFIG
[virtual_sdcard]
#path:/home/mks/uploads
path: ~/gcode_files
#*# <---------------------- SAVE_CONFIG ---------------------->
#*# DO NOT EDIT THIS BLOCK OR BELOW. The contents are auto-generated.
#*#