-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprinter.cfg
More file actions
884 lines (790 loc) · 26.1 KB
/
printer.cfg
File metadata and controls
884 lines (790 loc) · 26.1 KB
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
# This file contains common pin mappings for the BIGTREETECH SKR mini
# E3 v1.2. To use this config, the firmware should be compiled for the
# STM32F103 with a "28KiB bootloader". Also, select "Enable extra
# low-level configuration options" and configure "GPIO pins to set at
# micro-controller startup" to "!PC13".
# The "make flash" command does not work on the SKR mini E3. Instead,
# after running "make", copy the generated "out/klipper.bin" file to a
# file named "firmware.bin" on an SD card and then restart the SKR
# mini E3 with that SD card.
[stepper_x]
step_pin: PB13
dir_pin: !PB12
enable_pin: !PB14
microsteps: 32
rotation_distance: 40
endstop_pin: tmc2209_stepper_x:virtual_endstop
position_min: -36
position_max: 255
position_endstop: -36
homing_speed: 80
homing_retract_dist: 0
[tmc2209 stepper_x]
uart_pin: PB15
diag_pin: PC0
run_current: 0.8
#stealthchop_threshold: 999999
#driver_SGTHRS: 90
interpolate: true
[autotune_tmc stepper_x]
motor: creality-42-40
sg4_thrs: 140
tuning_goal: silent
[stepper_y]
step_pin: PB10
dir_pin: !PB2
enable_pin: !PB11
microsteps: 32
rotation_distance: 40
endstop_pin: tmc2209_stepper_y:virtual_endstop
position_min: -54
position_max: 254
position_endstop: 254
homing_speed: 80
homing_retract_dist: 0
[tmc2209 stepper_y]
uart_pin: PC6
diag_pin: PC1
run_current: 0.8
#stealthchop_threshold: 999999
#driver_SGTHRS: 90
interpolate: true
[autotune_tmc stepper_y]
motor: creality-42-40
sg4_thrs: 140
tuning_goal: silent
[stepper_z]
step_pin: PB0
dir_pin: !PC5
enable_pin: !PB1
microsteps: 16
rotation_distance: 8
#endstop_pin: probe:z_virtual_endstop
#endstop_pin: PC14
endstop_pin: tmc2209_stepper_z:virtual_endstop
position_min: -0.5
position_max: 245
position_endstop: -0.5
homing_speed: 20
homing_retract_dist: 0
[tmc2209 stepper_z]
uart_pin: PC10
diag_pin: PC15
run_current: 1.2
stealthchop_threshold: 999999
driver_SGTHRS: 100
#interpolate: true
#[autotune_tmc stepper_z]
#motor: creality-42-34
#sg4_thrs: 100
[extruder]
step_pin: PB3
dir_pin: PB4
enable_pin: !PD2
microsteps: 16
rotation_distance: 22.598 #22.905740611 #22.6789511
full_steps_per_rotation: 200
gear_ratio: 50:10
nozzle_diameter: 0.600
filament_diameter: 1.750
heater_pin: PC8
sensor_type: ATC Semitec 104NT-4-R025H42G
sensor_pin: PA0
control = pid
pid_kp = 20.101
pid_ki = 1.441
pid_kd = 70.101
min_temp: -50
max_temp: 300
min_extrude_temp: 0
max_extrude_cross_section: 101
max_extrude_only_distance: 100
pressure_advance: 0.0288
pressure_advance_smooth_time: 0.040
[tmc2209 extruder]
uart_pin: PC11
interpolate: true
run_current: 0.850
hold_current: 0.100
sense_resistor: 0.11
stealthchop_threshold: 0 #999999
driver_TBL: 0
driver_HEND: 6
driver_HSTRT: 7
driver_TOFF: 4
#[autotune_tmc extruder]
#motor: usongshine-17hs4023
[verify_heater extruder]
max_error: 120
check_gain_time: 60
hysteresis: 5
heating_gain: 2
[heater_bed]
heater_pin: PC9
sensor_type: ATC Semitec 104GT-2
sensor_pin: PC3
control = pid
pid_kp = 73.716
pid_ki = 1.273
pid_kd = 1067.044
min_temp: 0
max_temp: 130
[fan]
pin: PA8
#kick_start_time: 0.800
#cycle_time: 0.010
cycle_time: 0.06
max_power: 0.5
[mcu]
serial: /dev/ttyAMA0
baud: 250000
restart_method: command
[mcu rpi]
serial: /tmp/klipper_host_mcu
[mcu eddy]
serial: /dev/serial/by-id/usb-Klipper_rp2040_455035712912AB78-if00
restart_method: command
[printer]
kinematics: corexy
max_velocity: 550
max_accel: 10000
max_z_velocity: 30
max_z_accel: 100
[static_digital_output usb_pullup_enable]
pins: !PC13
[board_pins]
aliases:
# EXP1 header
EXP1_1=PB5, EXP1_3=PA9, EXP1_5=PA10, EXP1_7=PB8, EXP1_9=<GND>,
EXP1_2=PB6, EXP1_4=<RST>, EXP1_6=PB9, EXP1_8=PB7, EXP1_10=<5V>
[display]
lcd_type: st7920
cs_pin: EXP1_7
sclk_pin: EXP1_6
sid_pin: EXP1_8
encoder_pins: ^EXP1_5, ^EXP1_3
click_pin: ^!EXP1_2
[output_pin _BEEPER_pin]
pin: EXP1_1
pwm: True
value: 0
shutdown_value: 0
cycle_time: 0.001
#[bltouch]
#sensor_pin: ^PC2
#control_pin: PA1
#x_offset: 0
#y_offset: -30
#z_offset = 1.800
##pin_move_time: 0.4
#pin_up_touch_mode_reports_triggered: False
##pin_up_reports_not_triggered: False
##set_output_mode: 5V
#sample_retract_dist: 2.0
#speed: 50
#lift_speed: 50
#probe_with_touch_mode: True
#stow_on_each_sample: False
[temperature_sensor btt_eddy_mcu]
sensor_type: temperature_mcu # Sets the type of sensor for Klipper to read
sensor_mcu: eddy # Sets the MCU of the eddy probe tempereature sensor
min_temp: 10 # Sets the minimum tempereature for eddys tempereature sensor to operate
max_temp: 100 # Sets the maximum tempereature for eddys tempereature sensor to operate
[temperature_probe btt_eddy]
sensor_type: Generic 3950
sensor_pin: eddy:gpio26
horizontal_move_z: 2
[probe_eddy_current btt_eddy]
sensor_type: ldc1612
z_offset: 2
#i2c_address:
i2c_mcu: eddy
i2c_bus: i2c0f
x_offset: 14.5
y_offset: 35.5
#reg_drive_current = 15
[idle_timeout]
timeout: 1800
[bed_mesh]
speed: 200
horizontal_move_z: 3
mesh_min: 15,15
mesh_max: 220,215
probe_count: 12,12
algorithm: bicubic
mesh_pps: 3,3
#bicubic_tension: 0.4
#fade_start: 1
#fade_end: 10
#fade_target: 0
adaptive_margin: 10
[screws_tilt_adjust]
screw1: 15,-4
screw1_name: front left screw
screw2: 185,-4
screw2_name: front right screw
screw3: 185,166
screw3_name: rear right screw
screw4: 15,166
screw4_name: rear left screw
horizontal_move_z: 10
speed: 200
screw_thread: CW-M4
[adxl345]
cs_pin: rpi:None
[resonance_tester]
accel_chip: adxl345
probe_points: 116,76,20 #belts middle'ish
[input_shaper]
shaper_freq_x: 53.8
shaper_type_x: zv
shaper_freq_y: 46.8
shaper_type_y: mzv
[gcode_arcs]
resolution: 0.6
[force_move]
enable_force_move: true
[temperature_sensor raspberry_pi]
sensor_type: temperature_host
min_temp: 10
max_temp: 100
[temperature_sensor mcu]
sensor_type: temperature_mcu
min_temp: 0
max_temp: 100
[pause_resume]
[display_status]
[exclude_object]
[virtual_sdcard]
path: /home/pi/printer_data/gcodes
[shaketune]
# https://github.com/Frix-x/klippain-shaketune/blob/main/docs/README.md
result_folder: ~/printer_data/config/ShakeTune_results
# Path where the processed results will be stored. If the folder doesn't exist,
# it will be automatically created. You can change this if you'd like to store
# results in a different location.
number_of_results_to_keep: 4
# This setting defines how many results you want to keep in the result folder.
# Once the specified number is exceeded, older results will be automatically deleted
# to free up space on the SD card and avoid cluttering the results folder.
keep_raw_data: False
# If set to True, Shake&Tune will store both the processed graphs and the raw accelerometer
# .stdata files in the results folder. This can be useful for debugging or archiving purposes.
# Please always attach them when reporting any issues on GitHub or Discord.
show_macros_in_webui: True
# Mainsail and Fluidd doesn't create buttons for system commands (macros that are not part
# of the printer.cfg file). This option allow Shake&Tune to inject them into the webui at runtime.
# If set to False, the macros will be hidden but still accessible from the console by typing
# their names manually, which can be useful if you prefer to encapsulate them into your own macros.
timeout: 600
# This defines the maximum processing time (in seconds) to allows to Shake&Tune for generating
# graphs from a .stdata file. 10 minutes should be more than enough in most cases, but if you have
# slower hardware (e.g., older SD cards or low-performance devices), increase it to prevent timeouts.
# measurements_chunk_size: 2
# Each Shake&Tune command uses the accelerometer to take multiple measurements. By default,
# Shake&Tune will write a chunk of data to disk every two measurements, and at the end of the
# command will merge these chunks into the final .stdata file for processing. "2" is a very
# conservative setting to avoid Klipper Timer Too Close errors on lower end devices with little
# RAM, and should work for everyone. However, if you are using a powerful computer, you may
# wish to increase this value to keep more measurements in memory (e.g., 15-20) before writing
# the chunk and avoid stressing the filesystem too much.
# max_freq: 200
# This setting defines the maximum frequency at which the calculation of the power spectral density
# is cutoff. The default value should be fine for most machines and accelerometer combinations and
# avoid touching it unless you know what you're doing.
# dpi: 300
# Controls the resolution of the generated graphs. The default value of 300 dpi was optimized
# and strikes a balance between performance and readability, ensuring that graphs are clear
# without using too much RAM to generate them. Usually, you shouldn't need to change this value.
#[gcode_button kill_switch]
#pin: PC14
##pin: tmc2209_stepper_z:virtual_endstop
#press_gcode:
# M104 S0 ; turn off temperature
# M140 S0 ; turn off temperature of bed (MD)
# M106 S0 ; turn off cooling fan
# G91 ; use relative positioning for the XYZ axes
# G1 Z20 F30000 ; lift up
# M84 ; disable motors
# M112 ; emergancy stop
[gcode_macro SET_GCODE_OFFSET]
rename_existing: SET_GCODE_OFFSET_ORIG
variable_restored: False # Mark whether the var has been restored from NVM
variable_runtime_offset: 0
gcode:
SET_GCODE_OFFSET_ORIG { rawparams }
[gcode_macro PROBE_EDDY_CURRENT_CALIBRATE_AUTO]
gcode:
BED_MESH_CLEAR
G28 X Y
G90 # Abs positioning
G1 X{ printer.toolhead.axis_maximum.x/2 } Y{ printer.toolhead.axis_maximum.y/2 } F6000
{% if 'z' not in printer.toolhead.homed_axes %}
SET_KINEMATIC_POSITION Z={ printer.toolhead.axis_maximum.z-1 } # Allows the user to work it down until it touches.
{% endif %}
PROBE_EDDY_CURRENT_CALIBRATE {rawparams}
[gcode_macro UNSAFE_MOVE_Z]
description: Lower the bed 10mm without homing
gcode:
G90
SET_KINEMATIC_POSITION Z=0
G0 Z20 F600
M84
[homing_override]
axes: xyz
gcode:
{% set home_all = 'X' not in params and 'Y' not in params and 'Z' not in params %}
{% set RUN_CURRENT_X = printer.configfile.settings['tmc2209 stepper_x'].run_current|float %}
{% set RUN_CURRENT_Y = printer.configfile.settings['tmc2209 stepper_y'].run_current|float %}
{% set RUN_CURRENT_Z = printer.configfile.settings['tmc2209 stepper_z'].run_current|float %}
{% set HOME_CURRENT = 0.5 %}
{% set HOME_Z_CURRENT = 0.7 %}
#M300
# sleep (ms)
G4 P500
{% if home_all %}
UNSAFE_MOVE_Z
{% endif %}
# Set current for sensorless homing
{% if home_all or 'Y' in params or 'X' in params %}
SET_TMC_CURRENT STEPPER=stepper_x CURRENT={HOME_CURRENT}
SET_TMC_CURRENT STEPPER=stepper_y CURRENT={HOME_CURRENT}
{% endif %}
{% if home_all or 'Z' in params %}
SET_TMC_CURRENT STEPPER=stepper_z CURRENT={HOME_Z_CURRENT}
{% endif %}
# Wait just a second… (give StallGuard registers time to clear)
G4 P1000
{% if home_all or 'Y' in params %}
# Home
G28 Y
# Move away
G91
G1 Y-6 F1200
G90
{% endif %}
{% if home_all or 'X' in params %}
G28 X
# Move away
G91
G1 X6 F1200
G90
{% endif %}
{% if home_all or 'Z' in params %}
# Home
G28 Z
#Use bed mesh
BED_MESH_PROFILE LOAD=default
# Move away
G91
G1 Z20
G90
{% endif %}
# Wait just a second… (give StallGuard registers time to clear)
G4 P1000
# Set current back for printing
SET_TMC_CURRENT STEPPER=stepper_x CURRENT={RUN_CURRENT_X}
SET_TMC_CURRENT STEPPER=stepper_y CURRENT={RUN_CURRENT_Y}
SET_TMC_CURRENT STEPPER=stepper_z CURRENT={RUN_CURRENT_Z}
# sleep (ms)
G4 P200
# move to the corner of bed
{% if home_all %}
G1 X0 Y230 F1200
{% endif %}
#M300
[gcode_macro PAUSE]
description: Pause the actual running print
rename_existing: PAUSE_BASE
gcode:
##### set defaults #####
{% set x = params.X|default(0) %} #edit to your park position
{% set y = params.Y|default(-20) %} #edit to your park position
{% set z = params.Z|default(30)|float %} #edit to your park position
{% set e = params.E|default(1) %} #edit to your retract length
##### calculate save lift position #####
{% set max_z = printer.toolhead.axis_maximum.z|float %}
{% set act_z = printer.toolhead.position.z|float %}
{% set lift_z = z|abs %}
{% if act_z < (max_z - lift_z) %}
{% set z_safe = lift_z %}
{% else %}
{% set z_safe = max_z - act_z %}
{% endif %}
##### end of definitions #####
PAUSE_BASE
G91
{% if printer.extruder.can_extrude|lower == 'true' %}
G1 E-{e} F2100
{% else %}
{action_respond_info("Extruder not hot enough")}
{% endif %}
{% if "xyz" in printer.toolhead.homed_axes %}
G1 Z{z_safe}
G90
G1 X{x} Y{y} F6000
{% else %}
{action_respond_info("Printer not homed")}
{% endif %}
[gcode_macro RESUME]
description: Resume the actual running print
rename_existing: RESUME_BASE
gcode:
##### set defaults #####
{% set e = params.E|default(1) %} #edit to your retract length
#### get VELOCITY parameter if specified ####
{% if 'VELOCITY' in params|upper %}
{% set get_params = ('VELOCITY=' + params.VELOCITY) %}
{%else %}
{% set get_params = "" %}
{% endif %}
##### end of definitions #####
G91
{% if printer.extruder.can_extrude|lower == 'true' %}
G1 E{e} F2100
{% else %}
{action_respond_info("Extruder not hot enough")}
{% endif %}
RESUME_BASE {get_params}
[gcode_macro CANCEL_PRINT]
description: Cancel the actual running print
rename_existing: CANCEL_PRINT_BASE
gcode:
MD_UNLOADFIL DISABLE=1
TURN_OFF_HEATERS
M106 S0
CANCEL_PRINT_BASE
M18
[gcode_macro BED_MESH_CALIBRATE]
rename_existing: BTT_BED_MESH_CALIBRATE
gcode:
{% set max_velocity = printer.configfile.settings['printer'].max_velocity * 60 %}
BTT_BED_MESH_CALIBRATE METHOD=rapid_scan
BED_MESH_OUTPUT
#G1 X116 Y235 Z40 F{max_velocity/2}
[gcode_macro MD_CALIBRATE_SCREWS]
gcode:
#G28
SCREWS_TILT_CALCULATE
#M18
[gcode_macro MD_WARMUPPOS]
gcode:
{% set max_velocity = 200 * 60 %}
{% set max_z_velocity = printer.configfile.settings['printer'].max_z_velocity * 60 %}
{% if printer.toolhead.homed_axes != "xyz" %}
G28
{% endif %}
G90; absolute
G1 Z40 F{max_z_velocity}
G1 X92 Y{printer.configfile.settings['stepper_y'].position_min} F{max_velocity/2} ; this is a good start heating position
[gcode_macro MD_PRIME]
gcode:
#M117 Prime Line
G90; absolute
G92 E0 ;Reset Extruder
G1 X1 Y{printer.configfile.settings['stepper_y'].position_min} F1500 ;Move left from warmup pos
# move z axis
G1 Y0 Z2.0 F1500 ;Move Z Axis up and Y out
# move to prime position
G1 X1 Y0 Z0.28 F1500 ;Move to start position
G1 X1 Y120 Z0.28 F1500 E9 ;Draw the first line (slightly under extrude)
G1 X1.75 Y120 Z0.28 F5000 ;Move to side a little
G1 X1.75 Y30 Z0.28 F1500 E18 ;Draw the second line (slightly over extrude)
G92 E0 ;Reset Extruder
[gcode_macro MD_STARTPRINT]
gcode:
{% set bedtemp = params.BED_TEMP|default(70)|float %}
{% set extrudertemp = params.EXTRUDER_TEMP|default(210)|float %}
# Start bed heating and continue
M140 S{bedtemp}
M104 S{extrudertemp}
{% if printer.toolhead.homed_axes != "xyz" %}
G28
{% endif %}
# Use the bed mesh
BED_MESH_CALIBRATE
#BED_MESH_PROFILE LOAD=default
# Move the nozzle near the bed
MD_WARMUPPOS
# Start bed heating and continue
M190 S{bedtemp}
M109 S{extrudertemp}
MD_LOADFIL
MD_PRIME
#M117 Printing...
[gcode_macro MD_PRINTDONE]
gcode:
#M117 Done printing :)
# move z up
G91
G1 E-3 Z+10 F3000
G91 ; use relative positioning for the XYZ axes
G1 Z20 F5000
G90 ; use absolute positioning for the XYZ axes
G1 X115 Y212 F5000 ; move bed forward and center x (MD)
MD_UNLOADFIL DISABLE=0
M104 S0 ; turn off temperature
M140 S0 ; turn off temperature of bed (MD)
M106 S0 ; turn off cooling fan
M84 ; disable motors
BED_MESH_CLEAR
[gcode_macro MD_LOADFIL]
gcode:
#M117 Load Fillament
G91
G1 E30 F1200
G1 E20 F600
G1 E-6 F1200
G90
[gcode_macro MD_UNLOADFIL]
gcode:
{% set disable = params.DISABLE|default(1)|float %}
#M117 Unload Fillament
G91
G1 E2 F1200
G1 E-5 F150
G1 E-15 F300
G1 E-10 F1200
{% if disable > 0 %}
M84 E
{% endif %}
G90
[gcode_macro MD_CUT]
gcode:
{% set max_velocity = params.CUT_SPEED|default(0)|int %}
{% set velocity = params.MOVE_SPEED|default(0)|int %}
{% set repeat_cut = params.REPEAT_X|default(3)|int %}
{% set pos = printer.gcode_move.gcode_position %}
{% if max_velocity<=0 %}
{% set max_velocity = printer.configfile.settings['printer'].max_velocity * 60 %}
{% else %}
{% set max_velocity = max_velocity * 60 %}
{% endif %}
{% if velocity<=0 %}
{% set velocity = (max_velocity * 0.5)|int %}
{% else %}
{% set velocity = velocity * 60 %}
{% endif %}
G90
G1 X230 Y-54 F{velocity}
{% for i in range(repeat_cut) %}
G1 X253 Y-54 F{max_velocity}
G1 X230 Y-54 F{max_velocity}
{% endfor %}
G1 X{pos.x} Y{pos.y} Z{pos.z} F{velocity}
[gcode_macro MD_EXERCISE]
gcode:
{% set repeat_fan = params.REPEAT_FAN|default(0)|int %}
{% set repeat_x = params.REPEAT_X|default(4)|int %}
{% set repeat_y = params.REPEAT_Y|default(4)|int %}
{% set repeat_c = params.REPEAT_C|default(8)|int %}
{% set repeat_small_x = params.REPEAT_SMALL_X|default(4)|int %}
{% set repeat_small_y = params.REPEAT_SMALL_Y|default(4)|int %}
{% set repeat_small_c = params.REPEAT_SMALL_C|default(8)|int %}
{% set repeat_z = params.REPEAT_Z|default(0)|int %}
{% set max_velocity = params.SPEED_XY|default(0)|int %}
{% set max_z_velocity = params.SPEED_Z|default(0)|int %}
{% set x_min = printer.configfile.settings['stepper_x'].position_min + 20 %}
{% set x_max = printer.configfile.settings['stepper_x'].position_max - 20 %}
{% set x_mid = ( printer.configfile.settings['stepper_x'].position_max + printer.configfile.settings['stepper_x'].position_min ) / 2 %}
{% set y_min = printer.configfile.settings['stepper_x'].position_min + 20 %}
{% set y_max = printer.configfile.settings['stepper_x'].position_max - 20 %}
{% set y_mid = ( printer.configfile.settings['stepper_x'].position_max + printer.configfile.settings['stepper_x'].position_min ) / 2 %}
{% set z_home = printer.configfile.settings['stepper_z'].position_min + 12 %}
{% set z_min = printer.configfile.settings['stepper_z'].position_min + 50 %}
{% set z_max = printer.configfile.settings['stepper_z'].position_max - 100 %}
{% if max_velocity<=0 %}
{% set max_velocity = printer.configfile.settings['printer'].max_velocity * 60 %}
{% else %}
{% set max_velocity = max_velocity * 60 %}
{% endif %}
{% if max_z_velocity<=0 %}
{% set max_z_velocity = printer.configfile.settings['printer'].max_z_velocity * 60 %}
{% else %}
{% set max_z_velocity = max_z_velocity * 60 %}
{% endif %}
{% if printer.toolhead.homed_axes != "xyz" %}
G28
{% endif %}
G90
G1 X{x_mid} Y{y_mid} Z{z_home} F{max_velocity}
{% if repeat_fan > 0 %}
{% for i in range(repeat_fan) %}
M106 S255
G4 P800
M106 S0
G4 P200
{% endfor %}
{% endif %}
{% if repeat_y > 0 %}
G1 X{x_mid} Y{y_mid} F{max_velocity}
{% for i in range(repeat_y) %}
G1 Y{y_min} F{max_velocity}
G1 Y{y_max} F{max_velocity}
{% endfor %}
{% endif %}
{% if repeat_x > 0 %}
G1 X{x_mid} Y{y_mid} F{max_velocity}
{% for i in range(repeat_x) %}
G1 X{x_min} F{max_velocity}
G1 X{x_max} F{max_velocity}
{% endfor %}
{% endif %}
{% if repeat_c > 0 %}
G1 X{x_mid/2} Y{y_mid} F{max_velocity}
{% for i in range(repeat_c) %}
G2 X{3*x_mid/2} Y{y_mid} I{x_mid/2} J{x_mid/2} F{max_velocity}
G2 X{x_mid/2} Y{y_mid} I{0-x_mid/2} J{x_mid/2} F{max_velocity}
{% endfor %}
{% endif %}
{% if repeat_small_y > 0 %}
{% for i in range(repeat_small_y) %}
G1 Y{y_mid-(y_mid/12)} F{max_velocity}
G1 Y{y_mid+(y_mid/12)} F{max_velocity}
{% endfor %}
{% endif %}
{% if repeat_small_x > 0 %}
G1 X{x_mid} Y{y_mid} F{max_velocity}
{% for i in range(repeat_small_x) %}
G1 X{x_mid-(x_mid/12)} F{max_velocity}
G1 X{x_mid+(x_mid/12)} F{max_velocity}
{% endfor %}
{% endif %}
{% if repeat_small_c > 0 %}
G1 X{x_mid/12} Y{y_mid} F{max_velocity}
{% for i in range(repeat_small_c) %}
G2 X{3*x_mid/12} Y{y_mid} I{x_mid/12} J{x_mid/12} F{max_velocity}
G2 X{x_mid/12} Y{y_mid} I{0-x_mid/12} J{x_mid/12} F{max_velocity}
{% endfor %}
{% endif %}
{% if repeat_z > 0 %}
G1 X{x_mid} Y{y_mid} F{max_velocity}
{% for i in range(repeat_z) %}
G1 Z{z_max} F{max_z_velocity}
G1 Z{z_min} F{max_z_velocity}
{% endfor %}
G1 Z{z_home} F{max_z_velocity/12}
{% endif %}
G1 X{x_mid} Y{y_mid} F{max_velocity}
G1 Z{z_home} F{max_z_velocity/12}
# load filament
[gcode_macro M701]
gcode:
SAVE_GCODE_STATE NAME=loading_filament
MD_LOADFIL
RESTORE_GCODE_STATE NAME=loading_filament
# unload filament
[gcode_macro M702]
gcode:
SAVE_GCODE_STATE NAME=unloading_filament
MD_UNLOADFIL DISABLE=0
RESTORE_GCODE_STATE NAME=unloading_filament
# Park toolhead
[gcode_macro M125]
gcode:
SAVE_GCODE_STATE NAME=parking
#M117 Parking toolhead
G91
G1 Z20 F600 # move up 20 mm
G90
G1 X125 Y0 F4000 # move to park position
RESTORE_GCODE_STATE NAME=parking
# Beeper
[gcode_macro M300]
gcode:
# Use a default 1kHz tone if S is omitted.
{% set S = params.S|default(1000)|int %}
# Use a 10ms duration is P is omitted.
{% set P = params.P|default(100)|int %}
SET_PIN PIN=_BEEPER_pin VALUE=0.1 CYCLE_TIME={ 1.0/S if S > 0 else 1 }
G4 P{P}
SET_PIN PIN=_BEEPER_pin VALUE=0
[menu __main __temp __preheat_plap]
type: list
name: Preheat PLA+
[menu __main __temp __preheat_plap __all]
type: command
enable: {('extruder' in printer) and ('heater_bed' in printer)}
name: Preheat all
gcode:
M140 S65
M104 S204
[menu __main __temp __preheat_plap __hotend]
type: command
enable: {'extruder' in printer}
name: Preheat hotend
gcode: M104 S204
[menu __main __temp __preheat_plap __hotbed]
type: command
enable: {'heater_bed' in printer}
name: Preheat hotbed
gcode: M140 S65
#*# <---------------------- SAVE_CONFIG ---------------------->
#*# DO NOT EDIT THIS BLOCK OR BELOW. The contents are auto-generated.
#*#
#*# [bed_mesh default]
#*# version = 1
#*# points =
#*# 0.961999, 0.938304, 0.910291, 0.904164, 0.902395, 0.869775, 0.849251, 0.828602, 0.799067, 0.787583, 0.793080, 0.764448
#*# 0.965924, 0.960036, 0.912406, 0.879960, 0.867021, 0.836440, 0.819530, 0.798487, 0.781476, 0.786138, 0.782925, 0.762201
#*# 0.977706, 0.926556, 0.895860, 0.863163, 0.836991, 0.809104, 0.776980, 0.775855, 0.759789, 0.753360, 0.764879, 0.716143
#*# 0.969529, 0.935899, 0.886494, 0.850262, 0.825899, 0.796748, 0.775534, 0.771836, 0.748460, 0.740480, 0.747133, 0.707440
#*# 0.980975, 0.938605, 0.880489, 0.848838, 0.811612, 0.782441, 0.762037, 0.759305, 0.738578, 0.721662, 0.724321, 0.661951
#*# 0.972635, 0.934994, 0.881196, 0.852419, 0.823774, 0.785013, 0.767657, 0.759950, 0.733633, 0.727299, 0.711400, 0.661440
#*# 0.978524, 0.939057, 0.875366, 0.853382, 0.831344, 0.781478, 0.767500, 0.760594, 0.730215, 0.700755, 0.701574, 0.640922
#*# 0.972145, 0.942825, 0.894977, 0.856552, 0.841262, 0.806788, 0.768463, 0.762684, 0.739907, 0.711398, 0.694557, 0.641097
#*# 0.995704, 0.945986, 0.899038, 0.866882, 0.838875, 0.817985, 0.800998, 0.799838, 0.753207, 0.716718, 0.706464, 0.641436
#*# 1.009298, 0.974599, 0.925053, 0.884551, 0.867433, 0.834238, 0.836991, 0.882433, 0.810842, 0.733255, 0.715766, 0.647030
#*# 1.036283, 1.000171, 0.943128, 0.911199, 0.882609, 0.863300, 0.866469, 0.885082, 0.834372, 0.767180, 0.765729, 0.672201
#*# 1.074368, 1.032296, 0.983264, 0.948997, 0.925001, 0.887202, 0.867158, 0.861785, 0.822809, 0.779230, 0.765573, 0.676613
#*# tension = 0.2
#*# min_x = 15.0
#*# algo = bicubic
#*# y_count = 12
#*# mesh_y_pps = 3
#*# min_y = 15.0
#*# x_count = 12
#*# max_y = 214.98000000000005
#*# mesh_x_pps = 3
#*# max_x = 219.92999999999998
#*#
#*# [temperature_probe btt_eddy]
#*# calibration_temp = 33.162114
#*#
#*# [probe_eddy_current btt_eddy]
#*# calibrate =
#*# 0.050000:3254752.636,0.090000:3254489.666,0.130000:3254207.492,
#*# 0.170000:3253944.687,0.210000:3253272.906,0.250000:3252570.160,
#*# 0.290000:3251885.355,0.330000:3251193.273,0.370000:3250532.752,
#*# 0.410000:3249845.272,0.450000:3249226.965,0.490000:3248574.918,
#*# 0.530000:3247971.003,0.570000:3247358.807,0.610000:3246768.905,
#*# 0.650000:3246198.595,0.690000:3245651.821,0.730000:3245066.225,
#*# 0.770000:3244488.325,0.810000:3243971.652,0.850000:3243440.870,
#*# 0.890000:3242912.235,0.930000:3242410.435,0.970000:3241915.248,
#*# 1.010000:3241419.429,1.050000:3240927.912,1.090000:3240462.545,
#*# 1.130000:3240018.940,1.170000:3239552.019,1.210000:3239092.970,
#*# 1.250000:3238653.925,1.290000:3238198.815,1.330000:3237796.806,
#*# 1.370000:3237382.028,1.410000:3236971.227,1.450000:3236588.992,
#*# 1.490000:3236197.545,1.530000:3235785.533,1.570000:3235410.066,
#*# 1.610000:3235059.920,1.650000:3234664.038,1.690000:3234318.262,
#*# 1.730000:3233986.614,1.770000:3233612.047,1.810000:3233283.690,
#*# 1.850000:3232949.106,1.890000:3232631.527,1.930000:3232293.704,
#*# 1.970000:3231985.249,2.010000:3231674.323,2.050000:3231385.081,
#*# 2.090000:3231070.926,2.130000:3230803.104,2.170000:3230459.604,
#*# 2.210000:3230214.515,2.250000:3229920.021,2.290000:3229671.130,
#*# 2.330000:3229381.144,2.370000:3229102.043,2.410000:3228857.154,
#*# 2.450000:3228591.058,2.490000:3228334.394,2.530000:3228117.523,
#*# 2.570000:3227855.643,2.610000:3227622.192,2.650000:3227367.110,
#*# 2.690000:3227131.298,2.730000:3226919.536,2.770000:3226685.632,
#*# 2.810000:3226479.859,2.850000:3226243.494,2.890000:3226040.522,
#*# 2.930000:3225814.771,2.970000:3225613.091,3.010000:3225418.927,
#*# 3.050000:3225206.761,3.090000:3225030.198,3.130000:3224837.921,
#*# 3.170000:3224606.368,3.210000:3224453.605,3.250000:3224258.913,
#*# 3.290000:3224071.097,3.330000:3223899.195,3.370000:3223703.438,
#*# 3.410000:3223557.150,3.450000:3223394.855,3.490000:3223236.127,
#*# 3.530000:3223025.447,3.570000:3222879.704,3.610000:3222705.188,
#*# 3.650000:3222567.931,3.690000:3222383.441,3.730000:3222229.294,
#*# 3.770000:3222100.391,3.810000:3221945.890,3.850000:3221820.556,
#*# 3.890000:3221665.617,3.930000:3221522.123,3.970000:3221394.921,
#*# 4.010000:3221235.300,4.050000:3221106.727
#*# reg_drive_current = 15