Help with post processor for NEE AMC4 CNC control for CR Onsrud CNC flatbed

Help with post processor for NEE AMC4 CNC control for CR Onsrud CNC flatbed

Foremosttriminc
Explorer Explorer
3,765 Views
19 Replies
Message 1 of 20

Help with post processor for NEE AMC4 CNC control for CR Onsrud CNC flatbed

Foremosttriminc
Explorer
Explorer

We recently purchased a nice clean used CNC flatbed router and we wish to use Fusion360 to program the machine. The machine has an NEE AMC4 control and we are trying to find information or hopefully a usable post for the new machine. It is a CNC flatbed 5x12 router table with a drill block head.  We mostly plan to use it for custom parts as our cabinet software should take care of the programming for most of the things we make.   Any help or assistance with this would be most appreciated. Thank you..\

 

Pete

 

0 Likes
3,766 Views
19 Replies
Replies (19)
Message 2 of 20

djowen40
Advocate
Advocate

Given the age of the control try the RS274D post processor. My 5 minute google did not reveal a manual for the controller but the general age suggest that standard RS274 G-code is likely to work. If not report back and we can dig some more.

0 Likes
Message 3 of 20

Foremosttriminc
Explorer
Explorer

DJOWEN,

   Thanks for the suggestion.  I am trying to find information on this control we have some data from CR Onsrud on the machine post processor setup but it does not appear simple to implement. I was hoping to be able to use an off the shelf post from another similar control and modify it to suit. This machine has a drill block with multiple drills that are engaged pneumatically. It would be very nice if we could use that in fusion360 but honestly just typical 3d movement in 3 axes with the single spindle with toolchange would work for most of what we are needing to do. Thanks for the suggestion I will look into it. Happy Thanksgiving!

 

Pete

0 Likes
Message 4 of 20

beachbumpete1
Participant
Participant

Ok folks I started working on editing the R274 generic post in Fusion. Our new machine takes a code that puts the spindle direction callout before the spindle speed callout.   I have made several changes that appear to work properly but I cannot seem to be able to reverse the callouts of these two parameters.  any idea how to do this?   Similarly the tool callout and m6 callout are also reversed from what my new control wants to see. IE it says T1 M6 instead of M6 T1.   Is there an easy way to reverse these two items?  Thanks for your assistance...

 

 

Pete

 

0 Likes
Message 5 of 20

beachbumpete1
Participant
Participant

update: managed to get the spindle direction and speed callout orientation reversed now working on the tool callout and m6 command callout orientation.  It is not as simple apparently 😉    Also the new machine does not use the next tool callout to prep the toolchanger for the next tool change as it is a carousel type so I will need to remove that bit of code or at least null it out.  Any suggestions there would be helpful. 

 

 

pete

 

0 Likes
Message 6 of 20

djowen40
Advocate
Advocate

Line 420

Original

writeBlock("T" + toolFormat.format(tool.number), mFormat.format(6));

change it to:

writeBlock(mFormat.format(6), "T" + toolFormat.format(tool.number));

 

 

Message 7 of 20

Foremosttriminc
Explorer
Explorer

Thank you man I appreciate it. I ALMOST had that exact same line but I had an extra parenthesis in there causing a syntax error I could not see. Now it works as expected. Appreciate it.  

 

Another thing the new control apparently does is you do not need to use H or D codes for cutter compensation. The cutter callout automatically accesses values stores in the tool table and uses them.  So I am not sure if that means that the codes are just not required or will be ignored or if I need to remove them entirely.  Looking now at how to do that. No need to have them if it COULD be an issue I suppose.  Any idea how to accomplish this?  

 

  Our CR Onsrud CNC router also has a multi tool pneumatically actuated drill block to drill multiple holes at one time as in shelf pin holes etc. I am unsure if Fusion360 can even take advantage of this feature but whether or not it can an M6 T0 must be added to retract any extended drills I would think before the initial tool callout. So I am thinking just a generic M6 T0 somewhere in the header code or before ANY toolchange would be necessary. Open to suggestions on how to do that.... 

 

    Thanks for all the assistance. I am attaching a photo of the machine we are trying to setup in case anyone is wondering or has questions.  🙂

 

Pete

 

0 Likes
Message 8 of 20

pete
Enthusiast
Enthusiast

Well we finally got the CNC machine operational and actually ran our first bit of code yesterday without issues.  I have been looking at the manual for the control and it appears that the machine likes to see G34 G35 G36 etc for the work coordinate systems available instead of G54 G55 G56 etc. I have been trying to figure out a way to make Fusion output this but I have not had much luck. Any ideas about this. Also there is a G70 callout at the beginning of every program code body it basically looks like this:

 

N10 G70

N20 G40 G34

M6 T1

M3 S1000

Etc etc

I was able to add the word START at the beginning of the code and also a few other modifications so we are getting closer.  Any input would be appreciated.

 

Pete

 

0 Likes
Message 9 of 20

djowen40
Advocate
Advocate

You can fix the WCS by changing this line (line 496 in the standard RS274 post)

writeBlock(gFormat.format(53 + workOffset)); // G54->G59

essentially it is taking the WCS you program in Fusion and adding ti to 53 to output to arrive at G54 etc. so by changing it to the line below you will shift the WCS output into the range you need.

writeBlock(gFormat.format(33 + workOffset)); // G34->G39

 

 

I can't see anywhere in the RS274 post the would produce a G70, in addition G70 is not a standard G-Code to the best of my knowledge. (some machines use it as a part of a canned cycle?). I assume you are saying your machine requries the G70 to be added?

 

You can add it to the startup block by adding it to the end of the OnOpen function as shown in the sample below (roughly line 240-248 in the original post).

switch (unit) {
  case IN:
    writeBlock(gUnitModal.format(20));
    break;
  case MM:
    writeBlock(gUnitModal.format(21));
    break;
  }
  
// This line added to output G70 at start of programme
writeBlock(gFormat.format(70)); }

If you need the G70 to appear somewhere else then the same line will work but we will need to figure out what part of the post to put it in. It would help if i new what the intended action G70 takes is.

0 Likes
Message 10 of 20

pete
Enthusiast
Enthusiast

Awesome my friend thank you very much. As far as I can tell the G70 at the beginning of the program is supposed to set inch mode 71 is metric mode apparently.  Not sure how necessary that is but we received a PC with quite a few programs from the previous owner of the CNC and we are just trying to emulate the posted code they ran assumedly on the machine. It also adds a G40 to cancel any previously enacted cutter compensation in the beginning of the code.  Finally there are callouts for M6 T0 after every tool cycle completes to retract any drills from the multi drill block.  We will probably never use that feature in Fusion 360 as it is more cabinet plywood processing related which our other software is geared towards.  However it would be nice to have it automatically generate it so that going from one code post to another in the machine it does not get overlooked.  So say at the end of every process block it would output the M6 T0 before the next block begins calling out its own toolchange.  

 

I really appreciate the help here thank you my friend.

 

Pete

 

0 Likes
Message 11 of 20

pete
Enthusiast
Enthusiast

Ok I just made the changes to the WCS and that seems to have worked as expected. Not really sure where you want me to inert that second bit of text.  Here is a snippet of what that portion looks like...

 

 

function onOpen() {
if (!machineConfiguration.isMachineCoordinate(0)) {
aOutput.disable();
}
if (!machineConfiguration.isMachineCoordinate(1)) {
bOutput.disable();
}
if (!machineConfiguration.isMachineCoordinate(2)) {
cOutput.disable();
}

if (!properties.separateWordsWithSpace) {
setWordSeparator("");
}

sequenceNumber = properties.sequenceNumberStart;
writeln("START");

if (programName) {
writeComment(programName);
}
if (programComment) {
writeComment(programComment);
}

// dump machine configuration
var vendor = machineConfiguration.getVendor();
var model = machineConfiguration.getModel();
var description = machineConfiguration.getDescription();

if (properties.writeMachine && (vendor || model || description)) {
writeComment(localize("Machine"));
if (vendor) {
writeComment(" " + localize("vendor") + ": " + vendor);
}
if (model) {
writeComment(" " + localize("model") + ": " + model);
}
if (description) {
writeComment(" " + localize("description") + ": " + description);
}
}

// dump tool information
if (properties.writeTools) {
var zRanges = {};
if (is3D()) {
var numberOfSections = getNumberOfSections();
for (var i = 0; i < numberOfSections; ++i) {
var section = getSection(i);
var zRange = section.getGlobalZRange();
var tool = section.getTool();
if (zRanges[tool.number]) {
zRanges[tool.number].expandToRange(zRange);
} else {
zRanges[tool.number] = zRange;
}
}
}

var tools = getToolTable();
if (tools.getNumberOfTools() > 0) {
for (var i = 0; i < tools.getNumberOfTools(); ++i) {
var tool = tools.getTool(i);
var comment = "T" + toolFormat.format(tool.number) + " " +
"D=" + xyzFormat.format(tool.diameter) + " " +
localize("CR") + "=" + xyzFormat.format(tool.cornerRadius);
if ((tool.taperAngle > 0) && (tool.taperAngle < Math.PI)) {
comment += " " + localize("TAPER") + "=" + taperFormat.format(tool.taperAngle) + localize("deg");
}
if (zRanges[tool.number]) {
comment += " - " + localize("ZMIN") + "=" + xyzFormat.format(zRanges[tool.number].getMinimum());
}
comment += " - " + getToolTypeName(tool.type);
writeComment(comment);
}
}
}

if ((getNumberOfSections() > 0) && (getSection(0).workOffset == 0)) {
for (var i = 0; i < getNumberOfSections(); ++i) {
if (getSection(i).workOffset > 0) {
error(localize("Using multiple work offsets is not possible if the initial work offset is 0."));
return;
}
}
}

 

Any advise as to where I should insert your text?   Thanks and I am sorry if this is obvious but I cannot seem to tell where the OnOpen part ends...

0 Likes
Message 12 of 20

pete
Enthusiast
Enthusiast

Also the posts seems to insert a G28 G91 Z0 go to Z home  in the initial block and also even tho there is no coolant selected(there is none on the machine) it inputs an M9 code.  I THINK that may be a setting in the CAM to change that but have not found it yet.  Trying to find the line that calls out that goto home setup.  It is apparently not necessary as the other programs in their files did not have that either. 

 

Pete

 

0 Likes
Message 13 of 20

djowen40
Advocate
Advocate

Looking at these issues one at a time:

 

First up, dealing with the G70 issue:

Given that for your control G70/71 seem to control metric vs inch programming (normally G20/21) you need to find the section of code that looks like this (Line 240 in the original post but you have added some stuff so its likely around line 245)

switch (unit) {
  case IN:
    writeBlock(gUnitModal.format(20));
    break;
  case MM:
    writeBlock(gUnitModal.format(21));
    break;
  }

and change it to look like  this

switch (unit) {
  case IN:
    writeBlock(gUnitModal.format(70)); // 20 changed to 70
    break;
  case MM:
    writeBlock(gUnitModal.format(71)); // 21 change to 71
    break;
  }

 

2nd, M6 T0 call out at the end of each section (process block):

You can add a "M6 T0" call out to the end of each section by modifying the the onSectionEnd function as shown below. Note that i have added two lines the first will generate the same G28 G91 Z0 command as you comment on to ensure that the z axis is clear of the work. As per my comments in item 3 below this is a safety feature but if you are 100% sure you don't need it then feel free to omit the 1st added line.

 

function onSectionEnd() {
  writeRetract(Z);			// line added to ensure safe tool change height
  writeBlock(mFormat.format(6),"T0");	// line added to output M6 T0 to clear multi drill block
  writeBlock(gPlaneModal.format(17));
  forceAny();
}

 

3rd, Z axis homing:

This is a pretty standard safety block. Assuming you machine understands the command it should retract the Z axis all the way to the top. This guarantees that any moves etc made as part of a tool change wont hit the work piece. I would be inclined to leave it in unless you have a specific reason for not wanting it. It should only take a few seconds unless the machines homing cycle is very slow.

 

If you really want to remove it than you can comment out these to lines in the onSection function by adding a // to the start of the line (roughly line 395)

// retract to safe plane
    writeRetract(Z);
    zOutput.reset();

 

4th, Coolant codes (M9):

No this is not a setting in fusion it is hard coded as a part of the tool change process in the post processor. This insures that coolant is not running during a tool change. It wont hurt your controller to have it there. 

 

Does your machine have a code controlled vacuum dust extraction or similar? If so these are likely controlled by coolant codes.

 

If the above doesn't apply and you truly have zero use for the coolant codes then you can disable all coolant code output by making a change to the setCoolant function as shown below.

function setCoolant(coolant) {
  return 0;  // Line added to disable all coolant output
  var coolantCodes = getCoolantCodes(coolant);
  if (Array.isArray(coolantCodes)) {
    for (var c in coolantCodes) {
      writeBlock(coolantCodes[c]);
    }
    return undefined;
  }
  return coolantCodes;
}

 

0 Likes
Message 14 of 20

pete
Enthusiast
Enthusiast

Ok NOW we're getting complicated 🙂  I got SOME of what you suggested to work and another thing I needed is that the control likes to see the program name(or number) without parentheses after a capitol P.  I was able to make this happen after the word START.  In the programs we received from the previous owner the G34 is on the same line as the G40 in the beginning block.  Now it happens after the toolchange callout I cannot see how that would be an issue but I will test run today and see if the control spits it back.  

 

   Thank you so much for all your assistance. I am NO programmer but I seem to have trudged thru here with your help

 

Pete

 

0 Likes
Message 15 of 20

pete
Enthusiast
Enthusiast

OK well we just took some posted code down to the machine today after all of these adjustments. It APPEARS that we were mistaken in our choice of starting point for the post processor. Apparently the machine's control does not like the I,J arc radius callouts instead the control likes to see the R radius callout.  Are we screwed here and have to start over with a different post processor or can this post be modified to output R values instead?  Thanks

 

Pete

 

0 Likes
Message 16 of 20

pete
Enthusiast
Enthusiast

Well scratch that last posting I just found two programs that use I and J coordinates for the arcs.  Not sure really why the machine is acting the way it is with these lines but it is apparently NOT because of the I and J. Sorry for the confusion...

 

Pete

 

0 Likes
Message 17 of 20

pete
Enthusiast
Enthusiast

I am attaching two files showing previous owner ran code on the same machine as well as a bit of data from the manufacturer about post processor setup.  Open to suggestions as to why the arc set is not working correctly. Also it appears that the H callouts for height and diameter are unnecessary as it is preset in the control. This post is rather elaborate in this regard.  Not sure what to do here.  The spoilboard resurfacing program was done in another software using a custom post made for us by that manufacturer but it ran fine. It also uses I,J codes.  Would be  possibly willing to pay reasonably for someones time to assist us getting this post working so we can start using Fusion to cut our more complex parts.  Thank you for your assistance.  

 

Pete

 

 

0 Likes
Message 18 of 20

pete
Enthusiast
Enthusiast

here is another file that did not attach previously.... 

0 Likes
Message 19 of 20

pete
Enthusiast
Enthusiast

Oh and here is the post as it is so far...

0 Likes
Message 20 of 20

djowen40
Advocate
Advocate

Hi @pete,

 

Happy to help rewrite this and get it working but i am doing it in my spare time so it may take time.

 

I have attached a fusion 360 file for reference so we can both see the part and intended tool path. I have also attached the resulting g-code from my current version of your post. If you could run the code and tell me where it goes wrong that would be great. If possible a video of the machine running the code would be helpful.

 

 

0 Likes