PrusaSlicer code causes motor timeout due to G28 - M109 order
 
Notifications
Clear all

PrusaSlicer code causes motor timeout due to G28 - M109 order  

  RSS
dawjr
(@dawjr)
Member
PrusaSlicer code causes motor timeout due to G28 - M109 order

Hey, Guys – New to Prusaslicer, coming from Symplify3D. I have three large format Folgertech printers that run Marlin2.

The gcode that Prusaslicer creates has the G28 (home all axis’) ahead of the M109 (wait until temperature is reached) – Symplify3D has the G28 command afterward.With the Prusaslicer code, while the printer is heating, the motors become disabled due to timeout which can result in the bed moving slightly – then when the printing begins the first layer may not be correct.

Is there a way to correct this in the Starting Gcode?

Here’s clips of the code -

From S3D

G90

M82

M106 S0 P0

M140 S50

M190 S50

M104 S225 T0

M109 S225 T0

G28 ;Homing - move to stops and set all positions to 0

From Prusaslicer

M190 S35 ; set bed temperature and wait for it to be reached

M104 S240 ; set temperature;

TYPE:Custom

G28 ; home all axes

G1 Z5 F5000 ; lift nozzle

M109 S240 ; set temperature and wait for it to be reached

As you can see in the second clip, the G28 command is before the M109 command. I would not mind a second G28 command. And I rather not increase the motor timeout/disable since that would involve re-flashing all the machines.

I apologize that this question is not posted the the Prusaslicer forum – whenever I click on that link, my login drops out – only for that thread (anyone know why)

All the best, Don

 

 

 

 

Posted : 12/01/2025 4:22 pm
Sembazuru
(@sembazuru)
Prominent Member
RE:

The code snippet you are looking at is set in PrusaSlicer's profiles at Printers/Custom G-code/Start G-code and you can change that to fit your printer.

In the Prusa startup, there is an M104 S240 that starts heating the nozzle up, but doesn't wait. Then it gets to the G28 to home so that happens while the nozzle is heating up. And then is the M109 S240 to wait for the nozzle to get to temperature. The motor timeout is a firmware setting in your printer. (Note in the Start G-code the temperature control commands probably don't specify 240°C, rather it probably uses the "first_layer_temperature" placeholder that gets replaced when the gcode is generated. This allows the actual temperature to be set by the filament profile.)

I see three potential options to resolve this issue.

  1. Adjust the motor timeout to longer in the firmware of your printer. I don't know your printer so maybe this is impossible, but if it is possible I don't know the commands.
  2. Manually adjust the Start G-code in Prusa slicer to move the M109 line to before the G28.
  3. Change the M104 line in Start G-code to "M109 S{first_layer_temperature[0]-30}". This will set and wait for the nozzle to get 30°C below the printing temperature of the filament. This will soften any blobs on the tip to avoid bed crashing during Z-axis homing, but usually isn't warm enough for oozing. You may need to adjust the 30°C offset for your situation. Hopefully the nozzle will warm up the last 30°C before the motors time out.

I hope I made sense.

 

I also notice that your PrusaSlicer profile will only heat the bed up to 35°, but your S3D profile heats the bed up to 50°C. You might want to check that for print adhesion issues...

This post was modified 5 days ago by Sembazuru

See my (limited) designs on:
Printables - https://www.printables.com/@Sembazuru
Thingiverse - https://www.thingiverse.com/Sembazuru/designs

Posted : 22/01/2025 11:06 pm
dawjr
(@dawjr)
Member
Topic starter answered:
RE: PrusaSlicer code causes motor timeout due to G28 - M109 order

Hey, Sembazuru and thank you so much for your comprehensive answer.

In the interim I've researched this and just before I went down the road of modifying the configuration files, I discovered that in Marlin 2 I could send the command from the console - "M84 S600" which increases the motor timeout to ten minutes, your number 1 suggestion.

Up until that point,  I was doing your number 2 suggestion, manually adjusting the gcode in a text file - but if I forgot to do it, then the print was ruined, and I'm dealing with generating many gcodes, so that was time consuming too.

I need to consider your third suggestion because in PrusaSlicer the gcode generates the lines thus - M104 S240 ; set temperature; is followed immediately by the G28 command  - I didn't think about a hard blob interfering with the G28. So in the first line of the custom start gcode I could command - M109 S200 - this is  about 30 under any filament used and would protect from any hard blobs and shorten the enabled motor times - I'll experiment with this. But so far, having a ten minute motor timeout is working.

BTW, the profiles posted were generic and not a one to one representation of generated gcode - but good catch and caution if that was truly the case.

All the best, Don

Posted : 23/01/2025 3:45 am
Sembazuru liked
Share: