peraxis
This commit is contained in:
parent
9cf77f8e81
commit
c5fc5ae237
3 changed files with 122 additions and 15 deletions
|
@ -48,6 +48,7 @@ gcode:
|
|||
gcode:
|
||||
PID_CALIBRATE HEATER=heater_bed TARGET=110
|
||||
|
||||
|
||||
[gcode_macro TEST_SPEED]
|
||||
gcode:
|
||||
# Example: TEST_SPEED SPEED=300 ACCEL=5000 ITERATIONS=10 Z=10
|
||||
|
@ -140,6 +141,101 @@ gcode:
|
|||
# Restore previous gcode state (absolute/relative, etc)
|
||||
RESTORE_GCODE_STATE NAME=TEST_SPEED
|
||||
|
||||
|
||||
[gcode_macro TEST_AXIS_SPEED]
|
||||
gcode:
|
||||
# Example: TEST_AXIS_SPEED SPEED=300 X_ACCEL=5000 Y_ACCEL=2000 ITERATIONS=10 Z=10
|
||||
# Speed
|
||||
{% set speed = params.SPEED|default(printer.configfile.settings.printer.max_velocity)|int %}
|
||||
# Iterations
|
||||
{% set iterations = params.ITERATIONS|default(1)|int %}
|
||||
# Acceleration
|
||||
{% set x_accel = params.X_ACCEL|default(printer.configfile.settings.printer.max_accel)|int %}
|
||||
{% set y_accel = params.Y_ACCEL|default(printer.configfile.settings.printer.max_accel)|int %}
|
||||
# Bounding inset for large pattern (helps prevent slamming the toolhead into the sides after small skips, and helps to account for machines with imperfectly set dimensions)
|
||||
{% set bound = params.BOUND|default(30)|int %}
|
||||
# Size for small pattern box
|
||||
{% set smallpatternsize = SMALLPATTERNSIZE|default(20)|int %}
|
||||
{% set z_pos = params.ZPOS|default(10)|int %}
|
||||
|
||||
# Large pattern
|
||||
# Max positions, inset by BOUND
|
||||
{% set x_min = printer.toolhead.axis_minimum.x + bound %}
|
||||
{% set x_max = printer.toolhead.axis_maximum.x - bound %}
|
||||
{% set y_min = printer.toolhead.axis_minimum.y + bound %}
|
||||
{% set y_max = printer.toolhead.axis_maximum.y - bound %}
|
||||
|
||||
# Small pattern at center
|
||||
# Find X/Y center point
|
||||
{% set x_center = (printer.toolhead.axis_minimum.x|float + printer.toolhead.axis_maximum.x|float ) / 2 %}
|
||||
{% set y_center = (printer.toolhead.axis_minimum.y|float + printer.toolhead.axis_maximum.y|float ) / 2 %}
|
||||
|
||||
# Set small pattern box around center point
|
||||
{% set x_center_min = x_center - (smallpatternsize/2) %}
|
||||
{% set x_center_max = x_center + (smallpatternsize/2) %}
|
||||
{% set y_center_min = y_center - (smallpatternsize/2) %}
|
||||
{% set y_center_max = y_center + (smallpatternsize/2) %}
|
||||
|
||||
# Home first
|
||||
G28
|
||||
|
||||
# Save current gcode state (absolute/relative, etc)
|
||||
SAVE_GCODE_STATE NAME=TEST_SPEED
|
||||
|
||||
# Output parameters to g-code terminal
|
||||
{ action_respond_info("TEST_SPEED: starting %d iterations at speed %d, x_accel %d, y_accel %d" % (iterations, speed, x_accel, y_accel)) }
|
||||
|
||||
# Absolute positioning
|
||||
G90
|
||||
|
||||
# Set new limits
|
||||
SET_VELOCITY_LIMIT VELOCITY={speed} ACCEL={x_accel} ACCEL_TO_DECEL={x_accel}
|
||||
SET_KINEMATICS_LIMIT X_ACCEL={x_accel} Y_ACCEL={y_accel}
|
||||
|
||||
|
||||
# Go to starting position
|
||||
G0 X{x_min} Y{y_min} Z{z_pos} F{speed*60}
|
||||
|
||||
{% for i in range(iterations) %}
|
||||
# Large pattern
|
||||
# Diagonals
|
||||
G0 X{x_min} Y{y_min} F{speed*60}
|
||||
G0 X{x_max} Y{y_max} F{speed*60}
|
||||
G0 X{x_min} Y{y_min} F{speed*60}
|
||||
G0 X{x_max} Y{y_min} F{speed*60}
|
||||
G0 X{x_min} Y{y_max} F{speed*60}
|
||||
G0 X{x_max} Y{y_min} F{speed*60}
|
||||
|
||||
# Box
|
||||
G0 X{x_min} Y{y_min} F{speed*60}
|
||||
G0 X{x_min} Y{y_max} F{speed*60}
|
||||
G0 X{x_max} Y{y_max} F{speed*60}
|
||||
G0 X{x_max} Y{y_min} F{speed*60}
|
||||
|
||||
# Small pattern
|
||||
# Small diagonals
|
||||
G0 X{x_center_min} Y{y_center_min} F{speed*60}
|
||||
G0 X{x_center_max} Y{y_center_max} F{speed*60}
|
||||
G0 X{x_center_min} Y{y_center_min} F{speed*60}
|
||||
G0 X{x_center_max} Y{y_center_min} F{speed*60}
|
||||
G0 X{x_center_min} Y{y_center_max} F{speed*60}
|
||||
G0 X{x_center_max} Y{y_center_min} F{speed*60}
|
||||
|
||||
# Small box
|
||||
{% for i in range(4) %}
|
||||
G0 X{x_center_min} Y{y_center_min} F{speed*60}
|
||||
G0 X{x_center_min} Y{y_center_max} F{speed*60}
|
||||
G0 X{x_center_max} Y{y_center_max} F{speed*60}
|
||||
G0 X{x_center_max} Y{y_center_min} F{speed*60}
|
||||
{% endfor %}
|
||||
{% endfor %}
|
||||
|
||||
{ action_respond_info("TEST_SPEED: CAN NOT RESTORE AXIS LIMITS! Check these.") }
|
||||
SET_VELOCITY_LIMIT VELOCITY={printer.configfile.settings.printer.max_velocity} ACCEL={printer.configfile.settings.printer.max_accel} ACCEL_TO_DECEL={printer.configfile.settings.printer.max_accel_to_decel}
|
||||
|
||||
# Restore previous gcode state (absolute/relative, etc)
|
||||
RESTORE_GCODE_STATE NAME=TEST_SPEED
|
||||
|
||||
[gcode_macro TEST_CARDINAL_SPEED]
|
||||
gcode:
|
||||
# Example: TEST_CARDINAL_SPEED SPEED=300 ACCEL=5000 ITERATIONS=10 ZPOS=10
|
||||
|
|
|
@ -33,14 +33,14 @@ timeout: 1800 # change timeout to 30 minutes
|
|||
# https://github.com/Piezoid/klipper/blob/ae295ba64b3111b0eb296e1d15adc2ac7b2e6eae/klippy/kinematics/limited_cartesian.py
|
||||
kinematics: limited_corexy
|
||||
max_velocity: 1000
|
||||
max_accel: 50000
|
||||
max_accel: 45000
|
||||
max_accel_to_decel: 50000
|
||||
max_x_accel: 45000
|
||||
max_y_accel: 16000
|
||||
scale_xy_accel: true
|
||||
max_z_velocity: 80
|
||||
max_z_accel: 1000
|
||||
square_corner_velocity: 8
|
||||
square_corner_velocity: 12
|
||||
|
||||
[mcu]
|
||||
serial: /dev/serial/by-id/usb-Klipper_stm32f446xx_3F003E001650534E4E313420-if00
|
||||
|
|
|
@ -18,7 +18,7 @@ gcode:
|
|||
G28 X0
|
||||
# Move away
|
||||
G90
|
||||
G1 x60 F{20*60}
|
||||
G1 x20 F{20*60}
|
||||
G91
|
||||
# Set current during print
|
||||
SET_TMC_CURRENT STEPPER=stepper_x CURRENT={RUN_CUR}
|
||||
|
@ -61,18 +61,29 @@ set_position_z: -1.8
|
|||
gcode:
|
||||
# Parameters
|
||||
{% set Z = 20 %}
|
||||
|
||||
G90
|
||||
G1 Z{Z} # Z lift
|
||||
SENSORLESS_HOME_X
|
||||
SENSORLESS_HOME_Y
|
||||
|
||||
G4 P2200
|
||||
G90
|
||||
G1 x300 y226 F{800*60}
|
||||
# Belt is tight on the edge. Go slow to reach the endstop.
|
||||
G1 x327.5 y226 F{30*60}
|
||||
SET_GCODE_OFFSET Z=0.0 # Reset offset before homing Z
|
||||
G28 Z0
|
||||
G1 Z{Z}
|
||||
G91
|
||||
{% set home_all = 'X' not in params and 'Y' not in params and 'Z' not in params %}
|
||||
|
||||
{% if home_all or 'X' in params %}
|
||||
SENSORLESS_HOME_X
|
||||
{% endif %}
|
||||
|
||||
{% if home_all or 'Y' in params %}
|
||||
SENSORLESS_HOME_Y
|
||||
{% endif %}
|
||||
|
||||
{% if home_all or 'Z' in params %}
|
||||
G4 P2200
|
||||
G90
|
||||
G1 x300 y226 F{800*60}
|
||||
# Belt is tight on the edge. Go slow to reach the endstop.
|
||||
G1 x327.5 y226 F{30*60}
|
||||
SET_GCODE_OFFSET Z=0.0 # Reset offset before homing Z
|
||||
G28 Z0
|
||||
G1 Z{Z}
|
||||
G91
|
||||
{% endif %}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue