Compensation for every toolpath?

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
Dacicusan
Active Member
Posts: 49
Joined: Sat Oct 14, 2017 1:44 am

Compensation for every toolpath?

Post by Dacicusan » Tue Feb 08, 2022 11:12 am

I'm creating a post-processor and I do need to write the side compensation of the tool on every created toolpath. Right now Qcad/CAM it is writing the compensation only when it is changing the side of the machining.

I do have this peace of code:

Code: Select all

    // Tool Compensation LEFT | C=2
    this.linearMoveCompensationLeft = [
        "C=2" //OLD:"G41 [X] [Y]"
    ];

    // Tool Compensation RIGHT  C=1
    this.linearMoveCompensationRight = [
        "C=1" //OLD:"G42 [X] [Y]"
    ];

    // Tool Compensation OFF  C=0
    this.linearMoveCompensationOff = [
        "C=0", //OLD:"G40"
    ];
The problem is that I don't understand how to create a variable that can read this inputs and write the desired compensation on the toolpath header like C=2, C=1 or C=0, for every toolpath created.

Best regards.

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

Re: Compensation for every toolpath?

Post by CVH » Wed Feb 09, 2022 1:40 pm

Dacicusan wrote:
Tue Feb 08, 2022 11:12 am
Right now Qcad/CAM it is writing the compensation only when it is changing the side of the machining.
Correct: G40, G41 and G42 are modal.
Meaning that in standard G-code they stay active as long as they aren't changed.
BTW: I am convinced that your machine can load normal G-code files.

Also remark that all 3 have an XY component.
Some dialecs may also require an explicit G1.
The compensation of G41/2 will be nothing initially.
The cutter will only be fully compensated at the end of the compensation move.
Or fully cancelled with G40.

A linearMoveCompensationLeft is simply what its says:
- A linear move to a point in X/Y
- Apply a left compensation so the motion actually ends 'left' from X/Y

I am only guessing that "C=0..2" means none, right or left compensation mode.
But I don't see a compensation move.
linearMoveCompensationLeft doesn't mean 'I am in this or that compensation mode'. :wink:

I suppose this.getSide(); returns the cutter radius compensation side of the current toolpath.
What is written as toolpath header is defined in: this.toolpathHeader = [...];
The real solution may be overriding writing the toolpath header.
MyPost.prototype.writeToolpathHeader = function() {...};

Regards,
CVH

Post Reply

Return to “QCAD/CAM”