Skip to content

Instantly share code, notes, and snippets.

@tehmaze
Created May 24, 2021 19:49
Show Gist options
  • Save tehmaze/2dc7f80710b4304356aa1e3d31ac3c29 to your computer and use it in GitHub Desktop.
Save tehmaze/2dc7f80710b4304356aa1e3d31ac3c29 to your computer and use it in GitHub Desktop.
CoreXY torture tests
[gcode_macro HOME]
gcode:
# home not homed axies
{% for axis in ['x', 'y', 'z'] %}
{% if axis not in printer.toolhead.homed_axes %}
G28 { axis }
{% endif %}
{% endfor %}
[gcode_macro CENTER]
gcode:
HOME
# Abs pos
G90
{% if printer.gcode_move.position.z < 5 %}
G0 Z5 F1000
{% endif %}
G0 X{ printer.toolhead.axis_maximum.x / 2 } Y{ printer.toolhead.axis_maximum.y / 2 } F{ printer.toolhead.max_velocity * 60 }
G0 Z0 F300
[gcode_macro UNSAFE_TEST_X]
gcode:
#CENTER
#G0 Z10
# Set feedrate to max
G0 F{ printer.toolhead.max_velocity * 60 }
# move head to center of bed at max speed
G0 X{ printer.toolhead.axis_maximum.x / 2 } Y{ printer.toolhead.axis_maximum.y / 2 }
# Vibrate max speed +/- 30% of min-min to max-max
{% for i in range(60) %}
G0 X{ ( printer.toolhead.axis_maximum.x / 2 ) * ( 1 + i*i / 10000.0 ) } Y{ ( printer.toolhead.axis_maximum.y / 2 ) * ( 1 + i*i / 10000.0 ) }
G0 X{ ( printer.toolhead.axis_maximum.x / 2 ) * ( 1 - i*i / 10000.0 ) } Y{ ( printer.toolhead.axis_maximum.y / 2 ) * ( 1 - i*i / 10000.0 ) }
{% endfor %}
# move head to center of bed at max speed
G0 X{ printer.toolhead.axis_maximum.x / 2 } Y{ printer.toolhead.axis_maximum.y / 2 } F{ printer.toolhead.max_velocity * 60 }
# Vibrate max speed +/- 30% of max-min to min-max
{% for i in range(60) %}
G0 X{ ( printer.toolhead.axis_maximum.x / 2 ) * ( 1 - i*i / 10000.0 ) } Y{ ( printer.toolhead.axis_maximum.y / 2 ) * ( 1 + i*i / 10000.0 ) }
G0 X{ ( printer.toolhead.axis_maximum.x / 2 ) * ( 1 + i*i / 10000.0 ) } Y{ ( printer.toolhead.axis_maximum.y / 2 ) * ( 1 - i*i / 10000.0 ) }
{% endfor %}
# move head to center of bed at max speed
G0 X{ printer.toolhead.axis_maximum.x / 2 } Y{ printer.toolhead.axis_maximum.y / 2 } F{ printer.toolhead.max_velocity * 60 }
[gcode_macro TEST_SM_SQUARE]
gcode:
CENTER
G0 Z10
# Set feedrate to max
G0 F{ printer.toolhead.max_velocity * 60 }
# Rel pos
G91
{% for i in range(100) %}
G0 X-3
G0 Y-3
G0 X+3
G0 Y+3
{% endfor %}
# Abs pos
G90
[gcode_macro TEST_CIRCLE]
gcode:
CENTER
G0 Z10
{% for i in range(100) %}
G2 I4 J4 F{ printer.toolhead.max_velocity * 60 }
{% endfor %}
[gcode_macro TEST_LG_SQUARE]
gcode:
CENTER
G0 Z10
# Set feedrate to max
G0 F{ printer.toolhead.max_velocity * 60 }
# Vibrate max speed +/- 30% of min-min to max-max
{% for i in range(20) %}
G0 X20 Y20
G0 X{ printer.toolhead.axis_maximum.x } Y20
G0 X{ printer.toolhead.axis_maximum.x } Y{ printer.toolhead.axis_maximum.y }
G0 X20 Y{ printer.toolhead.axis_maximum.y }
{% endfor %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment