Jump to content

Insert gcode on Layer X


ManuelW

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.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
        • 18 replies
      • S-Line Firmware 8.3.0 was released Nov. 20th on the "Latest" firmware branch.
        (Sorry, was out of office when this released)

        This update is for...
        All UltiMaker S series  
        New features
         
        Temperature status. During print preparation, the temperatures of the print cores and build plate will be shown on the display. This gives a better indication of the progress and remaining wait time. Save log files in paused state. It is now possible to save the printer's log files to USB if the currently active print job is paused. Previously, the Dump logs to USB option was only enabled if the printer was in idle state. Confirm print removal via Digital Factory. If the printer is connected to the Digital Factory, it is now possible to confirm the removal of a previous print job via the Digital Factory interface. This is useful in situations where the build plate is clear, but the operator forgot to select Confirm removal on the printer’s display. Visit this page for more information about this feature.
        • 0 replies
    ×
    ×
    • Create New...