-
Notifications
You must be signed in to change notification settings - Fork 0
/
speedtest.cfg
84 lines (80 loc) · 3.65 KB
/
speedtest.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
[gcode_macro SPEEDTEST]
gcode:
{% set fmin = params.FMIN|default(300)|float * 60 %}
{% set fmax = params.FMAX|default(500)|float * 60 %}
{% set steps = params.STEPS|default(3)|int %}
{% set cycles = params.CYCLES|default(1)|int %}
{% set inset = 20.0|float %}
{% set maxX = printer.configfile.settings.stepper_x.position_max|float - inset %}
{% set maxY = printer.configfile.settings.stepper_y.position_max|float - inset %}
#{% set minX = printer.configfile.settings.stepper_x.position_min|float + inset %}
#{% set minY = printer.configfile.settings.stepper_y.position_min|float + inset %}
{% set minX = inset %}
{% set minY = inset %}
SAVE_GCODE_STATE NAME=speedtest_state
G90
{% for INTERVAL in range(steps) %}
{% for REPEAT in range(cycles) %}
{% if fmin == fmax %}
{% set feedrate = fmin %}
{% else %}
{% set feedrate = fmin + ( (fmax - fmin) / (steps -1) ) * INTERVAL %}
{% endif %}
M400 # Wait for queue to empty
M117 {INTERVAL+1}/{steps} {"%4.0f mm/s" % (feedrate/60)}
M118 {INTERVAL+1}/{steps} {"%4.0f mm/s" % (feedrate/60)}
G1 F{feedrate} # set feedrate for the round
G1 X{minX} Y{minY} # front left
G1 X{minX} Y{minY + (maxY-minY)/2} # mid left
G1 X{maxX} Y{minY + (maxY-minY)/2} # mid right
G1 X{minX} Y{minY + (maxY-minY)/2} # mid left
G1 X{minX} Y{minY} # front left
G1 X{maxX} Y{maxY} # back right
G1 X{maxX} Y{minY} # front right
G1 X{minX} Y{maxY} # back left
{% endfor %}
{% endfor %}
M117
RESTORE_GCODE_STATE NAME=speedtest_state
[gcode_macro ACCELTEST]
gcode:
{% set speed = params.SPEED|default(200)|float * 60 %}
{% set amin = params.AMIN|default(5)|float * 1000 %}
{% set amax = params.AMAX|default(5)|float * 1000 %}
{% set steps = params.STEPS|default(1)|int %}
{% set cycles = params.CYCLES|default(1)|int %}
{% set line_dist = params.LINE_DIST|default(30)|int / 2 %}
{% set lines = (24/2)|int %}
{% set center = printer.toolhead.axis_maximum %}
{% set center = [center[0] / 2, center[1] / 2] %}
SAVE_GCODE_STATE NAME=acceltest_state
SET_VELOCITY_LIMIT ACCEL=2000
{% if not 'xy' in printer.toolhead.homed_axes %}
G28 X Y
{% endif %}
G0 X{center[0]} Y{center[1]} F{speed}
G91
{% for INTERVAL in range(steps) %}
{% for REPEAT in range(cycles) %}
{% if amin == amax %}
{% set feedrate = amin %}
{% else %}
{% set feedrate = amin + ( (amax - amin) / (steps -1) ) * INTERVAL %}
{% endif %}
M400
M117 {INTERVAL+1}/{steps} {"%4.0f mm/s²" % (feedrate)}
M118 {INTERVAL+1}/{steps} {"%4.0f mm/s²" % (feedrate)}
G0 F{speed}
SET_VELOCITY_LIMIT ACCEL={feedrate}
SET_VELOCITY_LIMIT ACCEL_TO_DECEL={feedrate}
{% for angle in range(lines) %}
{% set angle = angle * (15*pi/180) %}
G0 X{line_dist * round((cos(angle)),3)} Y{line_dist * round((sin(angle)),3)}
G0 X{line_dist * (2*(round((cos(angle)),3)*-1))} Y{line_dist * (2*(round((sin(angle)),3)*-1))}
G0 X{line_dist * round((cos(angle)),3)} Y{line_dist * round((sin(angle)),3)}
{% endfor %}
{% endfor %}
{% endfor %}
G90
M117
RESTORE_GCODE_STATE NAME=acceltest_state