Announcements
Autodesk Community will be read-only between April 26 and April 27 as we complete essential maintenance. We will remove this banner once completed. Thanks for your understanding

Laser on during initial move

myjunkmail2209
Participant Participant
683 Views
7 Replies
Message 1 of 8

Laser on during initial move

myjunkmail2209
Participant
Participant
I decided to try Fusion for some laser etching/cutting, and I've noticed something odd and annoying.
The laser is on for the initial move from the WCS origin to the starting location.
 
Is this an issue with Fusion, my post-processor or user error?
 
Output from post-processor:
 

 

;***********************************************************************************
;HyperCube CAM post processor for Fusion360: Version 1.0
;Compatible with Marlin 1.1.4+
;By Tech2C
;https://www.thingiverse.com/thing:1752766
;https://www.youtube.com/watch?v=n2jM6v3E7sU...
;***********************************************************************************
M117 Starting...
M5 ;Laser/Fan OFF
G21 ;Metric Values
G17 ;Plane XY
G90 ;Absolute Positioning
G92 X0 Y0 Z0 ;Set XYZ Positions
G0 F2500
G0 Z0 F300 ;Position Z
M400
M117 Outside
M3 S192
G1 X-9 Y-211.36 Z0
G1 X-8
G1 Y0
G1 X8
G1 Y-211.36
G1 X-8
G1 X-9
M400
M5 ;Laser/Fan OFF
G0 F2500
M84 ;Motors OFF
M117 Finished​

 

Reply
Reply
0 Likes
Accepted solutions (1)
684 Views
7 Replies
Replies (7)
Message 2 of 8

myjunkmail2209
Participant
Participant

I think it is the post processor that is causing the issue.

 

Could someone please look over the following to see if the problem is evident.

 

/**
  HyperCube CAM post processor for Fusion360
  Compatible with Marlin 1.1.4+

  By Tech2C
  https://www.thingiverse.com/thing:1752766
  https://www.youtube.com/watch?v=n2jM6v3E7sU&list=PLIaArjwViQRVAERWRrYfe9rtiwvvRGCzw
  Changed to M3 Sxxx - Laser on @ power Sxxx
  Changed to M5 - Laser OFF

  Adapted from 'Generic Grbl' (grbl.cps) and 'Dumper' (dump.cps)
*/
description = "HyperCube for Fusion360";
vendor = "Marlin";
vendorUrl = "https://github.com/MarlinFirmware/Marlin";

extension = "nc";
setCodePage("ascii");

capabilities = CAPABILITY_INTERMEDIATE;
tolerance = spatial(0.002, MM);

minimumChordLength = spatial(0.01, MM);
minimumCircularRadius = spatial(0.01, MM);
maximumCircularRadius = spatial(1000, MM);
minimumCircularSweep = toRad(0.01);
maximumCircularSweep = toRad(180);
allowHelicalMoves = true;
allowedCircularPlanes = undefined; // allow any circular motion

// user-defined properties
properties = {
  startHomeX: false,
  startHomeY: false,
  startHomeZ: false,
  startPositionZ: "2",
  finishHomeX: false,
  finishPositionY: "",
  finishPositionZ: "",
  finishBeep: false,
  rapidTravelXY: 2500,
  rapidTravelZ: 300,
  laserEtch: "M3 S128",
  laserVaperize: "M3 S255",
  laserThrough: "M3 S192",
  laserOFF: "M5"
};

var xyzFormat = createFormat({decimals:3});
var feedFormat = createFormat({decimals:0});

var xOutput = createVariable({prefix:"X"}, xyzFormat);
var yOutput = createVariable({prefix:"Y"}, xyzFormat);
var zOutput = createVariable({prefix:"Z"}, xyzFormat);
var feedOutput = createVariable({prefix:"F"}, feedFormat);
var planeOutput = createVariable({prefix:"G"}, feedFormat);

// circular output
var	iOutput	= createReferenceVariable({prefix:"I"}, xyzFormat);
var	jOutput	= createReferenceVariable({prefix:"J"}, xyzFormat);
var	kOutput	= createReferenceVariable({prefix:"K"}, xyzFormat);

var cuttingMode;

function formatComment(text) {
  return String(text).replace(/[\(\)]/g, "");
}

function writeComment(text) {
  writeWords(formatComment(text));
}

function onOpen() {
  writeln(";***********************************************************************************");
  writeln(";HyperCube CAM post processor for Fusion360: Version 1.0");
  writeln(";Compatible with Marlin 1.1.4+");
  writeln(";By Tech2C");
  writeln(";https://www.thingiverse.com/thing:1752766");
  writeln(";https://www.youtube.com/watch?v=n2jM6v3E7sU&list=PLIaArjwViQRVAERWRrYfe9rtiwvvRGCzw");
  writeln(";***********************************************************************************");
}

/** Force output of X, Y, and Z. */
function forceXYZ() {
  xOutput.reset();
  yOutput.reset();
  zOutput.reset();
}

/** Force output of X, Y, Z, and F on next output. */
function forceAny() {
  forceXYZ();
  feedOutput.reset();
}

function onSection() {
  if(isFirstSection()) {
    writeln("");
	  writeWords("M117 Starting...");
	  writeWords(properties.laserOFF, "         ;Laser/Fan OFF");
    writeWords("G21", "          ;Metric Values");
	  writeWords(planeOutput.format(17), "          ;Plane XY");
	  writeWords("G90", "          ;Absolute Positioning");
	  writeWords("G92 X0 Y0 Z0", " ;Set XYZ Positions");
	  writeWords("G0", feedOutput.format(properties.rapidTravelXY));
	  if(properties.startHomeX) { writeWords("G28 X", "        ;Home X"); }
	  if(properties.startHomeY) { writeWords("G28 Y", "        ;Home Y"); }
	  if(properties.startHomeZ) { writeWords("G28 Z", feedOutput.format(properties.rapidTravelZ), "    ;Home Z"); }
	  if(properties.startPositionZ) { writeWords("G0 Z" + properties.startPositionZ, feedOutput.format(properties.rapidTravelZ), "   ;Position Z"); }
}
  
  if (currentSection.getType() == TYPE_JET) {
    if(currentSection.jetMode == 0) {cuttingMode = properties.laserThrough }
	else if(currentSection.jetMode == 1) {cuttingMode = properties.laserEtch }
	  else if(currentSection.jetMode == 2) {cuttingMode = properties.laserVaperize }
	    else {cuttingMode = (properties.laserOFF + "         ;Unknown Laser Cutting Mode") }
  }
  
  if (hasParameter("operation-comment")) {
    var comment = getParameter("operation-comment");
    if (comment) {
	    writeln("");
	    writeWords("M400");
      writeComment("M117 " + comment);
    }
  }
}

function onDwell(seconds) {
  if (seconds > 99999.999) {
    warning(localize("Dwelling time is out of range."));
  }
  seconds = clamp(0.001, seconds, 99999.999);
  writeWords("G4 S" + seconds, "        ;Dwell time");
}

function onPower(power) {
  if (power) { writeWords(cuttingMode) }
  else { writeWords(properties.laserOFF) }
}

function onRapid(_x, _y, _z) {
  var x = xOutput.format(_x);
  var y = yOutput.format(_y);
  var z = zOutput.format(_z);
  if (x || y) {
    writeWords("G0", x, y, feedOutput.format(properties.rapidTravelXY));
  }
  if (z) {
    writeWords("G0", z, feedOutput.format(properties.rapidTravelZ));
  }
}

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);
  if(x || y || z) {
    writeWords("G1", x, y, z, f);
  }
  else if (f) {
    writeWords("G1", f);
  }
}

function onCircular(clockwise, cx, cy, cz, x, y, z, feed) {
  // one of X/Y and I/J are required and likewise
  var start = getCurrentPosition();
  
  switch (getCircularPlane()) {
  case PLANE_XY:
    writeWords(planeOutput.format(17), (clockwise ? "G2":"G3"), xOutput.format(x), yOutput.format(y), zOutput.format(z), iOutput.format(cx - start.x, 0), jOutput.format(cy - start.y, 0), feedOutput.format(feed));
    break;
  case PLANE_ZX:
    writeWords(planeOutput.format(18), (clockwise ? "G2":"G3"), xOutput.format(x), yOutput.format(y), zOutput.format(z), iOutput.format(cx - start.x, 0), kOutput.format(cz - start.z, 0), feedOutput.format(feed));
    break;
  case PLANE_YZ:
    writeWords(planeOutput.format(19), (clockwise ? "G2":"G3"), xOutput.format(x), yOutput.format(y), zOutput.format(z), jOutput.format(cy - start.y, 0), kOutput.format(cz - start.z, 0), feedOutput.format(feed));
	break;
  default:
    linearize(tolerance);
  }
}

function onSectionEnd() {
  writeWords(planeOutput.format(17));
  forceAny();
}

function onClose() {
  writeln("");
  writeWords("M400");
  writeWords(properties.laserOFF, "         ;Laser/Fan OFF");
  if(properties.finishPositionZ) { writeWords("G0 Z" + properties.finishPositionZ, feedOutput.format(properties.rapidTravelZ), "   ;Position Z"); }
  writeWords("G0", feedOutput.format(properties.rapidTravelXY));
  if(properties.finishHomeX) { writeWords("G28 X", "        ;Home X"); }
  if(properties.finishPositionY) { writeWords("G0 Y" + properties.finishPositionY, "      ;Position Y"); }
  writeWords("M84", "          ;Motors OFF");
  if(properties.finishBeep) { writeWords("M300 S800 P300"); }
  writeWords("M117 Finished :)");
}
Reply
Reply
0 Likes
Message 3 of 8

carl.j.barker
Collaborator
Collaborator

Just looking at the code, I'd say that this line

 

G1 X-9 Y-211.36 Z0

 

Should be a G0. or otherwise be done before the laser is turned on.

 

Can you show fusions output for this - right click the toolpath in the browser and choose 'view toolpath' 

so we can see what fusion is sending to the PP.

Reply
Reply
0 Likes
Message 4 of 8

myjunkmail2209
Participant
Participant

toolpath.png

 

Reply
Reply
0 Likes
Message 5 of 8

carl.j.barker
Collaborator
Collaborator

Well the post is outputting correctly as far as I can tell.

Your tool path is missing the initial rapids to start point (or what ever the personal version outputs, Guessing just a linear ).

 

Can you share the design with the setup and toolpathing on it?

 

Reply
Reply
0 Likes
Message 6 of 8

myjunkmail2209
Participant
Participant
Reply
Reply
0 Likes
Message 7 of 8

myjunkmail2209
Participant
Participant

I've also noticed that when I stack duplicate operations, the laser is not turned off at the end, before moving back to the initial starting position to go around again - Just ruined a nice bit of leather 😞

Reply
Reply
0 Likes
Message 8 of 8

myjunkmail2209
Participant
Participant
Accepted solution

Thanks for your assistance Carl.

 

I've discovered that the power on at the start seems to be an aberration as I cannot replicate the fault in a new design.

The power remaining on between sections was a flaw in the post processor that I'm using.

Reply
Reply
0 Likes