-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmacros_idre.cfg
561 lines (508 loc) · 17.6 KB
/
macros_idre.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
########################################
# VOLUMIC IDRE Macro configuration
########################################
[gcode_macro START_PRINT]
description: Start a new running print
gcode:
BED_MESH_PROFILE LOAD=default
SET_LED LED="Eclairage_LEDs" RED=1 GREEN=1 BLUE=1 SYNC=0 TRANSMIT=1
M117 Demarrage
M107
{% if params.BED is defined %}
{% set bedtemp = params.BED|default(0)|int %}
{% else %}
{% set bedtemp = 0 %}
{% endif %}
{% if params.EXTRUDER is defined %}
{% set e0temp = params.EXTRUDER|default(0)|int %}
{% else %}
{% set e0temp = 0 %}
{% endif %}
{% if params.EXTRUDER1 is defined %}
{% set e1temp = params.EXTRUDER1|default(0)|int %}
{% else %}
{% set e1temp = 0 %}
{% endif %}
M140 S{bedtemp}
M104 T0 S{e0temp}
M104 T1 S{e1temp}
G90
M82
G28
G92 E0
G1 Z3 F800
{% if params.MIRROR is defined %}
MODE_MIRROR
{% endif %}
{% if params.COPY is defined %}
MODE_COPY
{% endif %}
{% if params.WAITBED is defined %}
M190 S{bedtemp}
{% endif %}
M109 T0 S{e0temp}
M109 T1 S{e1temp}
M117 Impression
[gcode_macro END_PRINT]
gcode:
SET_LED LED="Eclairage_LEDs" RED=0 GREEN=0 BLUE=1 SYNC=0 TRANSMIT=1
TURN_OFF_HEATERS
M107
G28 X Y
#T0
#T1
#T0
#{% set maxY = printer.configfile.config.stepper_y.position_max %}
#G1 Y{maxY} F21000
M84
[gcode_macro T0]
description: Select extruder 0 (left)
gcode:
SET_GCODE_OFFSET X=0 MOVE=1
SET_GCODE_OFFSET Y=0 MOVE=1
SET_GCODE_OFFSET Z=0 MOVE=1
{% set idremode = printer.dual_carriage.carriage_1 %}
{% if "xyz" in printer.toolhead.homed_axes and (idremode == "PRIMARY" or idremode == "INACTIVE") %}
SAVE_GCODE_STATE NAME=park1
G90
ACTIVATE_EXTRUDER EXTRUDER=extruder1
SET_DUAL_CARRIAGE CARRIAGE=1
{% set maxX = printer.configfile.config.dual_carriage.position_max|float - printer["gcode_macro VOLUMIC_Settings"].idre_x_offset|float %}
G1 X{maxX} F21000
RESTORE_GCODE_STATE NAME=park1
{% endif %}
SET_GCODE_OFFSET X=0 MOVE=1
SET_GCODE_OFFSET Y=0 MOVE=1
SET_GCODE_OFFSET Z=0 MOVE=1
ACTIVATE_EXTRUDER EXTRUDER=extruder
{% if idremode == "PRIMARY" or idremode == "INACTIVE" %}
SET_DUAL_CARRIAGE CARRIAGE=0
{% endif %}
[gcode_macro T1]
description: Select extruder 1 (right)
gcode:
{% if "xyz" in printer.toolhead.homed_axes %}
SAVE_GCODE_STATE NAME=park2
G90
ACTIVATE_EXTRUDER EXTRUDER=extruder
SET_DUAL_CARRIAGE CARRIAGE=0
G1 X0 F21000
RESTORE_GCODE_STATE NAME=park2
{% endif %}
SET_GCODE_OFFSET X={printer["gcode_macro VOLUMIC_Settings"].idre_x_offset} MOVE=1
SET_GCODE_OFFSET Y={printer["gcode_macro VOLUMIC_Settings"].idre_y_offset} MOVE=1
SET_GCODE_OFFSET Z={printer["gcode_macro VOLUMIC_Settings"].idre_z_offset} MOVE=1
ACTIVATE_EXTRUDER EXTRUDER=extruder1
SET_DUAL_CARRIAGE CARRIAGE=1
[gcode_macro MODE_COPY]
description: Extruder 1 copy extruder 0
gcode:
SET_DUAL_CARRIAGE CARRIAGE=0 MODE=PRIMARY
G1 X0 F21000
ACTIVATE_EXTRUDER EXTRUDER=extruder
SET_DUAL_CARRIAGE CARRIAGE=1 MODE=PRIMARY
{% set HalfmaxX = printer.configfile.config.dual_carriage.position_max|int / 2 %}
G1 X{HalfmaxX} F21000
SET_DUAL_CARRIAGE CARRIAGE=1 MODE=COPY
SYNC_EXTRUDER_MOTION EXTRUDER=extruder1 MOTION_QUEUE=extruder
[gcode_macro MODE_MIRROR]
description: Extruder 1 copy reversed extruder 0
gcode:
SET_DUAL_CARRIAGE CARRIAGE=0 MODE=PRIMARY
G1 X0 F21000
ACTIVATE_EXTRUDER EXTRUDER=extruder
SET_DUAL_CARRIAGE CARRIAGE=1 MODE=PRIMARY
{% set maxX = printer.configfile.config.dual_carriage.position_max %}
G1 X{maxX} F21000
SET_DUAL_CARRIAGE CARRIAGE=1 MODE=MIRROR
SYNC_EXTRUDER_MOTION EXTRUDER=extruder1 MOTION_QUEUE=extruder
[gcode_macro MODE_NORMAL]
description: Extruder 1 & 2 independant
gcode:
G28 X
[gcode_macro M600]
description: GCODE de changement de filament (compatibilité)
gcode:
PAUSE
M83
G92 E0.0
G0 E-150 F300
G92 E0.0
M82
[gcode_macro M601]
description: GCODE de pause impression (compatibilité)
gcode:
PAUSE
[gcode_macro M300]
description: GCODE de beep (compatibilité)
gcode: {action_respond_info("BEEP")}
[gcode_macro G28]
rename_existing: G28.0
gcode:
{% if params.X is defined or params.Y is defined or params.Z is defined %}
{% if params.Y is defined %}
G28.0 Y
{% endif %}
{% if params.X is defined %}
G28.0 X
{% endif %}
{% if params.Z is defined %}
G28.0 Z
{% endif %}
{% else %}
G28.0 Y
G28.0 X
G28.0 Z
{% endif %}
[gcode_macro CHARGER_FILAMENT_1]
description: Charger un filament sur l'extrudeur 1 en chauffant la tête puis en extrudant 150mm de fil à 220°C.
gcode:
SET_DUAL_CARRIAGE CARRIAGE=0
LOAD_FILAMENT
[gcode_macro CHARGER_FILAMENT_2]
description: Charger un filament sur l'extrudeur 2 en chauffant la tête puis en extrudant 150mm de fil à 220°C.
gcode:
SET_DUAL_CARRIAGE CARRIAGE=1
LOAD_FILAMENT
[gcode_macro LOAD_FILAMENT]
gcode:
{% if not printer.pause_resume.is_paused %}
M109 S220
{% endif %}
M83
G92 E0.0
G0 E150 F300
G92 E0.0
M82
{% if not printer.pause_resume.is_paused %}
M84
{% endif %}
[gcode_macro EJECTER_FILAMENT_1]
description: Ejecter un filament sur l'extrudeur 1 en chauffant la tête puis en retractant 150mm de fil à 220°C.
gcode:
SET_DUAL_CARRIAGE CARRIAGE=0
UNLOAD_FILAMENT
[gcode_macro EJECTER_FILAMENT_2]
description: Ejecter un filament sur l'extrudeur 2 en chauffant la tête puis en retractant 150mm de fil à 220°C.
gcode:
SET_DUAL_CARRIAGE CARRIAGE=1
UNLOAD_FILAMENT
[gcode_macro UNLOAD_FILAMENT]
gcode:
{% if not printer.pause_resume.is_paused %}
M109 S220
{% endif %}
M83
G92 E0.0
G0 E-150 F300
G92 E0.0
M82
{% if not printer.pause_resume.is_paused %}
M84
{% endif %}
[gcode_macro M106]
gcode:
{% if params.P is defined %}
{% if params.S is defined %}
{% set activetool = params.P|default(0)|int %}
{% if activetool == 0 %}
SET_PIN PIN=Ventilation_1 VALUE={params.S|int}
{% else %}
SET_PIN PIN=Ventilation_2 VALUE={params.S|int}
{% endif %}
{% else %}
{% if activetool == 0 %}
SET_PIN PIN=Ventilation_1 VALUE=255
{% else %}
SET_PIN PIN=Ventilation_2 VALUE=255
{% endif %}
{% endif %}
{% else %}
{% set idremode = printer.dual_carriage.carriage_1 %}
{% if idremode == "COPY" or idremode == "MIRROR" %}
{% if params.S is defined %}
SET_PIN PIN=Ventilation_1 VALUE={params.S|int}
SET_PIN PIN=Ventilation_2 VALUE={params.S|int}
{% else %}
SET_PIN PIN=Ventilation_1 VALUE=255
SET_PIN PIN=Ventilation_2 VALUE=255
{% endif %}
{% else %}
{% if params.S is defined %}
SET_PIN PIN=Ventilation_1 VALUE={params.S|int}
{% else %}
SET_PIN PIN=Ventilation_1 VALUE=255
{% endif %}
{% endif %}
{% endif %}
[gcode_macro M107]
gcode:
{% if params.P is defined %}
{% set activetool = params.P|default(0)|int %}
{% if activetool == 0 %}
SET_PIN PIN=Ventilation_1 VALUE=0
{% else %}
SET_PIN PIN=Ventilation_2 VALUE=0
{% endif %}
{% else %}
SET_PIN PIN=Ventilation_1 VALUE=0
SET_PIN PIN=Ventilation_2 VALUE=0
{% endif %}
[gcode_macro ETALONNAGE_COMPLET]
description: Etalonnage complet de la machine, Parallélisme + Surface + Chauffe tête + Chauffe lit.
gcode:
G28
QUAD_GANTRY_LEVEL
BED_MESH_CALIBRATE PROFILE=default
PID_CALIBRATE HEATER=extruder TARGET=220
PID_CALIBRATE HEATER=heater_bed TARGET=80
SAVE_CONFIG
[gcode_macro ETALONNAGE_PARALLELISME]
description: Etalonnage du parallélisme des 4 axes Z.
gcode:
G28
QUAD_GANTRY_LEVEL
[gcode_macro ETALONNAGE_SURFACE]
description: Etalonnage de Surface du lit.
gcode:
G28
BED_MESH_CALIBRATE PROFILE=default
[gcode_macro CALIBRATION_TETE_1]
description: Calibration de la chauffe de la tête 1 (PID : important).
gcode:
PID_CALIBRATE HEATER=extruder TARGET=230
SAVE_CONFIG
[gcode_macro CALIBRATION_TETE_2]
description: Calibration de la chauffe de la tête 2 (PID : important).
gcode:
PID_CALIBRATE HEATER=extruder1 TARGET=230
SAVE_CONFIG
[gcode_macro CALIBRATION_LIT]
description: Calibration de la chauffe du lit (PID : important).
gcode:
PID_CALIBRATE HEATER=heater_bed TARGET=80
SAVE_CONFIG
[gcode_macro Palpeur_ON]
description: Sortir le palpeur
gcode:
SET_PIN PIN=Palpeur VALUE=1 # Probe deploy command
[gcode_macro Palpeur_OFF]
description: Rentrer le palpeur
gcode:
SET_PIN PIN=Palpeur VALUE=0 # Probe stow command
[gcode_macro CALIBRATION_ZV]
description: Lancer une calibration de l'Input Shaping avec l'accéléromètre. ATTENTION : ne pas lancer cette procédure trop souvent, la machine étant soumise à de fortes vibrations durant le test.
gcode:
G28
G1 Z20
G4 S5
SHAPER_CALIBRATE AXIS=X
SHAPER_CALIBRATE AXIS=Y
SAVE_CONFIG
[gcode_macro ETEINDRE_MOTEURS]
description: Eteindre les moteurs qui sont sous tension.
gcode:
M84
[idle_timeout]
timeout: 259200 # 3 jours (72*60*60 secondes)
[delayed_gcode manage_fans]
initial_duration: 0.1
gcode:
{% set sysstate = printer["idle_timeout"] %}
{% if sysstate.state == "Printing" %}
{% set chambersensor = printer["temperature_sensor Chambre"] %}
{% set capotfanspeed = (chambersensor.temperature*2.3)/100 %}
{% if capotfanspeed > 1 %}
{% set capotfanspeed = 1 %}
{% endif %}
{% if capotfanspeed < 0 %}
{% set capotfanspeed = 0 %}
{% endif %}
SET_FAN_SPEED FAN=_Capot SPEED={capotfanspeed}
{% endif %}
{% set alimsensor = printer["temperature_sensor Alimentation"] %}
{% set alimfanspeed = (alimsensor.temperature)/100 %}
{% if alimfanspeed > 1 %}
{% set alimfanspeed = 1 %}
{% endif %}
{% if alimfanspeed < 0.25 %}
{% set alimfanspeed = 0.25 %}
{% endif %}
SET_FAN_SPEED FAN=_Alimentation SPEED={alimfanspeed}
UPDATE_DELAYED_GCODE ID=manage_fans DURATION=5
#{action_respond_info(alimfanspeed|string)}
[delayed_gcode load_bedmesh]
initial_duration: 1
gcode:
BED_MESH_PROFILE LOAD=default
[gcode_macro CANCEL_PRINT]
description: Cancel the actual running print
rename_existing: CANCEL_PRINT_BASE
gcode:
SET_LED LED="Eclairage_LEDs" RED=1 GREEN=0 BLUE=0 SYNC=0 TRANSMIT=1
_CLIENT_RETRACT LENGTH={retract}
TURN_OFF_HEATERS
M107
# clear pause_next_layer and pause_at_layer as preparation for next print
SET_GCODE_VARIABLE MACRO=SET_PRINT_STATS_INFO VARIABLE=pause_next_layer VALUE="{{'enable': False, 'call':"PAUSE"}}"
SET_GCODE_VARIABLE MACRO=SET_PRINT_STATS_INFO VARIABLE=pause_at_layer VALUE="{{'enable': False, 'layer': 0, 'call':"PAUSE"}}"
CANCEL_PRINT_BASE
G28 X Y
#T0
#T1
#T0
#{% set maxY = printer.configfile.config.stepper_y.position_max %}
#G1 Y{maxY} F21000
M84
[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)}
# Usage: SET_PAUSE_NEXT_LAYER [MACRO=<name>]
[gcode_macro PAUSE_PROCHAINE_COUCHE]
description: Enable a pause if the next layer is reached
gcode:
SET_GCODE_VARIABLE MACRO=SET_PRINT_STATS_INFO VARIABLE=pause_next_layer VALUE="{{'enable':True, 'call':params.MACRO|default("PAUSE")}}"
# Usage: SET_PAUSE_AT_LAYER [LAYER=<number>] [MACRO=<name>]
[gcode_macro PAUSE_A_LA_COUCHE]
description: Enable/disable a pause if a given layer number is reached
gcode:
{% if params.LAYER is defined %}
SET_GCODE_VARIABLE MACRO=SET_PRINT_STATS_INFO VARIABLE=pause_at_layer VALUE="{{'enable': True, 'layer':params.LAYER|int, 'call':params.MACRO|default("PAUSE")}}"
{% else %}
SET_GCODE_VARIABLE MACRO=SET_PRINT_STATS_INFO VARIABLE=pause_at_layer VALUE="{{'enable': False, 'layer':0, 'call':"PAUSE"}}"
{% endif %}
# Usage: SET_PRINT_STATS_INFO [TOTAL_LAYER=<total_layer_count>] [CURRENT_LAYER= <current_layer>]
[gcode_macro SET_PRINT_STATS_INFO]
rename_existing: SET_PRINT_STATS_INFO_BASE
description: Overwrite, to get pause_next_layer and pause_at_layer feature
variable_pause_next_layer: {'enable':False, 'call':"PAUSE"}
variable_pause_at_layer : {'enable':False, 'layer':0, 'call':"PAUSE"}
gcode:
{% if pause_next_layer.enable %}
{action_respond_info("%s, forced by pause_next_layer" % pause_next_layer.call)}
{pause_next_layer.call} ; execute the given gcode to pause, should be either M600 or PAUSE
SET_GCODE_VARIABLE MACRO=SET_PRINT_STATS_INFO VARIABLE=pause_next_layer VALUE="{{'enable': False, 'call':"PAUSE"}}"
{% elif pause_at_layer.enable and params.CURRENT_LAYER is defined and params.CURRENT_LAYER|int == pause_at_layer.layer %}
{action_respond_info("%s, forced by pause_at_layer [%d]" % (pause_at_layer.call, pause_at_layer.layer))}
{pause_at_layer.call} ; execute the given gcode to pause, should be either M600 or PAUSE
SET_GCODE_VARIABLE MACRO=SET_PRINT_STATS_INFO VARIABLE=pause_at_layer VALUE="{{'enable': False, 'layer': 0, 'call':"PAUSE"}}"
{% endif %}
SET_PRINT_STATS_INFO_BASE {rawparams}
##### 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 = 10.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 %}
{% if "xyz" in printer.toolhead.homed_axes %}
G90
G1 Z{z_park} F600
{% 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}
[virtual_sdcard]
path: ~/printer_data/gcodes
on_error_gcode: CANCEL_PRINT
[pause_resume]
[display_status]