Page 1 of 1

Modify Post Processor

Posted: Wed Dec 04, 2019 2:01 pm
by n_spect_r
I'd like to modify the Mach3 post processor in this way. It currently begins with G20 G17 G90 G40 G49 G80, on the next line there is G70 G91.1
then after the first move it adds G28. Want to remove several of these, G70, G91.1 and G28. Also the program does the initial X-Y move before the tool change, I need to do the tool change first. I found the web page describing making custom posts. Playing with this and having mixed success. My custom post works on the company windows 7 machine but the same post will not work on my Linux laptop. I managed to get the initial G codes that I want in the post, still would like to move the tool change to before any move, and my machines need a decimal point after any whole number. It interprets a 1 as .1 in feed or position. So a feed rate of 100 would be read as .1. Likewise a position of 1,2 is interpreted as .1,.2.

Thanks

Re: Modify Post Processor

Posted: Thu Dec 05, 2019 8:56 pm
by n_spect_r
OK I've had some success. Made a new post, followed the basic example on the web page about making posts. I edited the GCodeBase by removing the toolheader. I added the tool change to my custom post, looks like this. Now I just need to get decimal points on whole numbers.

// Include GCodeBase.js which contains the class 'GCodeBase', used as base for our own configuration:
include("GCodeBase.js");

// Constructor of our class:
function MyGCode(documentInterface, newDocumentInterface) {
// Call constructor of base class:
GCodeBase.call(this, documentInterface, newDocumentInterface);
this.decimals = 4;
this.unit = RS.Inch;

this.header = [
"[N] G20 G17 G90 G40 G49 G80",
"[N] [T] M6",
"[N] [S] M03 M08"
];
}

// Derive our class from class GCodeBase:
MyGCode.prototype = new GCodeBase();

// Display name shown in user interface:
MyGCode.displayName = "My G-Code";

Re: Modify Post Processor

Posted: Fri Dec 06, 2019 2:29 pm
by n_spect_r
I find myself answering my own questions. LOL. I found a post by p44banditd with decimal point issues. His solution solved mine.
I'm running this on 4 Mazak Nexus 510 machines. I couldn't get the initial Z move to come after the X-Y but that's moot as I like to set that manually anyway. Used this to do some engraving which came out quite nice. I plan to try on some other items.

This is my new post, note added the trailing zeros line. And in GCodeBaase, I took out the rapid move for Z.
On these machines we sometimes have issues with the first Z move so I like to add G43 H(x) line If I figure out how to do that in a post I'll put it here.

// Include GCodeBase.js which contains the class 'GCodeBase', used as base for our own configuration:
include("GCodeBase.js");

// Constructor of our class:
function MyGCode(documentInterface, newDocumentInterface) {
// Call constructor of base class:
GCodeBase.call(this, documentInterface, newDocumentInterface);
this.decimals = 4;
this.unit = RS.Inch;
this.options = { trailingZeroes:true };

this.header = [
"[N] G20 G17 G90 G40 G49 G80",
"[N] [T] M6",
"[N] [S] M03 M08"
];
}

// Derive our class from class GCodeBase:
MyGCode.prototype = new GCodeBase();

// Display name shown in user interface:
MyGCode.displayName = "My G-Code";

Re: Modify Post Processor

Posted: Tue Dec 10, 2019 2:49 pm
by andrew
Thanks for your contribution.

Can we include this in future QCAD/CAM releases? We'd rename it to something like "MazakNexus510.js".

Re: Modify Post Processor

Posted: Fri Dec 13, 2019 3:26 pm
by n_spect_r
I still need to make a few more tweaks, when I have what I really like I'll post it as a final. But it can certainly be added to future releases.