Post processor for lathe

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

Post processor for lathe

Post by n_spect_r » Thu Jan 05, 2023 9:11 pm

I have not found anything in the index concerning lathe posts, maybe there is something and I am just not looking in the right place. I needed to do an internal taper on our lathe and had to use G codes instead of Mazatrol. Drew up a .dxf and I posted the geometry as X and Y coordinates, then simply changed all X's to Z's and Y's became X's in the exported file. The only problem is that the lathe wants diameter and not radius. I manually doubled what was originally the Y (new X) output. Wondering if there is a way to create a variable in the post to double all of the Y values. Thanks.

CVH
Premier Member
Posts: 3417
Joined: Wed Sep 27, 2017 4:17 pm

Re: Post processor for lathe

Post by CVH » Thu Jan 05, 2023 9:54 pm

Hi,
Yes, I think there is.
All variables are declared in your Postprossesor or where your Postprossesor is based on.

For the exported Y an example from GCodeBase.js:

Code: Select all

    // variables:
    //                    name,                  ID,                     always, prefix, decimals, options
    this.registerVariable("yPosition",           "Y",                    false, "Y", "DEFAULT", "DEFAULT");
One can alter the output by including a factor as option:

Code: Select all

    this.registerVariable("yPosition",           "Y",                    false, "Y", "DEFAULT", { factor: 2 });
This should double the Y values so far I can understand it. :wink:
But you may have to alter more than only this Y parameter. :?

You probably are better of by creating a new Postprossesor or a new copy of the one you used for this specific output.
Something in the nature of MyLatch2Y.js ... Maybe you could include its brand ... :wink:

Regards,
CVH
Last edited by CVH on Fri Jan 06, 2023 8:01 am, edited 1 time in total.

CVH
Premier Member
Posts: 3417
Joined: Wed Sep 27, 2017 4:17 pm

Re: Post processor for lathe

Post by CVH » Fri Jan 06, 2023 7:22 am

Swapping some axis in the output should also be feasible.
One could replace all prefixes declared as "X.." with a "Z.." and all the 'Y's with an 'X'.

On a linear move it would write this block of code:

Code: Select all

this.linearMove =                "[N] [X] [Y] [F]";
But that would export as "Nnnn Zxxx Xyyy F..." where the lower cases are the values.

With including a factor=2 for the Y values the exported yyy would then be doubled and prefixed with an 'X'.

Regards,
CVH

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

Re: Post processor for lathe

Post by n_spect_r » Fri Jan 06, 2023 3:10 pm

Thanks for the replies. I added the variable line to my post and it works fine. This was an odd occurrence, I may or may not need to do something like this again. For those who are curious, I have attached some files. The part has a 47 degree angle so we could not simply use a countersink/chamfer tool. And it's a pretty small part. After breaking the last .160 boring bar, we decided to try scrubbing with a .125 ball end mill. The results were quite good
ANGLE_BORE.jpg
ANGLE_BORE.jpg (37 KiB) Viewed 8274 times
. I stepped the ball .008 along the slope. The yellow designates the path. I exported as a drill path, then modified the exported file. It's not a lot of work with global replacement. If the need arises, I might try writing another post to do more. Attached are also the post I use for the Mazak mills (Nexus 510), and what I modified for the lathe.
Attachments
Mazak.js
(2.91 KiB) Downloaded 241 times
Mazak_L.js
(2.89 KiB) Downloaded 229 times
ANGLE_BORE.nc
(1.94 KiB) Downloaded 245 times
ANGLE_BORE_1.nc
(2.02 KiB) Downloaded 258 times

Post Reply

Return to “QCAD/CAM”