Modify Post Processor

Discussions around the CAM Add-On of QCAD.

Moderator: andrew

Forum rules

Always indicate your operating system and QCAD version.

Indicate the post processor used.

Attach drawing files and screenshots.

Post one question per topic.

Post Reply
n_spect_r
Active Member
Posts: 44
Joined: Tue Jun 18, 2019 12:09 pm

Modify Post Processor

Post by n_spect_r » Wed Dec 04, 2019 2:01 pm

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

n_spect_r
Active Member
Posts: 44
Joined: Tue Jun 18, 2019 12:09 pm

Re: Modify Post Processor

Post by n_spect_r » Thu Dec 05, 2019 8:56 pm

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";

n_spect_r
Active Member
Posts: 44
Joined: Tue Jun 18, 2019 12:09 pm

Re: Modify Post Processor

Post by n_spect_r » Fri Dec 06, 2019 2:29 pm

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";

User avatar
andrew
Site Admin
Posts: 9036
Joined: Fri Mar 30, 2007 6:07 am

Re: Modify Post Processor

Post by andrew » Tue Dec 10, 2019 2:49 pm

Thanks for your contribution.

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

n_spect_r
Active Member
Posts: 44
Joined: Tue Jun 18, 2019 12:09 pm

Re: Modify Post Processor

Post by n_spect_r » Fri Dec 13, 2019 3:26 pm

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.

Post Reply

Return to “QCAD/CAM”