mapWorkOrigin =false - Pattern issue (HSMWorks)

mwhitten123
Advocate
Advocate

mapWorkOrigin =false - Pattern issue (HSMWorks)

mwhitten123
Advocate
Advocate

Hello all,

 

I am trying to post patterns using a Haas or Fanuc post with the map work origin set to false("mapWorkOrigin =false"). If I insert this line (mapWorkOrigin = false) into the top of the post as shown below, everything seems to work fine except that the patterns are output to the gcode in the same spot. In example, if I face off a part and then pattern it over 10", the gcode simply repeats the same exact values as the unpatterned toolpath.

 

The dump file seems to be outputting the patterned values, but as indicated, the gcode does not. This would seem to be a post issue, but I am not sure as none of the stock posts I have tried will work with patterns when mapWorkOrigin = false.

 

.
.

allowSpiralMoves = true;
highFeedrate = (unit == IN) ? 500 : 5000;
mapWorkOrigin = false; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<


// user-defined properties
properties = {
  writeMachine: true, // write machine
  writeTools: true, // writes the tools
.
.

I attached some very simple test files, I am using HSMWorks R1.41874 and the Haas.cps(ver 41433) for testing. I also tested in Inventor HSM and found the same results.

 

****test files attached

 

Does anyone have a clue if this is a post issue, user issue(me) or a software issue and a clue as to how to correct?

 

Thanks in advance,

Mike

 

Michael Whitten
Selway Machine Tool
CAM Support
mwhitten@selwayapplications.com
0 Likes
Reply
826 Views
9 Replies
Replies (9)

Anonymous
Not applicable
Did you add your if ( properties.mapworkorigin statement ?
0 Likes

mwhitten123
Advocate
Advocate

No, not sure what you are referring to, but a clue would be much appreciated.


Thanks

Michael Whitten
Selway Machine Tool
CAM Support
mwhitten@selwayapplications.com
0 Likes

bob.schultz
Autodesk
Autodesk

@mwhitten123 wrote:

Hello all,

 

I am trying to post patterns using a Haas or Fanuc post with the map work origin set to false("mapWorkOrigin =false"). If I insert this line (mapWorkOrigin = false) into the top of the post as shown below, everything seems to work fine except that the patterns are output to the gcode in the same spot. In example, if I face off a part and then pattern it over 10", the gcode simply repeats the same exact values as the unpatterned toolpath.

 

The dump file seems to be outputting the patterned values, but as indicated, the gcode does not. This would seem to be a post issue, but I am not sure as none of the stock posts I have tried will work with patterns when mapWorkOrigin = false.

 

.
.

allowSpiralMoves = true;
highFeedrate = (unit == IN) ? 500 : 5000;
mapWorkOrigin = false; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<


// user-defined properties
properties = {
  writeMachine: true, // write machine
  writeTools: true, // writes the tools
.
.

I attached some very simple test files, I am using HSMWorks R1.41874 and the Haas.cps(ver 41433) for testing. I also tested in Inventor HSM and found the same results.

 

****test files attached

 

Does anyone have a clue if this is a post issue, user issue(me) or a software issue and a clue as to how to correct?

 

Thanks in advance,

Mike

 


Hello Mike,

 

The "mapWorkOrigin =false" statement tells the post engine to not translate the operations based on the workOrigin of the operation.  Translated patterns use the workOrigin to inform the post where the pattern instance is located.  Since you disabled the automatic mapping of the workOrigin you will have to handle the translation yourself inside the post.  You can do this by using the following command.

 

setTranslation(currentSection.workOrigin);

I don't know why you are not automatically mapping the work origin, but you will have to place a conditional around this statement so that it is not processed when the workOrigin is handled elsewhere in the post.



Bob Schultz
Sr. Post Processor Developer

0 Likes

Anonymous
Not applicable
0 Likes

mwhitten123
Advocate
Advocate

Hello Bob,

 

 

----------

I don't know why you are not automatically mapping the work origin, but you will have to place a conditional around this statement so that it is not processed when the workOrigin is handled elsewhere in the post.

--------

 

It seems weird to me that the "default" is to map the origin to the setup origin without warning the user; I have never seen a CAM system do this until now. Most/Many shops must have the origin set on the part. This is for a variety of reasons of course.

 

Anyhow, your help is much appreciated on this. It makes sense now, I just need to figure out how to add the logic.

 

Thanks!

 

Michael Whitten
Selway Machine Tool
CAM Support
mwhitten@selwayapplications.com
0 Likes

bob.schultz
Autodesk
Autodesk

Hello Michael,

 

You asked that I supply the solution in the Forum after the MM problem was fixed and I seemed to have forgot, until this same issue came up again.  Here is a solution that solves this scenario.

 

First, add the definedPatterns variable to the collected state section at the top of the program.

 

// collected state
var definedPatterns = new Array();

Then add the 'offsetPattern' function above the 'onSection' function.  'offsetPattern' will translate the XYZ coordinates for the pattern instance translations when 'mapWorkOrigin = false'.

 

// performs work origin translation for patterns when mapWorkOrigin = false
function offsetPattern() {
  if (currentSection.isPatterned() && !mapWorkOrigin) {
    var currentPattern = currentSection.getPatternId();
    var found = false;
    for (var i = 0; i < definedPatterns.length; ++i) {
      if (currentPattern == definedPatterns[i].patternId) {
        newOrigin = Vector.diff(currentSection.workOrigin, definedPatterns[i].baseOrigin);
        // writeln("Base Origin = " + definedPatterns[i].baseOrigin);
        // writeln("New Origin = " + newOrigin);
        setTranslation(newOrigin);
        found = true;
        break;
      }
    }
    if (!found) {
      definedPatterns.push({
        patternId: currentPattern,
        baseOrigin: currentSection.workOrigin
      });
      newOrigin = new Vector(0, 0, 0);
      setTranslation(newOrigin);
    }
  } else {
    newOrigin = new Vector(0, 0, 0);
    setTranslation(newOrigin);
  }
}

and finally, add the call to 'offsetPattern' above the call to get the initial position in 'onSection'.

 

// adjust origin for patterns
  offsetPattern();

  var initialPosition = getFramePosition(currentSection.getInitialPosition());

 



Bob Schultz
Sr. Post Processor Developer

mwhitten123
Advocate
Advocate

Hello Bob,

 

I very much appreciate the work on this one; this will help out several of our customers.

 

I will play will it later this week and post back on this thread.

 

Thank you!

Michael Whitten
Selway Machine Tool
CAM Support
mwhitten@selwayapplications.com
0 Likes

mwhitten123
Advocate
Advocate

Hello Bob,

 

Sorry, I got busy/sidetracked and am just now getting to this.

 

I updated a post and have questions. Before I say anything, it may best if I make some simple samples and email them to you. I plan to get this done in the next few days.

 

Thank you,

Michael Whitten
Selway Machine Tool
CAM Support
mwhitten@selwayapplications.com
0 Likes

CoastalMachine
Enthusiast
Enthusiast

Thanks for the help. Seems to work for my issues trying to use patterns.