-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtune_pressure_advance.cfg
63 lines (54 loc) · 2.76 KB
/
tune_pressure_advance.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
[gcode_macro TUNE_PRESSURE_ADV]
description: Tune Pressure Advance
gcode:
# saved_variables.cfg
{% set speed = 9000 %}
{% set nozzle_temp = 215 %}
{% set bed_temp = 70 %}
{% set nozzle_diameter = 0.4 %}
# macro parameters
{% set BED = params.BED|default(bed_temp)|float %}
{% set NOZZLE = params.NOZZLE|default(nozzle_temp)|float %}
{% set PA_START = params.PA_START|default(0.0)|float %}
{% set PA_STOP = params.PA_STOP|default(0.1)|float %}
{% set NZL = params.NZL|default(nozzle_diameter)|float %}
# calculated variables
{% set PA_STEP = (PA_STOP - PA_START) / 20 |float %}
{% set E20 = (0.1147475 * NZL) * 20|float %}
{% set E40 = (0.1147475 * NZL) * 40|float %}
{% set X_MID = printer.toolhead.axis_maximum.x|float / 2.0 %}
{% set Y_MID = printer.toolhead.axis_maximum.y|float / 2.0 %}
# delta printer so we override center to be (0,0)
{% set X_MID = 0.0|float %}
{% set Y_MID = 0.0|float %}
START_PRINT BED_TEMP={BED} EXTRUDER_TEMP={NOZZLE}
G21 ; millimeter units
G90 ; absolute XYZ
M83 ; relative E
SET_VELOCITY_LIMIT ACCEL=3000 ACCEL_TO_DECEL=1500
G92 E0
M106 S0
G1 X{(X_MID-40)} Y{(Y_MID-50)} F{speed} ; move to start position
G1 Z0.25 F300 ; move to layer height
G1 E0.75 F1800 ; un-retract
G1 X{(X_MID-20)} Y{(Y_MID-50)} E{E20} F300 ; print line part one
G1 X{(X_MID+20)} Y{(Y_MID-50)} E{E40} F3000 ; print line part two
G1 X{(X_MID+40)} Y{(Y_MID-50)} E{E20} F300 ; print line part three
G1 E-0.75 F1800 ; retract
G1 Z1 F300 ; move above layer height
{% for i in range(0, 21) %}
SET_PRESSURE_ADVANCE ADVANCE={PA_START + (i * PA_STEP)} ; set Pressure Advance
M117 PA={PA_START + (i * PA_STEP)}, STEP={PA_STEP}.
G1 X{(X_MID-40)} Y{(Y_MID-45)+(5*i)} F30000 ; move to start position
G1 Z0.25 F300 ; move to layer height
G1 E0.75 F1800 ; un-retract
G1 X{(X_MID-20)} Y{(Y_MID-45)+(5*i)} E{E20} F300 ; print line part one
G1 X{(X_MID+20)} Y{(Y_MID-45)+(5*i)} E{E40} F3000 ; print line part two
G1 X{(X_MID+40)} Y{(Y_MID-45)+(5*i)} E{E20} F300 ; print line part three
G1 E-0.75 F1800 ; retract
G1 Z1 F300 ; move above layer height
{% endfor %}
END_PRINT
# these may not work, in which case you will need to count and do the math yourself!
M117 New PA = ({PA_START} + (bestLine * {PA_STEP}) )
#{action_respond_info ("Find best line and multiply it by (" + PA_START|string + " + (bestLine * " + PA_STEP|string + ") ) to find your PA setting.")}