Jump to content

Not to G28 or QGL every time from start macro if its already done.


Buurman
 Share

Recommended Posts

So I want to see if its possible to check the status of G28 and QGL if its already done in previous print for example.

If its already done, skip it and continue, this can save some time since the TAP needs to cool off, etc for this.

I have found that it seems possible, but wanted to make sure I am following the right path here, maybe someone is already doing this today...

So I found this:

[gcode_macro G32]
gcode:
    STATUS_HOMING

    
    # 1 ----- HOMING ------------------------------------------
    # Home if not already homed and park the head near the center front
    {% if not 'xyz' in printer.toolhead.homed_axes %}
        G28
    {% endif %}

    # 4 ----- QUAD GANTRY LEVELING -----------------------------
    {% if printer.quad_gantry_level.applied|lower == 'false' %}
        {% if V %}
            RESPOND MSG="QGL..."
        {% endif %}
        QUAD_GANTRY_LEVEL
    {% endif %}

So it seems if I would call a G32 (I now dont in my start macro, I call a separate G28 and a QGL) then this would check its status, and skip if its still valid.

Yet, what does this STATUS_HOMING do? I cant call this manually, is this a seperate macro I dont have?

I have seen it in more macro's out there, yet cant really found out how to get it to work, I havent called it from this macro yet, just manually tried it, gives an unknown command.

Would be cool to find out and be able to skip it, running multiple prints, it can save some time for sure, since I heat up the nozzle first, scrub it, then cool it off again for a new/clean G28/QGL. And like this I should be able to skip all of that, and scrub and print. TAP starts to annoy me a bit on the cold probing 😉 (something happened to the smilies)

Link to comment
Share on other sites

1 hour ago, Buurman said:

STATUS_HOMING

i guess it is for the LED's (see here a part of my led.cfg)

[gcode_macro status_homing]
gcode:
    STOP_LED_EFFECTS
    SET_LED_EFFECT EFFECT=sb_logo_homing
    SET_LED_EFFECT EFFECT=set_nozzle_leds

 

Edited by Wick
  • Thanks 1
Link to comment
Share on other sites

I do the check if already homed in my unload/load Filament macro for example and it works fine and safes time

.
.
{% if printer.toolhead.homed_axes != 'xyz' %}    
      M117 Homing...
      STATUS_HOMING
      G28                                                                       ; Homing
{% endif %}
.
.

 

Link to comment
Share on other sites

58 minutes ago, Wick said:

i guess it is for the LED's (see here a part of my led.cfg)

[gcode_macro status_homing]
gcode:
    STOP_LED_EFFECTS
    SET_LED_EFFECT EFFECT=sb_logo_homing
    SET_LED_EFFECT EFFECT=set_nozzle_leds

ok, strange name for a led effect macro, guess I can leave it out then, thanks a lot!

Link to comment
Share on other sites

I have added these two parts to my start macro but still they take place every time.

So I expect that the requested xyz are not in the place they look for it... no idea how to find out though..

 

    # 1 ----- HOMING ------------------------------------------
    # Home if not already homed and park the head near the center front
    {% if not 'xyz' in printer.toolhead.homed_axes %}
        G28
    {% endif %}

    # 4 ----- QUAD GANTRY LEVELING -----------------------------
    {% if printer.quad_gantry_level.applied|lower == 'false' %}
        {% if V %}
            RESPOND MSG="QGL..."
        {% endif %}
        QUAD_GANTRY_LEVEL
    {% endif %}

 

  • Like 1
Link to comment
Share on other sites

Moin,

I found this on GitHub:
https://github.com/zellneralex/klipper_config/blob/master/probe_qgl.cfg

 

#####################################################################
#  Macros
#####################################################################
[gcode_macro QUAD_GANTRY_LEVEL]
description: Conform a moving, twistable gantry to the shape of a stationary bed
rename_existing: QUAD_GANTRY_LEVEL_BASE
gcode:
  {% set user   = printer['gcode_macro _USER_VARIABLE'] %}
  {% set move_z = [user.z_hop, printer.toolhead.position.z]|max %} ; calc movement high
  _SET_Z_CURRENT VAL=HOME
  {% if "xyz" not in printer.toolhead.homed_axes %} G28 {% endif %}
  {% if user.hw.mag_probe.ena %}
    G90
    G0 Z{move_z} F{user.speed.z_hop} ; move head up to insure Probe is not triggered in error case
    ATTACH_PROBE 
  {% endif %}
  QUAD_GANTRY_LEVEL_BASE {rawparams}
  {% if user.hw.mag_probe.ena %} DETACH_PROBE {% endif %}
   {% if params.HOME|default('true')|lower == 'true' %} G28 Z {% endif %}
  _SET_Z_CURRENT
  {% if params.PARK|default('true')|lower == 'true' %}
    G90
    G0 X{user.park.bed.x} Y{user.park.bed.y} Z{user.park.bed.z} F{user.speed.travel}
  {% endif %}
  {% if not printer.gcode_move.absolute_coordinates %} G91 {% endif %} ; set back to relative

[gcode_macro CHECK_QGL]
description: Run after QUAD_GANTRY_LEVEL to insure it passes
gcode:
  {% set user        = printer['gcode_macro _USER_VARIABLE'] %}
  {% set probe_state = printer['gcode_macro _MAG_PROBE'].state|default('unknown')|lower %} ; get probe state
  {% set probe_ok    = False if user.hw.mag_probe.ena and (probe_state == 'error' or probe_state == 'unknown')
                  else True %}  
  {% if not printer.quad_gantry_level.applied or not probe_ok %} ; check QGL and probe status
    {action_respond_info("QGL CHECK: Fail therefore cancel the print")}
    PAUSE_BASE
    G90
    G0 Z{user.z_hop} F{user.speed.z_hop}                                 ; move nozzle to z high first
    {% if not printer.gcode_move.absolute_coordinates %} G91 {% endif %} ; set back to relative
    {% if user.hw.mag_probe.ena %} DETACH_PROBE {% endif %}
    CANCEL_PRINT PARK=1 ERROR=1
  {% else %}
    {action_respond_info("QGL CHECK: Pass")}
  {% endif %}



 

Link to comment
Share on other sites

Here's what I have for conditional homing:

 

[gcode_macro _CG28]
description: Conditional homing
gcode:
  {% if "xyz" not in printer.toolhead.homed_axes %}
    G28 { rawparams }
  {% endif %}


[gcode_macro G28]
description: G28 homing with SB LED status
rename_existing: G2828
gcode:
  LED_HOMING
  RESPOND MSG="Homing"
  G2828 { rawparams }
  UPDATE_DELAYED_GCODE ID=_CLEAR_DISPLAY DURATION=1
  LED_STANDBY

So in my print_start, I only home if it's needed. Being a Trident I z_tilt_adjust instead of QGL, but I don't care if it's been done or not--I just run it every time.

 

 

Link to comment
Share on other sites

some good things here though requiring some other macros to be set, which I don't use. Short and sweet, no other macros, no extraneous messages on console (though that can come in handy).

Trident:

[homing_override]
axes: z
set_position_z: 0
gcode:
   G90
   G0 Z5 F600
   {% if not 'xy' in printer.toolhead.homed_axes %}
     G28 X Y
   {% endif %}

   G0 X150 Y150 F9000
   G28 Z
   G0 Z10 F1800
   G0 X150 Y150 Z30 F5000

[gcode_macro Z_TILT_ADJUST]
rename_existing: _Z_TILT_ADJUST
description: Conditional Z_TILT_ADJUST
gcode:
    {% if printer.z_tilt.applied == False %}
      _Z_TILT_ADJUST {% for p in params
            %}{'%s=%s ' % (p, params[p])}{%
           endfor %}
      G28 Z0
    {% endif %}

V2.4:

[homing_override]
axes: z
set_position_z: 0
gcode:
   G90
   G0 Z5 F600
   {% if not 'xy' in printer.toolhead.homed_axes %}
     G28 X Y
   {% endif %}
   G0 X150 Y150 F10000
   G28 Z
   G0 Z10 F1800
   G0 X150 Y150 Z30 F5000

[gcode_macro QUAD_GANTRY_LEVEL]
rename_existing: _QUAD_GANTRY_LEVEL
gcode:
    {% if printer.quad_gantry_level.applied == False %}
      _QUAD_GANTRY_LEVEL {% for p in params
              %}{'%s=%s ' % (p, params[p])}{%
              endfor %}
    {% endif %}

 

Link to comment
Share on other sites

7 hours ago, Wick said:

@geekandi the macros you postet are for TAP I guess as homing Z is in the center of the bed (in this case 300mm) and I think the 2nd "G0 X150 Y150 Z30 F5000" is not neccessary?

This is what I used pre-Tap and post-Tap - works just dandy - sharing what works for me, YMMV

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...