Jump to content
Ultimaker Community of 3D Printing Experts

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.

  • 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

    Archived

    This topic is now archived and is closed to further replies.

    ×
    ×
    • Create New...