[solved] Rapid movement for tool-up motions

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
lagnat
Junior Member
Posts: 24
Joined: Mon Dec 07, 2020 4:58 pm

[solved] Rapid movement for tool-up motions

Post by lagnat » Sat Dec 19, 2020 5:57 pm

I am looking for a way to override the default behavior of using the feed rate to move the Z up after a drilling or milling operation. Obviously not a big deal if I can't do this but as a matter of simplicity I'd like to use rapid movement to withdraw the tool rather than normal + feed rate.

I poked around the javascript and came up with this stab in the dark but it didn't work.

Code: Select all

    this.writeToolUp = function() {
        this.g = GCode.Mode.Rapid;
        this.z = this.getToolUpLevel();
        this.toolPosition = GCode.ToolPosition.Up;
        this.writeLine();
        this.toolIsUp();
    };  

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

Re: Rapid movement for tool-up motions

Post by andrew » Mon Dec 21, 2020 10:33 am

Assuming your post processor is called "MyGCode", you can override exportToolUp as follows:

Code: Select all

MyGCode.prototype.exportToolUp = function(force) {
    this.pushContext("CamRapidMove");
    CamExporterV2.prototype.exportToolUp.call(this, force);
    this.popContext("CamRapidMove");
};

lagnat
Junior Member
Posts: 24
Joined: Mon Dec 07, 2020 4:58 pm

Re: Rapid movement for tool-up motions

Post by lagnat » Thu Dec 24, 2020 11:23 pm

That ends up generating code like this: N110 Z2. Shouldn't there be a G0 in there?

I also went searching for CamExporterV2 but it's not in the app bundle. Is that available to look at?

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

Re: Rapid movement for tool-up motions

Post by CVH » Fri Dec 25, 2020 5:12 am

lagnat wrote:
Sat Dec 19, 2020 5:57 pm
I'd like to use rapid movement to withdraw the tool rather than normal + feed rate.
Agreed.
The faster you are out of cut the better ... Your tool is rubbing :!:
Straight up to a local safe Z and fast is good. Presumed to be called 'clearance level' (ZU)

Even better would be a G0 Z[local safe] and backing up a bit in X&Y reversing the last move.
On top:
Such a reversed entry move might also be a better option than to plunge straight down.
Not all cutters or mills are shaped to drill a hole.
Engravers tips don't like to plunge! Tips in the sub mm range break off.
lagnat wrote:
Sat Dec 19, 2020 5:57 pm
Obviously not a big deal if I can't do this
Obviously a very big deal !!!
For me as engraver, with several hundreds of plunges, the time to retract sums up.
Luckily you mention it is done in feed-rate.
I saw high end engraver applications that does retract in plunging rate. What is awesome anoying slow.

And the best approach so far to transfer from 'end in cut' to the next clearance position in X&Y is even not with G0.
It uses G1 F[max feed] in conjuction with a rather large G64 P value. :P
lagnat wrote:
Thu Dec 24, 2020 11:23 pm
That ends up generating code like this: N110 Z2. Shouldn't there be a G0 in there?
Always including a G0 ... Without any doubt! Feed is modal.
lagnat wrote:
Thu Dec 24, 2020 11:23 pm
I also went searching for CamExporterV2 but it's not in the app bundle.
This is my biggest hurdle too.
All is rather undocumented ...
Searched the full CAM installation for "exportToolUp", "CamRapidMove", "pop/pushContext"
I can not be able to understand how the override by Andrew works.
It already starts with the argument 'force' ... Force what?

Regards,
CVH

lagnat
Junior Member
Posts: 24
Joined: Mon Dec 07, 2020 4:58 pm

Re: Rapid movement for tool-up motions

Post by lagnat » Fri Dec 25, 2020 4:28 pm

My problem ended up being user error. The suggested code snippet works.

Post Reply

Return to “QCAD/CAM”