-
Notifications
You must be signed in to change notification settings - Fork 0
/
macro_tune_pa.cfg
86 lines (76 loc) · 3.94 KB
/
macro_tune_pa.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
[gcode_macro PA_CAL]
# Pressure Advance Simple Test macro.
# Usage: PA_CAL BED=100 EXTRUDER=240 PA_START=0.03 PA_STEP=0.002 NZL=0.4
# Or with no parameters as: PA_CAL, this would execute as
# PA_CAL BED=99 EXTRUDER=239 PA_START=0.0 PA_STEP=0.005 NZL=(as per printer.cfg)
# First prints a line with current set PA, then prints 20 line segments
# starting with PA_START, increasing each line by PA_STEP.
# Based http://realdeuce.github.io/Voron/PA/pressure_advance.html
# Assisted by u/imoftendisgruntled, u/scul86, and thanks to u/beansisfat, u/stray_r
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(110)|float %}
{% set HOTEND = params.HOTEND|default(250)|float %}
{% set PA_START = params.PA_START|default(0.0)|float %}
{% set PA_STEP = params.PA_STEP|default(0.005)|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 %}
BED_TEMP={BED} EXTRUDER_TEMP={HOTEND}
SET_PIN PIN=caselight VALUE=1.00
CG28
M117 Starting warmup
M117 Warmup
G0 Z20
G0 x175 y175
STATUS_HEATING
M106 s205
M190 S{65} ; set & wait for bed temp
BEEP I=1 DUR=100 FREQ=2000
M109 S{215} ; set & wait for hotend temp
BEEP I=1 DUR=100 FREQ=2000
M106 S0
G32
BED_MESH_CALIBRATE
BED_MESH_PROFILE LOAD=default
M83 ; Make the E relative independant of other axis
M117 Purging
PURGE_BUCKET
#G1 E2 F1500 # unretract
M117 Starting Print
STATUS_BUSY
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)}
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 %}