Skip to content

Generate gcode for lasers/machines which do not support laser intensity. #635

Open
@Rabter1

Description

Right now the software cant control lasers without intensity regulation. (Laser raster)
It would be very easy to add support for these lasers.

Background

I am using Mach3 with a very weak laser.
Because of this i have no intensity hooked up to control the laser.
There is only Laser ON and Laser OFF. The laser is not listening to intensity values (S X.XXX).
Because i have no analog / PWM output left, i cant even hook up the intensity to my laser.

Right now i am using a custom Mach3 postprocessor to engrave contours.
I wanted to use this software to engrave surfaces aswell.
In Mach3 i can control the laser in two ways.

Possibility one:
Use custom M commands to turn on a digitalOutputs (Turn On or Turn Off Laser)
The code would look something like this.

G1 X10 Y10 
M303 ; Turn on Laser
X20 
M505; Turn off Laser
X10 Y10.2
...

The issue

The problem with LaserWeb is, that i can define custom commands in macros in Tool ON and Tool OFF for turning laser on and off, but these get not triggert in between the lines when using laser raster.
The code looks something like this.

M303
G1 X10 Y10 
S1.0 ; Turn on Laser
X20 
S0.0 ; Turn off Laser
X10 Y10.2
...
M505

The software expects the machine to turn off the laser when settings S0 but this is not the case when a machine has no intensity control.

This would be an easy fix because everytime the software outputs S0.0 we could just output Tool OFF Macro. And everytime the intensity is >0 or >0.5 we could output Tool ON Macro.

The second way to control a laser in Mach3 is by using the commands M67 and M68.
This is the prefered way becasue mach3 only turns on the laser when the axis is moving.
See also #334

The Code would look something like this:

G1 X10 Y10 
M67 E(PWMSigNo) Q(LaserPower) ; Turn on Laser
X20 
M68 E(PWMSigNo) Q(PWMMinPow) ; Turn off Laser
X10 Y10.2
...

Because I have no PWM control i just leave the Q value out.
This is basically the same code as above with just another custom macro set for Tool ON and Tool OFF

The issue is, that the Macros are not beeing called as mentioned.

There is also an awkward bug in mach3 with some controllers, that cause the machine to wait a tiny amount (maybe 1ms) when executing an S Command. This can lead to a burning spot.
Thats why it would be awesome to have an checkmark option to disable intensity values completely. (Btw. this bug is one of the reasons M67 and M68 exist in the first place)

So for Mach3 there needs to be an output ideally like this:

M67 E(PWMSigNo) Q(LaserPower) ; Turn on Laser
G1 Move

And for lasers without intensity settings, there needs to be a checkmark like Use Intensity which is checked by default but can be deactivated.

If intensity it deactivated the Mach3 G Code would look like this:

M67 E(PWMSigNo) ; Turn on Laser
G1 Move
M68 E(PWMSigNo) ; Turn off Laser

But if Mach3 would be supportet with M67 and M68. I think it would not harm to have the Power value there. So the checkmark for leaving the power values out might not even be necessary.

But it is very important to turn the laser off by calling M68 or by the Tool OFF Macro and not by calling Laser ON with Power 0 thats basically the logic right now.

I might be able to help programm these changes and submit a pull request but i dont know if this software is still maintained.

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions