Jump to content

Adding gcode before the automaticaly generated M190,M104 and M109 commands


dgrogandesign

Recommended Posts

Posted · Adding gcode before the automaticaly generated M190,M104 and M109 commands

I have added a command

M42 P40 S0

at the very beginning of my gcode which turns on my printer by switching a relay.

Problem is, cura prepends the start code with M190, M104 and M109 which begin the heating process and wont do anything until the targets have been reached. This is of course a problem if my M42 command hasnt been issued to turn on the power!

Is there any way that i can get cura to add my command in before it adds the heating commands? I can of course manually edit the gcode but this is a bit of an inelegant solution.

Many thanks!

Danny

  • Link to post
    Share on other sites

    Posted · Adding gcode before the automaticaly generated M190,M104 and M109 commands

    You should use M190 S{material_bed_temperature} and M109 S{material_print_temperature} in your start gcode.

    With the default gcode, CuraEngine thinks you are not heating up the bed. Because there is no temperature set in the start gcode, CuraEngine decides to protect your printer from trying to "cold extrude" and inserts heatup command by itself, before the gcode.

    Unless CuraEngine detects the use of {material_bed_temperature} and {material_print_temperature} in the start gcode, it will insert temperatures on its own before the start gcode.

    Since this question comes up quite often, I think I will prepare a pull request to amend the default start gcode to include lines to properly heat up the bed and head.

    • Like 1
    Link to post
    Share on other sites

    Posted · Adding gcode before the automaticaly generated M190,M104 and M109 commands

    My bad, I thought you were in Ultigcode and that was causing it to inject your snippet at the wrong location. I had no idea about the behaviour ahoeben described. I kinda assumed that gave you full control.

  • Link to post
    Share on other sites

    Posted · Adding gcode before the automaticaly generated M190,M104 and M109 commands
    You should use M190 S{material_bed_temperature} and M109 S{material_print_temperature} in your start gcode.

    This would require me to bypass the cura gui with regards to inputting my temperatures and fiddle with the start gcode every time would it not? This is the kind of thing which i would rather avoid since it is nice being able to tweak temperatures(especially within the context of profiles) without worrying about my start/end gcode.

  • Link to post
    Share on other sites

    Posted · Adding gcode before the automaticaly generated M190,M104 and M109 commands

    ....scratch that, ive just copied in the commands exactly as you said and it does indeed work. at first i thought the parts in brackets were for me to fill in manually. So thanks, problem solved!

  • 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.
          • Like
        • 0 replies
    ×
    ×
    • Create New...