Start G-Code, Using Current Temperature?
 
Notifications
Clear all

Start G-Code, Using Current Temperature?  

  RSS
wcndave
(@wcndave)
Trusted Member
Start G-Code, Using Current Temperature?

I have some code that waits for 100 deg, then kicks off the process.

However if I have just done a print, it might be already at 150.

I checked here: https://github.com/prusa3d/PrusaSlicer/wiki/Slic3r-Prusa-Edition-Macro-Language

and on the placeholders page, however I can seem to find something that will say:

wait for temp >= 100

Apologies if I am just missing something obvious!

 

Publié : 05/05/2020 9:06 am
Neophyl
(@neophyl)
Illustrious Member
RE: Start G-Code, Using Current Temperature?

The normal wait for temp works as its a target goal.  So it doesn't matter if its hotter or colder to start with  it will go to the target temp before proceeding.  Basically its just an equals to.

Its actually a bit annoying as I have start code that preheats to 160 degrees and moves the extruder to the middle of the bed to get the pinda to a set temp before proceeding with mesh levelling.  This is ok when starting from cold but after a previous print it waits to cool to 160 first then moves to the middle and them immediately zips back to front left and does the bed levelling.  Then it heats to temp again.  

So I don't think there is anything you can do with it as while you can put conditionals into the slicer that it can process during slicing the printer itself is just a dumb box that follows simple instructions.  The printer gcode doesn't really have conditionals as it just parses the commands in order.  So  for example while you can have pause until x or pause until y, you cant really have pause until either x or y as it has to process them in order separately. 

 

Publié : 05/05/2020 10:39 am
wcndave
(@wcndave)
Trusted Member
Topic starter answered:
RE: Start G-Code, Using Current Temperature?

@neophyl

Well yes, this is basically the case I am stating.  Using the excellent Muppet Labs site, he has this in there:

Line 19 waits for the nozzle to hit the no-ooze temp before proceeding. This ensures any filament stuck to the nozzle will be soft enough to bend if it hits the PEI print surface.

Now I don't want to wait until 160 to get started, so I did wait for 100, then start all the other stuff, eg pinda warmup etc, and meanwhile, the nozzle can get up to 160, so that the last step is to jump from no-ooze temp to final temp and start printing.

However, If I've just done a print, I have to wait for it to drop to 100!  If I set it to 160, then the first print is slower to start.  I guess I'm not looking for two lines to be executed, just wondering if there's a way to do >= or "at least", rather than "go to temp".

So, you've shown there's more than one person who'd like this 😉

 

 

Publié : 05/05/2020 11:38 am
Neophyl
(@neophyl)
Illustrious Member
RE: Start G-Code, Using Current Temperature?

@david-m86

Unfortunately as I said the printer itself doesn't do conditionals.  If you are using  startup code based on Bobstro's instructions then the S command is 'supposed' to work like you want anyway, it just doesn't.

M109 S160 ; wait for extruder temp <- this with the S160 is supposed to only wait for it while heating, not while heating or cooling which is M109 R160.  However it seems that Prusa's implementation of Marlin does not function according the the Marlin definition https://marlinfw.org/docs/gcode/M109.html

You would have to raise an issue over on the Prusa Mk3 firmware github https://github.com/prusa3d/Prusa-Firmware/issues to petition them to fix or change the behaviour for this.  I suspect the limited amount of program space available on the printers 8bit control board has forced them to consolidate the marlin gcode parameters into a more limited subset so I dont think you will get a lot of traction for it.  Its possibly still worth raising though as I might be wrong 🙂

Edit - just checked and there is already an issue over there https://github.com/prusa3d/Prusa-Firmware/issues/2126 that has been open since August 2019 and there was an earlier one referenced in that one opened in Jan 2019 so as you can see its a long standing item.

Publié : 05/05/2020 12:13 pm
wcndave
(@wcndave)
Trusted Member
Topic starter answered:
RE: Start G-Code, Using Current Temperature?

@neophyl

ok, thanks, that's helpful.

I guess the printer is sort of doing a condition of a kind, as it's saying "while temp != XXX, if temp above, cool, else heat"

I think I'll just skip the wait, and ensure there's no impeding material before the print starts.

Thank!

Publié : 05/05/2020 12:43 pm
Neophyl
(@neophyl)
Illustrious Member
RE: Start G-Code, Using Current Temperature?

I can think of a workflow to bypass the wait.

If you generate a gcode print file that basically just has the heat to 160 or whatever other temps you want for extruder and bed then name it such that its the first one in your list , say "AAA_heat_160.gcode" then  from a 'cold' start you could just run the print file.  That would warm up to whatever temps you set then end.  That in effect is your 'first print' of the session.

That way you could remove the wait from your standard start gcode so that its optimised for repeat print use.  

Publié : 05/05/2020 1:09 pm
bobstro
(@bobstro)
Illustrious Member
RE: Start G-Code, Using Current Temperature?

The Prusa implementation is not always consistent. The PINDA temps seem to be taken as >=, nozzle temps as =. 

In my example, I do want to wait specifically for 260C since the goal of the exercise is to eliminate ooze during mesh bed leveling. I'm also doing the PINDA warmup procedure. You can certainly skip those steps!

Thanks @neophyl!

My notes and disclaimers on 3D printing

and miscellaneous other tech projects
He is intelligent, but not experienced. His pattern indicates two dimensional thinking. -- Spock in Star Trek: The Wrath of Khan

Publié : 05/05/2020 1:24 pm
wcndave
(@wcndave)
Trusted Member
Topic starter answered:
RE: Start G-Code, Using Current Temperature?
Posted by: @neophyl

I can think of a workflow to bypass the wait.

If you generate a gcode print file that basically just has the heat to 160 or whatever other temps you want for extruder and bed then name it such that its the first one in your list , say "AAA_heat_160.gcode" then  from a 'cold' start you could just run the print file.  That would warm up to whatever temps you set then end.  That in effect is your 'first print' of the session.

That way you could remove the wait from your standard start gcode so that its optimised for repeat print use.  

It's an idea.  I tend not to have prints queued up, but say I change the nozzle, or the material, it normally takes about 5 first layer test prints to dial in the Z axis.  So the 3 mintes delay for each 3 minute print is just boring and annoying.  For that I could load one up that gets the temps up, and then not have that code in my test print, so that's probably best, and for proper prints, I'll just accept the wait, as it's a small fraction of overall print.  So test prints won't have any wait built in, I'll preheat, and actual prints will have it built in.  Thanks!

Publié : 05/05/2020 1:45 pm
wcndave
(@wcndave)
Trusted Member
Topic starter answered:
RE: Start G-Code, Using Current Temperature?
Posted by: @bobstro

The Prusa implementation is not always consistent. The PINDA temps seem to be taken as >=, nozzle temps as =. 

In my example, I do want to wait specifically for 260C since the goal of the exercise is to eliminate ooze during mesh bed leveling. I'm also doing the PINDA warmup procedure. You can certainly skip those steps!

Thanks @neophyl!

I actually want to do the same things.  However after a print has finished, the nozzle will cool, let's say from 215 to 180.  I have a line that says "don't do anything until you get to 100" (to ensure stuck filament will bend).  However then I have to wait for it to cool  from 180 to 100, which can be about 5 minutes.  at 180 it doesn't ooze.  I guess what I have tried to do, is take what you did, and get it "started" earlier with levelling etc, at 100deg, while the nozzle continues up to 160 during the process.  The end result is that it starts the first print much faster, but subsequent ones are slower to start.

The nozzle has always stopped oozing by the time it's going to start the next print, just 45 seconds of cooling and it's there, so I don't need to wait for it to go down to 160, and I don't want to wait for it to go down to 100!  However I guess it's better to wait for it to go UP to 160, but only once for test prints, and each time for proper prints.

I have also added one extra step to your code which before the print line step, whilst the bed and nozzle are getting to final temp, I raise it to 5cm, which enables me to give a quick brass brush under, or use pliers to pull off any stray wisps of filament.  It's not doing anything else anyway at that time 😉

Thanks for the great site with the good clear advice!

Publié : 05/05/2020 1:54 pm
Partager :