-
-
Notifications
You must be signed in to change notification settings - Fork 35
/
Copy pathSET_MATERIAL.cfg
78 lines (71 loc) · 3.4 KB
/
SET_MATERIAL.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
## Copyright (C) 2023 Chris Laprade
##
## This file is part of zippy_config.
##
## zippy_config is free software: you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation, either version 3 of the License, or
## (at your option) any later version.
##
## zippy_config is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with zippy_config. If not, see <http://www.gnu.org/licenses/>.
#####################################
## Set Material ##
## Version 1.0 2023-4-2 ##
#####################################
## Set Material-specific Configs
##
## Add this immediately after your start_print line of the start gcode in Prusa/SuperSlicer:
## SET_MATERIAL MATERIAL='{filament_type[initial_extruder]}'
##
## Add this immediately after your start_print line of the start gcode in Cura:
## SET_MATERIAL MATERIAL='{material_type}'
##
[gcode_macro SET_MATERIAL]
description: Set values based on material type
variable_material: ''
gcode:
{% set MATERIAL = params.MATERIAL|default('PLA')|string %} ; Get material type from slicer
SET_GCODE_VARIABLE MACRO=SET_MATERIAL VARIABLE=material VALUE='"{MATERIAL}'" ; Save the material type to a variable just because
{% if MATERIAL == 'PLA' %} ; If material type is PLA
BED_MESH_PROFILE LOAD="pla_mesh" ; Load bed mesh
SET_PRESSURE_ADVANCE ADVANCE=0.035 SMOOTH_TIME=0.040 ; Set pressure_advance settings
SET_GCODE_OFFSET Z=0 ; Set z_offset
SET_VELOCITY_LIMIT VELOCITY=100 ACCEL=2000 ; Set max speed/acceleration
SET_INPUT_SHAPER SHAPER_FREQ_X=58.6 SHAPER_FREQ_Y=34.2 SHAPER_TYPE_X=mzv SHAPER_TYPE_Y=mzv ; Set input_shaper
{% elif MATERIAL == 'ABS' %} ; If material type is ABS
BED_MESH_PROFILE LOAD="abs_mesh" ; Load bed mesh
SET_PRESSURE_ADVANCE ADVANCE=0.035 SMOOTH_TIME=0.040 ; Set pressure_advance settings
SET_GCODE_OFFSET Z=0 ; Set z_offset
{%else %} ; If any other material type
BED_MESH_PROFILE LOAD="default" ; Load bed mesh
SET_PRESSURE_ADVANCE ADVANCE=0.035 SMOOTH_TIME=0.040 ; Set pressure_advance settings
SET_GCODE_OFFSET Z=0 ; Set z_offset
{% endif %}
## Set nozzle-specific Configs
##
## Add this immediately after your start_print line of the start gcode in Prusa/SuperSlicer:
## SET_NOZZLE NOZZLE='{nozzle_diameter[initial_extruder]}'
##
## Add this immediately after your start_print line of the start gcode in Cura:
## SET_NOZZLE NOZZLE='{machine_nozzle_size}'
##
[gcode_macro SET_NOZZLE]
description: Set values based on nozzle diameter
variable_nozzle: 0
gcode:
{% set NOZZLE = params.NOZZLE|default(0.4)|float %} ; Get nozzle diameter from slicer
SET_GCODE_VARIABLE MACRO=SET_NOZZLE VARIABLE=nozzle VALUE={NOZZLE} ; Save the nozzle diameter to a variable just because
{% if NOZZLE == 0.4 %} ; If nozzle diameter is 0.4
## Set z_offset settings
SET_GCODE_OFFSET Z=0 ; Set z_offset
{% elif NOZZLE == 0.2 %} ; If nozzle diameter is 0.2
SET_GCODE_OFFSET Z=0 ; Set z_offset
{%else %} ; If any other nozzle diameter
SET_GCODE_OFFSET Z=0 ; Set z_offset
{% endif %}