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.8 beta released
        Another Cura release has arrived and in this 5.8 beta release, the focus is on improving Z seams, as well as completing support for the full Method series of printers by introducing a profile for the UltiMaker Method.
          • Like
        • 1 reply
      • 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
    ×
    ×
    • Create New...