-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathprinter.cfg
727 lines (692 loc) · 20.3 KB
/
printer.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
[include mainsail.cfg]
[include timelapse.cfg]
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
[stepper_x]
step_pin: PA3 #✓
dir_pin: PA1 #✓
enable_pin: !PA5 #✓
microsteps: 64 #✓
rotation_distance: 40 #✓
endstop_pin: tmc2130_stepper_x:virtual_endstop #✓
position_endstop: 0 #✓
position_max: 220 #✓
homing_speed: 25 #✓
homing_retract_dist: 0 #✓
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
[stepper_y]
step_pin: PC6 #✓
dir_pin: PA0 #✓
enable_pin: !PA7 #✓
microsteps: 64 #✓
rotation_distance: 40 #✓
endstop_pin: tmc2130_stepper_y:virtual_endstop #✓
position_endstop: 0 #✓
position_max: 224 #✓
homing_speed: 25 #✓
homing_retract_dist: 0 #✓
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
[stepper_z]
step_pin: PC0 #✓
dir_pin: !PG2 #✓
enable_pin: !PC2 #✓
microsteps: 64 #✓
rotation_distance: 8 #✓
endstop_pin: tmc2130_stepper_z:virtual_endstop #✓
position_endstop: 0 #✓
position_max: 224 #✓
position_min: 0 #✓
homing_speed: 5 #✓
homing_retract_dist: 0 #✓
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
[extruder]
step_pin: PL6 #✓
dir_pin: !PL4 #✓
enable_pin: !PG0 #✓
microsteps: 64 #✓
rotation_distance: 32.68
nozzle_diameter: 0.5 #✓
filament_diameter: 1.750 #✓
heater_pin: PE4 #✓
sensor_type: Generic 3950#✓
sensor_pin: PK0 #✓
max_power: 1
pwm_cycle_time: 0.05
min_temp: 0 #✓
max_temp: 300 #✓
min_extrude_temp: 150
#control: pid #✓
#pid_kp: 13
#pid_ki: 1
#pid_kd: 84
max_extrude_only_distance: 65.0
max_extrude_only_velocity: 120
max_extrude_only_accel: 6400
pressure_advance: 0.40
pressure_advance_smooth_time: 0.040
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
[heater_bed]
heater_pin: PG5 #✓
sensor_type: NTC 100K MGB18-104F39050L32 #✓
sensor_pin: PK2 #✓
min_temp: 0 #✓
max_power: 1
max_temp: 100 #✓
#control: pid #✓
#pid_kp: 263
#pid_ki: 50
#pid_kd: 933
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
[fan]
pin: PH4
hardware_pwm: True
cycle_time: 0.02
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
[mcu]
serial: /dev/ttyAMA0
restart_method: command
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
[printer]
kinematics: cartesian
max_velocity: 400
max_accel: 5000
max_z_velocity: 100
max_z_accel: 50
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
[display_status]
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
[display]
lcd_type: st7920
cs_pin: PD1 #✓
sclk_pin: PH1 #✓
sid_pin: PH0 #✓
encoder_pins: ^PL7, ^PG1 #✓
click_pin: ^!PD2 #✓
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
[tmc2130 stepper_x]
cs_pin: PA2 #✓
#spi_speed:
#spi_bus:
interpolate: true
run_current: 0.7
hold_current: 0.5
stealthchop_threshold: 110
#driver_IHOLDDELAY: 10
#driver_TPOWERDOWN: 0
#driver_TBL: 1
#driver_TOFF: 4
#driver_HEND: 7
#driver_HSTRT: 0
#driver_PWM_AUTOSCALE: True
#driver_PWM_FREQ: 1
#driver_PWM_GRAD: 4
#driver_PWM_AMPL: 128
driver_SGT: 11
diag1_pin: ^!PL2
#diag0_pin: PL2
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
[tmc2130 stepper_y]
cs_pin: PA6 #✓
#spi_speed:
#spi_bus:
#chain_position:
#chain_length:
interpolate: true
run_current: 0.7
hold_current: 0.5
stealthchop_threshold: 110
#driver_IHOLDDELAY: 10
#driver_TPOWERDOWN: 0
#driver_TBL: 1
#driver_TOFF: 4
#driver_HEND: 7
#driver_HSTRT: 0
#driver_PWM_AUTOSCALE: True
#driver_PWM_FREQ: 1
#driver_PWM_GRAD: 4
#driver_PWM_AMPL: 128
driver_SGT: 9
diag1_pin: ^!PL1
#diag0_pin: PL1
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
[tmc2130 stepper_z]
cs_pin: PA4 #✓
#spi_speed:
#spi_bus:
#chain_position:
#chain_length:
interpolate: true
run_current: 0.8
hold_current: 0.5
stealthchop_threshold: 110
#driver_IHOLDDELAY: 10
#driver_TPOWERDOWN: 0
#driver_TBL: 1
#driver_TOFF: 4
#driver_HEND: 7
#driver_HSTRT: 0
#driver_PWM_AUTOSCALE: True
#driver_PWM_FREQ: 1
#driver_PWM_GRAD: 4
#driver_PWM_AMPL: 128
driver_SGT: 5
diag1_pin: ^!PL0
#diag0_pin: PL0
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
[tmc2130 extruder]
cs_pin: PC7 #✓
#spi_speed:
#spi_bus:
#chain_position:
#chain_length:
interpolate: true
run_current: 0.8
hold_current: 0.5
stealthchop_threshold: 110
#driver_IHOLDDELAY: 10
#driver_TPOWERDOWN: 0
#driver_TBL: 1
#driver_TOFF: 4
#driver_HEND: 7
#driver_HSTRT: 0
#driver_PWM_AUTOSCALE: True
#driver_PWM_FREQ: 1
#driver_PWM_GRAD: 4
#driver_PWM_AMPL: 128
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
[verify_heater extruder]
max_error: 100
check_gain_time: 30
hysteresis: 5
heating_gain: 2
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
[probe]
pin: ^!PC5 #✓
deactivate_on_each_sample: False
x_offset: 0
y_offset: 0
#z_offset: 0.2
speed: 10
samples: 3
sample_retract_dist: 1
lift_speed: 20
samples_result: average
samples_tolerance: 0.100
samples_tolerance_retries: 3
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
[force_move]
# Enable commands that force potentially unsafe movement
enable_force_move: True
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
[gcode_macro SENSORLESS_HOME]
gcode:
{% set driver_config_x = printer.configfile.settings['tmc2130 stepper_x'] %}
{% set driver_config_y = printer.configfile.settings['tmc2130 stepper_y'] %}
{% set driver_config_z = printer.configfile.settings['tmc2130 stepper_z'] %}
{% set RUN_CUR_X = driver_config_x.run_current %}
{% set RUN_CUR_Y = driver_config_y.run_current %}
{% set RUN_CUR_Z = driver_config_z.run_current %}
SET_TMC_CURRENT STEPPER=stepper_x CURRENT=0.4
SET_TMC_CURRENT STEPPER=stepper_y CURRENT=0.4
SET_TMC_CURRENT STEPPER=stepper_z CURRENT=0.4
SET_PIN PIN=Light VALUE=0.2
SET_PIN PIN=Beeper VALUE=0.2
G4 P100
SET_PIN PIN=Light VALUE=0
SET_PIN PIN=Beeper VALUE=0
G4 P1000
force_move stepper=stepper_z distance=10 velocity=20 accel=200
G4 P1000
G28 X0
G90
G1 X1 F1200
SET_PIN PIN=Light VALUE=0.5
SET_PIN PIN=Beeper VALUE=0.5
G4 P100
SET_PIN PIN=Light VALUE=0
SET_PIN PIN=Beeper VALUE=0
G28 Y0
G90
G1 Y1 F1200
SET_PIN PIN=Light VALUE=0.6
SET_PIN PIN=Beeper VALUE=0.6
G4 P100
SET_PIN PIN=Light VALUE=0
SET_PIN PIN=Beeper VALUE=0
G28 Z0
SET_PIN PIN=Light VALUE=0.7
SET_PIN PIN=Beeper VALUE=0.7
G4 P100
SET_PIN PIN=Light VALUE=0
SET_PIN PIN=Beeper VALUE=0
G90
G1 Z10 F500
#G1 X8 F1200
#G1 Y30 F1200
SET_PIN PIN=Light VALUE=1
SET_PIN PIN=Beeper VALUE=1
G4 P100
SET_PIN PIN=Light VALUE=0
SET_PIN PIN=Beeper VALUE=0
SET_TMC_CURRENT STEPPER=stepper_x CURRENT={RUN_CUR_X}
SET_TMC_CURRENT STEPPER=stepper_y CURRENT={RUN_CUR_Y}
SET_TMC_CURRENT STEPPER=stepper_z CURRENT={RUN_CUR_Z}
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
[homing_override]
gcode: SENSORLESS_HOME
#axes: xyz
#set_position_x:
#set_position_y:
#set_position_z:
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
[bed_mesh]
speed: 70
horizontal_move_z: 6
mesh_min: 2, 15
mesh_max: 208, 220
probe_count: 6, 6
#fade_start: 1.0
#fade_end: 0.0
#fade_target:
#split_delta_z: .025
#move_check_distance: 5.0
#mesh_pps: 2, 2
#algorithm: lagrange
#bicubic_tension: .2
#relative_reference_index:
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
[bed_screws]
screw1: 2, 15
screw2: 208, 15
screw3: 208, 220
screw4: 2, 220
probe_height: 2
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
[screws_tilt_adjust]
screw1: 2, 15
screw2: 208, 15
screw3: 208, 220
screw4: 2, 220
horizontal_move_z: 10
screw_thread: CW-M4
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
[firmware_retraction]
retract_length: 4.5
retract_speed: 50
#unretract_extra_length: 1
unretract_speed: 50
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
[pause_resume]
#recover_velocity: 50.0
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
[gcode_macro M600]
gcode:
{% set X = params.X|default(50)|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_arcs]
#resolution: 1.0
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
# [controller_fan my_controller_fan]
# pin: PE5 #✓
# max_power: 0.6
# shutdown_speed: 0.5
# cycle_time: 0.01
# hardware_pwm: true
# kick_start_time: 10
# #off_below:
# fan_speed: 0.6
# #idle_timeout:
# idle_speed: 0.5
# #heater:
# stepper: stepper_x
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
[temperature_fan PSU]
pin: PB5
max_power: 1
shutdown_speed: 0
cycle_time: 0.02
hardware_pwm: false
kick_start_time: 10
#off_below:
sensor_type: Generic 3950
sensor_pin: PK1
control: watermark
max_delta: 2
min_temp: 0
max_temp: 80
#pid_kp: 130
#pid_ki: 25
#pid_kd: 400
#pid_deriv_time: 3.0
target_temp: 50
max_speed: 1.0
min_speed: 0
gcode_id: PSU
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
[temperature_fan DRV]
pin: PE5
max_power: 0.7
shutdown_speed: 0
cycle_time: 0.02
hardware_pwm: true
kick_start_time: 10
#off_below:
sensor_type: Generic 3950
sensor_pin: PF2
control: watermark
max_delta: 2
min_temp: 0
max_temp: 80
#pid_kp: 130
#pid_ki: 25
#pid_kd: 400
#pid_deriv_time: 3.0
target_temp: 50
max_speed: 1
min_speed: 0
gcode_id: DRV
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
# [led my_led]
# #red_pin:
# #green_pin:
# #blue_pin:
# white_pin: PB7
# cycle_time: 0.010
# hardware_pwm: false
# #initial_RED: 0.0
# #initial_GREEN: 0.0
# #initial_BLUE: 0.0
# #initial_WHITE: 0.0
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
[output_pin Light]
pin: PH6
pwm: True
hardware_pwm: True
value: 0
cycle_time: 0.001
# [output_pin LED_pin_beat]
# pin: PB7
# pwm: True
# hardware_pwm: True
# value: 0
# cycle_time: 0.010
# [delayed_gcode heartBeat]
# initial_duration: 1.
# gcode:
# SET_PIN PIN=LED_pin_beat VALUE=1
# G4 P10
# SET_PIN PIN=LED_pin_beat VALUE=0
# G4 P50
# SET_PIN PIN=LED_pin_beat VALUE=1
# G4 P10
# SET_PIN PIN=LED_pin_beat VALUE=0
# UPDATE_DELAYED_GCODE ID=heartBeat DURATION=2
[delayed_gcode welcome]
initial_duration: 1.
gcode:
SET_PIN PIN=Light VALUE=0.5
SET_PIN PIN=Beeper VALUE=0.5
G4 P100
SET_PIN PIN=Light VALUE=0
SET_PIN PIN=Beeper VALUE=0
G4 P300
SET_PIN PIN=Light VALUE=0.5
SET_PIN PIN=Beeper VALUE=1
G4 P100
SET_PIN PIN=Light VALUE=0
SET_PIN PIN=Beeper VALUE=0
[gcode_macro HomeEnd]
gcode:
SET_PIN PIN=Light VALUE=0.5
SET_PIN PIN=Beeper VALUE=0.5
G4 P100
SET_PIN PIN=Light VALUE=0
SET_PIN PIN=Beeper VALUE=0
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
# [adc_temperature VOLT]
# temperature1: 10
# voltage1: 1.0
# temperature2: 50
# voltage2: 5.0
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
# [temperature_sensor VIN]
# sensor_type: VOLT
# sensor_pin: PF0
# min_temp:0
# max_temp:50
# adc_voltage: 5.0
# voltage_offset: 0.24
# gcode_id: VIN
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
#[temperature_sensor VBED]
#sensor_type: VOLT
#sensor_pin: PF1
#min_temp:0
#max_temp:26
#gcode_id: VBED
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
[temperature_sensor raspberry_pi]
sensor_type: temperature_host
min_temp: 1
max_temp: 100
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
[gcode_macro START_PRINT]
gcode:
{% set BED_TEMP = params.BED_TEMP|default(60)|float %}
{% set EXTRUDER_TEMP = params.EXTRUDER_TEMP|default(190)|float %}
# Start bed heating
M140 S{BED_TEMP}
# Use absolute coordinates
G90
# Reset the G-Code Z offset (adjust Z offset if needed)
SET_GCODE_OFFSET Z=0.0
# Home the printer
G28
# Move the nozzle near the bed
G1 Z5 F3000
# Move the nozzle very close to the bed
G1 Z0.15 F300
# Wait for bed to reach temperature
M190 S{BED_TEMP}
# Set and wait for nozzle to reach temperature
M109 S{EXTRUDER_TEMP}
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
[gcode_macro END_PRINT]
gcode:
# Turn off bed, extruder, and fan
M140 S0
M104 S0
M106 S0
# Move nozzle away from print while retracting
G91
G1 X-2 Y200 E-3 F500
# Raise nozzle by 10mm
G1 Z10 F300
G90
# Disable steppers
M84
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
[output_pin Beeper]
pin: PD3
# Beeper pin. This parameter must be provided.
# ar37 is the default RAMPS/MKS pin.
pwm: True
# A piezo beeper needs a PWM signal, a DC buzzer doesn't.
value: 0
# Silent at power on, set to 1 if active low.
shutdown_value: 0
# Disable at emergency shutdown (no PWM would be available anyway).
cycle_time: 0.001
# Default PWM frequency : 0.001 = 1ms will give a tone of 1kHz
# Although not pitch perfect.
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
[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 VALUE=0.5 CYCLE_TIME={ 1.0/S if S > 0 else 1 }
G4 P{P}
SET_PIN PIN=Beeper VALUE=0
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
[gcode_macro LOAD_FILAMENT]
gcode:
{% set speed = params.SPEED|default(300) %}
{% set max_velocity = printer.configfile.settings['extruder'].max_extrude_only_velocity %}
M300 # beep
G91
G92 E0
G1 E350 F{max_velocity}
G1 E25 F{speed} #purge
M300
M300
[gcode_macro UNLOAD_FILAMENT]
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
gcode:
{% set speed = params.SPEED|default(300) %}
{% set max_velocity = printer.configfile.settings['extruder'].max_extrude_only_velocity %}
G91
M300 # beep
G92 E0
G1 E25 F{speed} # purge
G1 E-420 F{max_velocity}
M300
M300
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
[gcode_macro M600]
gcode:
{% set X = params.X|default(50)|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 M205]
gcode:
{% if 'X' in params %}
SET_VELOCITY_LIMIT SQUARE_CORNER_VELOCITY={params.X}
{% elif 'Y' in params %}
SET_VELOCITY_LIMIT SQUARE_CORNER_VELOCITY={params.Y}
{% endif %}
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
# Cancel object (aka Marlin/RRF M486 commands) support
#
# Enable object exclusion
[exclude_object]
[gcode_macro M486]
gcode:
# Parameters known to M486 are as follows:
# [C<flag>] Cancel the current object
# [P<index>] Cancel the object with the given index
# [S<index>] Set the index of the current object.
# If the object with the given index has been canceled, this will cause
# the firmware to skip to the next object. The value -1 is used to
# indicate something that isn’t an object and shouldn’t be skipped.
# [T<count>] Reset the state and set the number of objects
# [U<index>] Un-cancel the object with the given index. This command will be
# ignored if the object has already been skipped
{% if 'exclude_object' not in printer %}
{action_raise_error("[exclude_object] is not enabled")}
{% endif %}
{% if 'T' in params %}
EXCLUDE_OBJECT RESET=1
{% for i in range(params.T | int) %}
EXCLUDE_OBJECT_DEFINE NAME={i}
{% endfor %}
{% endif %}
{% if 'C' in params %}
EXCLUDE_OBJECT CURRENT=1
{% endif %}
{% if 'P' in params %}
EXCLUDE_OBJECT NAME={params.P}
{% endif %}
{% if 'S' in params %}
{% if params.S == '-1' %}
{% if printer.exclude_object.current_object %}
EXCLUDE_OBJECT_END NAME={printer.exclude_object.current_object}
{% endif %}
{% else %}
EXCLUDE_OBJECT_START NAME={params.S}
{% endif %}
{% endif %}
{% if 'U' in params %}
EXCLUDE_OBJECT RESET=1 NAME={params.U}
{% endif %}
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
#[gcode_button my_gcode_button]
#pin:
# The pin on which the button is connected. This parameter must be
# provided.
#analog_range:
# Two comma separated resistances (in Ohms) specifying the minimum
# and maximum resistance range for the button. If analog_range is
# provided then the pin must be an analog capable pin. The default
# is to use digital gpio for the button.
#analog_pullup_resistor:
# The pullup resistance (in Ohms) when analog_range is specified.
# The default is 4700 ohms.
#press_gcode:
# A list of G-Code commands to execute when the button is pressed.
# G-Code templates are supported. This parameter must be provided.
#release_gcode:
# A list of G-Code commands to execute when the button is released.
# G-Code templates are supported. The default is to not run any
# commands on a button release.
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
#*# <---------------------- SAVE_CONFIG ---------------------->
#*# DO NOT EDIT THIS BLOCK OR BELOW. The contents are auto-generated.
#*#
#*# [bed_mesh default]
#*# version = 1
#*# points =
#*# 1.353125, 1.497292, 1.552917, 1.563333, 1.493542, 1.338750
#*# 1.345417, 1.527708, 1.597708, 1.622708, 1.552708, 1.431458
#*# 1.326875, 1.535625, 1.632292, 1.655833, 1.593750, 1.443542
#*# 1.318542, 1.545833, 1.662917, 1.697708, 1.631875, 1.462292
#*# 1.344167, 1.593333, 1.706667, 1.741042, 1.678750, 1.484375
#*# 1.290833, 1.613750, 1.719167, 1.755833, 1.666875, 1.431250
#*# tension = 0.2
#*# min_x = 2.0
#*# algo = lagrange
#*# y_count = 6
#*# mesh_y_pps = 2
#*# min_y = 15.0
#*# x_count = 6
#*# max_y = 220.0
#*# mesh_x_pps = 2
#*# max_x = 208.0
#*#
#*# [heater_bed]
#*# control = pid
#*# pid_kp = 67.836
#*# pid_ki = 1.181
#*# pid_kd = 974.291
#*#
#*# [extruder]
#*# control = pid
#*# pid_kp = 34.412
#*# pid_ki = 1.616
#*# pid_kd = 183.246
#*#
#*# [probe]
#*# z_offset = 0.015