Turge08 / print_area_bed_mesh

Create bed mesh for print area only
209 stars 40 forks source link

Feature request - Probe if previous mesh had different temp for the bed. #18

Open WickedInvi opened 2 years ago

WickedInvi commented 2 years ago

Personally, I get different warping of the bed depending on temperature (more be warping with ABS). Would be good to check if the previous mesh was at the same temp if different than probe again. Not sure if it would be easy to implement. (I've done it after writing this first part)

Not really sure how git hub works to just do a merge request.

I've updated mine so perhaps you can add it to the main branch

BED_TEMP used so the current Start macro does not have to be edited or changed just pass a new variable with the bed temp.

Edit: Still need to handle if variable is not passed at all

ADD:
variable_parameter_BED_TEMP: 0
variable_last_bed_temp: -1 ; Do not change

        { action_respond_info("Bed Temp: %s" % (params.BED_TEMP)) }
        { action_respond_info("Last Bed Temp: %s" % (last_bed_temp)) }

        {% set bed_temp= params.BED_TEMP %}

                SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=last_bed_temp VALUE={bed_temp|int}

Change:
        {% if (params.FORCE_NEW_MESH != null) or (bed_temp|int != last_bed_temp|int) or (print_min_x|float < last_area_start_x|float) or (print_max_x|float > last_area_end_x|float) or (print_min_y|float < last_area_start_y|float) or (print_max_y|float > last_area_end_y|float)  %}

            { action_respond_info("No need to recreate Bed Mesh since it's same as current mesh or smaller and the bed temperature is the same") }

Change to klipper's printer.cfg
            BED_MESH_CALIBRATE PRINT_MIN={params.PRINT_MIN} PRINT_MAX={params.PRINT_MAX} BED_TEMP={params.BED_TEMP} 

edit: Changed a few things as I thought it was working but the variables need to be all lower case now seems to work fine