Jump to content

Disable M105?


Recommended Posts

Posted · Disable M105?

Is there a way to prevent Cura from adding M105 to gcode? 


I have used the "find and replace" to comment it out, but is there a way to prevent it completely?

  • Link to post
    Share on other sites

    Posted (edited) · Disable M105?

    I was looking into where the M105 command is generated and it's in the functions writeTemperatureCommand and writeBedTemperatureCommand in the file gcodeExport.cpp of the CuraEngine project. Here's the code responsible for the M105 command:


        if (wait && flavor != EGCodeFlavor::MAKERBOT)
            if(flavor == EGCodeFlavor::MARLIN)
                *output_stream << "M105" << new_line; // get temperatures from the last update, the M109 will not let get the target temperature
            *output_stream << "M109";
            extruder_attr[extruder].waited_for_temperature = true;
            *output_stream << "M104";
            extruder_attr[extruder].waited_for_temperature = false;

    So looking for ways to disable M105 your options are:

    1) Choose a flavor of G code that's not from Marlin in the printer settings. (But then something else will almost certainly break because of other differences in the generated g-code.)

    2) Change the code in the CuraEngine source code and recompile it.


    By far the simplest option would probably be to continue using search and replace. When you say search and replace I'm assuming you mean the post processing plugin and not opening the file in a text editor and doing it manually. In case you didn't discover it yet: Go to extensions, post processing, modify g-code. Add a script and select "search and replace". Here you can enter M105 and remove the command automatically every time.


    May I ask you why you would want to disable M105 though?

    Edited by nitro2k01
    • Like 1
    Link to post
    Share on other sites

    Posted · Disable M105?

    Thank you for the perfect reply. Yes, I was using the post processing option.


    As for disabling M105, It's just a small project I'm helping with and all temperature related controls are handled mechanically and not through a slicer. M105 was triggering an error. I can't get into it much as it's not my personal project,  I'm just testing various slicers for tool path and motion controls. Nothing temperature related if that makes sense.

  • Link to post
    Share on other sites

    Posted · Disable M105?

    I make a PPScript to delete de M105 and M109 only when i use the same material in both extruders from a geeetech A10M.


    The PPScript start counting the number of different temps that are in the M109, and if there is only one temp, delete all the M105 and M109 from the gcode.


    If there is several temps changing, then the script warn in the gcode in the POSTPROCESSED line and do not change anything.



  • Link to post
    Share on other sites

    • 1 year later...
    Posted · Disable M105?

    If you set temperature settings by yourself in printer profile start gcode, cura won't use that template it prints before the start gcode. You'll need to use replacement patterns to do that.


    M140 S{material_bed_temperature}   ; set bed temp
    M190 S{material_bed_temperature}   ; wait for bed temp
    M104 S{material_print_temperature} ; set extruder temp
    M109 S{material_print_temperature} ; wait for extruder temp


    Because it's not using the template to add temperature codes, it'll also skip M105.

    Here's an example how this start gcode rendered:



    ;Generated with Cura_SteamEngine 4.12.1
    M82 ;absolute extrusion mode
    ; Ender 3 Custom Start G-code

    M140 S60   ; set bed temp
    M190 S60   ; wait for bed temp
    M104 S200 ; set extruder temp
    M109 S200 ; wait for extruder temp
    G92 E0 ; Reset Extruder
    G28 ; Home all axes
    G1 Z2.0 F3000 ; Move Z Axis up little to prevent scratching of Heat Bed

  • 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...