-
Notifications
You must be signed in to change notification settings - Fork 18
/
PA_CAL-V2
68 lines (60 loc) · 3.63 KB
/
PA_CAL-V2
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
[gcode_macro PA_CAL]
# Pressure Advance Simple Test macro.
# Usage: PA_CAL BED=100 EXTRUDER=240 PA_START=0.0 PA_STOP=0.1 NZL=0.4
# Or with no parameters, this would execute the same as
# PA_CAL BED=99 EXTRUDER=239 PA_START=0.0 PA_STOP=0.1 NZL=(as per printer.cfg)
# First prints a line with current set PA, then prints 21 additional line segments
# starting with PA_START, and increasing to PA_STOP.
# Based http://realdeuce.github.io/Voron/PA/pressure_advance.html
# Assisted by u/imoftendisgruntled, u/scul86, and thanks to u/beansisfat, u/stray_r
# If using BOWDEN setup and having difficulty, try increasing retraction/un-retraction
# settings below to 1.25 vice 0.75. Search/replace 0.75 with 1.25
description: Tune Pressure Advance
gcode:
{% if printer.idle_timeout.state == "Printing" or printer.pause_resume.is_paused %}
{action_respond_info("Cannot do that while printing")}
{% else %}
{% set BED = params.BED|default(99)|float %}
{% set EXTRUDER = params.EXTRUDER|default(239)|float %}
{% set PA_START = params.PA_START|default(0.0)|float %}
{% set PA_STOP = params.PA_STOP|default(0.1)|float %}
{% set PA_STEP = (PA_STOP - PA_START) / 20 |float %}
{% set NZL_CFG = printer.configfile.config["extruder"]["nozzle_diameter"]|float %}
{% set NZL = params.NZL|default(NZL_CFG)|float %}
{% set E20 = (0.1147475 * NZL) * 20|float %}
{% set E40 = (0.1147475 * NZL) * 40|float %}
{% set X_MID = printer.configfile.config["stepper_x"]["position_max"]|float / 2.0 %}
{% set Y_MID = printer.configfile.config["stepper_y"]["position_max"]|float / 2.0 %}
# For DELTA replace the previous two lines with:
# {% set X_MID = 0|float %}
# {% set Y_MID = 0|float %}
PRINT_START BED_TEMP={BED} EXTRUDER_TEMP={EXTRUDER}
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-65)} 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-65)} E{E20} F300 ; print line part one
G1 X{(X_MID+20)} Y{(Y_MID-65)} E{E40} F9000 ; print line part two
G1 X{(X_MID+40)} Y{(Y_MID-65)} 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, 20) %}
SET_PRESSURE_ADVANCE ADVANCE={PA_START + (i * PA_STEP)} ; set Pressure Advance
M117 Testing Pressure Advance at: {PA_START + (i * PA_STEP)}, increased PA by {PA_STEP}.
G1 X{(X_MID-40)} Y{(Y_MID-35)+(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-35)+(5*i)} E{E20} F300 ; print line part one
G1 X{(X_MID+20)} Y{(Y_MID-35)+(5*i)} E{E40} F9000 ; print line part two
G1 X{(X_MID+40)} Y{(Y_MID-35)+(5*i)} E{E20} F300 ; print line part three
G1 E-0.75 F1800 ; retract
G1 Z1 F300 ; Move above layer height
{% endfor %}
M117 Find best line and multiply it by ({PA_START} + (line * {PA_STEP}) ) to find your PA setting.
PRINT_END
{% endif %}