31

My printer has an auto-leveling feature that works by touching the build plate with the tip of the nozzle.

I started using a BuildTak surface and BuildTak is damaged when you push a hot nozzle into it.

So I edited the start G-code to run the auto-leveling before heating up the hotend

But ABS doesn't stick to the build surface unless I pre-heat the hotend and wait about a minute.

So now I'm looking for a G-code command to put at the end of the start G-code that will make the printer wait a minute before printing

The sequence I'm looking for is:

  • Heat up the bed
  • Auto level
  • Raise the hotend a little bit so it doesn't touch the build plate
  • Heat up the hotend
  • Wait a minute (that's the only part that is missing, everything else works)
  • Start printing

Any way to insert a delay into the G-code?

I'm using Cura to slice/print, my printer is Robo3D R1+

Greenonline
  • 5,831
  • 7
  • 30
  • 60
Nir
  • 2,401
  • 4
  • 18
  • 32
  • 3
    G4 P60000 as explained here:http://reprap.org/wiki/Gcode#G4:_Dwell – Lars Pötter Feb 07 '16 at 21:39
  • Hi, @Nir! So, you want to set hotend temperature, and wait until it is warm before printing (at the end of start.gcode)? I generally doubt you really need to explicitly set a delay - it is basically a hack to overcome (not fix) the problem! – Tormod Haugene Feb 07 '16 at 21:44
  • @LarsPötter That should be an answer, not a comment! – Tom van der Zanden Feb 07 '16 at 21:52
  • @LarsPötter thanks, if you post your comment as an answer I'll accept it – Nir Feb 07 '16 at 22:02
  • @TormodHaugene - I wrote the entire back story as to why I'm looking for this, if you have a better solution I'm open to trying it – Nir Feb 07 '16 at 22:04
  • @Nir, I believe I answered that previous question. It's getting late now, but I can have a look at it tomorrow, if you like! :-) – Tormod Haugene Feb 07 '16 at 22:05
  • @Nir, could you post the code in start.gcode that you are currently using? I believe ´M109 S{print_temperature}´ is the command you are looking for, as was posted in the previous question. Did that work? http://3dprinting.stackexchange.com/questions/454/how-to-configure-cura-to-run-the-z-probe-before-heating/469#469 – Tormod Haugene Feb 08 '16 at 07:26
  • @TormodHaugene - yes, M 109 works, everything works perfectly for PLA but ABS doesn't stick to the bed, if I pre-heat the hotend (and remove the M 109) the ABS does stick to the bed - so my working assumption (that I have to test) is that it takes a little bit of extra time for the heat to make it from the thermistor to the tip of the nozzle – Nir Feb 08 '16 at 07:36
  • 1
    @Nir, Oh, I see. In that case, you are probably right that adding a delay or "Dwell" (with G4) is the way to go. :-) – Tormod Haugene Feb 08 '16 at 07:39

4 Answers4

27

The G-code to delay is G4.

G4 P60000 will wait for one minute. The P is in milliseconds. Some firmware also accept a S Parameter that has the seconds. So, if supported, G4 S60 would do the same thing.

The details for this and all other G-codes are documented here.

Greenonline
  • 5,831
  • 7
  • 30
  • 60
Lars Pötter
  • 1,561
  • 1
  • 12
  • 20
  • In my end-G-code, I shut off the hot end, and wait several minutes before shutting off the fan. I was getting communications timeout errors and the fan would never actually shut off from the code (using Monoprice Select Mini with Octoprint). If this occurs for you before the print, it will not print at all. I resolved it by simply breaking it up unto a series of shorter delays. – mbmcavoy Mar 01 '18 at 19:57
  • For cncjs, the command is G4 P0.5 for half a second, for example. i.e. it's a float, not an int. – Gavin Simpson May 28 '19 at 06:55
  • so the P actually behaving like the S parameter (seconds instead of milliseconds). Can you also put that information into here: https://reprap.org/wiki/G-code#G4:_Dwell – Lars Pötter May 28 '19 at 20:49
14

An alternative solution to using a hard delay with the G4 dwell command, is to increase the time that the temperature set with M109 has to be held before it continues with the next command.

In Marlin, this setting is named TEMP_RESIDENCY_TIME, and can be found around line 150 in Configuration.h. By default, this is set to 5 seconds, which looks like:

// Actual temperature must be close to target for this long before M109 returns success
#define TEMP_RESIDENCY_TIME 5  // (seconds)

If increasing this setting solves your exact problem, I cannot say, but it could be worth looking into.

Tormod Haugene
  • 3,947
  • 2
  • 20
  • 40
1

Thank you Fernando Baltazar for the G-code you used to solve the hot end cooling issue after bed levelling probing. I did change M190 to S60 but kept everything else. This worked.

G29 ; Autonivel
M190 S35 ; set bed temperature
G1 Z4 F240 ; lift nozzle
M109 S195 ; wait for temperature to be reached
G21 ; set units to millimeters
G90 ; use absolute coordinates
M82 ; use absolute distances for extrusion
M104 S210 ; set temperature
G92 E0
G1 E-1.5000 F1800
G1 Z0.225 F240
Greenonline
  • 5,831
  • 7
  • 30
  • 60
1

I´m using this code for my prints.

    G29 ; Autonivel
    M190 S35 ; set bed temperature
    G1 Z4 F240 ; lift nozzle
    M109 S195 ; wait for temperature to be reached
    G21 ; set units to millimeters
    G90 ; use absolute coordinates
    M82 ; use absolute distances for extrusion
    M104 S210 ; set temperature
    G92 E0
G1 E-1.5000 F1800
G1 Z0.225 F240

On M190 S35, the nozzle is still on the low position (1.2mm), then goes to 4mm then waits for the extruder temperature Ex. 195°C; when the extruder reach the 195°C for 10 seconds then the printers starts to print going the nozzle to 0.22mm while the nozzle reach the second temperature of 210°C. On This time its allow me to clean the nozzle and normalize the temperatures for a good prints.

Note: To avoid the nozzle stays many time on low position (1.2mm) normally I preheat the bed at 35°C. some times to heat the bed takes a longer time than heating the nozzle. This is the main reason that I prefer to preheat the printer.

Fernando Baltazar
  • 1,420
  • 3
  • 13
  • 21