Community
HSM Post Processor Forum
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Help editing Mach3 post for 360

4 REPLIES 4
Reply
Message 1 of 5
chrishome4597
290 Views, 4 Replies

Help editing Mach3 post for 360

I’m not sure if I’m even posting in the proper forum. Please excuse my ignorance. 

I’m a little overwhelmed trying to figure out how to edit the standard Mach 3 post for Fusion360 for plasma cutting op. 
I need to add the ability to post an M10P3 command prior to any Holes or radius smaller than 0.6” and corners tighter than 60° Then follow it with M11P3.  I also need to do the M11 on lead in and the M10 0” after. Same concept for lead out. Id prefer to make them variables  that can be set via the post UI if possible.  I did try using AI before attempting to embarrass myself here. It wrote me basic “if” statements though I’m not sure how to implement them into the post. 

Any guidance would be appreciated. 

4 REPLIES 4
Message 2 of 5

No one can help point me in the proper direction? 

Message 3 of 5

Good morning,

Sorry for the delayed response. 

 

For adding something prior to a lead-in / lead-out, you could add this function to your post:

function onMovement(movement){
  if (movement == MOVEMENT_LEAD_IN) {
    writeBlock(mFormat.format(11));
  } else if (movement == MOVEMENT_LEAD_OUT) {
    writeBlock(mFormat.format(10), '0"');
  }
}

Here you will see it checks for lead-in/out and adds the appropriate commands

 

For the option of you are looking for based on the radius, you would need to do some logic in onCircular(). Here is a quick example (it would likely need changing):

function onCircular(clockwise, cx, cy, cz, x, y, z, feed) {
  if (pendingRadiusCompensation >= 0) {
    error(localize("Radius compensation cannot be activated/deactivated for a circular move."));
    return;
  }

  var start = getCurrentPosition();

  if (getCircularRadius() < toPreciseUnit(0.6, IN)) {
    writeBlock (mFormat.format(10) + "P3");
  }

  writeBlock(getCircularRadius())
  if (isFullCircle()) {
    if (isHelical()) {
      linearize(tolerance);
      return;
    }
    switch (getCircularPlane()) {
    case PLANE_XY:
      writeBlock(gMotionModal.format(clockwise ? 2 : 3), xOutput.format(x), iOutput.format(cx - start.x, 0), jOutput.format(cy - start.y, 0), feedOutput.format(feed));
      break;
    default:
      linearize(tolerance);
    }
  } else {
    switch (getCircularPlane()) {
    case PLANE_XY:
      writeBlock(gMotionModal.format(clockwise ? 2 : 3), xOutput.format(x), yOutput.format(y), iOutput.format(cx - start.x, 0), jOutput.format(cy - start.y, 0), feedOutput.format(feed));
      break;
    default:
      linearize(tolerance);
    }
  }
  if (getCircularRadius() < toPreciseUnit(0.6, IN)) {
    writeBlock (mFormat.format(11) + "P3");
  }

}

 

Hope this helps you get started! 

-

George Roberts

Manufacturing Product manager
If you'd like to provide feedback and discuss how you would like things to be in the future, Email Me and we can arrange a virtual meeting!
Message 4 of 5

Thank you for the response.  Where in the post is it safe to make these edits. With The onCircular logic the final if statement says:

 

if (getCircularRadius() < toPreciseUnit(0.6, IN)) {
    writeBlock (mFormat.format(11) + "P3");

 

Isn't that the same as the leading If? or am I confused on this?

 

if (getCircularRadius() < toPreciseUnit(0.6, IN)) {
    writeBlock (mFormat.format(10) + "P3");

 

Message 5 of 5

Thanks for the response.  Can you explain where in the post its safe to make theses edits. Do I need to name and declare the function first?

Also, does the oncircular edits you demonstrated for me look correct? The leading "If "  statement looks similar to the finale "If " statement. Or, am I confused on this.  

 

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report