Skip to content

Instantly share code, notes, and snippets.

@alienboyxp
Last active April 2, 2024 19:18
Show Gist options
  • Select an option

  • Save alienboyxp/2bb27e5547ecca823c17435cbaf49849 to your computer and use it in GitHub Desktop.

Select an option

Save alienboyxp/2bb27e5547ecca823c17435cbaf49849 to your computer and use it in GitHub Desktop.
# Current Version v_20240401
[gcode_macro TEST_KINEMATICS]
description: Test Printer Kinematics
gcode:
# home not homed axies
{% for axis in ['x', 'y', 'z'] %}
{% if axis not in printer.toolhead.homed_axes %}
G28 { axis }
{% endif %}
{% endfor %}
# move bed down 3 cm at max speed
G0 Z30 F1000
# 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 min-min to max-max
{% for i in range(30) %}
G0 X{ ( printer.toolhead.axis_maximum.x / 2 ) * ( 1 + i / 100.0 ) } Y{ ( printer.toolhead.axis_maximum.y / 2 ) * ( 1 + i / 100.0 ) } F{ printer.toolhead.max_velocity * 60 }
G0 X{ ( printer.toolhead.axis_maximum.x / 2 ) * ( 1 - i / 100.0 ) } Y{ ( printer.toolhead.axis_maximum.y / 2 ) * ( 1 - i / 100.0 ) } F{ printer.toolhead.max_velocity * 60 }
{% 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(30) %}
G0 X{ ( printer.toolhead.axis_maximum.x / 2 ) * ( 1 - i / 100.0 ) } Y{ ( printer.toolhead.axis_maximum.y / 2 ) * ( 1 + i / 100.0 ) } F{ printer.toolhead.max_velocity * 60 }
G0 X{ ( printer.toolhead.axis_maximum.x / 2 ) * ( 1 + i / 100.0 ) } Y{ ( printer.toolhead.axis_maximum.y / 2 ) * ( 1 - i / 100.0 ) } F{ printer.toolhead.max_velocity * 60 }
{% 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 }
# Current Version v_202305221109
[gcode_macro TEST_KINEMATICS]
gcode:
# home not homed axies
{% for axis in ['x', 'y', 'z'] %}
{% if axis not in printer.toolhead.homed_axes %}
G28 { axis }
{% endif %}
{% endfor %}
# move bed down 3 cm at max speed
G0 Z30 F1000
# 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 min-min to max-max
{% for i in range(30) %}
G0 X{ ( printer.toolhead.axis_maximum.x / 2 ) * ( 1 + i / 100.0 ) } Y{ ( printer.toolhead.axis_maximum.y / 2 ) * ( 1 + i / 100.0 ) } F{ printer.toolhead.max_velocity * 60 }
G0 X{ ( printer.toolhead.axis_maximum.x / 2 ) * ( 1 - i / 100.0 ) } Y{ ( printer.toolhead.axis_maximum.y / 2 ) * ( 1 - i / 100.0 ) } F{ printer.toolhead.max_velocity * 60 }
{% 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(30) %}
G0 X{ ( printer.toolhead.axis_maximum.x / 2 ) * ( 1 - i / 100.0 ) } Y{ ( printer.toolhead.axis_maximum.y / 2 ) * ( 1 + i / 100.0 ) } F{ printer.toolhead.max_velocity * 60 }
G0 X{ ( printer.toolhead.axis_maximum.x / 2 ) * ( 1 + i / 100.0 ) } Y{ ( printer.toolhead.axis_maximum.y / 2 ) * ( 1 - i / 100.0 ) } F{ printer.toolhead.max_velocity * 60 }
{% 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 }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment