Jump to content
dgrogandesign

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

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

Share this post


Link to post
Share on other sites
Posted · Adding gcode before the automaticaly generated M190,M104 and M109 commands

Change your gcode flavour to Reprap in the machine settings.

Share this post


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

Share this post


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.

Share this post


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.

Share this post


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!

Share this post


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 4.0 | Stable available!
      Ultimaker Cura 4.0 is mainly focused on the improved user interface and cloud integration.
      As always, we want to collect your user feedback for this release. If there are any improvements you can think of, feel free to mention it here and help us to shape the next release.
      • 98 replies
×
×
  • Create New...

Important Information

Welcome to the Ultimaker Community of 3D printing experts. Visit the following links to read more about our Terms of Use or our Privacy Policy. Thank you!