Mach3 post processor M3/M5 Gcode

Mach3 post processor M3/M5 Gcode

Anonymous
Not applicable
1,069 Views
3 Replies
Message 1 of 4

Mach3 post processor M3/M5 Gcode

Anonymous
Not applicable

Hello

 

I need a little help to get this gcode out of my mach3 post processor.

But how should I do that?

I have been playing with different settings but can not find the correct place to do the inputs.

G00 Z0
G00 X-100,0197 Y-5,9306 F300 M3 S8000
G00 Z-0,078
G01 X-96,8153 Y-5,4911 F3000 S100 M3
G01 X-96,7295 Y-7,543
G01 X-96,345 Y-8,9472
G01 X-95,6618 Y-9,7037
M5
G01 X-94,9774 Y-10,4613 F3000 S100 M3
G00 Z-0,078
G01 X-94,0321 Y-10,8389
G01 X-92,8236 Y-10,8378
G01 X-91,9321 Y-10,8389
M5
G01 X-94,9774 Y-10,4613 F3000 S100 M3
G010Z-0,078
G01 X-94,0321 Y-10,8389
G01 X-92,8236 Y-10,8378
G01 X-91,9321 Y-10,8389
M5
M30

 

So it use:

Feed

Speed

Start/Stop (M3/M5) between the moves.

 

Do you know how to do it?

0 Likes
1,070 Views
3 Replies
Replies (3)
Message 2 of 4

Marek_Skotak
Advocate
Advocate

Hello,

 

 you can try something like this. Not tested, only idea from my head. 

 

function onRapid(_x, _y, _z) {
  var x = xOutput.format(_x);
  var y = yOutput.format(_y);
  var z = zOutput.format(_z);

  
  if (x || y || z) {
    if (pendingRadiusCompensation >= 0) {
      error(localize("Radius compensation mode cannot be changed at rapid traversal."));
      return;
    }
 

	 
 
    writeBlock(gMotionModal.format(0), x, y, z);

 	feedOutput.reset();
  }
  // this is my code
var first_move = true
}

function onLinear(_x, _y, _z, feed) {
  var x = xOutput.format(_x);
  var y = yOutput.format(_y);
  var z = zOutput.format(_z);
  var f = feedOutput.format(feed);
// this is my code
if (fist_move) {
writeBlock (sOutput.format(tool.spindleRPM), mFormat.format(tool.clockwise ? 3 : 4))
writeBlock(gMotionModal.format(1), x, y, z, f);
first_move = false
}

  if (x || y || z) {
    if (pendingRadiusCompensation >= 0) {
      pendingRadiusCompensation = -1;
      writeBlock(gPlaneModal.format(17));
      switch (radiusCompensation) {
      case RADIUS_COMPENSATION_LEFT:
        pOutput.reset();
        writeBlock(gMotionModal.format(1), gFormat.format(41), x, y, z, f, pOutput.format(tool.diameter));
        break;
      case RADIUS_COMPENSATION_RIGHT:
        pOutput.reset();
        writeBlock(gMotionModal.format(1), gFormat.format(42), x, y, z, f, pOutput.format(tool.diameter));
        break;
      default:
        writeBlock(gMotionModal.format(1), gFormat.format(40), x, y, z, f);
      }
    } else {
      writeBlock(gMotionModal.format(1), x, y, z, f);
    }
  } else if (f) {
    if (getNextRecord().isMotion()) { // try not to output feed without motion
      feedOutput.reset(); // force feed on next line
    } else {
      writeBlock(gMotionModal.format(1), f);
    }
  }

}

Marek

www.cadcam-softcz.cz

Postprocessor writer, CNC trainer, .NET programmer, www.cadcam-softcz.cz
0 Likes
Message 3 of 4

Anonymous
Not applicable

Sorry but it didnt work.

 

But this is the output I am looking for:

G1X39.0928Y35.8210
M5
G0X43.0084Y35.2696
G1X43.3356Y35.2296S12000F3600.0
G1X42.3434Y35.3599

 

Where do I have to edit.

0 Likes
Message 4 of 4

daniel_lyall
Mentor
Mentor

why do you wont M3 and M5 to go off and on between moves 

 


Win10 pro | 16 GB ram | 4 GB graphics Quadro K2200 | Intel(R) 8Xeon(R) CPU E5-1620 v3 @ 3.50GHz 3.50 GHz

Daniel Lyall
The Big Boss
Mach3 User
My Websight, Daniels Wheelchair Customisations.
Facebook | Twitter | LinkedIn

0 Likes