Laser Manual: Difference between revisions

Jump to navigation Jump to search
1,499 bytes added ,  3 November 2018
→‎Graster Conversion Workflow: update instructions for graster2
m (Replace EMC2 with LinuxCNC)
(→‎Graster Conversion Workflow: update instructions for graster2)
Line 74: Line 74:


To create raster jobs, use Graster:
To create raster jobs, use Graster:
http://github.com/jedediah/graster
https://github.com/IgorYeremin/graster/tree/laser


'''Warning:''' you cannot use the "touch off" feature of EMC with a Graster job, it will not work and bad stuff will probably happen. ''Before starting a job, make sure the coordinate system is reset by going to'' Machine -> Zero Coordinate System -> P1 ''(the first option)''.
'''Warning:''' The old version of graster could not be touched off, graster2 can! You can check what version your file uses by checking the .raster.ngc file for "M101" or "M102", the latter implies you're using graster2. To reset touch off position for the old graster: ''Machine -> Zero Coordinate System -> P1 ''(the first option)''.


Graster is already installed on the laser PC you should use it there, if possible, because it is still a bit tricky to install.
Graster is already installed on the laser PC you should use it there, if possible, because it is still a bit tricky to install.
Line 82: Line 82:
To use it:
To use it:


# Load the image onto the laser printer.<br/><pre>scp image.png hacklab@laser.hacklab.to/image.png</pre>
# Load the image onto the laser printer.<br/><pre>scp image.png hacklab@laser.hacklab.to:~/my-folder/</pre>
# SSH into the laser printer.
# SSH into the laser computer or use the local terminal.
# Run the script on your image.<br/><pre>../graster/graster.rb image.png</pre>
# Run the script on your image.<br/><pre>~/graster2/graster.rb image.png</pre>
# The output results in three files: <br/>&nbsp;&nbsp;&nbsp;&nbsp;image.png.cut.ngc - A box cutout of the image. <br/>&nbsp;&nbsp;&nbsp;&nbsp;image.png.raster.gmask - The gmask file with laser instructions.<br/>&nbsp;&nbsp;&nbsp;&nbsp;'''image.png.raster.ngc''' - This is the main Gcode file that you want to load into the cutter.
# The output results in three files: <br/>&nbsp;&nbsp;&nbsp;&nbsp;image.png.cut.ngc - A box cutout of the image. <br/>&nbsp;&nbsp;&nbsp;&nbsp;image.png.raster.gmask - The gmask file with laser instructions.<br/>&nbsp;&nbsp;&nbsp;&nbsp;'''image.png.raster.ngc''' - This is the main Gcode file that you want to load into the cutter.


===Advanced Graster info===
 
==== Graster Job Output/Running ====
Graster output consists of a cut G-code file (filename.cut.ngc), a raster G-code file (filename.raster.ngc) and a mask file (filename.raster.gmask).
* The cut file is a simple g-code sequence that just cuts out the outer perimeter rectangle of the image/job. You can use this to align your work, cut the outline in a piece of scrap paper, then place your work piece on the outline.
* The raster g-code file consists of a constant raster pattern covering the entire surface of the piece.  It's normal for this to appear as a solid white box when loaded into AXIS (if you zoom in you will see the constant pattern).
* Once the raster job starts in AXIS, it executes the 'M102' g-code command, which is set up to launch the Graster Streamer.  The g-code itself just tells the laser head to move back and forth over and over, and the Graster Streamer actually streams the bitmap data to it (via the mask file).
* If you need to stop a job, press the Stop button on AXIS and then press the Cancel button on the Graster Streamer if it's still open.
 
 
====Advanced Graster info====


To run Graster yourself, '''you will need Ruby 1.9, not Ruby 1.8'''. At present, the version of 1.9 in the Debian/Ubuntu repository is '''very old''', do not install it. You will have to build Ruby 1.9 (or later) from source (http://www.ruby-lang.org/en/downloads/). You will also need to install RubyGems and a gem called rmagick (which is used to read image files). This is all a bit of a hassle and a simpler install method is planned for ''The Future''.
To run Graster yourself, '''you will need Ruby 1.9, not Ruby 1.8'''. At present, the version of 1.9 in the Debian/Ubuntu repository is '''very old''', do not install it. You will have to build Ruby 1.9 (or later) from source (http://www.ruby-lang.org/en/downloads/). You will also need to install RubyGems and a gem called rmagick (which is used to read image files). This is all a bit of a hassle and a simpler install method is planned for ''The Future''.
Line 98: Line 107:
dpi: [500, 500]
dpi: [500, 500]
on_range: [0.0, 0.5]
on_range: [0.0, 0.5]
feed: 300
cut_feed: 20
offset: [0.0, 0.0]
overshoot: 0.5
overshoot: 0.5
offset: [1.0, 1.0]
repeat: [1, 1]
repeat: [1, 1]
tile_size: [3, 1]
tile_size: [3, 1]
tile_spacing: [0.125, 0.125]
tile_spacing: [0.125, 0.125]
feed: 120
cut_feed: 20
corner_radius: 0.125
corner_radius: 0.125
</pre>
</pre>


'''dpi''': The resolution you want to draw the image at, in dots-per-inch. The laser's natural resolution is 500x500 so you should probably use that for best results. This means that 500 pixels in your image will be one inch on the laser. If you want it bigger, you should scale up the image in an image editing program that has good filtering or better yet, get a higher quality source image.
'''dpi''': The resolution you want to draw the image at, in dots-per-inch. The laser's natural resolution is 1000x1000 so you should probably use a factor of that: 1000, 500, 250. Lower resolution = less run time. This means that 500 pixels in your image will be one inch on the laser. If you want it bigger, you should scale up the image in an image editing program that has good filtering or better yet, get a higher quality source image.


'''on_range''': The range of lightness values for which the laser will be on. Images are converted to greyscale with range 0..1 and tested against this range. Since the laser tends to darken things, the default is to laser dark pixels.
'''on_range''': The range of lightness values for which the laser will be on. Images are converted to greyscale with range 0..1 and tested against this range. Since the laser tends to darken things, the default is to laser dark pixels.


'''overshoot''': The stepper motors that move the laser can't start and stop instantly, they need time accelerate and decelerate. When drawing raster lines, you want to the laser to be moving at a constant speed from one end all the way to the other. We overshoot the end of the image so the X axis motor can change direction without affecting the burn. The default value seems to be enough for even the fastest speed.
'''feed''': Feed rate for rastering, you can change it later in the raster.ngc by editing the F number.


'''offset''': The location of the bottom left corner of the image, relative to the bottom left corner of the laser table. This allows you to reposition the whole image. EMC has a similar feature in AXIS but you can't use that feature with Graster.  
'''cut_feed''': Feed rate for cutout
 
'''overshoot''': graster2 ignores this and calculates the optimal value at run time! Old graster: The stepper motors that move the laser can't start and stop instantly, they need time accelerate and decelerate. When drawing raster lines, you want to the laser to be moving at a constant speed from one end all the way to the other. We overshoot the end of the image so the X axis motor can change direction without affecting the burn. The default value seems to be enough for even the fastest speed.
 
'''offset''': The location of the bottom left corner of the image, relative to the bottom left corner of the laser table. This allows you to reposition the whole image. This existed to allow the old graster to overshoot correctly. Not it should probably stay at [0, 0] since you can offset the job anywhere with AXIS touch off.


'''repeat''': Number of times to repeat the image in the X and Y directions. Yup, this lets you burn a whole batch of things instead of just one.
'''repeat''': Number of times to repeat the image in the X and Y directions. Yup, this lets you burn a whole batch of things instead of just one.
TODO:


'''tile_size''': Size of repeated images
'''tile_size''': Size of repeated images
Line 124: Line 135:
'''tile_spacing''': Gap between repeated images
'''tile_spacing''': Gap between repeated images


'''feed''': Feed rate for rastering
'''corner_radius''': Corner radius of cutout, 0 for pointy corners


'''cut_feed''': Feed rate for cutout
==== Graster Troubleshooting ====
 
===== Filled rectangle engraved instead of image =====
* Make sure your image has a white background. Transparent background is sometimes interpreted as black.
 
===== Left/Right edge of etch are darker than middle =====
* Not enough overshoot distance. Turn feed override down to <=100%. The calculated overshoot value is optimized for the file's F feed rate at 100% override. If you want faster feed, edit the F value in the file. For old graster: turn feed down or edit overshoot setting in the graster config file and re-run it.


'''corner_radius''': Corner radius of cutout, 0 for pointy corners
===== LinuxCNC complains about exceeding axis limits =====
* The overshoot on the left side goes into negative X, so jobs can't be touched off all the way on the left edge of the table. AXIS should show how much overshoot room you need, move your work by at least that distance and re-touch-off.


==== Graster Job Output/Running ====
Graster output consists of a cut G-code file (filename.cut.ngc), a raster G-code file (filename.raster.ngc) and a mask file (filename.raster.gmask).
* The cut file is a simple g-code sequence that just cuts out the outer perimeter rectangle of the image/job.
* The raster g-code file consists of a constant raster pattern covering the entire surface of the piece.  It's normal for this to appear as a solid white box when loaded into AXIS (if you zoom in you will see the constant pattern).
* Once the raster job starts in AXIS, it executes the 'M101' g-code command, which is set up to launch the Graster Streamer.  The g-code itself just tells the laser head to move back and forth over and over, and the Graster Streamer actually streams the bitmap data to it (via the mask file).


=== DXF Conversion Workflow ===
=== DXF Conversion Workflow ===
Line 237: Line 250:


See: https://github.com/IgorYeremin/fusion-postproc
See: https://github.com/IgorYeremin/fusion-postproc


== Getting your files on the laser ==
== Getting your files on the laser ==

Navigation menu