-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathprinter-gtmax3d-core-a1v1.cfg
473 lines (432 loc) · 12.6 KB
/
printer-gtmax3d-core-a1v1.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
# Elaborado e testado por @zenaro147
# Aquivo de configuração para a GTMax Core A1 v1.
# Esta configuração é baseada na impressora usando toda eletronica original.
# Nesse código consta apenas um upgrade, um sensor de filamento, já que esse modelo foi lançado sem tal funcionalidade.
# Essa configuração foi baseada no Klipper com a interface Mainsail
# Antes de usar, recomendo recalibrar o PID da mesa e da extrusora, usando os comandos "PID_CALIBRATE HEATER=heater_bed TARGET=110" e "PID_CALIBRATE HEATER=extruder TARGET=240"
# Caso necessário ajuste também o offset do probe em relação ao bico, seguindo a documentacao https://www.klipper3d.org/Probe_Calibrate.html. Lembre de mudar o "home_xy_position", "mesh_min" e "mesh_max" caso faça isso e gere valores diferentes
[include mainsail.cfg]
[stepper_x]
step_pin: PF0
dir_pin: !PF1
enable_pin: !PD7
microsteps: 16
rotation_distance: 40
endstop_pin: ^!PE5
position_endstop: -5
position_min: -5
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: 200
homing_speed: 50
[stepper_z]
step_pin: PL3
dir_pin: !PL1
enable_pin: !PK0
microsteps: 16
rotation_distance: 8
position_max: 250
endstop_pin: probe:z_virtual_endstop
position_min: -5
[extruder]
step_pin: PA4
dir_pin: PA6
enable_pin: !PA2
microsteps: 16
rotation_distance: 8.547
nozzle_diameter: 0.400
filament_diameter: 1.750
heater_pin: PB4
sensor_type: EPCOS 100K B57560G104F
sensor_pin: PK5
#control: pid
#pid_Kp: 32.81
#pid_Ki: 3.84
#pid_Kd: 70.15
min_temp: 0
max_temp: 250
max_extrude_only_velocity: 100
max_extrude_only_accel: 3000
min_extrude_temp: 150
[fan]
pin: PH6
[heater_bed]
heater_pin: PH5
sensor_type: EPCOS 100K B57560G104F
sensor_pin: PK6
#control: watermark
min_temp: 0
max_temp: 130
[safe_z_home]
home_xy_position: 162, 139 ;Visto que a mesa tem 300x200, ao aplicar o offset, o probe mede em 150x100
speed: 50
z_hop: 15
[probe]
pin: ^PD3
#z_offset: 4.350 ;Valores originais
#x_offset: -18 ;Valores originais
#y_offset: -43 ;Valores originais
x_offset: -12 ;Novos valores após medicao seguindo a documentacao https://www.klipper3d.org/Probe_Calibrate.html
y_offset: -39 ;Novos valores após medicao seguindo a documentacao https://www.klipper3d.org/Probe_Calibrate.html
samples: 2
[bed_mesh]
#mesh_min: 27, 63 ;Valores originais
#mesh_max: 295, 193 ;Valores originais
mesh_min: 15, 24 ;Adaptado para offset do probe
mesh_max: 283, 154 ;Adaptado para offset do probe
probe_count: 5, 4 ;Original é 3x3, mas alterei para 5x4
horizontal_move_z: 10 ;Dependendo do desnivel, o valor padrao pode ser pouco. 10 é um valor seguro
algorithm: bicubic
[gcode_macro G29]
gcode:
BED_MESH_CLEAR
BED_MESH_CALIBRATE
G1 Z10 F12000
G1 X8 Y35
G1 Z1
G1 Z10
[display_status]
[display]
lcd_type: hd44780
rs_pin: EXP1_4
e_pin: EXP1_3
d4_pin: EXP1_5
d5_pin: EXP1_6
d6_pin: EXP1_7
d7_pin: EXP1_8
encoder_pins: ^EXP2_3, ^EXP2_5
click_pin: ^!EXP1_2
kill_pin: ^!EXP2_8
[output_pin BEEPER_pin]
pin: EXP1_1
pwm: True
value: 0.
shutdown_value: 0
cycle_time: 0.001
[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
[board_pins]
aliases:
# Common EXP1 header found on many "all-in-one" ramps clones
EXP1_1=PC0, EXP1_3=PH0, EXP1_5=PA1, EXP1_7=PA5, EXP1_9=<GND>,
EXP1_2=PC2, EXP1_4=PH1, EXP1_6=PA3, EXP1_8=PA7, EXP1_10=<5V>,
# EXP2 header
EXP2_1=PB3, EXP2_3=PC6, EXP2_5=PC4, EXP2_7=PL0, EXP2_9=<GND>,
EXP2_2=PB1, EXP2_4=PB0, EXP2_6=PB2, EXP2_8=PG0, EXP2_10=<RST>
# Pins EXP2_1, EXP2_6, EXP2_2 are also MISO, MOSI, SCK of bus "spi"
[mcu]
serial: /dev/serial/by-id/usb-1a86_USB_Serial-if00-port0
[printer]
kinematics: corexy
max_velocity: 200
max_accel: 2000
max_z_velocity: 50
max_z_accel: 1000
#max_velocity: 100
#max_accel: 1500
#max_z_velocity: 20
#max_z_accel: 100
square_corner_velocity: 1
######################################################################
# Códigos Upgrades/Funcoes
######################################################################
# --------------------------------------------------
# Habilita modulo de probe manual
# --------------------------------------------------
[manual_probe]
# --------------------------------------------------
# Suporte para comandos gcode arc (G2/G3)
# --------------------------------------------------
[gcode_arcs]
resolution: 0.5
# --------------------------------------------------
# Sensor de filamento
# --------------------------------------------------
[pause_resume]
[filament_switch_sensor e0_sensor]
pause_on_runout: True
# When set to True, a PAUSE will execute immediately after a runout
# is detected. Note that if pause_on_runout is False and the
# runout_gcode is omitted then runout detection is disabled. Default
# is True.
switch_pin: ^!PK1
# The pin on which the switch is connected. This parameter must be
# provided.
runout_gcode:
REMOVE_FILAMENT
# A list of G-Code commands to execute after a filament runout is
# detected. See docs/Command_Templates.md for G-Code format. If
# pause_on_runout is set to True this G-Code will run after the
# PAUSE is complete. The default is not to run any G-Code commands.
insert_gcode:
INSERT_FILAMENT
# A list of G-Code commands to execute after a filament insert is
# detected. See docs/Command_Templates.md for G-Code format. The
# default is not to run any G-Code commands, which disables insert
# detection.
event_delay: 3
# The minimum amount of time in seconds to delay between events.
# Events triggered during this time period will be silently
# ignored. The default is 3 seconds.
[gcode_macro REMOVE_FILAMENT]
gcode:
G91
G90
G1 X150 Y0 F12000
M400
G1 X0 Y100 F3600
M400
M83
M104 S200
M117 Retirando Filamento
G1 E50 F300
M400
M109 S200
M104 S160
M117 Retirando Filamento
G1 E-50 F200 ;Retrai o Filamento Devagar
G1 E-50 F200 ;Retrai o Filamento Devagar
M400
M109 S160
M117 Retirando Filamento
G1 E-50 F1200 ;Retira o resto do filamento
G1 E-50 F1200 ;Retira o resto do filamento
G1 E-50 F1200 ;Retira o resto do filamento
G1 E-50 F1200 ;Retira o resto do filamento
G1 E-50 F1200 ;Retira o resto do filamento
G1 E-50 F1200 ;Retira o resto do filamento
G1 E-50 F1200 ;Retira o resto do filamento
G1 E-50 F1200 ;Retira o resto do filamento
G1 E-50 F1200 ;Retira o resto do filamento
G1 E-50 F1200 ;Retira o resto do filamento
G1 E-50 F1200 ;Retira o resto do filamento
G1 E-50 F1200 ;Retira o resto do filamento
G1 E-50 F1200 ;Retira o resto do filamento
G1 E-50 F1200 ;Retira o resto do filamento
M400
M117 Carregar Filamento
M300 S4 P500
M400
M104 S0
M117 Carregar Filamento
SET_STEPPER_ENABLE STEPPER=extruder ENABLE=0 ;Permite desligar o Stepper da extrusora. Necessário pois esse script precisa que o filamento seja carregado até o "clip" que segura o tubo
[gcode_macro INSERT_FILAMENT]
gcode:
G4 P10000 ;Espera 10 segundos antes de realizar a carga
SET_STEPPER_ENABLE STEPPER=extruder ENABLE=1 ;Liga novamente o Stepper da extrusora.
M83
M117 EsperandoTemperatura
M104 S233
M117 Carregando Filamento
G1 E50 F1200 ;Carrega o filamento novo
G1 E50 F1200 ;Carrega o filamento novo
G1 E50 F1200 ;Carrega o filamento novo
G1 E50 F1200 ;Carrega o filamento novo
G1 E50 F1200 ;Carrega o filamento novo
G1 E50 F1200 ;Carrega o filamento novo
G1 E50 F1200 ;Carrega o filamento novo
G1 E50 F1200 ;Carrega o filamento novo
G1 E50 F1200 ;Carrega o filamento novo
G1 E50 F1200 ;Carrega o filamento novo
G1 E50 F1200 ;Carrega o filamento novo
G1 E50 F1200 ;Carrega o filamento novo
G1 E50 F1200 ;Carrega o filamento novo
G1 E50 F1200 ;Carrega o filamento novo
M400
G1 E50 F300 ;Carrega o filamento novo
G1 E50 F300 ;Carrega o filamento novo
M400
M109 S233
M117 Carregando Filamento
G1 E50 F200 ;Faz uma purga para tirar sujeira de cor
M400
G1 X0 Y0 F12000
M400
G1 X0 Y100 F12000
M400
G91
G90
M117 Filamento Pronto
# --------------------------------------------------
# Comando M600 para troca de filamento
# --------------------------------------------------
[gcode_macro M600]
gcode:
SAVE_GCODE_STATE NAME=M600_state
PAUSE
REMOVE_FILAMENT
RESTORE_GCODE_STATE NAME=M600_state
# --------------------------------------------------
# Comando M0 para Pausa
# --------------------------------------------------
[gcode_macro M0]
gcode:
SAVE_GCODE_STATE NAME=M0_state
PAUSE
RESTORE_GCODE_STATE NAME=M0_state
# --------------------------------------------------
# Cancelar Impressão (comando customizado)
# --------------------------------------------------
[gcode_macro CANCEL_PRINT]
description: Cancel the actual running print
rename_existing: CANCEL_PRINT_BASE
gcode:
#https://klipper.info/macro-examples-1/aboms-cancel_print
M220 S100 ; Reset Speed factor override percentage to default (100%)
M221 S100 ; Reset Extrude factor override percentage to default (100%)
G91 ; Set coordinates to relative
{% if printer.extruder.temperature >= 170 %}
G1 F1800 E-3; Retract filament 3 mm to prevent oozing
{% endif %}
G90 ; Set coordinates to absolute
{% if printer.toolhead.homed_axes == "xyz" %}
G0 X0 Y100 F4000;
TURN_OFF_HEATERS
{% endif %}
M84 ; DESLIGA MOTORES
M106 S0 ; DESLIGA VENTILADOR
CANCEL_PRINT_BASE
# --------------------------------------------------
# Suporte ao gcode M486 (cancelar objetos)
# --------------------------------------------------
[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 %}
# --------------------------------------------------
# Macos customizadas
# --------------------------------------------------
[gcode_macro Inserir_Filamento]
gcode:
M83
M109 S170
M117 Esperando Temp
M104 S233
M117 Carregando Filamento
G1 E50 F1200
G1 E50 F1200
G1 E50 F1200
G1 E50 F1200
G1 E50 F1200
G1 E50 F1200
G1 E50 F1200
G1 E50 F1200
G1 E50 F1200
G1 E50 F1200
G1 E50 F1200
G1 E50 F1200
G1 E50 F1200
G1 E50 F300
M400
M109 S233
M117 Carregando Filamento
G1 E50 F200
M400
M84
TURN_OFF_HEATERS
M300 S600 P500
[gcode_macro Retirar_Filamento]
gcode:
M83
M109 S230
M104 S200
M117 Retirando Filamento
G1 E50 F300
M400
M109 S200
M104 S170
M117 Retirando Filamento
G1 E-50 F200
G1 E-50 F200
M400
M109 S170
M117 Retirando Filamento
G1 E-50 F1200
G1 E-50 F1200
G1 E-50 F1200
G1 E-50 F1200
G1 E-50 F1200
G1 E-50 F1200
G1 E-50 F1200
G1 E-50 F1200
G1 E-50 F1200
G1 E-50 F1200
G1 E-50 F1200
G1 E-50 F1200
G1 E-50 F1200
G1 E-50 F1200
M400
M117 Carregar Filamento
M300 S4 P500
M400
M84
TURN_OFF_HEATERS
M300 S600 P500
#*# <---------------------- SAVE_CONFIG ---------------------->
#*# DO NOT EDIT THIS BLOCK OR BELOW. The contents are auto-generated.
#*#
#*# [extruder]
#*# control = pid
#*# pid_kp = 26.112
#*# pid_ki = 1.612
#*# pid_kd = 105.752
#*#
#*# [heater_bed]
#*# control = pid
#*# pid_kp = 67.822
#*# pid_ki = 2.540
#*# pid_kd = 452.713
#*#
#*# [probe]
#*# z_offset = 4.409