Skip to content

[QUESTION] START_PRINT: I have a probe issue with temp pulling #19

@wessold

Description

@wessold

OK..... I am new to Klipper and I'm really close to going back to Marline. Your guide has been helpful. I'm can not even get the first layer on the Benchy to print. It will not stick to the bed, almost like my z offset is off. I have calibrated everything multiple time. I have deleted the "saved" data in my printer.cfg file and recalibrated again. Now I am starting to see if my macros are the issue.

I am now using your START_PRINT: I have a probe macro instead of my start g code in Orca. but now it's not pulling my filament Temp setting from Orca. it's printing with the "default" setting in your macro.

ALSO...... I can't get the damn purge to work either.

[gcode_macro START_PRINT]
gcode:
{% set BED_TEMP = params.BED_TEMP|default(60)|float %}
{% set EXTRUDER_TEMP = params.EXTRUDER_TEMP|default(190)|float %}
# Heat bed for probing
M190 S{BED_TEMP}
# Use absolute coordinates
G90
# Home the printer
G28

# If you are using QGL:
#QUAD_GANTRY_LEVEL
#G28 Z

# If you are using Z-Tilt:
Z_TILT_ADJUST

# If you are generating a new bed mesh:
BED_MESH_CALIBRATE ADAPTIVE=1
## NOTE:    The adaptive meshing feature requires exclude_object     ##
##      and may require 'Label Objects' to be enabled in the slicer  ##
##           To mesh without it just use BED_MESH_CALIBRATE          ##

# If you are loading an existing mesh:
#BED_MESH_PROFILE LOAD=default

# Move the nozzle near the bed
G1 Z5 F3000
# Set and wait for nozzle to reach printing temperatur
M109 S{EXTRUDER_TEMP}
M98 P=Line_Purge
# Start printing!

Enable exclude_object for adaptive meshing

[exclude_object]

The Line_Purge.cfg file is

[[gcode_macro LINE_PURGE]
description: A purge macro that adapts to be near your actual printed objects
gcode:
# Get relevant printer params
{% set travel_speed = (printer.toolhead.max_velocity) * 60 | float %}
{% set cross_section = printer.configfile.settings.extruder.max_extrude_cross_section | float %}

# Use firmware retraction if it is defined
{% if printer.firmware_retraction is defined %}
    {% set RETRACT = G10 | string %}
    {% set UNRETRACT = G11 | string %}
{% else %}
    {% set RETRACT = 'G1 E-.5 F2100' | string %}
    {% set UNRETRACT = 'G1 E.5 F2100' | string %}
{% endif %}

# Get purge settings from _Kamp_Settings
{% set verbose_enable = printer["gcode_macro _KAMP_Settings"].verbose_enable | abs %}
{% set purge_height = printer["gcode_macro _KAMP_Settings"].purge_height | float %}
{% set tip_distance = printer["gcode_macro _KAMP_Settings"].tip_distance | float %}
{% set purge_margin = printer["gcode_macro _KAMP_Settings"].purge_margin | float %}
{% set purge_amount = printer["gcode_macro _KAMP_Settings"].purge_amount | float %}
{% set flow_rate = printer["gcode_macro _KAMP_Settings"].flow_rate | float %}


# Calculate purge origins and centers from objects
{% set all_points = printer.exclude_object.objects | map(attribute='polygon') | sum(start=[]) %}    # Get all object points
{% set purge_x_min = (all_points | map(attribute=0) | min | default(0)) %}                          # Object x min
{% set purge_x_max = (all_points | map(attribute=0) | max | default(0)) %}                          # Object x max
{% set purge_y_min = (all_points | map(attribute=1) | min | default(0)) %}                          # Object y min
{% set purge_y_max = (all_points | map(attribute=1) | max | default(0)) %}                          # Object y max

{% set purge_x_center = ([((purge_x_max + purge_x_min) / 2) - (purge_amount / 2), 0] | max) %}      # Create center point of purge line relative to print on X axis
{% set purge_y_center = ([((purge_y_max + purge_y_min) / 2) - (purge_amount / 2), 0] | max) %}      # Create center point of purge line relative to print on Y axis

{% set purge_x_origin = ([purge_x_min - purge_margin, 0] | max) %}                                  # Add margin to x min, compare to 0, and choose the larger
{% set purge_y_origin = ([purge_y_min - purge_margin, 0] | max) %}                                  # Add margin to y min, compare to 0, and choose the larger

# Calculate purge speed
{% set purge_move_speed = (flow_rate / 5.0) * 60 | float %}

{% if cross_section < 5 %}

    {action_respond_info("[Extruder] max_extrude_cross_section is insufficient for purge, please set it to 5 or greater. Purge skipped.")}

{% else %}

    {% if verbose_enable == True %}

    {action_respond_info("Moving filament tip {}mms".format(                                                                 
        (tip_distance),                                                                                      
    )) }
    {% endif %}

    {% if printer.firmware_retraction is defined %}
        {action_respond_info("KAMP purge is using firmware retraction.")}
    {% else %}
        {action_respond_info("KAMP purge is not using firmware retraction, it is recommended to configure it.")}
    {% endif %}

    {% if purge_y_origin > 0 %}
    
        {action_respond_info("KAMP purge starting at {}, {} and purging {}mm of filament, requested flow rate is {}mm3/s.".format(                                                                 
            (purge_x_center),
            (purge_y_origin),
            (purge_amount),
            (flow_rate),
        )) }

    {% else %}

        {action_respond_info("KAMP purge starting at {}, {} and purging {}mm of filament, requested flow rate is {}mm3/s.".format(                                                                 
            (purge_x_origin),
            (purge_y_center),
            (purge_amount),
            (flow_rate),
        )) }

    {% endif %}

    SAVE_GCODE_STATE NAME=Prepurge_State                                                    # Create gcode state

    {% if purge_y_origin > 0 %}                                                             # If there's room on Y, purge along X axis in front of print area

        G92 E0                                                                              # Reset extruder
        G0 F{travel_speed}                                                                  # Set travel speed
        G90                                                                                 # Absolute positioning
        G0 X{purge_x_center} Y{purge_y_origin}                                              # Move to purge position
        G0 Z{purge_height}                                                                  # Move to purge Z height
        M83                                                                                 # Relative extrusion mode
        G1 E{tip_distance} F{purge_move_speed}                                              # Move filament tip
        G1 X{purge_x_center + purge_amount} E{purge_amount} F{purge_move_speed}             # Purge line
        {RETRACT}                                                                           # Retract
        G0 X{purge_x_center + purge_amount + 10} F{travel_speed}                            # Rapid move to break string
        G92 E0                                                                              # Reset extruder distance
        M82                                                                                 # Absolute extrusion mode
        G0 Z{purge_height * 2} F{travel_speed}                                              # Z hop

    {% else %}                                                                              # If there's room on X, purge along Y axis to the left of print area
        
        G92 E0                                                                              # Reset extruder
        G0 F{travel_speed}                                                                  # Set travel speed
        G90                                                                                 # Absolute positioning
        G0 X{purge_x_origin} Y{purge_y_center}                                              # Move to purge position
        G0 Z{purge_height}                                                                  # Move to purge Z height
        M83                                                                                 # Relative extrusion mode
        G1 E{tip_distance} F{purge_move_speed}                                              # Move filament tip
        G1 Y{purge_y_center + purge_amount} E{purge_amount} F{purge_move_speed}             # Purge line
        {RETRACT}                                                                           # Retract
        G0 Y{purge_y_center + purge_amount + 10} F{travel_speed}                            # Rapid move to break string
        G92 E0                                                                              # Reset extruder distance
        M82                                                                                 # Absolute extrusion mode
        G0 Z{purge_height * 2} F{travel_speed}                                              # Z hop

    {% endif %}

    RESTORE_GCODE_STATE NAME=Prepurge_State                                                 # Restore gcode state

{% endif %}

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions