Laser power control postprocessor

Do you have a question you want to ask an existing QCAD user about QCAD and what you can do with it? Do you want to know if a particular feature exists? This is the place to ask.

Moderator: andrew

Forum rules

Always indicate your operating system and QCAD version.

Attach drawing files and screenshots.

Post one question per topic.

Post Reply
Alan F
Newbie Member
Posts: 4
Joined: Sun May 01, 2022 3:36 am

Laser power control postprocessor

Post by Alan F » Sun May 01, 2022 4:03 am

Hello,

I have downloaded the QCAD/CAM trial and generated some gcode for the various laser cutters, none have allowed me to input the power required.
I am using a Cohesion 3D control board on a co2 laser, using Linux 64bit QCAD Version 3.27.3. on LinuxMint 20
The laser power setting required is from 0 to 1, example S0.5 for 50% power and S1 for 100% power.
Is it possible to modify a post processor to allow a spindle input in a range of 0 to 1?, currently 0.5 is outputted as 0.
Here is a sample line of gcode that I generate in Cut2d.
G1 X1.0000 Y1.0000 S0.5 F10.0
I have looked through the post processor and gcodebase java scripts and was not able to find any clues.
Can someone post a sample code that will generate the 0 to 1 spindle range and tell me which script needs to be copied and modified?

Thanks,

Alan

User avatar
Husky
Moderator/Drawing Help/Testing
Posts: 4931
Joined: Wed May 11, 2011 9:25 am
Location: USA

Re: Laser power control postprocessor

Post by Husky » Sun May 01, 2022 8:31 pm

Hello,
Alan F wrote:
Sun May 01, 2022 4:03 am
I have downloaded the QCAD/CAM trial and generated some gcode for the various laser cutters, none have allowed me to input the power required.
Not my wheelhouse but could this do the trick ...?

Husky-2022.05.01-01.png
Husky-2022.05.01-01.png (47.4 KiB) Viewed 11300 times
Alan F wrote:
Sun May 01, 2022 4:03 am
I have looked through the post processor and gcodebase java scripts and was not able to find any clues.
There is a Post Processor tutorial out there - maybe it can help to find some clues ... :wink:

https://qcad.org/en/qcad-cam-postprocessor
Work smart, not hard: QCad Pro
Win10/64, QcadPro, QcadCam version: Current.
If a thread is considered as "solved" please change the title of the first post to "[solved] Title..."

Alan F
Newbie Member
Posts: 4
Joined: Sun May 01, 2022 3:36 am

Re: Laser power control postprocessor

Post by Alan F » Sun May 01, 2022 9:25 pm

That almost does it. It would work fine if I'm only doing engraving or cutting but can't do both as they require different laser powers.
I was hoping to set up a couple of tools with the S value set for engraving and cutting and the post processor would pull from the tool data.

I have been using Cut2D to generate the gcode and there I would use a value of 0 to 100 because it would not let me use 0 to 1.
In the post processor that I modified I was able to use a math operation to divide the S value by 100 to get the 0 to 1 range.
Have not seen if this is possible in my search for QCad.

Thanks for the reply, for many tasks this is a good solution if a project only needs one S value.

Enjoy!

User avatar
Husky
Moderator/Drawing Help/Testing
Posts: 4931
Joined: Wed May 11, 2011 9:25 am
Location: USA

Re: Laser power control postprocessor

Post by Husky » Sun May 01, 2022 10:04 pm

Alan F wrote:
Sun May 01, 2022 9:25 pm
That almost does it. It would work fine if I'm only doing engraving or cutting but can't do both as they require different laser powers.
Just for clarification: You need different Laser powers in the same drawing / g-code?
Work smart, not hard: QCad Pro
Win10/64, QcadPro, QcadCam version: Current.
If a thread is considered as "solved" please change the title of the first post to "[solved] Title..."

Alan F
Newbie Member
Posts: 4
Joined: Sun May 01, 2022 3:36 am

Re: Laser power control postprocessor

Post by Alan F » Sun May 01, 2022 10:38 pm

Yes I need different laser powers in the same drawing and gcode so I can do engraving and cutting in one operation on the laser.

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

Re: Laser power control postprocessor

Post by andrew » Mon May 02, 2022 7:29 am

I've attached a post processor called LaserCohesionMM.js ("Laser Cohesion [mm]") for your reference. It produces spindle speed (= power) values with two decimals.

Note the references to spindleSpeed in the post processor which define it as having two decimal places and in initToolpath as being of floating type.

I don't know the codes required to switch on / off the laser, so there might still be adjustments needed.
Attachments
LaserCohesionMM.js
(1.6 KiB) Downloaded 325 times

Alan F
Newbie Member
Posts: 4
Joined: Sun May 01, 2022 3:36 am

Re: Laser power control postprocessor

Post by Alan F » Mon May 02, 2022 1:44 pm

Thanks Andrew!

I will give this a try tonight.
Just providing the spindle speed with a value turns the laser on.

Have a great day.

Post Reply

Return to “Pre-sales Questions”