Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GET_PROBE_LIMITS #81

Open
pellcorp opened this issue Jul 5, 2024 · 1 comment
Open

GET_PROBE_LIMITS #81

pellcorp opened this issue Jul 5, 2024 · 1 comment

Comments

@pellcorp
Copy link
Owner

pellcorp commented Jul 5, 2024

https://github.com/rootiest/zippy_guides/blob/main/resources/GET_PROBE_LIMITS.cfg

Also cleanup the [respond] config perhaps adding it to printer.cfg and remove from guppyscreen.cfg

@pellcorp
Copy link
Owner Author

From KILLbabylon:

[gcode_macro GET_PROBE_LIMITS]
description: Calculates the probe min/max/current coordinates
gcode: 
    {% set config = printer.configfile.settings %}
    # Find probe config in configfile
    {% if config["bltouch"] %}
        # bltouch section found
        {% set probe = config["bltouch"] %}
        {% set has_probe = True %}
    {% elif config["probe"] %}
        # probe section found
        {% set probe = config["probe"] %}
        {% set has_probe = True %}
    {% elif config["beacon"] %}
        # probe section found
        {% set probe = config["beacon"] %}
        {% set has_probe = True %}
    {% elif config["smart_effector"] %}
        # smart_effector probe section found
        {% set probe = config["smart_effector"] %}
        {% set has_probe = True %}
    {% elif config["probe_eddy_current btt_eddy"] %}
        # probe_eddy_current btt_eddy probe section found
        {% set probe = config["probe_eddy_current btt_eddy"] %}
        {% set has_probe = True %}
    {% else %}
        # No probe or bltouch sections found
        RESPOND MSG="Failed to detect probe in configfile"
    {% endif %}
    {% if has_probe %}
        {% set stepperx = config["stepper_x"] %}
        {% set steppery = config["stepper_y"] %}
        {% set xprobemin = stepperx["position_min"]|float + probe["x_offset"]|float %} 
        {% set xprobemax = stepperx["position_max"]|float + probe["x_offset"]|float %} 
        {% set yprobemin = steppery["position_min"]|float + probe["y_offset"]|float %} 
        {% set yprobemax = steppery["position_max"]|float + probe["y_offset"]|float %}
        RESPOND MSG="Configured Probe X-Offset {probe.x_offset}"
        RESPOND MSG="Configured Probe Y-Offset {probe.y_offset}"
        {% if probe.z_offset is defined %}
            RESPOND MSG="Configured Probe Z-Offset {probe.z_offset}"
        {% elif probe.trigger_distance is defined %}
            RESPOND MSG="Configured Probe Trigger Distance {probe.trigger_distance}"
        {% endif %}
        RESPOND MSG="Minimum PROBE position X={xprobemin} Y={yprobemin}" 
        RESPOND MSG="Maximum PROBE position X={xprobemax} Y={yprobemax}"
        # check if printer homed
        {% if "xyz" in printer.toolhead.homed_axes %} 
            {% set curprobex = printer.toolhead.position.x|float + probe["x_offset"]|float %} 
            {% set curprobey = printer.toolhead.position.y|float + probe["y_offset"]|float %} 
            RESPOND MSG="Current PROBE position X={curprobex} Y={curprobey}"
        {% endif %}
    {% endif %}

Can most likely add 'cartographer' as a clone of the beacon section, and for Simple AF would remove beacon and smart_effector, and until such time as btt eddy is supported remove that as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant