<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
    <channel>
        <title>Turning laser on/off in UV curing printing</title>
        <description> Hi, would anyone have any information about using slicer? At the moment the software is more set up for extruding and not for UV resin printing. So basically i need to figure out how to turn on and off the laser at the right time so it doesn&#039;t cure when traveling on none print moves. My laser on Command is M127 and off is M126. I have trying to look this up but have no found much information about it. is there any special software that i could use? 

Example below, whats underlined is where i think the laser commands should go in but surely there is an easier way to do this? Also as i am not extruding there is no need for an of the E values in this code? Any information would be great, thanks

G1 X120.291 Y102.184 E253.57984 ; skirt
M126 ; Laser off
G92 E0 ; reset extrusion distance
G1 X134.899 Y104.097 F1500.000 ; move to first infill point
M127 ; Laser on
G1 X143.410 Y112.608 E27.89906 F450.000 ; infill
G1 X143.407 Y115.179 E33.85960 ; infill
G1 X132.322 Y104.094 E70.19679 ; infill
G1 X130.290 Y104.637 E75.07089 ; infill
G1 X142.867 Y117.214 E116.29891 ; infill
G1 X141.986 Y118.907 E120.72350 ; infill
G1 X128.596 Y105.517 E164.61633 ; infill
G1 X127.189 Y106.685 E168.85419 ; infill
G1 X140.819 Y120.315 E213.53390 ; infill
G1 X139.415 Y121.485 E217.77094 ; infill
G1 X126.020 Y108.090 E261.68081 ; infill
G1 X125.139 Y109.784 E266.10595 ; infill
G1 X137.721 Y122.366 E307.34932 ; infill
G1 X135.681 Y122.900 E312.23763 ; infill
G1 X124.600 Y111.819 E348.56070 ; infill
G1 X124.595 Y114.389 E354.51577 ; infill
G1 X133.120 Y122.913 E382.46025 ; infill
M126 ; Laser off
G92 E0 ; reset extrusion distance
G1 X128.350 Y120.719 F1500.000 ; move to first infill point
M127 ; Laser on
G1 X126.724 Y119.092 E5.33159 F450.000 ; infill
M126 ; Laser off
G92 E0 ; reset extrusion distance
G1 X139.776 Y106.399 F1500.000 ; move to first infill point
M127 ; Laser on
G1 X141.120 Y107.743 E4.40418 F450.000 ; infill
M126 ; Laser off
G92 E0 ; reset extrusion distance</description>
        <link>https://reprap.org/forum/read.php?263,594735,594735#msg-594735</link>
        <lastBuildDate>Thu, 16 Apr 2026 07:06:42 -0400</lastBuildDate>
        <generator>Phorum 5.2.23</generator>
        <item>
            <guid>https://reprap.org/forum/read.php?263,594735,610027#msg-610027</guid>
            <title>Re: Turning laser on/off in UV curing printing</title>
            <link>https://reprap.org/forum/read.php?263,594735,610027#msg-610027</link>
            <description><![CDATA[ Hi Does anyone have any information on this? Also For uv resin printing, what would be the suggested layer height and how close would you bring the head to the bottom of the vat?]]></description>
            <dc:creator>soneill2</dc:creator>
            <category>Slic3r</category>
            <pubDate>Fri, 15 Jan 2016 09:11:40 -0500</pubDate>
        </item>
        <item>
            <guid>https://reprap.org/forum/read.php?263,594735,599767#msg-599767</guid>
            <title>Re: Turning laser on/off in UV curing printing</title>
            <link>https://reprap.org/forum/read.php?263,594735,599767#msg-599767</link>
            <description><![CDATA[ Hi Does anyone have any information on this? Also For uv resin printing, what would be the suggested layer height and how close would you bring the head to the bottom of the vat?]]></description>
            <dc:creator>soneill2</dc:creator>
            <category>Slic3r</category>
            <pubDate>Tue, 22 Dec 2015 10:41:57 -0500</pubDate>
        </item>
        <item>
            <guid>https://reprap.org/forum/read.php?263,594735,596576#msg-596576</guid>
            <title>Re: Turning laser on/off in UV curing printing</title>
            <link>https://reprap.org/forum/read.php?263,594735,596576#msg-596576</link>
            <description><![CDATA[ I am using sprinter at the moment. I can manually enter m code into the code but this is not really the way I want as for a big print it would take to much. I have change some lines in the firware to<br />
<br />
 case 126: //M126 Laser On (Valve)<br />
     st_synchronize(); // wait for all movements to finish<br />
     WRITE(LASER_PIN, HIGH); <br />
break;<br />
case 127: //M127 Laser Off (Valve)<br />
     st_synchronize(); // wait for all movements to finish<br />
     WRITE(LASER_PIN, LOW); <br />
break;<br />
<br />
This is so each step is fully completed before the next will happen. <br />
is there any links or guides to explain how to replace all the Extrusion parts with laser on and off? <br />
<br />
Also how would you set the z to lift in and out of the vat during each layer?]]></description>
            <dc:creator>soneill2</dc:creator>
            <category>Slic3r</category>
            <pubDate>Mon, 14 Dec 2015 11:07:09 -0500</pubDate>
        </item>
        <item>
            <guid>https://reprap.org/forum/read.php?263,594735,595004#msg-595004</guid>
            <title>Re: Turning laser on/off in UV curing printing</title>
            <link>https://reprap.org/forum/read.php?263,594735,595004#msg-595004</link>
            <description><![CDATA[ <blockquote class="bbcode"><div><small>Quote<br /></small><strong>soneill2</strong><br />
Hi, thanks for the reply guys. at the moment i have an ilios hd 3d printer which is using the arduino board. Im currently using slicer to generate the g-code but find this is more suited to extrusion based printers. <br />
as above dave, where would you enter this code in the setup? would you recommend any better software which would be easier to use?</div></blockquote>
<br />
My code was just a very simple example that would do the job in a crude way - You would run it separately after slicing and it will create a new G-code file that have the laser commands.  It would run as a separate program using a Basic interpreter or compiler (e.g. the free "Just Basic" - you may have to change the syntax to suit the particular "flavour" of Basic).  In this case it takes the file Slicer made that you have renamed to "Ifile.g" and creates a new file called "Ofile.g" that has the laser commands inserted.  You could add a line at the start to prompt for a file name instead.  The code I wrote is untested and will probably need a tweak or two to get working - as said it was meant as just a rough example.  If you have no programming experience and don't have any other solution available, let me know and I'll send you something that is a bit more polished &amp; tested that will get you running.<br />
<br />
I usually use Basic for doing "quick &amp; nasty" manipulations of this sort simply because it was the first "high level" language I learned (about 40 years ago!) and so it is the most familiar to me (I code in assembler as a profession so don't use high level languages too often), but it's a dated language and you could do the same manipulation using a more modern language or script.  Slic3r allows you to add a post processing script (I think using Java?) that would probably also be able to do what you need so you get the right format directly rather than process the file as a separate operation, but I have no experience of using that facility at all and very limited experience with Java.<br />
<br />
Slic3r is designed for use with FDM printers, and while it should work (after modifying the G-code), I'm quite sure that there are slicing programs designed specifically for SLA printers that would probably produce G-code that is better suited for you, but I don't know if there are any that are free.  Maybe do a web search.<br />
<br />
Dave]]></description>
            <dc:creator>dmould</dc:creator>
            <category>Slic3r</category>
            <pubDate>Thu, 10 Dec 2015 08:02:15 -0500</pubDate>
        </item>
        <item>
            <guid>https://reprap.org/forum/read.php?263,594735,594991#msg-594991</guid>
            <title>Re: Turning laser on/off in UV curing printing</title>
            <link>https://reprap.org/forum/read.php?263,594735,594991#msg-594991</link>
            <description><![CDATA[ You haven't said which firmware your Arduino is running, but it's probably Marlin or Repetier. Unfortunately the Marlin wiki page is down, there is no documentation in the github repo for Marlin, and I don't know where else to look.<br />
<br />
In RepRapFirmware this facility is enabled by sending M571 (see [<a href="http://reprap.org/wiki/Gcodes#M571:_Set_output_on_extrude" target="_blank"  rel="nofollow">reprap.org</a>]), but AFAIK this gcode isn't implemented in any other firmware yet.<br />
<br />
So I think your easiest option may be to write a program or SED script to post-process the gcode file as dmould suggests.]]></description>
            <dc:creator>dc42</dc:creator>
            <category>Slic3r</category>
            <pubDate>Thu, 10 Dec 2015 07:32:52 -0500</pubDate>
        </item>
        <item>
            <guid>https://reprap.org/forum/read.php?263,594735,594928#msg-594928</guid>
            <title>Re: Turning laser on/off in UV curing printing</title>
            <link>https://reprap.org/forum/read.php?263,594735,594928#msg-594928</link>
            <description><![CDATA[ Hi, thanks for the reply guys. at the moment i have an ilios hd 3d printer which is using the arduino board. Im currently using slicer to generate the g-code but find this is more suited to extrusion based printers. <br />
as above dave, where would you enter this code in the setup? would you recommend any better software which would be easier to use?]]></description>
            <dc:creator>soneill2</dc:creator>
            <category>Slic3r</category>
            <pubDate>Thu, 10 Dec 2015 05:04:11 -0500</pubDate>
        </item>
        <item>
            <guid>https://reprap.org/forum/read.php?263,594735,594845#msg-594845</guid>
            <title>Re: Turning laser on/off in UV curing printing</title>
            <link>https://reprap.org/forum/read.php?263,594735,594845#msg-594845</link>
            <description><![CDATA[ Some firmwares such as RepRapFirmware have provision for turning an output on/off depending on whether extrusion is taking place or not. You may find that whatever firmware you are running has that option too.]]></description>
            <dc:creator>dc42</dc:creator>
            <category>Slic3r</category>
            <pubDate>Wed, 09 Dec 2015 16:27:26 -0500</pubDate>
        </item>
        <item>
            <guid>https://reprap.org/forum/read.php?263,594735,594767#msg-594767</guid>
            <title>Re: Turning laser on/off in UV curing printing</title>
            <link>https://reprap.org/forum/read.php?263,594735,594767#msg-594767</link>
            <description><![CDATA[ You need to write a script that inserts a "laser on" command immediately before the first G1 command that contains any "E" parameter when the laser was previously off, and a "laser off" command immediately before the first G1 command that does not have an "E" parameter if the laser was previously on.  It would in fact probably work if you put a "laser on" or "laser off" command immediately before <i>every</i> G1 command (depending whether there is an "E" parameter or not).  This would result in lots of redundant laser commands, but I should think they would do no harm.  That's assuming that your printer does not mind having an "E" parameter in the move commands.<br />
<br />
e.g. a quickie (untested) Basic program that would do that would be along the lines:<br />
<br />
10 open "Ifile.g" for input as #1<br />
20 open "Ofile.g" for output as #2<br />
30 print#2,"M126" : Laser=0<br />
<br />
40 if eof(#1) then goto 100<br />
50 input#1,Gline$<br />
60 if instr(Gline$,"G1")=0 then print#2,Gline$ : goto 40<br />
70 if instr(Gline$,"E")=0 and Laser=1 then print#2,"M126" : Laser=0<br />
80 if instr(Gline$,"E")&lt;&gt;0 and Laser=0 then print#2,"M127" : Laser=1<br />
90 print#2,Gline$ : goto 40<br />
<br />
100 close #1<br />
110 close #2<br />
120 end<br />
<br />
Dave<br />
<br />
<br />
<br />
<br />
Dave]]></description>
            <dc:creator>dmould</dc:creator>
            <category>Slic3r</category>
            <pubDate>Wed, 09 Dec 2015 12:01:54 -0500</pubDate>
        </item>
        <item>
            <guid>https://reprap.org/forum/read.php?263,594735,594735#msg-594735</guid>
            <title>Turning laser on/off in UV curing printing</title>
            <link>https://reprap.org/forum/read.php?263,594735,594735#msg-594735</link>
            <description><![CDATA[ Hi, would anyone have any information about using slicer? At the moment the software is more set up for extruding and not for UV resin printing. So basically i need to figure out how to turn on and off the laser at the right time so it doesn't cure when traveling on none print moves. My laser on Command is M127 and off is M126. I have trying to look this up but have no found much information about it. is there any special software that i could use? <br />
<br />
Example below, whats underlined is where i think the laser commands should go in but surely there is an easier way to do this? Also as i am not extruding there is no need for an of the E values in this code? Any information would be great, thanks<br />
<br />
G1 X120.291 Y102.184 E253.57984 ; skirt<br />
M126 ; Laser off<br />
G92 E0 ; reset extrusion distance<br />
G1 X134.899 Y104.097 F1500.000 ; move to first infill point<br />
M127 ; Laser on<br />
G1 X143.410 Y112.608 E27.89906 F450.000 ; infill<br />
G1 X143.407 Y115.179 E33.85960 ; infill<br />
G1 X132.322 Y104.094 E70.19679 ; infill<br />
G1 X130.290 Y104.637 E75.07089 ; infill<br />
G1 X142.867 Y117.214 E116.29891 ; infill<br />
G1 X141.986 Y118.907 E120.72350 ; infill<br />
G1 X128.596 Y105.517 E164.61633 ; infill<br />
G1 X127.189 Y106.685 E168.85419 ; infill<br />
G1 X140.819 Y120.315 E213.53390 ; infill<br />
G1 X139.415 Y121.485 E217.77094 ; infill<br />
G1 X126.020 Y108.090 E261.68081 ; infill<br />
G1 X125.139 Y109.784 E266.10595 ; infill<br />
G1 X137.721 Y122.366 E307.34932 ; infill<br />
G1 X135.681 Y122.900 E312.23763 ; infill<br />
G1 X124.600 Y111.819 E348.56070 ; infill<br />
G1 X124.595 Y114.389 E354.51577 ; infill<br />
G1 X133.120 Y122.913 E382.46025 ; infill<br />
M126 ; Laser off<br />
G92 E0 ; reset extrusion distance<br />
G1 X128.350 Y120.719 F1500.000 ; move to first infill point<br />
M127 ; Laser on<br />
G1 X126.724 Y119.092 E5.33159 F450.000 ; infill<br />
M126 ; Laser off<br />
G92 E0 ; reset extrusion distance<br />
G1 X139.776 Y106.399 F1500.000 ; move to first infill point<br />
M127 ; Laser on<br />
G1 X141.120 Y107.743 E4.40418 F450.000 ; infill<br />
M126 ; Laser off<br />
G92 E0 ; reset extrusion distance]]></description>
            <dc:creator>soneill2</dc:creator>
            <category>Slic3r</category>
            <pubDate>Wed, 09 Dec 2015 10:21:39 -0500</pubDate>
        </item>
    </channel>
</rss>
