Jump to content

Plugin to replace the extrusion g-code with my laser on/off function M126,M127)


newdesign

Recommended Posts

Posted · Plugin to replace the extrusion g-code with my laser on/off function M126,M127)

Hi, looking to get up and running using the cura software for my 3d printer. Its a uv resin curing printer so uses a laser to cure the solution as it rises from the vat.

My problem is that when i generate g-code its creates it as to think there is Extrusion happening, but what i need to do is replace this with my laser function (M126 on) and (M127 off) through out the entire code. how would this be achieved?

I have read about people creating a plugin for it or writing a script for it but i would not know how to do that. Any advise or where to go would be great.

  • Link to post
    Share on other sites

    Posted · Plugin to replace the extrusion g-code with my laser on/off function M126,M127)

    Hi Nallath, thanks for the reply im using cura 15.04.4. this is were i lack knowledge on script writing, i am not sure how i would go about doing this?

    Is there anything out there to help me do this?

  • Link to post
    Share on other sites

    Posted · Plugin to replace the extrusion g-code with my laser on/off function M126,M127)

    any links? It seems simple seen as other people have to be doing but i just cant figure out how to go about doing it. So all information i get is new to me

  • Link to post
    Share on other sites

    Posted · Plugin to replace the extrusion g-code with my laser on/off function M126,M127)

    Would anyone be able to point me in the right direction?

  • Link to post
    Share on other sites

    Posted · Plugin to replace the extrusion g-code with my laser on/off function M126,M127)

    Googled it. Third find explains it:

    http://www.appropedia.org/Open-source_laser_cutter

  • Link to post
    Share on other sites

    Posted · Plugin to replace the extrusion g-code with my laser on/off function M126,M127)

    Thanks for the reply, had a look at this but this is for etching. What i need to be able to do is is cure Uv resin with a 402nm laser. Just need to be able to turn the laser on and off at the right time through out the code instead of having the extrusion process happening.

  • Link to post
    Share on other sites

    Posted · Plugin to replace the extrusion g-code with my laser on/off function M126,M127)

    That sounds like an interesting project! I suppose you should dig in the examples that @nallath linked.

  • Link to post
    Share on other sites

    Posted (edited) · Plugin to replace the extrusion g-code with my laser on/off function M126,M127)

     

    @xisle maybe able to help you out if you ask him nicely. He has written gcode modifiers for me in the passed that worked really well.

    Edited by Guest
  • Link to post
    Share on other sites

    Posted · Plugin to replace the extrusion g-code with my laser on/off function M126,M127)

    thanks for the reply guys. i think the problem here is the lack of open socure software to do this, and that my knowledge is limited has its restrictions. Thank you labern, i will massage him and see can he help me out. this project is draging out on me and would really like to get it finished.

  • Link to post
    Share on other sites

    Posted · Plugin to replace the extrusion g-code with my laser on/off function M126,M127)

    Cool. I have actually made a plugin for CURA to control a laser also

  • Link to post
    Share on other sites

    Posted · Plugin to replace the extrusion g-code with my laser on/off function M126,M127)

    Perhaps you could use the Post-Processing Search/Replace function in Cura 2.6?

  • Link to post
    Share on other sites

    Posted · Plugin to replace the extrusion g-code with my laser on/off function M126,M127)

    You can but you also need to add some more bits.

  • Link to post
    Share on other sites

    Posted · Plugin to replace the extrusion g-code with my laser on/off function M126,M127)

    I made this plugin today so that I could operate my laser cutter with Cura:

     

    # Copyright (c) 2020 Belin Fieldson
    # LaserCode is released under the terms of the AGPLv3 or higher.
    
    from ..Script import Script
    
    class LaserCode(Script):
        version = "1.01"
        def __init__(self):
            super().__init__()
    
        def getSettingDataString(self):
            return """{
                "name":"Laser Code v.(""" + self.version + """)",
                "key":"LaserCode",
                "metadata": {},
                "version": 2,
                "settings":
                {
                    "_activation":
                    {
                        "label": "Laser Activate",
                        "description": "The code to use to activate the laser",
                        "type": "str",
                        "default_value": "M3"
                    },
                    "_deactivation":
                    {
                        "label": "Laser Deactivate",
                        "description": "The code to use to deactivate the laser",
                        "type": "str",
                        "default_value": "M5"
                    },
                    "_prefixActivation":
                    {
                        "label": "Active GCODE",
                        "description": "The gcode that the activate code should be prefixed to",
                        "type": "str",
                        "default_value": "G1"
                    },
                    "_prefixDeactivation":
                    {
                        "label": "Inactive GCODE",
                        "description": "The gcode that the deactivate code should be prefixed to",
                        "type": "str",
                        "default_value": "G0"
                    }
                }
            }"""
    
        def execute(self, data):
            activation = self.getSettingValueByKey("_activation");
            deactivation = self.getSettingValueByKey("_deactivation");
            searchActivation = self.getSettingValueByKey("_prefixActivation");
            searchDeactivation = self.getSettingValueByKey("_prefixDeactivation");
            activated = False;
            # Declare output gcode
            for layer in data:
                index = data.index(layer)
                lines = layer.split("\n")
                newLayer = ""
                for line in lines:
                    if (searchActivation in line and not activated):
                        newLayer += activation + "\n"
                        activated = True
                    if (searchDeactivation in line and activated):
                        newLayer += deactivation + "\n"
                        activated = False
                    newLayer += line + "\n"
                data[index] = newLayer
    
            return data

     

  • Link to post
    Share on other sites

    Posted · Plugin to replace the extrusion g-code with my laser on/off function M126,M127)
    On 1/7/2016 at 10:35 PM, newdesign said:

    Hi, looking to get up and running using the cura software for my 3d printer. Its a uv resin curing printer so uses a laser to cure the solution as it rises from the vat.

    My problem is that when i generate g-code its creates it as to think there is Extrusion happening, but what i need to do is replace this with my laser function (M126 on) and (M127 off) through out the entire code. how would this be achieved?

    I have read about people creating a plugin for it or writing a script for it but i would not know how to do that. Any advise or where to go would be great.

    Hi @newdesign

    I'm working on a project just like you do, have you figured out how to do this?
    Can you share with me? Thank you very much.

  • Link to post
    Share on other sites

    Posted (edited) · Plugin to replace the extrusion g-code with my laser on/off function M126,M127)

    hey anyone find about this if yes please let me know @newdesign  and @xisle

    or anyone else please. defining g-code for laser attached with extruder to sinter extruded composite

    @myterious0104 did you find it?

     

    Edited by Lokibaghel
  • Link to post
    Share on other sites

    Posted · Plugin to replace the extrusion g-code with my laser on/off function M126,M127)

    Even for someone who just knows a tiny bit of programming, this isn't a hard project.  Follow the links.  Look at the code.  Understand it.  Then write your own "post processing" plugin/extension.

  • Link to post
    Share on other sites

    Posted · Plugin to replace the extrusion g-code with my laser on/off function M126,M127)

    actually I am new to it , are you talking about above nallath github link

     

  • Link to post
    Share on other sites

    Posted · Plugin to replace the extrusion g-code with my laser on/off function M126,M127)

    yes and also thebelin's code just a few posts above.  You can change his M3 and M5 to the appropriate codes for your particular machine.

  • Link to post
    Share on other sites

    Create an account or sign in to comment

    You need to be a member in order to leave a comment

    Create an account

    Sign up for a new account in our community. It's easy!

    Register a new account

    Sign in

    Already have an account? Sign in here.

    Sign In Now
    • Our picks

      • Introducing the UltiMaker Factor 4
        We are happy to announce the next evolution in the UltiMaker 3D printer lineup: the UltiMaker Factor 4 industrial-grade 3D printer, designed to take manufacturing to new levels of efficiency and reliability. Factor 4 is an end-to-end 3D printing solution for light industrial applications
          • Thanks
          • Like
        • 3 replies
      • UltiMaker Cura 5.7 stable released
        Cura 5.7 is here and it brings a handy new workflow improvement when using Thingiverse and Cura together, as well as additional capabilities for Method series printers, and a powerful way of sharing print settings using new printer-agnostic project files! Read on to find out about all of these improvements and more. 
         
          • Like
        • 26 replies
    ×
    ×
    • Create New...