Jump to content
Ultimaker Community of 3D Printing Experts
dgrogandesign

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

Recommended Posts

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

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

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

×

Important Information

Terms of Use Privacy Policy