Jump to content

Recommended Posts

Posted · Insert gcode on Layer X

Hey there,

is it possible in Cura, to add a gcode command on a special layer or height?

I like the post processing plugin, but i can't do it with it. Is there another way?

  • Link to post
    Share on other sites

    Posted (edited) · Insert gcode on Layer X

    Yes i did and it works, but i have to set everything on every print.

    I'm looking for a possibility to set a gcode snippet and then only to say insert thins on layer 40, or layer XY ...

    As example, i have a third fan and i want him to blow on layers with small details. So i want to tell simply: power on at layer X; power off at layer Y; on again on layer Z

    I know i can do it with search and replace and i do it this way, but maybe there is a more simpler way.

    Edited by Guest
  • Link to post
    Share on other sites

    Posted · Insert gcode on Layer X

    I know i can do it with search and replace and i do it this way, but maybe there is a more simpler way.

    No, as far as I know, there is no simpler way

  • Link to post
    Share on other sites

    Posted (edited) · Insert gcode on Layer X

    I'm bored and this sounds interesting.

    It could be as simple as a bunch of options like:

    .
    At Layer [ A ] do [ gcode ]
    At Layer [ B ] do [ gcode ]
    .....
    

    Or, something smarter like: Turn on Fan if Layer uses less than N.nn mm of filament.

    Or maybe that's not exactly what you're looking for.

    @ManuelW , contact me via PM if you want to discuss further. I may be able to help.

    Edited by Guest
  • Link to post
    Share on other sites

    Posted · Insert gcode on Layer X

    Hey DaHai and Manuel,

     

    Did this conversation bear any fruits?

     

    I am searching for a tool that does exactly what you are talking about. I've been using the Search and Replace so far, but it's got to a point where is just painful to have to repeat the same process for every print.

  • Link to post
    Share on other sites

    Posted · Insert gcode on Layer X

    Because every gcode file is different you are going to be stuck customizing each one.  There is no "Easy" button.

    The Search and Replace is the simplest and since the Search and Replace plugin accepts multiple commands you should be able to do it without too much pain.

    Search = ;LAYER:125

    Replace = ;LAYER:125\nM106 S255

    and then another instance of Search and Replace:

    Search = ;LAYER:126

    Replace = ;LAYER:126\nM106 S0

    By taking "LAYER:xx" out and then putting it back in you can search the gcode easier to make sure it's all good.

    If your firmware supports M32 you may be able to have a standard routine that you can call.  You would still need the Search and Replace plugin to get the M32 calls into your model file.

    Search = ;LAYER:125

    Replace = ;LAYER:125\nM32 P !FanOn.gco#

    and another instance of Search and Replace

    Search = ;LAYER:126

    Replace = ;LAYER:126\nM32 P !FanOff.gco#

     

    FanOn.gco and FanOff.gco would be gcode files in the root directory of the SD card.  They can contain whatever you want to run.  M32 is supported by Marlin on my Ender 3 Pro.  I'm not sure about other printers and firmware.

  • 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

      • UltiMaker Cura 5.9 stable released!
        Here comes Cura 5.9 and in this stable release we have lots of material and printer profiles for UltiMaker printers, including the newly released Sketch Sprint. Additionally, scarf seams have been introduced alongside even more print settings and improvements.  Check out the rest of this article to find out the details on all of that and more
          • Like
        • 5 replies
      • 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
          • Heart
          • Thanks
          • Like
        • 4 replies
    ×
    ×
    • Create New...