Jump to content
Ultimaker Community of 3D Printing Experts
ex-egll

Changing Cura generated start code

Recommended Posts

Sorry, another question from a noob if I may.

Below is the portion of gcode produced ahead of the user defined stat code in a Cura 2.6 Beta gcode file..

;FLAVOR:RepRap

;TIME:4385

;Filament used: 1.60282m

;Layer height: 0.2

;Generated with Cura_SteamEngine 2.6.0

M190 S65

M104 S200

M109 S200

Is it possible to change this code? Ideally I would like to change the temperature settings to:

M104 S200 ;Start heating extruder

M140 S65 ;Start heating bed

M109 S200 ;Wait for extruder to reach temp before proceeding

M190 S200 ;Wait for bed to reach temp before proceeding

This way I can start heating bed and extruder at the same time, cutting back on the overall wait time.

Along the same lines, the Cura generated code seems a little odd

M190 S65 ;Wait for bed to reach temp before proceeding

M104 S200 ;Start heating extruder

M109 S200 ;Wait for extruder to reach temp before proceeding

What is the purpose of the second line, M104 S200?

Share this post


Link to post
Share on other sites

Yes you can change the start gcode. You can do this in the machine settings In CURA.

The reason it heats the bed then the nozzle is to reduce the amount of oozing from the nozzle as it takes a long time for the bed to heat up. The oozing creates a cavity in the nozzle which requires more priming.

Share this post


Link to post
Share on other sites

Yes you can change the start gcode. You can do this in the machine settings In CURA.

The reason it heats the bed then the nozzle is to reduce the amount of oozing from the nozzle as it takes a long time for the bed to heat up. The oozing creates a cavity in the nozzle which requires more priming.

 

Hi, thanks for the response. I realise that I can create my own start code in Cura but Cura inserts its own start code prior to the the user defined one e.g.

M190 S65

M104 S200

M109 S200

It was these I wanted to delete or be able to modify.

Ok on heating the bed first, I hadn't thought about the oozing issue, although my question was more about why, for the nozzle heating does Cura use an M104 followed by an M109. Wouldn't just the M109 serve the same purpose?

Share this post


Link to post
Share on other sites

I don't know. Have you tried editing the gcode file and removing M104 to see what happens?

You need to edit the .json file to stop it from adding both start codes.

 

Removing the M104 has no effect, at least on my machine. Could you point me to the location of the .json file that needs to be modified to to stop it from adding both start codes?

Many thanks

Share this post


Link to post
Share on other sites

The .Json files are all different for each printer and some have defines that others dont. you can copy paste some information from one to another to create your own but not everything works so its a bit of trial and error (well it was in my case making a UM2go+ Json)

Here is the UM2 defines for start end code.

5a333c452c962_Screenshot(106).thumb.png.214d6f0706fdb08c92077ec720083d05.png

IF using UltiFlavor then it will use the Start end Code set in the printer's firmware. but if you select any other flavor like rerap then it will use these defines.

The start end code in cura will be if you want to add something into the start or end code that's either not in the firmware or in one of the defines.

So I haven't tried but I guess if you remove the parts of the start and end code in the json file then you can add them in cura's machine settings.

5a333c452c962_Screenshot(106).thumb.png.214d6f0706fdb08c92077ec720083d05.png

Share this post


Link to post
Share on other sites

There are some things you can change/fix by editing json files, but this is not one of them. Changing the start gcode in json has the exact same effect as changing the start gcode in Machine Settings.

CuraEngine checks if the start gcode contains commands to heat up the hotend and bed before the print is started. If the start gcode does not have command to do that, CuraEngine adds the three lines (M190, M104, M109) before your start gcode just to make sure that the hotend is not cold before starting the actual print.

If you don't want Cura to add these lines, make sure your start gcode contains lines which have {material_print_temperature} and {material_bed_temperature} in them respectively. eg:

 

M104 S{material_print_temperature} ;Start heating extruderM140 S{material_bed_temperature} ;Start heating bedM109 S{material_print_temperature} ;Wait for extruder to reach temp before proceedingM190 S{material_print_temperature} ;Wait for bed to reach temp before proceeding

 

NB: I agree with @Labern about the order of heating up the hotend and the bed.

Edited by Guest

Share this post


Link to post
Share on other sites

I am trying to set up the machine settings for my BigBox Dual. By default cura heats up both extruders although only one extruder is used. There is a tab for Extruder1 and Extruder2 in Machine settings but if I edit the start code in one of these tabs, it has no effect on the generated gcode.

I would like to heat up both extruders to soften eventally oozed material on the unused extruder before bed leveling and switch off heating the unusd extruder afterwards.

Dual_Extruder_start_code.thumb.JPG.0b44fe1cec65057d0827be6019bc37a6.JPG

Share this post


Link to post
Share on other sites

The role of preheating should be handled in the script alone, or if someone needs something to do, specific controls for it. I will try and explain why.

I run a 400x400 MIC6 aluminum bed, with a 900w AC mat heater (no, I don't move my bed). It takes very little time for me to reach even 120C on my bed. Yet my v6 hot-end is slow to heat, as well as bed leveling even at 300mm/s. I prefer to heat the hot end after the bed leveling or preheat it to 160'ish at the start (PETG), and ramp to print temp after homing, just before bed leveling. This is my optimal setup. The hot end will reach around 220 just after the bed leveling, with a small dwell time before the print starts at 240. This gives me about a 5mm stringer, that I can easily swipe in a routine. If I have the hot end up to temp before homing and bed leveling, I am left with a frustrating mess. That stuff sticks to everything.

Just my 2 cents.

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