[solved] cutter offset path not exported in g-code

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
cki61
Junior Member
Posts: 21
Joined: Fri Jan 19, 2018 5:43 pm

[solved] cutter offset path not exported in g-code

Post by cki61 » Fri Jan 19, 2018 8:09 pm

Hi all,

I just tried QCADCAM the first time. I creatred a simple square size 30mm and tried to generate g-code. The cutter size is 2mm.
Independant of my chose to cut inside/outside/on the line I get the same G-Code as result.
I'm doing somthing wrong, but I can't see it.
The generated path has the needed offset of 1mm, please see picture (cutting outside), but the G-Code speaks of X10/y10, should be X09/Y09 ...
My version of QCADCAM is 3.19.2.0 (Linux).

I'd be glad to get an info what I'm doing wrong.

Regards,
Christof
Screenshot_20180119_195136.png
cutting outside
Screenshot_20180119_195136.png (80.63 KiB) Viewed 11025 times

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

Re: cutter offset path not exported in g-code

Post by andrew » Fri Jan 19, 2018 8:28 pm

You've chosen a postprocessor that uses G41/G42 for cutter radius compensation. This means that your controller will calculate the offset (if it supports G41/G42 at all).

If your controller does not support G41/G42, you need to choose a postprocessor that exports the offset coordinates instead (e.g. "G-Code (Offset)").

From your screenshot, I guess that you are using the postprocessor for LinuxCNC which does support G41/G42, so your output should work fine for you.

cki61
Junior Member
Posts: 21
Joined: Fri Jan 19, 2018 5:43 pm

Re: cutter offset path not exported in g-code

Post by cki61 » Sat Jan 20, 2018 6:32 pm

Hi Andrew,

many thanks for your quick reply. You are right supposing I'm using LinuxCNC. With your hint I could see that (I suppose) the generated g-code is missing an important command, see this info from LinuxCNC (http://linuxcnc.org/docs/2.5/html/gcode ... ation.html):
"Cutter compensation uses the data from the tool table to determine the offset needed. The data can be set at run time with G10 L1".
In my case the preprocessor created code without that G10 L1 information resp. tooltable, so my tool has diameter zero and the cutter follows the original edges.
If I'm right, can I influence myself the preprocessor for LinuxCNC and correct it?
I'd like to avoid entering this info manually after every new creation of g-code, I'm sure I do forget this at least once.

Many thanks,
Christof

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

Re: cutter offset path not exported in g-code

Post by andrew » Mon Jan 22, 2018 3:01 pm

cki61 wrote:If I'm right, can I influence myself the preprocessor for LinuxCNC and correct it?
Yes. The post processor is in your QCAD/CAM installation directory under postprocessors, for example LinuxCNCMM.js. It's an ECMAScript ("JavaScript") file. If you can attach an example file that works with your setup, I'm happy to help.

cki61
Junior Member
Posts: 21
Joined: Fri Jan 19, 2018 5:43 pm

Re: cutter offset path not exported in g-code

Post by cki61 » Fri Jan 26, 2018 12:16 pm

Hi Andrew,
thanks for your offer. I have two ideas to succeed. For both I need the programmers help.
The G-Code I need concerns the comand to set the tool table: G10 L1 Px Ry, where x is the Integer# of the tool (variable [T] stands for uppercase t plus the tool integer number, so not usable here) and y stands for the tool radius for which we easyly can use variable [TR] = ToolRadius.
So first we need a new variable for a solution:
this.registerVariable("toolNumber", "TN", true, "P", 0);
Now we have two posibilities:
a loop at the beginning of the gcode file to set the tool table like:
....
N50 G10 L1 P1 R1 //Tool1 with radius 1mm/diameter 2mm
N60 G10 L1 P2 R2 //Tool2 with radius 2mm/diameter 4mm
....

or we use the internal loop and send the command with every tool change:
....
N30 T1 M6
N40 S1002 M03
N50 G10 L1 P1 R1 //Tool1 with radius 1mm/diameter 2mm
.
.
N300 T2 M6
N310 S1002 M03
N320 G10 L1 P2 R2 //Tool2 with radius 2mm/diameter 4mm
....

after my opinion: I'd prefer solution 1 because you can better control the tool table at the beginning of the file.

for solution 2 we need a script like:

- file start -
include("LinuxCNC.js");

function LinuxCNCMM(cadDocumentInterface, camDocumentInterface) {
LinuxCNC.call(this, cadDocumentInterface, camDocumentInterface);

this.decimals = 4;
this.unit = RS.Millimeter;
this.toolHeader = [
"[N] [T] M6",
"[N] [S] M03",
"[N] G10 L1 [TN] R[TR]" //TN = new variable
];
}
LinuxCNCMM.prototype = new LinuxCNC();
LinuxCNCMM.displayName = "LinuxCNC [mm]";
- file end -

What do you think about an implementation in QCAD?
Do you see a solution that only affects the scripts?

Best Regards,
Christof

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

Re: cutter offset path not exported in g-code

Post by andrew » Tue Jan 30, 2018 10:06 am

I've attached a first attempt at exporting a tool list as part of the header.

This file replaces the existing file postprocessors/LinuxCNC.js. The configurations LinuxCNCMM.js and LinuxCNCIN.js are derived from this configuration and are both affected by this change. This has been tested against QCAD/CAM 3.19.2.

Please let me know if other changes are needed to make this work with your controller.
Attachments
LinuxCNC.js
(1.16 KiB) Downloaded 555 times

cki61
Junior Member
Posts: 21
Joined: Fri Jan 19, 2018 5:43 pm

Re: cutter offset path not exported in g-code

Post by cki61 » Sun Feb 04, 2018 11:07 pm

Hi Andrew,

today I tested your new cde with success.
Thanks for your help. Maybe you allow me to mention a whish: a tool to generate bridges to fix the part you cut would help me a lot.
Are there any plans to introduce it or something simular?

Best Regards,
Christof

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

Re: cutter offset path not exported in g-code

Post by andrew » Mon Feb 05, 2018 12:45 pm

Thanks for the feedback. The adjusted postprocessor will also be included in the next update.

Yes, support for "tabs" (small bridges to keep a cut out shape in place) is planned.

Post Reply

Return to “QCAD/CAM”