You down with OPP? (oozeBot Post-Processor)
-
We thought we'd create a thread about the initial beta of our post-processor (PP) for Slic3r-based programs (PrusaSlicer, SuperSlicer, etc) - especially with the recent threads about only probing the needed area on the build plate as that is its primary goal. Also because there isn't much info out there on building PPs and this could be used as framework for other projects.
The project lives at: https://github.com/oozebot/OPP It is not yet documented, as I just posted it. I'll get to that soon, but will provide an overview here on how to utilize it.
The script is written in Python, so you will need to install the latest version on your machine. OPP.py needs to be downloaded to your local machine and then referenced in your slicer under Print Settings > Output options > Post-processing scripts as follows:
"C:\Path To Python\python.exe" "C:\Path To Script\OPP.py"
To keep it lightweight, it relies on two additional lines of code added to Printer Settings > Custom G-code > Start G-code:
;=== OPP HEADER === ;FirstLayerMinMax: X{first_layer_print_min[0]}:{first_layer_print_max[0]} Y{first_layer_print_min[1]}:{first_layer_print_max[1]}
There are several variables that are defaulted in the script that can either be altered within it for your setup or can be passed into the script on the Post-processing command line referenced above. These are documented within the script but here they are as written in the command line with a quick overview:
"C:\Path To Python\python.exe" "C:\Path To Script\OPP.py" mesh=2 points=5 spacing=18 start=M9000 xOffset=19 yOffset=19 minGrid=0 maxGrid=300
It really only makes sense to pass in mesh and either points or spacing. The rest can be quickly adjusted in the script for your printer.
There are 3 options for Mesh:
Mesh=0 disables the functionality
Mesh=1 creates a custom mesh grid utilizing points- example: An object where X=100 and Y=200 with 5 points will probe the X-axis every 20mm per row and probe the Y-axis every 40mm per column, generating a 25 point mesh grid
Mesh=2 creates a custom mesh grid utilizing spacing
- example: An object where X=100 and Y=200 with 20mm spacing will probe the X-axis 5 times per row and probe the Y-axis 10 times per column, generating a 50 point mesh grid
As explained above, Points are used with Mesh=1 and Spacing is used with Mesh=2.
Start is the filename or customer mCode for an equivalent of start.g (we use M9000 / M9000.g). A unique start file is needed as start.g is called prior to executing any gcode at the beginning of a job and the unique mesh grid will not be executed otherwise.
And if you aren't using an initialization script like start.g, you should really consider converting to one!
xOffset and yOffset are your probes offset. They are used to find the center of the custom mesh grid. This is useful to set your Z=0 in the center of the mesh instead of the center of the build plate.. because you really only care about the relative section of your build plate when using a custom mesh.
minGrid and maxGrid are the boundaries your probe is capable of reaching. It the algorithm creates a mesh outside these bounds, the script will alert the user and no mesh will be created.
The end result of the PP is the injection of the following code. Note the size of the mesh is different as Mesh=1 uses the exact size of the printable object(s) + 1mm where Mesh=2 creates a grid based on the spacing around the object.
Mesh=0
;== Modified by OPP: oozeBot Post Processor ;== Source: https://github.com/oozeBot/OPP ;== Initialization script M9000
Mesh=1
;== Modified by OPP: oozeBot Post Processor ;== Source: https://github.com/oozeBot/OPP ;== 25 point mesh grid M557 X73:146 Y42:137 P5 M9000 C"mesh" X90.5 Y70.5
Mesh=2
;== Modified by OPP: oozeBot Post Processor ;== Source: https://github.com/oozeBot/OPP ;== 30 point mesh grid M557 X72.0:162.0 Y36.0:144.0 S18.0 M9000 C"mesh" X98.0 Y71.0
Note the parameters being passed into the custom start code (M9000). They can be handled like this within M9000.g (or whatever you use).
G28 ; Home all axes if exists(param.C) if {param.C} = "mesh" ; Generate custom mesh grid if exists(param.X) & exists(param.Y) G1 Z5 X{param.X} Y{param.Y} F9000 ; Move to center of object to set Z=0 else G1 Z5 X136 Y136 F9000 ; Move to center of build plate to set Z=0 M558 F200 H2.0 A20 S0.02 ; Configure z-probe M561 ; Clear bed transformations G30 Z-500 ; Probe build plate M208 X-10 Y-10 S1 ; Allow negative travel for X & Y M290 R0 S0 ; cancel baby stepping G29 S2 ; cancel mesh bed compensation M561 ; Clear bed transformations G29 S0 ; Perform mesh probing M208 X0 Y0 S1 ; Disallow negative travel for X & Y else G29 S2 ; cancel mesh bed compensation M561 ; Clear bed transformations G29 S1 P"heightmap-110c.csv" ; Load height map M376 H5 ; Set mesh taper
-
We'd love some feedback on this and ideas for additional functionality it can accomplish. While this is geared towards our printers, we are trying hard to keep all our code flexible enough where it will work for others as well without reverse engineering.
-