On my Prusa MK3, I'm trying to make a G-code that only heats up the print bed and moves the Z-axis up and down a little bit every 20 mins to prevent the safety timer going off. This is what I have done:

  1. Sliced a random file with PrusaSlicer.
  2. Opened it in TextEdit.
  3. Deleted the G-code for:
    • the actual print
    • heating the nozzle
    • waiting for the nozzle to heat up
  4. Changed the G-code to heat the bed to 50 °C.
  5. Inserted this G-code:
    G1 Z190 Y140 F500,
    G4 S1200,
    G1 Z188,
    G1 Z190,
  1. Copied and pasted G4 S1200, G1 Z188, G1 Z190 command 11 times - total of 12 instances.

I believe this should last a total of slightly more than 4 hours, right? I Just want to make sure before I possibly break my printer or if there is a better way to do this.


2 Answers 2


Overall, this solution should work, but have in mind, that modifying G-code files can be risky and may result in damaging your printer or causing other issues. Therefore, it is essential to exercise caution when creating and executing custom G-code.

As each instance includes a delay of 1200 seconds (20 minutes) and a movement of the Z-axis, the entire code should run for approximately 4 hours and 24 minutes.

However, keep in mind that you should periodically check the printer to ensure that everything is running smoothly and that no errors have occurred. Additionally, you may want to adjust the temperature and movement values based on your specific needs and printer settings. It is essential to exercise caution and closely monitor the printer during this operation to avoid any potential risks.


You can send the M86 command to your Prusa printer to change the safety timer. For example, to set the timer to disable heating after four hours, you could send M86 S14400. The relevant documentation is on the Prusa-specific G-Codes page.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .