LaserWeb / LaserWeb4

Collaborative effort on the next version of LaserWeb / CNCWeb
GNU Affero General Public License v3.0
713 stars 192 forks source link

Support Power-ON delay for Laser Cutter/Raster operations #501

Open omuzychko opened 6 years ago

omuzychko commented 6 years ago

I am trying to use LaserWeb4 for the first time and I think it has a great potential. At the moment my main software to generate gcode is Inkscape with an extension from J Tech Photonics. This setup is lacking on ability to Laser Cut Inside what is so nicely implemented in LaserWeb4. It is extremely critical feature for PCB DIY (cutting SMD stencils from Mylar or photo-resist exposure: Laserweb-Workspace.json.txt). But after trying LaserWeb I've found that and I am missing one major feature supported in Inkscape/JTech setup - it is a possibility to introduce a variable delay after we turned the laser ON (M106 Snnn) and before we start moving it (G1 ....):

jtechphotonicscutter

This is achieved by dwell command (G4 Pnnn). It ensures that all the previous commands in the queue have been accomplished and introduces optional delay before moving on to the next one. Here is the gcode output from Inkscape/JTech:

...
; Move the Laser to the starting point of the cut
G1 F3000                
G1  X29.09 Y17.83
; Make sure that the movements are done before we turn the Laser ON
G4 P0       
; Turn On the Laser at 100% power               
M106 S255      
; Delay for 50 ms, so that we ensure that the laser fully turned on and we initiated a cut
G4 P50  
; Start moving the laser to make a cut         
G1 F750.000000     
G1  X29.09 Y16.72
; Make sure that the processing movement-commands queue has completed
G4 P0           
; Turn Off the Laser
M107 S0     
;  Move to the starting point of the next cut            
G1 F3000                
G1  X28.24 Y19.55
...

Why this delay is needed:

In other words - without this feature the clean cutting of clear or lightly-colored materials with cheap 2..5W laser modules from eBay is virtually impossible. It either does not initiate a cut or over-burns the cutting path.

The value of the G4 Pnnn delay is closely correlated with chosen laser power (M106 Snnn) and cut rate (G1 Fnnn). So it should be property for each specific Laser Operation, textbox input next to the "Cut Rate" (NOT in a global GCode generation Settings):

laserweboperations

cprezzi commented 6 years ago

You can define the "TOOL ON" and "TOOL OFF" commands in settings/gcode (multiple lines are valid). That should solve your problem.

omuzychko commented 6 years ago

@cprezzi - your suggestion works and this is the first thing I've tried. And it is only OK if the delay doesn't depend on actual power of the laser applied. But it does. For 5W laser I need to introduce up to 100 ms dealy when cutting at full power, and somewhat 30..40 ms delay when running at 10%. If I use the same laser power for all operations - your solution works OK. But when each operation should have different laser power (some to cut through, others - to raster some shading at lower power) - the delay should be different as well.

gabrielgrant commented 3 years ago

Running into this same issue. I've added a fixed delay with a G4 "dwell" command in the "TOOL ON" field, wich kind of works, but this seems to apply at the beginning of every line segment (even when the cut continues from the same point as the previous segment, like in a corner). the result is extra time spent (and kerf width) at each corner