Ok, I think we are on a path to solve the Post processor side of things.
I’ve been talking to @robertbu on the side. I’m posting it here so I have a single source of reference as I make changes.
He suggested I generate a laser gcode from F360 and look for M106 and M107 commands.
I have not generated gcode for this yet, but will shortly.
However, I had a minute to look over the F360 PP and found this block of code for turning the laser on and off.
function laserOn(power) {
// Firmware is Grbl
if (fw == eFirmware.GRBL) {
var laser_pwm = power * 10;
writeBlock(mFormat.format(properties.cutter6_GrblMode), sFormat.format(laser_pwm));
}
// Default firmware
else {
var laser_pwm = power / 100 * 255;
switch (properties.cutter4_MarlinMode) {
case 106:
writeBlock(mFormat.format(106), sFormat.format(laser_pwm));
break;
case 3:
if (fw == eFirmware.REPRAP) {
writeBlock(mFormat.format(3), sFormat.format(laser_pwm));
} else {
writeBlock(mFormat.format(3), oFormat.format(laser_pwm));
}
break;
case 42:
writeBlock(mFormat.format(42), pFormat.format(properties.cutter5_MarlinPin), sFormat.format(laser_pwm));
break;
}
}
}
function laserOff() {
// Firmware is Grbl
if (fw == eFirmware.GRBL) {
writeBlock(mFormat.format(5));
}
// Default
else {
switch (properties.cutter4_MarlinMode) {
case 106:
writeBlock(mFormat.format(107));
break;
case 3:
writeBlock(mFormat.format(5));
break;
case 42:
writeBlock(mFormat.format(42), pFormat.format(properties.cutter5_MarlinPin), sFormat.format(0));
break;
}
}
}
I’m thinking there are two lines of code I need to change for F360 to generate the m280 code.
under the laser off function
@robertbu stated that 106 needs to change for pen down and 107 change to pen up
So this line of code for for laser on (m106)
case 106:
writeBlock(mFormat.format(106), sFormat.format(laser_pwm));
break;
changes to this for pen down
case 106:
writeBlock(mFormat.format(280), pFormat.format(0), sFormat.format(0));
break;
this changes m106 to m280. Adds index p0 (need to determine which index my servo is) and s0 for the servo position.
then…
this line of code for laser off (m107)
case 106:
writeBlock(mFormat.format(107));
break;
changes to this for pen up
case 106:
writeBlock(mFormat.format(280), pFormat.format(0), sFormat.format(90));
break;
changes m107 to m280, adds p0 for servo index and sets servo position to 90 degrees.
Would this be right? I guess it would be easy enough to try.