Hi @BoostedVal
the fff post utility will allow you to create a post processor from scratch, using the explanations provided on the webpage.
But it won't change a library post to suit your need.
If you want to alter the creality post, here is some explanations and links to resources:
https://forums.autodesk.com/t5/hsm-post-processor-forum/technical-faq/td-p/7473258
If you want to add m-codes at the start of the program, it will be done either in the onOpen, or more frequently in the onSection function. onOpen is called before heating up the bed/extruder(s)..., onSection is called after.
Let's consider an initial partial code like this one:
// homing
writeBlock(gFormat.format(28));
if (getProperty("enableBedLeveling") == "g29") {
writeBlock(gFormat.format(29)); // enable auto bed leveling
}
if (getProperty("enableBedLeveling") == "m420") {
writeComment("Enable auto bed leveling");
writeBlock(mFormat.format(420), sOutput.format(1), zOutput.format(bedLevelingHeight)); // enable auto bed levelling
}
// lower build plate
var initialPosition = getFramePosition(currentSection.getInitialPosition());
the g-code generated will be looking like this one:
G28
either G29
or M420 S1 Z depending on the post property selection for the bed levelling
G1....
If we need to add a M413 between G28 and the rest, it can be done this way:
// homing
writeBlock(gFormat.format(28));
// addition
writeBlock(mFormat.format(413));
if (getProperty("enableBedLeveling") == "g29") {
writeBlock(gFormat.format(29)); // enable auto bed leveling
}
if (getProperty("enableBedLeveling") == "m420") {
writeComment("Enable auto bed leveling");
writeBlock(mFormat.format(420), sOutput.format(1), zOutput.format(bedLevelingHeight)); // enable auto bed levelling
}
// lower build plate
var initialPosition = getFramePosition(currentSection.getInitialPosition());
If you need to alter your post, please you must start by copying it from the library to a personal folder (either on the cloud, or local)
Have a pleasant day.
Regards.
______________________________________________________________
If my post answers your question, please click the "Accept Solution" button. This helps everyone find answers more quickly!