-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathhoming.cfg
50 lines (47 loc) · 2 KB
/
homing.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
#####################################################################
# Homing definition
#####################################################################
[safe_z_home]
home_xy_position: 226,350 ## Update with X,Y location of endstop pin
speed: 3600 #6000
z_hop: 15
z_hop_speed: 6000
#move_to_previous: False
#####################################################################
# Macros
#####################################################################
## conditional home
[gcode_macro SMARTHOME]
gcode:
{% if printer.toolhead.homed_axes != "xyz" %}
G28
{% endif %}
[gcode_macro _SET_ACC]
default_parameter_VAL: RUN
default_parameter_HOMING_ACCEL: 500
variable_accel: 0
variable_accel_to_decel: 0
variable_last_val: 'RUN'
gcode:
{% if VAL == 'HOME' %}
# store old values and apply home value
SET_GCODE_VARIABLE MACRO=_SET_ACC VARIABLE=accel VALUE={printer.toolhead.max_accel}
SET_GCODE_VARIABLE MACRO=_SET_ACC VARIABLE=accel_to_decel VALUE={printer.toolhead.max_accel_to_decel}
{% set accel = HOMING_ACCEL %}
{% set accel_to_decel = HOMING_ACCEL %}
{% elif VAL == 'CONFIG' %}
# set all to config values
SET_GCODE_VARIABLE MACRO=_SET_ACC VARIABLE=accel VALUE={printer.configfile.settings.printer.max_accel}
SET_GCODE_VARIABLE MACRO=_SET_ACC VARIABLE=accel_to_decel VALUE={printer.configfile.settings.printer.max_accel}
{% set accel = printer.configfile.settings.printer.max_accel %}
{% set accel_to_decel = printer.configfile.settings.printer.max_accel %}
{% else %}
# load stored values
{% set accel = printer["gcode_macro _SET_ACC"].accel %}
{% set accel_to_decel = printer["gcode_macro _SET_ACC"].accel_to_decel %}
{% endif %}
{% if VAL != printer["gcode_macro _SET_ACC"].last_val|string %}
SET_GCODE_VARIABLE MACRO=_SET_ACC VARIABLE=last_val VALUE='"{VAL}"'
{action_respond_info("VELOCITY_LIMIT set ACCEL: %d ACCEL_TO_DECEL: %d" % (accel|int, accel_to_decel|int))}
SET_VELOCITY_LIMIT ACCEL={accel} ACCEL_TO_DECEL={accel_to_decel}
{% endif %}