-
Notifications
You must be signed in to change notification settings - Fork 1
/
printer_creality-cr-x.cfg
281 lines (236 loc) · 8.73 KB
/
printer_creality-cr-x.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
##----edit to suit your printer
[mcu]
serial: /dev/serial/by-id/*
[stepper_x]
step_pin: PF0
dir_pin: PF1
enable_pin: !PD7
microsteps: 16
rotation_distance: 40
endstop_pin: ^PE5
position_endstop: 0
position_max: 300
homing_speed: 50
[stepper_y]
step_pin: PF6
dir_pin: !PF7
enable_pin: !PF2
microsteps: 16
rotation_distance: 40
endstop_pin: ^PJ1
position_endstop: 0
position_max: 310
homing_speed: 50
[stepper_z]
step_pin: PL3
dir_pin: !PL1
enable_pin: !PK0
microsteps: 16
rotation_distance: 8
endstop_pin: ^PD3
position_endstop: 10
position_max: 400
position_min: -6.0
[extruder]
step_pin: PA4
dir_pin: PA6
enable_pin: !PA2
microsteps: 16
rotation_distance: 23.072855
nozzle_diameter: 0.400
filament_diameter: 1.750
heater_pin: PB4
sensor_type: EPCOS 100K B57560G104F
sensor_pin: PK5
control: pid
pid_Kp: 22.2
pid_Ki: 1.08
pid_Kd: 114
min_temp: 0
max_temp: 265
pressure_advance: 0.155
max_extrude_only_distance: 100.0
[extruder1]
step_pin: PC1
dir_pin: PC3
enable_pin: !PC7
microsteps: 16
rotation_distance: 23.072855
nozzle_diameter: 0.400
filament_diameter: 1.750
shared_heater: extruder
pressure_advance: 0.155
max_extrude_only_distance: 100.0
[heater_bed]
heater_pin: PH5
sensor_type: ATC Semitec 104GT-2
sensor_pin: PK6
control: pid
pid_Kp: 690.34
pid_Ki: 111.47
pid_Kd: 1068.83
min_temp: 0
max_temp: 130
[fan]
pin: PH6
[bed_screws]
screw1: 25, 50
screw2: 265, 50
screw3: 265, 270
screw4: 25, 270
[printer]
kinematics: cartesian
max_velocity: 300
max_accel: 5000
max_z_velocity: 10
max_z_accel: 1000
square_corner_velocity: 5.0
[input_shaper]
shaper_type_x = mzv
shaper_freq_x = 78.8
shaper_type_y = 2hump_ei
shaper_freq_y = 45.6
[pause_resume]
[respond]
default_type: echo
[virtual_sdcard]
path: ~/printer_data/gcodes
on_error_gcode: CANCEL_PRINT
[pause_resume]
[display_status]
[gcode_macro CANCEL_PRINT]
description: Cancel the actual running print
rename_existing: CANCEL_PRINT_BASE
gcode:
##### get user parameters or use default #####
{% set macro_found = True if printer['gcode_macro _CLIENT_VARIABLE'] is defined else False %}
{% set client = printer['gcode_macro _CLIENT_VARIABLE'] %}
{% set allow_park = False if not macro_found
else False if client.park_at_cancel is not defined
else True if client.park_at_cancel|lower == 'true'
else False %}
{% set retract = 5.0 if not macro_found else client.cancel_retract|default(5.0)|abs %}
##### define park position #####
{% set park_x = "" if not macro_found
else "" if client.park_at_cancel_x is not defined
else "X=" + client.park_at_cancel_x|string if client.park_at_cancel_x is not none %}
{% set park_y = "" if not macro_found
else "" if client.park_at_cancel_y is not defined
else "Y=" + client.park_at_cancel_y|string if client.park_at_cancel_y is not none %}
{% set custom_park = True if (park_x|length > 0 or park_y|length > 0) else False %}
##### end of definitions #####
{% if (custom_park or not printer.pause_resume.is_paused) and allow_park %} _TOOLHEAD_PARK_PAUSE_CANCEL {park_x} {park_y} {% endif %}
_CLIENT_RETRACT LENGTH={retract}
TURN_OFF_HEATERS
M106 S0
# clear pause_next_layer and pause_at_layer as preparation for next print
CANCEL_PRINT_BASE
[gcode_macro PAUSE]
description: Pause the actual running print
rename_existing: PAUSE_BASE
gcode:
PAUSE_BASE
_TOOLHEAD_PARK_PAUSE_CANCEL {rawparams}
[gcode_macro RESUME]
description: Resume the actual running print
rename_existing: RESUME_BASE
gcode:
##### get user parameters or use default #####
{% set macro_found = True if printer['gcode_macro _CLIENT_VARIABLE'] is defined else False %}
{% set client = printer['gcode_macro _CLIENT_VARIABLE'] %}
{% set velocity = printer.configfile.settings.pause_resume.recover_velocity %}
{% set sp_move = velocity if not macro_found else client.speed_move|default(velocity) %}
##### end of definitions #####
_CLIENT_EXTRUDE
RESUME_BASE VELOCITY={params.VELOCITY|default(sp_move)}
##### internal use #####
[gcode_macro _TOOLHEAD_PARK_PAUSE_CANCEL]
description: Helper: park toolhead used in PAUSE and CANCEL_PRINT
gcode:
##### get user parameters or use default #####
{% set macro_found = True if printer['gcode_macro _CLIENT_VARIABLE'] is defined else False %}
{% set client = printer['gcode_macro _CLIENT_VARIABLE'] %}
{% set velocity = printer.configfile.settings.pause_resume.recover_velocity %}
{% set use_custom = False if not macro_found
else False if client.use_custom_pos is not defined
else True if client.use_custom_pos|lower == 'true'
else False %}
{% set custom_park_x = 0.0 if not macro_found else client.custom_park_x|default(0.0) %}
{% set custom_park_y = 0.0 if not macro_found else client.custom_park_y|default(0.0) %}
{% set park_dz = 2.0 if not macro_found else client.custom_park_dz|default(2.0)|abs %}
{% set sp_hop = 900 if not macro_found else client.speed_hop|default(15) * 60 %}
{% set sp_move = velocity * 60 if not macro_found else client.speed_move|default(velocity) * 60 %}
##### get config and toolhead values #####
{% set origin = printer.gcode_move.homing_origin %}
{% set act = printer.gcode_move.gcode_position %}
{% set max = printer.toolhead.axis_maximum %}
{% set cone = printer.toolhead.cone_start_z|default(max.z) %} ; height as long the toolhead can reach max and min of an delta
{% set round_bed = True if printer.configfile.settings.printer.kinematics is in ['delta','polar','rotary_delta','winch']
else False %}
##### define park position #####
{% set z_min = params.Z_MIN|default(0)|float %}
{% set z_park = [[(act.z + park_dz), z_min]|max, (max.z - origin.z)]|min %}
{% set x_park = params.X if params.X is defined
else custom_park_x if use_custom
else 0.0 if round_bed
else (max.x - 5.0) %}
{% set y_park = params.Y if params.Y is defined
else custom_park_y if use_custom
else (max.y - 5.0) if round_bed and z_park < cone
else 0.0 if round_bed
else (max.y - 5.0) %}
##### end of definitions #####
_CLIENT_RETRACT
{% if "xyz" in printer.toolhead.homed_axes %}
G90
G1 Z{z_park} F{sp_hop}
G1 X{x_park} Y{y_park} F{sp_move}
{% if not printer.gcode_move.absolute_coordinates %} G91 {% endif %}
{% else %}
{action_respond_info("Printer not homed")}
{% endif %}
[gcode_macro _CLIENT_EXTRUDE]
description: Extrudes, if the extruder is hot enough
gcode:
{% set macro_found = True if printer['gcode_macro _CLIENT_VARIABLE'] is defined else False %}
{% set client = printer['gcode_macro _CLIENT_VARIABLE'] %}
{% set use_fw_retract = False if not macro_found
else False if client.use_fw_retract is not defined
else True if client.use_fw_retract|lower == 'true' and printer.firmware_retraction is defined
else False %}
{% set length = (params.LENGTH|float) if params.LENGTH is defined
else 1.0 if not macro_found
else client.unretract|default(1.0) %}
{% set speed = params.SPEED if params.SPEED is defined
else 35 if not macro_found
else client.speed_unretract|default(35) %}
{% set absolute_extrude = printer.gcode_move.absolute_extrude %}
{% if printer.extruder.can_extrude %}
{% if use_fw_retract %}
{% if length < 0 %}
G10
{% else %}
G11
{% endif %}
{% else %}
M83
G1 E{length} F{(speed|float|abs) * 60}
{% if absolute_extrude %}
M82
{% endif %}
{% endif %}
{% else %}
{action_respond_info("Extruder not hot enough")}
{% endif %}
[gcode_macro _CLIENT_RETRACT]
description: Retracts, if the extruder is hot enough
gcode:
{% set macro_found = True if printer['gcode_macro _CLIENT_VARIABLE'] is defined else False %}
{% set client = printer['gcode_macro _CLIENT_VARIABLE'] %}
{% set length = (params.LENGTH|float) if params.LENGTH is defined
else 1.0 if not macro_found
else client.retract|default(1.0) %}
{% set speed = params.SPEED if params.SPEED is defined
else 35 if not macro_found
else client.speed_retract|default(35) %}
_CLIENT_EXTRUDE LENGTH=-{length|float|abs} SPEED={speed|float|abs}