-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprinter.lab4455.cfg
880 lines (786 loc) · 21.9 KB
/
printer.lab4455.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
###################################################################################
###################################################################################
################ Prusa MK3s Klipper Config by Lab4450.com ###################
###################################################################################
###################################################################################
# This file contains pin mappings and reasonable defaults for Prusa i3 MK3S
# printers. It will work with MK3s.
# References to common community mods are included as well.
#
# Note: The Einsy boards sold by Prusa have defective firmware on the
# usb-to-serial chip that makes the boards unusable with Klipper through USB.
# While flashing Klipper firmware must be done over USB, the board can be used
# via serial with no additional modification.
# To use this config, the firmware should be compiled for the AVR atmega2560.
#
# SERIAL CONNECTION
# If you want to connect the Rpi to the back of the Einsy Board as https://help.prusa3d.com/article/prusaprint-rpi-zero-and-octoprint_2180
# run sudo raspi-config which will start the utility and then select:
# To use via serial, in "make menuconfig" select "Enable extra low-level configuration options"
# and select serial1 (the RasPi serial)
# on the raspbery pi make sure serial is enabled. run sudo raspi-config
# 3. Interfacing Options
# select Serial Port
# Then No when it asks if you want a login shell to be accessible over serial.
# Then Yes when it asks if you want the hardware enabled.
# At this point you might want to double check that the ssh server is running:
# From the raspi-config utility:
# 3. Interfacing Options
# select SSH
# Answer Yes when asked if you would like the SSH server to be enabled.
#
# USB CONNECTION
# If you want to use the USB connection dont select "Enable extra low-level configuration options".
#
### UI
[include mainsail.cfg]
### BOARD
[mcu]
serial: /dev/serial0 # If you are using internal RPI serial port
# serial: /dev/serial/by-id/usb-Prusa_Research__prusa3d.com__Original_Prusa_i3_MK3-if00 # If you are using RPI via USB connection to printer
restart_method: command
[temperature_sensor einsy_board]
sensor_pin: PF6
sensor_type: TDK NTCG104LH104JT1
min_temp: 0
max_temp: 70
### RPI
[temperature_sensor raspberry_pi]
sensor_type: temperature_host
min_temp: 0
max_temp: 80
### PRINTER DEFINITIONS
[printer]
kinematics: cartesian
max_accel: 4000
max_accel_to_decel: 2500
max_velocity: 300
max_z_velocity: 40
max_z_accel: 200
square_corner_velocity: 8.0
### BED
[heater_bed]
heater_pin: PG5
sensor_type: EPCOS 100K B57560G104F
sensor_pin: PF2
control: pid
min_temp: 0
max_temp: 120
pid_Kp:55.864
pid_Ki:0.876
pid_Kd:890.334
### FANS
[heater_fan hotend_fan]
pin: PH5
heater: extruder
heater_temp: 50.0
fan_speed: 1.0
[fan] # Part Cooling Fan
pin: PH3
### DISPLAY
[display]
lcd_type: hd44780
rs_pin: PD5
e_pin: PF7
d4_pin: PF5
d5_pin: PG4
d6_pin: PH7
d7_pin: PG3
encoder_pins: ^PJ1,^PJ2
click_pin: ^!PH6
[output_pin LCD_backlight_pin]
pin: PE3
pwm: True
hardware_pwm: True
value: 0.25 # 30% backlight
shutdown_value: 1 # Back to full backlight (without PWM) on restart
cycle_time: 0.001 # Default 0.1s cycle time flickers as hell
[static_digital_output debug_led] # Keeps Debug LED off / not floating
pins: !PB7
[output_pin BEEPER_pin]
pin: PH2
pwm: True
value: 0
shutdown_value:0
cycle_time: 0.001
scale: 1000
### MOTORS
[motor_constants prusa-xye]
# install https://github.com/andrewmcgr/klipper_tmc_autotune/tree/main
# this is a custom motor for xye
resistance: 6.5
inductance: 0.013
holding_torque: 0.49
max_current: 1
steps_per_revolution: 200
[motor_constants prusa-z]
# install https://github.com/andrewmcgr/klipper_tmc_autotune/tree/main
# this is a custom motor for z
resistance: 8
inductance: 0.095
holding_torque: 0.32
max_current: 1
steps_per_revolution: 200
[autotune_tmc stepper_x]
motor: prusa-xye
[stepper_x]
step_pin: PC0
dir_pin: !PL0
enable_pin: !PA7
microsteps: 16
rotation_distance: 32
endstop_pin: tmc2130_stepper_x:virtual_endstop
position_endstop: 0
position_max: 255
homing_speed: 50
homing_retract_dist: 0
[tmc2130 stepper_x]
cs_pin: PG0
interpolate: True
stealthchop_threshold: 0
run_current: .281738
hold_current: .281738
sense_resistor: 0.220
diag1_pin: !PK2
driver_IHOLDDELAY: 8
driver_TPOWERDOWN: 0
driver_TBL: 2
driver_TOFF: 3
driver_HEND: 1
driver_HSTRT: 5
driver_PWM_FREQ: 2
driver_PWM_GRAD: 2
driver_PWM_AMPL: 230
driver_PWM_AUTOSCALE: True
driver_SGT: 3
[autotune_tmc stepper_y]
motor: prusa-xye
[stepper_y]
step_pin: PC1
dir_pin: PL1
enable_pin: !PA6
microsteps: 16
rotation_distance: 32
endstop_pin: tmc2130_stepper_y:virtual_endstop
position_endstop: -4
position_max: 212.5
position_min: -4
homing_speed: 50
homing_retract_dist: 0
[tmc2130 stepper_y]
cs_pin: PG2
interpolate: True
stealthchop_threshold: 0
run_current: .281738
hold_current: .281738
sense_resistor: 0.220
diag1_pin: !PK7
driver_IHOLDDELAY: 8
driver_TPOWERDOWN: 0
driver_TBL: 2
driver_TOFF: 3
driver_HEND: 1
driver_HSTRT: 5
driver_PWM_FREQ: 2
driver_PWM_GRAD: 2
driver_PWM_AMPL: 230
driver_PWM_AUTOSCALE: True
driver_SGT: 3
[autotune_tmc stepper_z]
motor: prusa-z
[stepper_z]
step_pin: PC2
dir_pin: !PL2
enable_pin: !PA5
microsteps: 16
rotation_distance: 8
endstop_pin: probe:z_virtual_endstop
position_max: 210
position_min: -2
homing_speed: 13.333
[tmc2130 stepper_z]
cs_pin: PK5
run_current: .53033
hold_current: .53033
sense_resistor: 0.220
diag1_pin: !PK6
interpolate: True
driver_IHOLDDELAY: 8
driver_TPOWERDOWN: 0
driver_TBL: 2
driver_TOFF: 3
driver_HEND: 1
driver_HSTRT: 5
driver_PWM_FREQ: 2
driver_PWM_GRAD: 4
driver_PWM_AMPL: 200
driver_PWM_AUTOSCALE: True
driver_SGT: 4
### EXTRUDER
[extruder]
full_steps_per_rotation: 200
rotation_distance: 22.85696
max_extrude_cross_section: 50.0
max_extrude_only_velocity: 120.0
max_extrude_only_accel: 1250.0
max_extrude_only_distance: 200
nozzle_diameter: 0.4
filament_diameter: 1.750
pressure_advance: 0.06
pressure_advance_smooth_time: 0.040
step_pin: PC3
dir_pin: PL6
enable_pin: !PA4
microsteps: 16
heater_pin: PE5
sensor_type: ATC Semitec 104GT-2
sensor_pin: PF0
max_temp: 285
min_extrude_temp: 170
min_temp: 0
control: pid
pid_Kp:21.837
pid_Ki:1.234
pid_Kd:96.629
[autotune_tmc extruder]
motor: prusa-xye
[tmc2130 extruder]
cs_pin: PK4
interpolate: True
run_current: .513757
hold_current: .513757
sense_resistor: 0.220
diag1_pin: !PK3
driver_IHOLDDELAY: 8
driver_TPOWERDOWN: 0
driver_TBL: 2
driver_TOFF: 3
driver_HEND: 1
driver_HSTRT: 5
driver_PWM_FREQ: 2
driver_PWM_GRAD: 4
driver_PWM_AMPL: 240
driver_PWM_AUTOSCALE: True
driver_SGT: 3
[gcode_arcs]
resolution: 0.25
[firmware_retraction]
retract_length: 0.5
### BED MESH AND PROBE
[bed_mesh]
horizontal_move_z: 5
mesh_min: 35, 6
mesh_max: 240,198
# Odd number of probe points per dimension (3x3, 5x5, 7x7) is better as then the area near the center screw is probed
probe_count: 7,7
#probe_count: 5,5
#probe_count: 3,3
speed: 100
algorithm: bicubic
fade_start: 1.0
fade_end: 10.0
move_check_distance: 3.0
split_delta_z: .025
bicubic_tension: .2
mesh_pps: 0,0 #Don't generate interperlated points so our mesh is precise with screw tilt adjust
# Avoid magnets
faulty_region_1_min: 100.583, 187.376
faulty_region_1_max: 122.083, 229.376
faulty_region_2_min: 125.672, -18.124
faulty_region_2_max: 147.172, 23.876
faulty_region_3_min: 192.261, 5.126
faulty_region_3_max: 234.261, 26.626
faulty_region_4_min: 114.422, 39.876
faulty_region_4_max: 135.922, 81.876
faulty_region_5_min: 21.422, 87.126
faulty_region_5_max: 42.922, 129.126
faulty_region_6_min: 54.172, 97.376
faulty_region_6_max: 96.172, 118.876
faulty_region_7_min: 154.172, 97.376
faulty_region_7_max: 196.172, 118.876
faulty_region_8_min: 205.136, 87.126
faulty_region_8_max: 226.636, 129.126
faulty_region_9_min: 114.422, 134.376
faulty_region_9_max: 135.922, 176.376
faulty_region_10_min: 176.177, 191.394
faulty_region_10_max: 218.177, 212.894
[gcode_macro BED_MESH_CALIBRATE]
rename_existing: BASE_BED_MESH_CALIBRATE
gcode:
BED_MESH_CLEAR
BASE_BED_MESH_CALIBRATE
[safe_z_home]
home_xy_position: 128,110
speed: 50.0
z_hop: 15
z_hop_speed: 15.0
move_to_previous: False
[probe]
pin: PB4
x_offset: 23
y_offset: 5
speed: 20.0
#z_offset : 1.480 # default is zero. update this to your Z offset. this is just a safe value so you don't crash the nozzle against the pei plate
samples: 3 # Sampling, primarily for bed mesh. 3 is fine for normal PINDA probes.
samples_result: average
sample_retract_dist: 1.0
# if you are using a pinda v2 with 4 cables you can read the pinda inbuilt thermistor temperature
# [temperature_sensor pinda]
# sensor_type: EPCOS 100K B57560G104F
# sensor_pin: PF3
# min_temp: 0
# max_temp: 100
# gcode_id: C
[screws_tilt_adjust]
# SW Nylock Mod: Screw 1 uses the 6mm metallic spacer so its
# height is considered the baseline. For tilt adjust using the
# command SCREWS_TILT_CALCULATE or MACRO ADJUST_BED_SCREWS, this has to be your Screw 1:
#
# ******************
# * S7 S8 S9 *
# * *
# Bed: * S5 S1 S6 *
# * *
# * S2 S3 S4 *
# ******************
#
screw1: 128,110
screw1_name: Center
screw2: 13,6
screw2_name: Front Left
screw3: 13,115
screw3_name: Front Center
screw4: 13,210
screw4_name: Front Right
screw5: 123,6
screw5_name: Center Left
screw6: 123,210
screw6_name: Center Right
screw7: 223,6
screw7_name: Back Left
screw8: 223,115
screw8_name: Back Center
screw9: 223,210
screw9_name: Back Right
horizontal_move_z: 10.
speed: 50.
screw_thread: CCW-M3
[gcode_macro ADJUST_BED_SCREWS]
gcode:
# Heat the bed at 80ºc to proceed with a more accurate process
M140 S60 ; start heating bed to 80ºc
G28 ; home
Tram_Z ; tram z aka calibrate z
M190 S60 ; wait for bed to reach 80ºc
# G4 P300000 ; Waits 5 min for the bed temp to stabilize
# HOT TEMPERATURE! BE CAREFUL WHEN TOUCHING THE BED OR THE BED SCREWS
# HOT TEMPERATURE! BE CAREFUL WHEN TOUCHING THE BED OR THE BED SCREWS
# HOT TEMPERATURE! BE CAREFUL WHEN TOUCHING THE BED OR THE BED SCREWS
# HOT TEMPERATURE! BE CAREFUL WHEN TOUCHING THE BED OR THE BED SCREWS
SCREWS_TILT_CALCULATE SAMPLE_RETRACT_DIST=1
G1 X180 Y199 Z50 F1000
M190 S0 ; turn off bed heater
M117 !! ATTENTION BED IS HOT !!
UPDATE_DELAYED_GCODE ID=clear_display DURATION=3
M117 remove pei sheet
UPDATE_DELAYED_GCODE ID=clear_display DURATION=3
M117 adjust bed screws
UPDATE_DELAYED_GCODE ID=clear_display DURATION=3
# REPEAT THIS MACRO UNTIL PERFECTION
[menu __main __setup __calib __Ajust_Bed_Screws]
type: command
enable: {not printer.idle_timeout.state == "Printing"}
name: Adjust Bed Screws
gcode:
ADJUST_BED_SCREWS
[gcode_macro G80]
gcode:
M117 Bed leveling
BED_MESH_CALIBRATE
G1 X0 Y0 Z0.4 F4000
M117
M400
[gcode_macro G81]
gcode:
BED_MESH_OUTPUT
### ADXL
[input_shaper]
shaper_freq_x: 52.287 # frequency for the X mark of the test model
shaper_freq_y: 48.438 # frequency for the Y mark of the test model
shaper_type: mzv
damping_ratio_x: 0.1
damping_ratio_y: 0.12
### FILAMENT SENSOR
[filament_switch_sensor filament_sensor]
pause_on_runout: True
runout_gcode:
M118 Filament Runout Detected
M600
CONDITIONAL_BEEP i=3 dur=300 freq=400
insert_gcode:
M118 Filament Load Detected
LOAD_FILAMENT
event_delay: 3.0
# If you have issues with movement after the runout_gcode executes
# you may increase the pause_delay. It should be noted that this
# is a workaround for an issue with how Octoprint handles
# acknowledgments. This issue is schedule to be fixed in the next
# release, after which the "pause_delay" option will likely be removed.
pause_delay: 0.01
switch_pin: !PK0
#[delayed_gcode DISABLEFILAMENTSENSOR] #DISABLE FILAMENT SENSOR ON STARTUP
#initial_duration: 1
#gcode:
# SET_FILAMENT_SENSOR SENSOR=filament_sensor ENABLE=0
[gcode_macro M600] # Color Change
description: Color change
gcode:
{% set X = params.X|default(0)|float %}
{% set Y = params.Y|default(0)|float %}
{% set Z = params.Z|default(10)|float %}
SAVE_GCODE_STATE NAME=M600_state
PAUSE
G91
G1 E-.8 F2700
G1 Z{Z}
G90
G1 X{X} Y{Y} F3000
G91
G1 E-50 F1000
RESTORE_GCODE_STATE NAME=M600_state
[gcode_macro UNLOAD_FILAMENT]
gcode:
SAVE_GCODE_STATE NAME=unload_state
G91
{% if params.TEMP is defined or printer.extruder.can_extrude|lower == 'false' %}
M117 Heating...
# Heat up hotend to provided temp or 220 as default as that should work OK with most filaments.
M109 S{params.TEMP|default(220, true)}
{% endif %}
M117 Unloading filament...
G92 E0.0
G91
G1 E-45 F5000
G1 E-15 F1000
G1 E-20 F1000
G90
G92 E0.0
M400
M117 Remove Filament Now!
M300 S300 P1000
M117 Filament unloaded!
RESTORE_GCODE_STATE NAME=unload_state
UPDATE_DELAYED_GCODE ID=clear_display DURATION=5
[gcode_macro LOAD_FILAMENT]
gcode:
SAVE_GCODE_STATE NAME=load_state
G91
# Heat up hotend to provided temp or 220 as default as that should work OK with most filaments.
{% if params.TEMP is defined or printer.extruder.can_extrude|lower == 'false' %}
M117 Heating...
M109 S{params.TEMP|default(220, true)}
{% endif %}
M117 Loading filament...
# Load the filament into the hotend area.
G92 E0.0
G91
G1 E70 F400
G1 E40 F100
G90
G92 E0.0
M400
M117 Filament loaded!
RESTORE_GCODE_STATE NAME=load_state
UPDATE_DELAYED_GCODE ID=clear_display DURATION=5
[menu __filament __change]
type: command
name: Change Filament
gcode:
M600
[menu __filament __resume]
type: command
name: Resume
gcode:
RESUME
#####################
### MACROS
#####################
[respond]
default_type: command
[skew_correction]
[input_shaper]
[virtual_sdcard]
path: ~/printer_data/gcodes
[display_status]
[pause_resume]
[force_move]
enable_force_move: True
[gcode_macro M486]
gcode:
CLEAR_PAUSE
[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.5 CYCLE_TIME={ 1.0/S if S > 0 else 1 }
G4 P{P}
SET_PIN PIN=BEEPER_pin VALUE=0
[delayed_gcode clear_display]
initial_duration: 0.
gcode:
M117
[menu __main __octoprint] # we are not using this menu so we are going to remove it
type: disabled
[pause_resume]
[display_status]
[gcode_macro CANCEL_PRINT]
description: Cancel the actual running print
rename_existing: CANCEL_PRINT_BASE
variable_park: True
gcode:
## Move head and retract only if not already in the pause state and park set to true
{% if printer.pause_resume.is_paused|lower == 'false' and park|lower == 'true'%}
_TOOLHEAD_PARK_PAUSE_CANCEL
{% endif %}
TURN_OFF_HEATERS
CANCEL_PRINT_BASE
SDCARD_RESET_FILE
# Raise nozzle by 60mm
G1 Z60 F3000
G90
# Disable steppers
M84
[gcode_macro PAUSE]
description: Pause the actual running print
rename_existing: PAUSE_BASE
gcode:
PAUSE_BASE
_TOOLHEAD_PARK_PAUSE_CANCEL
[gcode_macro RESUME]
description: Resume the actual running print
rename_existing: RESUME_BASE
gcode:
##### read extrude from _TOOLHEAD_PARK_PAUSE_CANCEL macro #####
{% set extrude = printer['gcode_macro _TOOLHEAD_PARK_PAUSE_CANCEL'].extrude %}
#### get VELOCITY parameter if specified ####
{% if 'VELOCITY' in params|upper %}
{% set get_params = ('VELOCITY=' + params.VELOCITY) %}
{%else %}
{% set get_params = "" %}
{% endif %}
##### end of definitions #####
{% if printer.extruder.can_extrude|lower == 'true' %}
M83
G1 E{extrude} F2100
{% if printer.gcode_move.absolute_extrude |lower == 'true' %} M82 {% endif %}
{% else %}
{action_respond_info("Extruder not hot enough")}
{% endif %}
RESUME_BASE {get_params}
CLEAR_PAUSE
[gcode_macro _TOOLHEAD_PARK_PAUSE_CANCEL]
description: Helper: park toolhead used in PAUSE and CANCEL_PRINT
variable_extrude: 1.0
gcode:
##### set park positon for x and y #####
# default is your max posion from your printer.cfg
{% set x_park = printer.toolhead.axis_maximum.x|float - 5.0 %}
{% set y_park = printer.toolhead.axis_maximum.y|float - 5.0 %}
{% set z_park_delta = 2.0 %}
##### calculate save lift position #####
{% set max_z = printer.toolhead.axis_maximum.z|float %}
{% set act_z = printer.toolhead.position.z|float %}
{% if act_z < (max_z - z_park_delta) %}
{% set z_safe = z_park_delta %}
{% else %}
{% set z_safe = max_z - act_z %}
{% endif %}
##### end of definitions #####
{% if printer.extruder.can_extrude|lower == 'true' %}
M83
G1 E-{extrude} F2100
{% if printer.gcode_move.absolute_extrude |lower == 'true' %} M82 {% endif %}
{% else %}
{action_respond_info("Extruder not hot enough")}
{% endif %}
{% if "xyz" in printer.toolhead.homed_axes %}
G91
G1 Z{z_safe} F900
G90
G1 X{x_park} Y{y_park} F6000
{% if printer.gcode_move.absolute_coordinates|lower == 'false' %} G91 {% endif %}
{% else %}
{action_respond_info("Printer not homed")}
{% endif %}
[gcode_macro Tram_Z] # Prusa's calibrate Z
description: Tram Z axis
gcode:
{% set max_z = printer.toolhead.axis_maximum.z|float %}
{% if printer.toolhead.homed_axes != "xyz" %}
G28
{% endif %}
G1 X20 Y0
G1 Z{max_z-10} F2000 #Update with Z height.
FORCE_MOVE STEPPER=stepper_z Distance=20 Velocity=10
G1 Z{max_z-50} F2000 # Move down
G28 Z # Home again
[gcode_macro G34]
gcode:
Tram_Z
[menu __main __setup __calib __Tram_Z]
type: command
enable: {not printer.idle_timeout.state == "Printing"}
name: Tram Z Axis
gcode:
G34
[gcode_macro PREHEAT_PLA]
gcode:
# Start bed heating
M140 S60
# Start nozzle heating
M104 S200
[gcode_macro PREHEAT_PETG]
gcode:
# Start bed heating
M140 S90
# Start nozzle heating
M104 S240
[gcode_macro PREHEAT_TPU]
gcode:
# Start bed heating
M140 S50
# Start nozzle heating
M104 S190
[gcode_macro PID_TEST_BED]
gcode:
# Parameters
{% set TARGETTEMP = params.TEMP|default(70)|int %}
{% set max_x = printer.configfile.config["stepper_x"]["position_max"]|float %}
{% set max_y = printer.configfile.config["stepper_y"]["position_max"]|float %}
G28
G90
G1 X{max_x/2} Y{max_y/2} Z40 F6000
PID_CALIBRATE HEATER=< TARGET={TARGETTEMP}
[gcode_macro PID_TEST_HOTEND]
gcode:
# Parameters
{% set TARGETTEMP = params.TEMP|default(245)|int %}
{% set max_x = printer.configfile.config["stepper_x"]["position_max"]|float %}
{% set max_y = printer.configfile.config["stepper_y"]["position_max"]|float %}
G28
G90
G1 X{max_x/2} Y{max_y/2} Z10 F6000
M106 S64
PID_CALIBRATE HEATER=extruder TARGET={TARGETTEMP}
M107 ; Turn off print cooling fan
[gcode_macro PURGE_LINE]
gcode:
M117 Priming ...
G92 E0.0 ; reset extruder
G90 ; Absolute positioning
G0 X5 Y-3.0 F5000 ; Moves to starting point outside print area
G0 Z0.4 F500 ; Raises Z to 0.4
G91 ; Incremental positioning
G92 E0.0 ; reset extruder position
G90 ; Absolute positioning
G1 X50.0 E8.0 F1000.0 ; start intro line
G1 X90.0 E24.0 F1000.0 ; finish thicker
G92 E0.0
G90 ; Absolut position
[gcode_macro PRINT_START]
gcode:
# edit slicer
# M104 S0 ; Stops PrusaSlicer from sending temp waits separately
# M140 S0
# print_start EXTRUDER=[first_layer_temperature[initial_extruder]] BED=[first_layer_bed_temperature]
# Parameters
{% set bed = params.BED|int %}
{% set hotend = params.HOTEND|int %}
{% set chamber = params.CHAMBER|default(0)|int %}
M73 P0 ; clear LCD progress bar
M82 ; extruder to absolute mode
G92 E0 ; set extruder to zero
M140 S{bed} ; get bed heating up
M117 Bed Heating and Homing
G28 ; home all axis
G90 ; absolute positioning
M190 S{bed} ; wait for bed temp
G4 P300000 ; Waits 5 min for the bed temp to stabilize
# TEMPERATURE_WAIT SENSOR="temperature_sensor pinda" MINIMUM={chambertemp} ; enable if you have a pinda v2 with 4 cables and you want to wait for the pinda to reach slicer chamber temperature
G80 ; bed leveling and bed mesh calibration
M117 Leveling
BED_MESH_PROFILE LOAD=default ; load bed mesh
SCREWS_TILT_CALCULATE MAX_DEVIATION=0.01 ; will abort the print if the configured limit is exceeded
M107 ; Turns off the PT-fan
M104 S{hotend} ; set extruder temp
M109 S{hotend} ; wait for extruder temp
M117 Hotend Heating
PURGE_LINE; ; execute macro purge line
M400 ; clear buffer
M117 Printing...
[gcode_macro PRINT_END]
gcode:
CONDITIONAL_BEEP I=2 DUR=30 FREQ=8500
M400 ; wait for buffer to clear
G92 E0 ; zero the extruder
G1 F1000.0 ; set feed rate
G1 E-3 ; retract
G91 ; relative positioning
# Set safe speeds
{% set zVelocity = printer.configfile.settings.printer.max_z_velocity|default(15)|int %}
{% set maxVelocity = printer.configfile.settings.printer.max_velocity|default(200)|int %}
{% set zVelocityAdjusted = (0.95 * zVelocity * 60)|int %}
{% set maxVelocityAdjusted = (0.95 * maxVelocity * 60)|int %}
# Get Boundaries
{% set max_x = printer.configfile.config["stepper_x"]["position_max"]|float %}
{% set max_y = printer.configfile.config["stepper_y"]["position_max"]|float %}
{% set max_z = printer.configfile.config["stepper_z"]["position_max"]|float %}
# Check end position to determine safe direction to move
{% if printer.toolhead.position.x < (max_x - 20) %}
{% set x_safe = 20.0 %}
{% else %}
{% set x_safe = -20.0 %}
{% endif %}
{% if printer.toolhead.position.y < (max_y - 20) %}
{% set y_safe = 20.0 %}
{% else %}
{% set y_safe = -20.0 %}
{% endif %}
{% set lift_height = 25.0 %}
{% if printer.toolhead.position.z < (max_z - lift_height) %}
{% set z_safe = lift_height %}
{% else %}
{% set z_safe = max_z - printer.toolhead.position.z %}
{% endif %}
G0 Z{z_safe} F{zVelocityAdjusted} ; move nozzle up
G0 X{x_safe} Y{y_safe} F{maxVelocityAdjusted} ; move nozzle to remove stringing
TURN_OFF_HEATERS ; turn off heaters
M107 ; turn off fan
G90 ; absolute positioning
G0 X60 Y{max_y} F3600 ; park nozzle at rear
M221 S100 ; Reset Filament Flowrate
M84XYE ; disable xye motors
M117 Printer Ready ; LCD status message
[gcode_macro CANCEL_PRINT]
rename_existing: BASE_CANCEL_PRINT
gcode:
G91
G1 X-2 Y-2 E-1 F300
G1 Z50 F3000 ; Raise nozzle by 50mm
G90
TURN_OFF_HEATERS
M107
CLEAR_PAUSE
SDCARD_RESET_FILE
BASE_CANCEL_PRINT
CUSTOM_PRINT_CANCELED
[gcode_macro CUSTOM_PRINT_CANCELED]
gcode:
M117 Print canceled
#*# <---------------------- SAVE_CONFIG ---------------------->
#*# DO NOT EDIT THIS BLOCK OR BELOW. The contents are auto-generated.
#*#
#*# [probe]
#*# z_offset = 2.561