Turning laser on/off in UV curing printing
December 09, 2015 10:21AM
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?

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
Re: Turning laser on/off in UV curing printing
December 09, 2015 12:01PM
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 every 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.

e.g. a quickie (untested) Basic program that would do that would be along the lines:

10 open "Ifile.g" for input as #1
20 open "Ofile.g" for output as #2
30 print#2,"M126" : Laser=0

40 if eof(#1) then goto 100
50 input#1,Gline$
60 if instr(Gline$,"G1")=0 then print#2,Gline$ : goto 40
70 if instr(Gline$,"E")=0 and Laser=1 then print#2,"M126" : Laser=0
80 if instr(Gline$,"E")<>0 and Laser=0 then print#2,"M127" : Laser=1
90 print#2,Gline$ : goto 40

100 close #1
110 close #2
120 end

Dave




Dave
Re: Turning laser on/off in UV curing printing
December 09, 2015 04:27PM
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.



Large delta printer [miscsolutions.wordpress.com], E3D tool changer, Robotdigg SCARA printer, Crane Quad and Ormerod

Disclosure: I design Duet electronics and work on RepRapFirmware, [duet3d.com].
Re: Turning laser on/off in UV curing printing
December 10, 2015 05:04AM
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.
as above dave, where would you enter this code in the setup? would you recommend any better software which would be easier to use?
Re: Turning laser on/off in UV curing printing
December 10, 2015 07:32AM
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.

In RepRapFirmware this facility is enabled by sending M571 (see [reprap.org]), but AFAIK this gcode isn't implemented in any other firmware yet.

So I think your easiest option may be to write a program or SED script to post-process the gcode file as dmould suggests.



Large delta printer [miscsolutions.wordpress.com], E3D tool changer, Robotdigg SCARA printer, Crane Quad and Ormerod

Disclosure: I design Duet electronics and work on RepRapFirmware, [duet3d.com].
Re: Turning laser on/off in UV curing printing
December 10, 2015 08:02AM
Quote
soneill2
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.
as above dave, where would you enter this code in the setup? would you recommend any better software which would be easier to use?

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 & tested that will get you running.

I usually use Basic for doing "quick & 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.

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.

Dave
Re: Turning laser on/off in UV curing printing
December 14, 2015 11:07AM
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

case 126: //M126 Laser On (Valve)
st_synchronize(); // wait for all movements to finish
WRITE(LASER_PIN, HIGH);
break;
case 127: //M127 Laser Off (Valve)
st_synchronize(); // wait for all movements to finish
WRITE(LASER_PIN, LOW);
break;

This is so each step is fully completed before the next will happen.
is there any links or guides to explain how to replace all the Extrusion parts with laser on and off?

Also how would you set the z to lift in and out of the vat during each layer?
Re: Turning laser on/off in UV curing printing
December 22, 2015 10:41AM
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?
Re: Turning laser on/off in UV curing printing
January 15, 2016 09:11AM
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?
Sorry, only registered users may post in this forum.

Click here to login