Firmware request - Laser mode "frame"
-
When controlling a laser cutter through something like lightburn, once a file is placed in the workspace, it is possible to get the machine to frame the extents of the work area so the user can ensure the medium to be laser cut is in the correct place.
When using a duet board with a laser cutter and controlling it through DWC, its not currently possible to do this.I know that any gcode file which is uploaded is scanned to get the z height etc.
Would it be possible to do the same for the maximum area in x and y to allow the work area to be framed to make sure the material is in the correct place -
Oh, yes, please. Most laser controllers do this and it is VERY handy.
-
This was discussed in other threads for different purposes. It sounds like scanning the entire file for X/Y extents is not practical. The Z height is grabbed from a known location, at the end or beginning of the file, I think.
Many slicers inform with a comment of the X/Y and Z extents. Perhaps the laser software could do so too?
To me it sounds like RRF will at least get the functionality of detecting comments inserted by the slicer to determine extents, for the purposes of parking tools or creating mesh grids or framing for laser cutting. Maybe ask the software developer now to insert comments with the extents and then coordinate with dc42 about the formatting they output.
-
Thanks for that.
I'll get a sample gcode output from lightburn to see what it looks like and I'll attach it here for reference. -
Please find example gcode at https://drive.google.com/drive/folders/1CrL4YoZd5tJOMKaTDHrBT3AElnKmsV62?usp=sharing
These are all output by lightburn. At the moment, no information about the frame size is passed to the gcode.I've opened a post on their forum to ask for support.
https://forum.lightburnsoftware.com/t/frame-information-as-comment-at-start-of-gcode/15844 -
For your reference here is one of the other recent discussions relating to this: https://forum.duet3d.com/topic/16138/idex-smart-tool-parking-position
-
@bot said in Firmware request - Laser mode "frame":
This was discussed in other threads for different purposes. It sounds like scanning the entire file for X/Y extents is not practical. The Z height is grabbed from a known location, at the end or beginning of the file, I think.
Max Z is found via a full scan in Duet RepRap firmware 2 and 3 both. Re: https://forum.duet3d.com/topic/15643/layer-count-in-dwc-progress-display?_=1589150657667
X and Y could easily be gathered along the way. Relative moves would be the only thing even a little "hard", and while those could be scanned, I doubt it would be necessary.
Therefore, it was very kind of lightburn to put bounds in a comment header, but it might be more universally applicable for Duet firmware to slightly enhance the scan it is already doing.
Of course, all this is really up to Dave...
-
Are you positive that the firmware scans the entire file, parsing every line of gcode? I was under the impression that it looks for a comment at the begin, or it scans the file backwards for the last non Extruder G1 command with a Z parameter, thereby skipping the majority of the file.
Is this incorrect?
-
@bot said in Firmware request - Laser mode "frame":
Are you positive that the firmware scans the entire file, parsing every line of gcode? I was under the impression that it looks for a comment at the begin, or it scans the file backwards for the last non Extruder G1 command with a Z parameter, thereby skipping the majority of the file.
Is this incorrect?
This is the module that does it: https://github.com/dc42/RepRapFirmware/blob/285b457264b9c852cc744ff258010986c8f401c4/src/Storage/FileInfoParser.cpp
You are correct.
At present, it scans the first 4K and the last ?4K? (or amount that will fit in the buffers that were used for the header scan). It does scan both of those chunks top down. It could easily be changed to scan the whole file if the controller is in laser mode.
Other controllers are doing this somehow, without a "hint" in a header.
-
Also, to be clear, it does not "parse". It is searching (scanning) for certain keywords. It does 'accumulate' some things, but it is much simpler than a parse.
For example, it simply ignores everything between G91 and a following G90.
-
Interesting, thanks. I think your idea of scanning the entire file if in laser mode is a good idea. Also, have a check for filesize and allow a reasonable limit to not make the machine work for an hour scanning the file.
-
I believe it could scan during upload. Modern CPUs are ridiculously fast when compared to any form of IO
-
The gcode header will be updated to
; LightBurn 0.9.11 ; GRBL device profile, current position ; Bounds: X-46 Y-38.11 to X46 Y38.11 G00 G17 G40 G21 G54 G91 M4 ; Cut @ 100 mm/sec, 20% power
Now its just a case of looking for the comment and adding a button or extra item to the right click menu for a job when the duet is in laser mode.
-
I'll add this as a work item for RRF 3.02. Cura already outputs the bounds of the job and RRF already has a comment parser, so I was planning to add this for Cura. Now I'll add it for Lightburn too.
-
@dc42 sorry to bring up this rather old topic, but since fast laser engraving is now possible this feature is an other must have for using RRF on laser cutters.
Please include this in the next release.
Many thank's!
-
@dc42 did you look in to the frame part. ? (bounds)
-