.. include:: .. include:: 3dprinting_substitutions.txt .. meta:: :description lang=en: PrusaSlicer start gcode for the Prusa i3 Mk3 .. _prusaslicer_start_gcode_mk3: |PS| Start G-Code for the Prusa i3 Mk3 -------------------------------------- The default g-code that ships with |PS| works just fine, but I found myself wanting to tweak a few things to my liking. I have updated my startup g-code to incorporate several functions that I want to use on every print: * A 2-step "no ooze" nozzle warmup routine to speed up the heating process, but avoid dots and strings caused by molten filament dripping out during mesh bed leveling and bed warmup. [#f1]_ * Position the nozzle away from the PEI print surface during nozzle heating and startup movement to avoid damaging the print surface. * A modified prime line print routine to catch errant nozzle ooze, test extrusion and perform a final wipe action to avoid stringing between the prime line and start of the print. * PINDA warmup to ensure a consistent 35C PINDA temperature before performing mesh bed leveling to ensure consistent results. This is only necessary for printers with PINDA v2.0 probes as shipped on the original Mk3. [#f2]_ It is optional for PINDA v2.1+ and SuperPINDA configurations. For more information, check out the :ref:`PINDA warmup notes page `. .. important:: Prusa has recently released the SuperPINDA sensor for bed leveling. SuperPINDA works differently than the previous generations of PINDA sensors. If the **M860** gcode command is used, printers with the SuperPINDA mounted will simply hang. I have updated this page and the referenced gcode to detect whether the user is using a Mk3S or Mk3S+ printer profile. Lines of gcode will inserted or left out based on this setting. If you are runnning a SuperPINDA on a Mk3 (not Mk3*S*) printer profile, this gcode may not work. I do not believe there is a way to detect a SuperPINDA configuration in the slicer at this time. Please let me know via the contact links at the bottom of this page if you encounter any problems. I've incorporated these features into my own customized g-code settings for |PS|. .. include:: 3dprinting_disclaimer.rst Here's a line-by-line breakdown: .. caution:: Please be sure that you've calibrated your printer, and particularly your Live-Z settings before using any of the following examples. These routines move the nozzle around close to the bed, and could cause damage if your printer is not adjusted properly. Version control ^^^^^^^^^^^^^^^ The first lines are simple date, firmware, and hardware setting checks. * Line 3 chirps the printer speaker. I'm not a fan of loud piezo beeps, much less music, but I have inserted several chirp sounds (``M300 S100 P10``) to indicate progress throughout the print. * Line 4 does a printer model check. If you generated gcode using |PS| configured for a different printer, you'll receive a warning. * Line 5 does a nozzle diameter check. If you generated gcode using |PS| for a different nozzle size than you've set in your printer settings menu, you'll receive a warning. Note that the firmware currently only supports 0.25, 0.40 and 0.60mm nozzle sizes. * Line 6 does a firmware version check. If you print generated gcode on a printer running an older firmware version, you'll get a warning message to update. You can press the front knob to continue and ignore this warning, but updating to recent firmware is always recommended to take full advantage of enhanced features that Prusa is continually adding to the printer firmware and |PS|. .. literalinclude:: 3dprinting_prusaslicer_start_g-code_mk3.txt :linenos: :language: gcode :caption: |PS| start g-code version control :lines: 1-6 .. note:: I am not a fan of the printer and nozzle checks since I am the only user of my printer. I have disabled these checks in the printer menu. Initialize movement and extrusion coordinates ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ The next stanza sets the initial movement and extrusion coordinates. These aren't technically required, but if they're improperly set, they can cause problems with a print. * Line 9 sets absolute move coordinates for movement. * Line 10 sets relative extruder coordinates. .. literalinclude:: 3dprinting_prusaslicer_start_g-code_mk3.txt :linenos: :language: gcode :caption: |PS| start g-code coordinate initialization :lines: 7-10 :lineno-start: 7 .. _prusaslicer_start_gcode_mk3_initialization: Initialization ^^^^^^^^^^^^^^ The next block resets printing parameters that can persist after an aborted job. * Line 12 disables volumetric e (autospeed) printing. * Line 13 resets the print speed to 100% on the printer in case it was previously changed by using the front knob or an aborted print. * Line 14 resets the extrusion multiplier to 100% on the printer in case it was previously changed by using the front knob or an aborted print. .. literalinclude:: 3dprinting_prusaslicer_start_g-code_mk3.txt :linenos: :language: gcode :caption: |PS| start g-code print parameter initialization :lines: 11-14 :lineno-start: 11 Initialize warmup temperatures ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ The next block sets initial "two step" extruder warmup temperatures to avoid oozing during mesh bed leveling. .. note:: I have modified this section significantly as of January 2021: * Versions of the PINDA probe since the original v1 version do not require the PINDA warmup routine to ensure consistent results. However, warming up the printer is still recommended, particularly on cold days. The "PINDA warmup" is a good way to accomplish this. * The SuperPINDA sensor used on the Mk3S+ printer is not compatible with (and does not need) the PINDA temperature check. I have added checks for a Mk3s/Mk3s+ printer. PINDA temperature checks will be skipped if you are running this gcode with one of these printers. Unfortunately, this also means you will lose the benefit of warming the entire printer up before the first print of the day. I am working on a solution to still provide a reasonable warmup. * Line 17 sets the extruder (nozzle) temperature to 160C (``S160``), a good "no ooze" temp that will soften most filament, but not hot enough to cause filament to trickle out of the nozzle. This will prevent dots of filament and stringing during mesh bed leveling. * Line 18 sets the bed temperature. * If you are using this gcode on a Mk3s/Mk3s+ printer, the bed will be set to the temperature set in the filament settings profile. * If you are not running a Mk3s/Mk3s+ printer, the bed temperature will be set to the higher of the specified bed temperature or 80C. This is to ensure that the bed is hot enough to warm up the PINDA even on cold days. .. note:: I set the bed to 80C due to cold weather. See the :ref:`PINDA warmup ` notes for details. * Line 20 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 squish if it hits the PEI print surface. .. literalinclude:: 3dprinting_prusaslicer_start_g-code_mk3.txt :linenos: :language: gcode :caption: |PS| start g-code initial warmup temps :lines: 15-20 :lineno-start: 15 Initial homing ^^^^^^^^^^^^^^ The next stanza prepares for initial homing. On startup, the printer has no way of knowing where the extruder is in 3D space, so homing is necessary for it to establish a known position. This is to ensure that any filament hanging from the nozzle is sufficiently soft to either break off or bend when the nozzle is lowered in the next line. This avoids creating dents in the PEI sheet at the lower-left corner. * Line 24 performs homing (``G28 W``), moving the printer to the lowest (``Z 0``) left (``X 0``) front (``Y 210``) coordinates to establish the current position. .. literalinclude:: 3dprinting_prusaslicer_start_g-code_mk3.txt :linenos: :language: gcode :caption: |PS| start g-code initial homing :lines: 21-24 :lineno-start: 21 Bed presentation ^^^^^^^^^^^^^^^^ This stanza presents the bed for inspection and cleaning while waiting for the bed to come up to final printing temperature. The nozzle is moved to the center-rear portion of the bed, positioned slightly forward so the extruder is warmed by the bed. * Line 26 raises the nozzle 3mm to avoid possibly damaging the PEI sheet during nozzle movement in the steps that follow. * Line 27 moves the nozzle to the center (``X 125``) back (``Y 180``) to allow access to the bed for final inspection and cleaning while waiting for the PINDA warmup in the following steps. .. note:: I recently moved the resting Y position closer to the bed center to improve PINDA warming. * Line 28 lowers the nozzle and PINDA probe close to the bed (``Z 0.15mm``) to aid in warming up the PINDA probe. .. literalinclude:: 3dprinting_prusaslicer_start_g-code_mk3.txt :linenos: :language: gcode :caption: |PS| start g-code bed presentation :lines: 25-28 :lineno-start: 25 PINDA warmup ^^^^^^^^^^^^ The next stanza conditionally performs a PINDA warmup routine. If you are running a Mk3s/Mk3s+, this procedure will be skipped. This procedure will only be run if you *not* using this gcode as part of a Mk3s/Mk3s+ printer profile. The PINDA warmup procedure waits for the PINDA probe to reach a consistent temperature before automatic mesh bed leveling (MBL). For more info on the PINDA warmup procedure, refer to the :ref:`about PINDA warmup ` notes. .. note:: This procedure has become considerably more complex due to the need to do additional checks for the printer type. It is a good example of using the |PS| conditional code checks. * Line 31 starts a block of gcode that will be inserted if the `printer_model` placeholder contains the text "MK3S". * Line 32 sends a message to the printer display (``M117``). You can insert lines to be inserted only for a Mk3s/Mk3s+ printer here. * Line 33 starts the block of gcode that will be inserted if the `printer_model` placeholder does *not* contain the text "MK3S". * Line 34 sends a message to the printer display (``M117``). * Line 35 inserts the command (``M860 S35``) to wait for the PINDA probe to reach *at least* 35C, an all-around good temperature for mesh bed leveling. Note that this can take a long time (5-10 minutes) on the first print on a cold day. For subsequent prints, it should warm up much more quickly. * Line 36 ends the block of gcode that will be inserted if the `printer_model` placeholder does *not* contain the text "MK3S". * Line 37 sets the bed temp specified in the filament settings. This is done here before mesh bed leveling to let the bed cool down to close to the final print temperature as MBL completes. * Line 38 raises the nozzle 3mm (``Z3``) for movement as a precaution before rapid moves close to the print surface. .. literalinclude:: 3dprinting_prusaslicer_start_g-code_mk3.txt :linenos: :language: gcode :caption: |PS| start g-code PINDA warmup procedure :lines: 29-38 :lineno-start: 29 Mesh bed leveling and final warmup ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Now that any preparation is complete, we can perform mesh bed leveling. * Line 42 performs the actual leveling (``G80``). With the latest firmware releases, this will do either 3X3 or 7X7 grid leveling as configured in the printer setup menu. After leveling, the nozzle will return automatically to the home position. * Line 44 stores the leveling results for use with the Octoprint Prusa mesh bed leveling plugin. .. literalinclude:: 3dprinting_prusaslicer_start_g-code_mk3.txt :linenos: :language: gcode :caption: |PS| start g-code mesh bed leveling & final warmup :lines: 39-44 :lineno-start: 39 Final temperature settings ^^^^^^^^^^^^^^^^^^^^^^^^^^ After all calibration and settings are done, we set final temperatures in preparation for starting the actual print. * Line 47 raises the nozzle 5mm (``Z5``) while we wait for the nozzle to come up to full print temperature. This both avoids possibly damaging the PEI sheet under the nozzle, and also provides a clean prime line in the steps that follow. * Line 48 sets (``M140``) the first layer bed temperature set in the filament settings profile. * Line 49 sets (``M104``) the first layer print temperature set in the filament settings profile. * Line 50 waits for (``M109``) the first layer print temperature set in the slicer settings. * Line 51 waits for (``M190``) the first layer bed temperature to settle before printing. .. literalinclude:: 3dprinting_prusaslicer_start_g-code_mk3.txt :linenos: :language: gcode :caption: |PS| start g-code final temperature settings :lines: 45-52 :lineno-start: 45 Prime line ^^^^^^^^^^ Once the nozzle and bed come up to temperature, a custom prime line is printed. I've made some tweaks to the bog-standard line. * Line 55 lowers the nozzle (``Z0.15``) to initial printing position. * Line 56 disables Linear Advance (``M900 K0``) for printing the prime line. With LA enabled, I often get distracting extruder clicks and skips when printing the initial thick line. * Line 57 resets the current extruder position. This is done periodically when extruder moves are set to relative. It ensures that the amount of filament extruded does not drift over time. * Line 58 moves to the initial prime line position at the left (``X=0``) front (``Y=-3``) bed position. * Line 59 extrudes an initial 2mm "blort" of filament without moving (``G1 E2`` with no X or Y movement) to trap any ooze or string remaining on the nozzle. * Line 60 extrudes 6mm of filament (``E6``) while moving 20mm along the X axis (``X20.0``). * Line 61 extrudes 3.2mm of filament (``E3.2``) while moving another 40mm along the X axis (``X60``). * Line 62 extrudes 6mm of filament (``E6``) while moving another 40mm along the X axis (``X100``). I like another fat run at the end of the prime line to make it adhere better and avoid loose prime strips floating around. * Line 63 retracts 0.8mm of filament (``E-0.8``) to reduce stringing. * Line 64 performs a wipe action back over the printed line along the X axis (``X99.5``) without extruding (``E0``). * Line 65 moves another 10mm along the X axis (``X110.0``) without extruding (``E0``) to complete the wiping action and eliminate any stringing. * Line 66 de-retracts (pushes) 0.6mm of filament (``E0.6``) to re-prime after the previous retraction. Note that this is slightly less than was retracted in line 63 to avoid ooze as the nozzle moves into final printing position. If filament doesn't flow at the start of a print, either use a skirt to prime the flow, or increase this to 0.8mm. .. literalinclude:: 3dprinting_prusaslicer_start_g-code_mk3.txt :linenos: :language: gcode :caption: |PS| start g-code prime line procedure :lines: 52-67 :lineno-start: 52 Final print adjustments ^^^^^^^^^^^^^^^^^^^^^^^ Finally, we do any last minute print adjustments. I'm not doing anything here. Adjust for your printer. * Line 72 is commented out. It can be used to adjust the extrusion rate (``M221``). In this example, I set the rate to 90% for layer heights over 0.32mm. I find this is helpful when using large nozzles with very high layers. Generally, you want to set this in the extrusion multiplier for each filament profile. See my notes on the :ref:`PrusaSlicer system preset for the Mk3-series ` for more detail. .. literalinclude:: 3dprinting_prusaslicer_start_g-code_mk3.txt :linenos: :language: gcode :caption: |PS| start g-code final print adjustments :lines: 68-73 :lineno-start: 68 At this point, the print will proceed normally. Full startup g-code example ^^^^^^^^^^^^^^^^^^^^^^^^^^^ Here's the full start g-code: .. literalinclude:: 3dprinting_prusaslicer_start_g-code_mk3.txt :language: gcode :caption: |PS| start g-code Thanks /Urban for catching the paste error! Download the :download:`raw gcode here <3dprinting_prusaslicer_start_g-code_mk3.txt>` .. include:: 3dprinting_footer.rst .. rubric:: Footnotes .. [#f1] The earliest reference to the "2 step" warmup procedure for the Mk3 that I have found is `a post by @PJR on the Prusa forums back in 2017 `_. .. [#f2] There is a lot of confusion about PINDA numbering. I've based these version numbers on the info in the `Prusa knowledgebase `_ and aprocryphal information `here `_. Last edited on Dec 28, 2021. Last build on |today|.