Complete credit goes to ChipCE (https://gist.github.com/ChipCE/95fdbd3c2f3a064397f9610f915f7d02) for the idea and sample code. I completely rewrote the macro to be more dynamic and for some added features.
This is currently in development. While it works on my 2 printers, it's impossible to account for everyone's various config. When first implementing this, be prepared to click the "Emergency Stop" button if it tries to probe off the bed.
SSH into the Pi and run the following commands:
cd ~ git clone https://github.com/Turge08/print_area_bed_mesh.git ~/print_area_bed_mesh/install.sh
Through Fluidd/Mainsail, edit printer.cfg file and add the following line at the top of your printer.cfg:
[include print_area_bed_mesh.cfg]
From Fluidd/Mainsail, edit moonraker.conf (in the same folder as your printer.cfg file) and add:
[update_manager print_area_bed_mesh] type: git_repo path: ~/print_area_bed_mesh origin: https://github.com/Turge08/print_area_bed_mesh.git is_system_service: False
NOTE: You must perform step #1 at least once or Moonraker will generate an error.
Where you normally perform a BED_MESH_CALIBRATE in your start_print macro, replace it (or add it if you didn't previously have it) with the following line:
BED_MESH_CALIBRATE PRINT_MIN={params.PRINT_MIN} PRINT_MAX={params.PRINT_MAX}
If you want to force a new mesh every time, use the following syntax:
BED_MESH_CALIBRATE PRINT_MIN={params.PRINT_MIN} PRINT_MAX={params.PRINT_MAX} FORCE_NEW_MESH=True
Modify your printer's start g-code in your slicer to include the PRINT_MIN and PRINT_MAX parameters:
Examples:
PrusaSlicer/SuperSlicer:
print_start EXTRUDER={first_layer_temperature[initial_extruder] + extruder_temperature_offset[initial_extruder]} BED=[first_layer_bed_temperature] CHAMBER=[chamber_temperature] PRINT_MIN={first_layer_print_min[0]},{first_layer_print_min[1]} PRINT_MAX={first_layer_print_max[0]},{first_layer_print_max[1]}
Cura (add this to your start gcode at the end of the start_print command:)
PRINT_MIN=%MINX%,%MINY% PRINT_MAX=%MAXX%,%MAXY%
*(Cura slicer plugin) To make the macro to work in Cura slicer, you need to install the post process plugin by frankbags - In cura menu Help -> Show configuration folder. - Copy the python script from the above link in to scripts folder. - Restart Cura - In cura menu Extensions -> Post processing and select Mesh Print Size
Examples:
PrusaSlicer/SuperSlicer:
BED_MESH_CALIBRATE PRINT_MIN={first_layer_print_min[0]},{first_layer_print_min[1]} PRINT_MAX={first_layer_print_max[0]},{first_layer_print_max[1]}
Cura
BED_MESH_CALIBRATE PRINT_MIN=%MINX%,%MINY% PRINT_MAX=%MAXX%,%MAXY%
IdeaMaker
BED_MESH_CALIBRATE PRINT_MIN={print_pos_min_x},{print_pos_min_y} PRINT_MAX={print_pos_max_x},{print_pos_max_y}
BambuStudio/OrcaSlicer
BED_MESH_CALIBRATE PRINT_MIN={first_layer_print_min[0]},{first_layer_print_min[1]} PRINT_MAX={first_layer_print_max[0]},{first_layer_print_max[1]}